owfs-3.1p5/0000755000175000001440000000000013022537077007603 500000000000000owfs-3.1p5/module/0000755000175000001440000000000013022537105011060 500000000000000owfs-3.1p5/module/owcapi/0000755000175000001440000000000013022537105012342 500000000000000owfs-3.1p5/module/owcapi/src/0000755000175000001440000000000013022537105013131 500000000000000owfs-3.1p5/module/owcapi/src/example/0000755000175000001440000000000013022537105014564 500000000000000owfs-3.1p5/module/owcapi/src/example/Makefile.in0000644000175000001440000000115312654730021016553 00000000000000# Makefile for owcapi example program -- invoked separately from this directory # $Id$ CFLAGS = -g -I@prefix@/include OBJS = owcapiexample.o all: owcapiexample ifeq "$(shell uname)" "Darwin" # Compile-flags for MacOSX DARWINLDFLAGS = -L@prefix@/lib -lowcapi -low @LIBUSB_LIBS@ owcapiexample: $(OBJS) gcc $(CFLAGS) -o $@ $(OBJS) $(DARWINLDFLAGS) else # Compile-flags for Linux and Cygwin LDFLAGS = -L@prefix@/lib -Wl,--rpath -Wl,@prefix@/lib -lowcapi owcapiexample: $(OBJS) gcc $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) endif %.o: %.c @CC@ $(CFLAGS) -c -o $@ $< clean: $(RM) -f owcapiexample *.o *~ .~ Makefile owfs-3.1p5/module/owcapi/src/example/owcapiexample.c0000644000175000001440000000642512654730021017517 00000000000000#include #include #include #include #include #include const char DEFAULT_ARGV[] = "--fake 28 --fake 10"; const char DEFAULT_PATH[] = "/"; /* Takes a path and filename and prints the 1-wire value */ /* makes sure the bridging "/" in the path is correct */ /* watches for total length and free allocated space */ void GetValue(const char *path, const char *name) { char fullpath[PATH_MAX + 1]; int length_left = PATH_MAX; char *get_buffer; ssize_t get_return; size_t get_length; /* Check arguments and lengths */ if (path == NULL || strlen(path) == 0) { path = "/"; } if (name == NULL) { name = ""; } fullpath[PATH_MAX] = '\0'; // make sure final 0 byte strncpy(fullpath, path, length_left); length_left -= strlen(fullpath); if (length_left > 0) { if (fullpath[PATH_MAX - length_left - 1] != '/') { strcat(fullpath, "/"); --length_left; } } if (name[0] == '/') { ++name; } strncpy(&fullpath[PATH_MAX - length_left], name, length_left); get_return = OW_get(fullpath, &get_buffer, &get_length); if (get_return < 0) { printf("ERROR (%d) reading %s (%s)\n", errno, fullpath, strerror(errno)); } else { printf("%s has value %s (%d bytes)\n", fullpath, get_buffer, (int) get_length); free(get_buffer); } } int main(int argc, char **argv) { const char *path = DEFAULT_PATH; ssize_t dir_return; char *dir_buffer = NULL; char *dir_buffer_copy = NULL; size_t dir_length; char **d_buffer; char *dir_member; /* ------------- INITIALIZATIOB ------------------ */ /* steal first argument and treat it as a path (if not beginning with '-') */ if ((argc > 1) && (argv[1][0] != '-')) { path = argv[1]; argv = &argv[1]; argc--; } if (argc < 2) { printf("Starting with extra parameter \"%s\" as default\n", DEFAULT_ARGV); if (OW_init(DEFAULT_ARGV) < 0) { printf("OW_init error = %d (%s)\n", errno, strerror(errno)); goto cleanup; } } else { if (OW_init_args(argc, argv) < 0) { printf("OW_init error = %d (%s)\n", errno, strerror(errno)); goto cleanup; } } /* ------------- DIRECTORY PATH ------------------ */ dir_return = OW_get(path, &dir_buffer, &dir_length); if (dir_return < 0) { printf("DIRECTORY ERROR (%d) reading %s (%s)\n", errno, path, strerror(errno)); goto cleanup; } else { printf("Directory %s has members %s (%d bytes)\n", path, dir_buffer, (int) dir_length); } printf("\n"); /* ------------- GO THROUGH DIR ------------------ */ d_buffer = &dir_buffer; dir_buffer_copy = dir_buffer; while ((dir_member = strsep(d_buffer, ",")) != NULL) { switch (dir_member[0]) { case '1': if (dir_member[1] == '0') { // DS18S20 (family code 10) GetValue(dir_member, "temperature"); } //fall through case '0': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': { GetValue(dir_member, "type"); } break; default: break; } } /* ------------- STATIC PATHS ------------------ */ GetValue("system/process", "pid"); GetValue("badPath", "badName"); cleanup: /* ------------- DONE -- CLEANUP ----------------- */ OW_finish(); if (dir_buffer_copy) { free(dir_buffer_copy); dir_buffer_copy = NULL; } return 0; } owfs-3.1p5/module/owcapi/src/example/Makefile.example0000644000175000001440000000043512654730021017602 00000000000000 LDFLAGS = -L/opt/owfs/lib -Wl,--rpath -Wl,/opt/owfs/lib -lowcapi CFLAGS = -g -I/opt/owfs/include OBJS = owcapiexample.o all: owcapiexample owcapiexample: $(OBJS) gcc $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) %.o: %.c gcc $(CFLAGS) -c -o $@ $< clean: $(RM) -f owcapiexample *.o *~ .~ owfs-3.1p5/module/owcapi/src/example++/0000755000175000001440000000000013022537105014712 500000000000000owfs-3.1p5/module/owcapi/src/example++/Makefile.in0000644000175000001440000000121312654730021016676 00000000000000# Makefile for owcapi example program -- invoked separately from this directory # $Id$ CXXFLAGS = -g -I@prefix@/include -Wno-deprecated OBJS = owcapiexample.o all: owcapiexample ifeq "$(shell uname)" "Darwin" # Compile-flags for MacOSX DARWINLDFLAGS = -L@prefix@/lib -lowcapi -low @LIBUSB_LIBS@ owcapiexample: $(OBJS) gcc $(CFLAGS) -o $@ $(OBJS) $(DARWINLDFLAGS) else # Compile-flags for Linux and Cygwin LDFLAGS = -L@prefix@/lib -Wl,--rpath -Wl,@prefix@/lib -lowcapi owcapiexample: $(OBJS) gcc $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) -lstdc++ endif #%.o: %.cpp # g++ $(CXXFLAGS) -c -o $@ $< clean: $(RM) -f owcapiexample *.o *~ .~ Makefile owfs-3.1p5/module/owcapi/src/example++/owcapiexample.cpp0000644000175000001440000000736712654730021020213 00000000000000#include #include #include #include #include const char DEFAULT_ARGV[] = "--fake 28 --fake 10"; const char DEFAULT_PATH[] = "/"; /* Takes a path and filename and prints the 1-wire value */ /* makes sure the bridging "/" in the path is correct */ /* watches for total length and free allocated space */ void GetValue( const char * path, const char * name ) { char fullpath[PATH_MAX+1] ; int length_left = PATH_MAX ; char * get_buffer ; ssize_t get_return; size_t get_length ; /* Check arguments and lengths */ if ( path==NULL || strlen(path)==0) { path = "/" ; } if ( name==NULL ) { name = "" ; } fullpath[PATH_MAX] = '\0' ; // make sure final 0 byte strncpy(fullpath, path, length_left) ; length_left -= strlen(fullpath) ; if ( length_left > 0 ) { if ( fullpath[PATH_MAX-length_left-1] != '/' ) { strcat(fullpath, "/" ) ; --length_left ; } } if ( name[0] == '/' ) { ++name ; } strncpy(&fullpath[PATH_MAX-length_left], name, length_left) ; get_return = OW_get( fullpath, &get_buffer, &get_length ) ; if ( get_return < 0 ) { printf("ERROR (%d) reading %s (%s)\n",errno,fullpath,strerror(errno)) ; } else { printf("%s has value %s (%d bytes)\n",fullpath,get_buffer,(int)get_length); free(get_buffer); } } int main(int argc, char **argv) { const char *path = DEFAULT_PATH; ssize_t dir_return ; char *dir_buffer = NULL; char *dir_buffer_copy = NULL; size_t dir_length ; char ** d_buffer ; char * dir_member ; cout << "C++ example" << endl; /* ------------- INITIALIZATIOB ------------------ */ /* steal first argument and treat it as a path (if not beginning with '-') */ if ((argc > 1) && (argv[1][0] != '-')) { path = argv[1]; argv = &argv[1]; argc--; } if (argc < 2) { printf("Starting with extra parameter \"%s\" as default\n", DEFAULT_ARGV); if ( OW_init(DEFAULT_ARGV) < 0) { printf("OW_init error = %d (%s)\n",errno,strerror(errno)) ; goto cleanup; } } else { if ( OW_init_args(argc, argv) < 0) { printf("OW_init error = %d (%s)\n",errno,strerror(errno)) ; goto cleanup; } } /* ------------- DIRECTORY PATH ------------------ */ dir_return = OW_get( path, &dir_buffer, &dir_length ) ; if ( dir_return < 0 ) { printf("DIRECTORY ERROR (%d) reading %s (%s)\n",errno,path,strerror(errno)) ; goto cleanup; } else { printf("Directory %s has members %s (%d bytes)\n",path, dir_buffer, (int)dir_length); } printf("\n"); /* ------------- GO THROUGH DIR ------------------ */ d_buffer = &dir_buffer ; dir_buffer_copy = dir_buffer; while ( (dir_member=strsep(d_buffer,","))!=NULL ) { switch ( dir_member[0] ) { case '1': if ( dir_member[1] == '0' ) { // DS18S20 (family code 10) GetValue(dir_member, "temperature") ; } //fall through case '0': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': { GetValue(dir_member, "type") ; } break ; default: break ; } } /* ------------- STATIC PATHS ------------------ */ GetValue("system/process", "pid" ); GetValue("badPath", "badName" ) ; cleanup: /* ------------- DONE -- CLEANUP ----------------- */ OW_finish(); if (dir_buffer_copy) { free(dir_buffer_copy); dir_buffer_copy = NULL; } return 0 ; } owfs-3.1p5/module/owcapi/src/example++/Makefile.example0000644000175000001440000000121112654730021017721 00000000000000# Makefile for owcapi example program -- invoked separately from this directory # $Id$ CXXFLAGS = -g -I/opt/owfs/include -Wno-deprecated OBJS = owcapiexample.o all: owcapiexample ifeq "$(shell uname)" "Darwin" # Compile-flags for MacOSX DARWINLDFLAGS = -L/opt/owfs/lib -lowcapi -low -L/usr/lib -lusb owcapiexample: $(OBJS) gcc $(CFLAGS) -o $@ $(OBJS) $(DARWINLDFLAGS) else # Compile-flags for Linux and Cygwin LDFLAGS = -L/opt/owfs/lib -Wl,--rpath -Wl,/opt/owfs/lib -lowcapi owcapiexample: $(OBJS) g++ $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) -lstdc++ endif #%.o: %.cpp # g++ $(CXXFLAGS) -c -o $@ $< clean: $(RM) -f owcapiexample *.o *~ .~ owfs-3.1p5/module/owcapi/src/Makefile.am0000644000175000001440000000045212654730021015110 00000000000000SUBDIRS = c include # don't want to add the example as a subdirectory right now... EXTRA_DIST = example++/owcapiexample.cpp example++/Makefile.example example++/Makefile.in example/owcapiexample.c example/Makefile.example example/Makefile.in DISTCLEANFILES = example++/Makefile example/Makefile owfs-3.1p5/module/owcapi/src/Makefile.in0000644000175000001440000005554313022537051015132 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owcapi/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = c include # don't want to add the example as a subdirectory right now... EXTRA_DIST = example++/owcapiexample.cpp example++/Makefile.example example++/Makefile.in example/owcapiexample.c example/Makefile.example example/Makefile.in DISTCLEANFILES = example++/Makefile example/Makefile 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) --foreign module/owcapi/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owcapi/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owcapi/src/c/0000755000175000001440000000000013022537105013353 500000000000000owfs-3.1p5/module/owcapi/src/c/Makefile.am0000644000175000001440000000160512665167763015356 00000000000000libowcapi_la_DEPENDENCIES = ../../../owlib/src/c/libow.la lib_LTLIBRARIES = libowcapi.la libowcapi_la_SOURCES = owcapi.c if HAVE_CYGWIN libowcapi_la_LDFLAGS = -low ${LD_EXTRALIBS} -shared -no-undefined else if HAVE_DEBIAN # Debian patch libowcapi_la_LDFLAGS = -low -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) ${PTHREAD_LIBS} ${LD_EXTRALIBS} -shared -shrext .so else libowcapi_la_LDFLAGS = -low -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) ${PTHREAD_LIBS} ${LD_EXTRALIBS} -shared -shrext .so endif endif AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ -D__EXTENSIONS__ \ ${EXTRACFLAGS} \ ${PTHREAD_CFLAGS} \ ${LIBUSB_CFLAGS} \ ${PIC_FLAGS} owfs-3.1p5/module/owcapi/src/c/Makefile.in0000644000175000001440000006213413022537051015346 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owcapi/src/c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libowcapi_la_LIBADD = am_libowcapi_la_OBJECTS = owcapi.lo libowcapi_la_OBJECTS = $(am_libowcapi_la_OBJECTS) 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 = libowcapi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libowcapi_la_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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libowcapi_la_SOURCES) DIST_SOURCES = $(libowcapi_la_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)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ libowcapi_la_DEPENDENCIES = ../../../owlib/src/c/libow.la lib_LTLIBRARIES = libowcapi.la libowcapi_la_SOURCES = owcapi.c @HAVE_CYGWIN_FALSE@@HAVE_DEBIAN_FALSE@libowcapi_la_LDFLAGS = -low -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) ${PTHREAD_LIBS} ${LD_EXTRALIBS} -shared -shrext .so # Debian patch @HAVE_CYGWIN_FALSE@@HAVE_DEBIAN_TRUE@libowcapi_la_LDFLAGS = -low -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) ${PTHREAD_LIBS} ${LD_EXTRALIBS} -shared -shrext .so @HAVE_CYGWIN_TRUE@libowcapi_la_LDFLAGS = -low ${LD_EXTRALIBS} -shared -no-undefined AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ -D__EXTENSIONS__ \ ${EXTRACFLAGS} \ ${PTHREAD_CFLAGS} \ ${LIBUSB_CFLAGS} \ ${PIC_FLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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) --foreign module/owcapi/src/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owcapi/src/c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libowcapi.la: $(libowcapi_la_OBJECTS) $(libowcapi_la_DEPENDENCIES) $(EXTRA_libowcapi_la_DEPENDENCIES) $(AM_V_CCLD)$(libowcapi_la_LINK) -rpath $(libdir) $(libowcapi_la_OBJECTS) $(libowcapi_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owcapi.Plo@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool 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-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .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: owfs-3.1p5/module/owcapi/src/c/owcapi.c0000644000175000001440000001021112654730021014716 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097 serial connector Written 2003 Paul H Alfille */ #include #include "owfs_config.h" #include "ow.h" #include "owcapi.h" #include #define MAX_ARGS 20 static ssize_t OW_init_both(const char *params, enum restart_init repeat) ; static ssize_t OW_init_args_both(int argc, char **argv, enum restart_init repeat); static ssize_t ReturnAndErrno(ssize_t ret) { if (ret < 0) { errno = -ret; return -1; } else { errno = 0; return ret; } } void OW_set_error_print(const char *params) { API_set_error_print(params); } void OW_set_error_level(const char *params) { API_set_error_level(params); } ssize_t OW_init(const char *params) { return OW_init_both( params, restart_if_repeat ) ; } ssize_t OW_safe_init(const char *params) { return OW_init_both( params, continue_if_repeat ) ; } static ssize_t OW_init_both(const char *params, enum restart_init repeat) { /* Set up owlib */ API_setup(program_type_clibrary); if ( BAD( API_init(params, repeat) ) ) { API_finish(); return ReturnAndErrno(-EINVAL) ; } return ReturnAndErrno(0); } ssize_t OW_init_args(int argc, char **argv) { return OW_init_args_both( argc, argv, restart_if_repeat ) ; } ssize_t OW_safe_init_args(int argc, char **argv) { return OW_init_args_both( argc, argv, continue_if_repeat ) ; } static ssize_t OW_init_args_both(int argc, char **argv, enum restart_init repeat) { /* Set up owlib */ API_setup(program_type_clibrary); if ( BAD( API_init_args( argc, argv, repeat) ) ) { API_finish(); return ReturnAndErrno(-EINVAL) ; } return ReturnAndErrno(0); } /* Get a value, returning a copy of the contents in *buffer (which must be free-ed elsewhere) return length of string, or <0 for error *buffer will be returned as NULL on error */ /* Get a directory, returning a copy of the contents in *buffer (which must be free-ed elsewhere) return length of string, or <0 for error *buffer will be returned as NULL on error */ ssize_t OW_get(const char *path, char **return_buffer, size_t * buffer_length) { SIZE_OR_ERROR size_or_error = -EACCES ; /* current buffer string length */ if (API_access_start() == 0) { /* Check for prior init */ size_or_error = FS_get( path, return_buffer, buffer_length ); API_access_end(); } return ReturnAndErrno(size_or_error); } int OW_present(const char *path) { ssize_t ret = -ENOENT; /* current buffer string length */ if (API_access_start() == 0) { /* Check for prior init */ struct parsedname s_pn ; if (FS_ParsedName(path, &s_pn) != 0) { /* Can we parse the path string */ ret = -ENOENT; } else { FS_ParsedName_destroy(&s_pn); ret = 0 ; // good result } API_access_end(); } return ReturnAndErrno(ret); } ssize_t OW_lread(const char *path, char *buffer, const size_t size, const off_t offset) { ssize_t ret = -EACCES; /* current buffer string length */ /* Check the parameters */ if (buffer == NULL || path == NULL) { return ReturnAndErrno(-EINVAL); } if (API_access_start() == 0) { ret = FS_read(path, buffer, size, offset); API_access_end(); } return ReturnAndErrno(ret); } ssize_t OW_lwrite(const char *path, const char *buffer, const size_t size, const off_t offset) { ssize_t ret = -EACCES; /* current buffer string length */ /* Check the parameters */ if (buffer == NULL || path == NULL) { return ReturnAndErrno(-EINVAL); } if (API_access_start() == 0) { ret = FS_write(path, buffer, size, offset); API_access_end(); } return ReturnAndErrno(ret); } ssize_t OW_put(const char *path, const char *buffer, size_t buffer_length) { ssize_t ret = -EACCES; /* Check the parameters */ if (buffer == NULL || path == NULL) { return ReturnAndErrno(-EINVAL); } /* Check that we have done init, and that we can access */ if (API_access_start() == 0) { ret = FS_write(path, buffer, buffer_length, 0); API_access_end(); } return ReturnAndErrno(ret); } void OW_finish(void) { API_finish(); } owfs-3.1p5/module/owcapi/src/include/0000755000175000001440000000000013022537105014554 500000000000000owfs-3.1p5/module/owcapi/src/include/Makefile.am0000644000175000001440000000012312654730021016526 00000000000000headerdir = ${prefix}/include header_DATA = owcapi.h EXTRA_DIST = ${header_DATA} owfs-3.1p5/module/owcapi/src/include/Makefile.in0000644000175000001440000004505213022537051016547 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owcapi/src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(headerdir)" DATA = $(header_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ headerdir = ${prefix}/include header_DATA = owcapi.h EXTRA_DIST = ${header_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) --foreign module/owcapi/src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owcapi/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-headerDATA: $(header_DATA) @$(NORMAL_INSTALL) @list='$(header_DATA)'; test -n "$(headerdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(headerdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(headerdir)" || 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)$(headerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(headerdir)" || exit $$?; \ done uninstall-headerDATA: @$(NORMAL_UNINSTALL) @list='$(header_DATA)'; test -n "$(headerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(headerdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(headerdir)"; 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-libtool 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-headerDATA 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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-headerDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-headerDATA \ 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 mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-headerDATA .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: owfs-3.1p5/module/owcapi/src/include/owcapi.h0000644000175000001440000001052612654730021016135 00000000000000/* $Id$ OWFS (owfs, owhttpd, owserver, owperl, owtcl, owphp, owpython, owcapi) one-wire file system and related programs By Paul H Alfille {c} 2003-5 GPL paul.alfille@gmail.com */ /* OWCAPI - specific header */ /* OWCAPI is the simple C library for OWFS */ /* Commands OW_init, OW_get, OW_put, OW_finish */ #ifndef OWCAPI_H #define OWCAPI_H #include #include #ifdef __cplusplus extern "C" { #endif /* initialization, required before any other calls. Should be paired with a finish OW_init -- simplest, just a device name /dev/ttyS0 for serial u or u# for USB #### for TCP/IP port (owserver) looks just like the command line to owfs or owhttpd OW_init_args -- char** array usually from the main() call return value = 0 good < 0 error No need to call OW_finish if an error */ ssize_t OW_init(const char *params); ssize_t OW_init_args(int argc, char **args); /* repeat initialization can be the true init, or called safely a second time * this allows init to be called more than once, but the parameters are ignored after the first one. OW_safe_init -- simplest, just a device name /dev/ttyS0 for serial u or u# for USB #### for TCP/IP port (owserver) looks just like the command line to owfs or owhttpd OW_safe_init_args -- char** array usually from the main() call return value = 0 good < 0 error No need to call OW_finish if an error */ ssize_t OW_safe_init(const char *params); ssize_t OW_safe_init_args(int argc, char **args); void OW_set_error_level(const char *params); void OW_set_error_print(const char *params); /* OW_get -- data read or directory read path is OWFS style name, "" or "/" for root directory "01.23456708ABDE" for device directory "10.468ACE13579B/temperature for a specific device property buffer is a char buffer that is allocated by OW_get. buffer MUST BE "free"ed after use. buffer_length, if not NULL, will be assigned the length of the returned data If path is NULL, it is assumed to be "/" the root directory If path is not a valid C string, the results are unpredictable. If buffer is NULL, an error is returned If buffer_length is NULL it is ignored return value >=0 ok, length of information returned (in bytes) <0 error */ ssize_t OW_get(const char *path, char **buffer, size_t * buffer_length); /* OW_present -- check if path is present path is OWFS style name, "" or "/" for root directory "01.23456708ABDE" for device directory "10.468ACE13579B/temperature for a specific device property return value = 0 ok < 0 error */ int OW_present(const char *path); /* OW_put -- data write path is OWFS style name, "05.468ACE13579B/PIO.A for a specific device property buffer holds the value ascii, possibly comma delimitted Note NULL path or buffer will return an error. Note: path must be null-terminated Note: buffer_length will be used for length, there is no requirement that buffer be null-terminated return value = 0 ok < 0 error */ ssize_t OW_put(const char *path, const char *buffer, size_t buffer_length); /* OW_lread -- read data with offset path is OWFS style name, "05.468ACE13579B/PIO.A for a specific device property buffer holds the value ascii, possibly comma delimitted buffer must be size long offset is from start of value only ascii and binary data appropriate */ ssize_t OW_lread(const char *path, char *buf, const size_t size, const off_t offset); /* OW_lwrite -- write data with offset path is OWFS style name, "05.468ACE13579B/PIO.A for a specific device property buffer holds the value ascii, possibly comma delimitted buffer must be size long offset is from start of value only ascii and binary data appropriate */ ssize_t OW_lwrite(const char *path, const char *buf, const size_t size, const off_t offset); /* cleanup Clears internal buffer, frees file descriptors Normal process cleanup will work if program ends before OW_finish is called But not calling OW_init more than once without an intervening OW_finish will cause a memory leak No error return */ void OW_finish(void); #ifdef __cplusplus } #endif #endif /* OWCAPI_H */ owfs-3.1p5/module/owcapi/Makefile.am0000644000175000001440000000001712654730021014316 00000000000000SUBDIRS = src owfs-3.1p5/module/owcapi/Makefile.in0000644000175000001440000005500413022537051014333 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owcapi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src 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) --foreign module/owcapi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owcapi/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/ownet/0000755000175000001440000000000013022537102012211 500000000000000owfs-3.1p5/module/ownet/c/0000755000175000001440000000000013022537101012432 500000000000000owfs-3.1p5/module/ownet/c/src/0000755000175000001440000000000013022537101013221 500000000000000owfs-3.1p5/module/ownet/c/src/example/0000755000175000001440000000000013022537101014654 500000000000000owfs-3.1p5/module/ownet/c/src/example/Makefile.in0000644000175000001440000000261112654730021016647 00000000000000# Makefile for ownet example program -- invoked separately from this directory # $Id$ CFLAGS = -g -I@prefix@/include EXAMPLEA = ownetexample EXAMPLEA_OBJS = ownetexample.o EXAMPLEB = ownet_tree EXAMPLEB_OBJS = ownet_tree.o EXAMPLEC = ownet_rep_test EXAMPLEC_OBJS = ownet_rep_test.o EXAMPLED = ownet_init_test EXAMPLED_OBJS = ownet_init_test.o all: $(EXAMPLEA) $(EXAMPLEB) $(EXAMPLEC) $(EXAMPLED) ifeq "$(shell uname)" "Darwin" # Compile-flags for MacOSX DARWINLDFLAGS = -L@prefix@/lib -lownet -low @LIBUSB_LIBS@ $(EXAMPLEA): $(EXAMPLEA_OBJS) gcc $(CFLAGS) -o $@ $(EXAMPLEA_OBJS) $(DARWINLDFLAGS) $(EXAMPLEB): $(EXAMPLEB_OBJS) gcc $(CFLAGS) -o $@ $(EXAMPLEB_OBJS) $(DARWINLDFLAGS) $(EXAMPLEC): $(EXAMPLEC_OBJS) gcc $(CFLAGS) -o $@ $(EXAMPLEC_OBJS) $(DARWINLDFLAGS) $(EXAMPLED): $(EXAMPLED_OBJS) gcc $(CFLAGS) -o $@ $(EXAMPLED_OBJS) $(DARWINLDFLAGS) else # Compile-flags for Linux and Cygwin LDFLAGS = -L@prefix@/lib -Wl,--rpath -Wl,@prefix@/lib -lownet $(EXAMPLEA): $(EXAMPLEA_OBJS) gcc $(CFLAGS) -o $@ $(EXAMPLEA_OBJS) $(LDFLAGS) $(EXAMPLEB): $(EXAMPLEB_OBJS) gcc $(CFLAGS) -o $@ $(EXAMPLEB_OBJS) $(LDFLAGS) $(EXAMPLEC): $(EXAMPLEC_OBJS) gcc $(CFLAGS) -o $@ $(EXAMPLEC_OBJS) $(LDFLAGS) $(EXAMPLED): $(EXAMPLED_OBJS) gcc $(CFLAGS) -o $@ $(EXAMPLED_OBJS) $(LDFLAGS) endif %.o: %.c @CC@ $(CFLAGS) -c -o $@ $< clean: $(RM) -f $(EXAMPLEA) $(EXAMPLEB) $(EXAMPLEC) $(EXAMPLED) *.o *~ .~ Makefile owfs-3.1p5/module/ownet/c/src/example/ownetexample.c0000644000175000001440000000727012654730021017464 00000000000000/* $Id$ */ #include #include #include #include #include #include //------------- Globals vaiables ---------- char *owserver_address = "4304"; char *one_wire_path = "/"; //------------- Usage information -------- void usage(int argc, char **argv) { printf("%s shows examples of directory and read functions\n", argv[0]); printf("\n"); printf("Usage of %s:\n", argv[0]); printf("\t%s -s owserver_address\n", argv[0]); printf("\t\towserver_address -- tcp/ip address:port of owserver\n"); printf("\t\t\te.g. 192.168.0.77:3000 or just port number\n"); printf("\t\t\tdefault localhost:4304\n"); printf("\n"); printf("see http://www.owfs.org for information on owserver.\n"); exit(1); } //------------- Command line parsing ----- void parse_command_line(int argc, char **argv) { int argc_index; int next_is_owserver = 1; if (argc < 1) { usage(argc, argv); } for (argc_index = 1; argc_index < argc; ++argc_index) { if (strcmp(argv[argc_index], "-h") == 0) { usage(argc, argv); } else if (strcmp(argv[argc_index], "--help") == 0) { usage(argc, argv); } else if (strcmp(argv[argc_index], "-s") == 0) { next_is_owserver = 1; } else if (strcmp(argv[argc_index], "--server") == 0) { next_is_owserver = 1; } else { if (next_is_owserver) { owserver_address = argv[argc_index]; next_is_owserver = 0; } else { fprintf(stderr,"Extra argument <%s> in command line\n",argv[argc_index]); exit(1) ; } } } } //------------- Example-specific --------- struct pass_on { OWNET_HANDLE h; int depth; }; // directory_element callback function void Show_property(void *v, const char *filename) { // cast the void pointer to a known structure pointer struct pass_on *this_pass = v; // set up a structure to pass to future call-back struct pass_on next_pass = { this_pass->h, this_pass->depth + 1, }; char * read_data = NULL ; int read_length = OWNET_read(this_pass->h, filename, &read_data); // space in to level (for example) int indent_index; for (indent_index = 0; indent_index < this_pass->depth; ++indent_index) { printf(" "); } // print this filename printf("%s", filename); if ( read_length >= 0 ) { int i ; for ( i = 0 ; i < read_length ; ++i ) { if ( ! isprint( (int) read_data[i] ) ) { read_data[i] = '.' ; } } printf("\t<%s>",read_data); } if ( read_data != NULL ) { free( read_data ) ; } printf("\n") ; // recursive call on children OWNET_dirprocess(this_pass->h, filename, Show_property, &next_pass); } // directory_element callback function void Show_device(void *v, const char *filename) { // cast the void pointer to a known structure pointer struct pass_on *this_pass = v; // set up a structure to pass to future call-back struct pass_on next_pass = { this_pass->h, this_pass->depth + 1, }; // space in to level (for example) int indent_index; for (indent_index = 0; indent_index < this_pass->depth; ++indent_index) { printf(" "); } // print this filename printf("%s\n", filename); // Only continue for real devices if ( !isxdigit(filename[1]) || !isxdigit(filename[2]) ) { return ; } // recursive call on children OWNET_dirprocess(this_pass->h, filename, Show_property, &next_pass); } int main(int argc, char **argv) { ssize_t ret = 0; OWNET_HANDLE owh; struct pass_on first_pass; parse_command_line(argc, argv); if ((owh = OWNET_init(owserver_address)) < 0) { printf("OWNET_init(%s) failed.\n", owserver_address); exit(1); } first_pass.h = owh; first_pass.depth = 0; ret = OWNET_dirprocess(owh, one_wire_path, Show_device, &first_pass); if (ret < 0) { printf("OWNET_dirprocess error: %ld)\n", ret); } OWNET_close(owh); return 0; } owfs-3.1p5/module/ownet/c/src/example/Makefile.example0000644000175000001440000000043012654730021017671 00000000000000 LDFLAGS = -L/opt/owfs/lib -Wl,--rpath -Wl,/opt/owfs/lib -lownet CFLAGS = -g -I/opt/owfs/include OBJS = ownetexample.o all: ownetexample ownetexample: $(OBJS) gcc $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) %.o: %.c gcc $(CFLAGS) -c -o $@ $< clean: $(RM) -f ownetexample *.o *~ .~ owfs-3.1p5/module/ownet/c/src/Makefile.am0000644000175000001440000000031112654730021015176 00000000000000SUBDIRS = c include # don't want to add the example as a subdirectory right now... EXTRA_DIST = example/ownetexample.c example/Makefile.example example/Makefile.in DISTCLEANFILES = example/Makefile owfs-3.1p5/module/ownet/c/src/Makefile.in0000644000175000001440000005540513022537052015224 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/ownet/c/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = c include # don't want to add the example as a subdirectory right now... EXTRA_DIST = example/ownetexample.c example/Makefile.example example/Makefile.in DISTCLEANFILES = example/Makefile 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) --foreign module/ownet/c/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/ownet/c/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/ownet/c/src/c/0000755000175000001440000000000013022537101013443 500000000000000owfs-3.1p5/module/ownet/c/src/c/Makefile.am0000644000175000001440000000264512665167763015457 00000000000000LIBOWNET_SOURCE = \ compat.c \ error.c \ getaddrinfo.c \ getopt.c \ globals.c \ ow_browse.c \ ow_charblob.c \ ow_connect.c \ ow_dl.c \ ow_dnssd.c \ ow_locks.c \ ow_net_client.c \ ownet_close.c \ ownet_dir.c \ ownet_init.c \ ownet_read.c \ ownet_present.c \ ownet_setget.c \ ownet_write.c \ ow_rwlock.c \ ow_server.c \ ow_tcp_read.c lib_LTLIBRARIES = libownet.la libownet_la_SOURCES = ${LIBOWNET_SOURCE} if HAVE_CYGWIN libownet_la_LDFLAGS = ${PTHREAD_LIBS} ${LD_EXTRALIBS} -shared -no-undefined else libownet_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) ${PTHREAD_LIBS} ${LD_EXTRALIBS} -shared -shrext .so ${DL_LIBS} endif # Maybe need this for MacOS X #if HAVE_DARWIN #LDADDS = -framework IOKit -framework CoreFoundation #endif #libow_la_LDFLAGS = -shared -shrext .so \ # -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ # -release $(LT_RELEASE) \ # -export-dynamic \ # $(LDADDS) AM_CFLAGS = -I../include \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ -D__EXTENSIONS__ \ ${EXTRACFLAGS} \ ${PTHREAD_CFLAGS} \ ${PIC_FLAGS} owfs-3.1p5/module/ownet/c/src/c/Makefile.in0000644000175000001440000006666313022537052015456 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/ownet/c/src/c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libownet_la_LIBADD = am__objects_1 = compat.lo error.lo getaddrinfo.lo getopt.lo globals.lo \ ow_browse.lo ow_charblob.lo ow_connect.lo ow_dl.lo ow_dnssd.lo \ ow_locks.lo ow_net_client.lo ownet_close.lo ownet_dir.lo \ ownet_init.lo ownet_read.lo ownet_present.lo ownet_setget.lo \ ownet_write.lo ow_rwlock.lo ow_server.lo ow_tcp_read.lo am_libownet_la_OBJECTS = $(am__objects_1) libownet_la_OBJECTS = $(am_libownet_la_OBJECTS) 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 = libownet_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libownet_la_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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libownet_la_SOURCES) DIST_SOURCES = $(libownet_la_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)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ LIBOWNET_SOURCE = \ compat.c \ error.c \ getaddrinfo.c \ getopt.c \ globals.c \ ow_browse.c \ ow_charblob.c \ ow_connect.c \ ow_dl.c \ ow_dnssd.c \ ow_locks.c \ ow_net_client.c \ ownet_close.c \ ownet_dir.c \ ownet_init.c \ ownet_read.c \ ownet_present.c \ ownet_setget.c \ ownet_write.c \ ow_rwlock.c \ ow_server.c \ ow_tcp_read.c lib_LTLIBRARIES = libownet.la libownet_la_SOURCES = ${LIBOWNET_SOURCE} @HAVE_CYGWIN_FALSE@libownet_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) ${PTHREAD_LIBS} ${LD_EXTRALIBS} -shared -shrext .so ${DL_LIBS} @HAVE_CYGWIN_TRUE@libownet_la_LDFLAGS = ${PTHREAD_LIBS} ${LD_EXTRALIBS} -shared -no-undefined # Maybe need this for MacOS X #if HAVE_DARWIN #LDADDS = -framework IOKit -framework CoreFoundation #endif #libow_la_LDFLAGS = -shared -shrext .so \ # -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ # -release $(LT_RELEASE) \ # -export-dynamic \ # $(LDADDS) AM_CFLAGS = -I../include \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ -D__EXTENSIONS__ \ ${EXTRACFLAGS} \ ${PTHREAD_CFLAGS} \ ${PIC_FLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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) --foreign module/ownet/c/src/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/ownet/c/src/c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libownet.la: $(libownet_la_OBJECTS) $(libownet_la_DEPENDENCIES) $(EXTRA_libownet_la_DEPENDENCIES) $(AM_V_CCLD)$(libownet_la_LINK) -rpath $(libdir) $(libownet_la_OBJECTS) $(libownet_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getaddrinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_browse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_charblob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_connect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_dl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_dnssd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_locks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_net_client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_rwlock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_tcp_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ownet_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ownet_dir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ownet_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ownet_present.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ownet_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ownet_setget.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ownet_write.Plo@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool 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-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .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: owfs-3.1p5/module/ownet/c/src/c/compat.c0000644000175000001440000001764012654730021015030 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #ifndef HAVE_STRSEP /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Get next token from string *stringp, where tokens are possibly-empty * strings separated by characters from delim. * * Writes NULs into the string at *stringp to end tokens. * delim need not remain constant from call to call. * On return, *stringp points past the last NUL written (if there might * be further tokens), or is NULL (if there are definitely no more tokens). * * If *stringp is NULL, strsep returns NULL. */ char *strsep(char **stringp, const char *delim) { char *s; const char *spanp; int c, sc; char *tok; if ((s = *stringp) == NULL) return (NULL); for (tok = s;;) { c = *s++; spanp = delim; do { if ((sc = *spanp++) == c) { if (c == 0) s = NULL; else s[-1] = 0; *stringp = s; return (tok); } } while (sc != 0); } /* NOTREACHED */ } #endif /* !defined(HAVE_STRSEP) */ #ifndef HAVE_TDESTROY /* uClibc older than 0.9.19 is missing tdestroy() (don't know exactly when it was added) I added a replacement to this, just to be able to compile owfs for WRT54G without any patched uClibc. */ #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif static void tdestroy_recurse_(node * root, void (*freefct) (void *)) { if (root->left != NULL) tdestroy_recurse_(root->left, freefct); if (root->right != NULL) tdestroy_recurse_(root->right, freefct); if (root->key) { (*freefct) ((void *) root->key); //free(root->key); root->key = NULL; } /* Free the node itself. */ free(root); } void tdestroy(void *vroot, void (*freefct) (void *)) { node *root = (node *) vroot; if (root != NULL) { tdestroy_recurse_(root, freefct); } } #endif /* HAVE_TDESTROY */ #ifndef HAVE_TSEARCH #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif /* find or insert datum into search tree. char *key; key to be located register node **rootp; address of tree root int (*compar)(); ordering function */ void *tsearch(__const void *key, void **vrootp, __compar_fn_t compar) { register node *q; register node **rootp = (node **) vrootp; if (rootp == (struct node_t **) 0) return ((struct node_t *) 0); while (*rootp != (struct node_t *) 0) { /* Knuth's T1: */ int r; if ((r = (*compar) (key, (*rootp)->key)) == 0) /* T2: */ return (*rootp); /* we found it! */ rootp = (r < 0) ? &(*rootp)->left : /* T3: follow left branch */ &(*rootp)->right; /* T4: follow right branch */ } q = (node *) malloc(sizeof(node)); /* T5: key not found */ if (q != (struct node_t *) 0) { /* make new node */ *rootp = q; /* link new node to old */ q->key = (void *) key; /* initialize new node */ q->left = q->right = (struct node_t *) 0; } return (q); } #endif #ifndef HAVE_TFIND #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif void *tfind(__const void *key, void *__const * vrootp, __compar_fn_t compar) { register node **rootp = (node **) vrootp; if (rootp == (struct node_t **) 0) return ((struct node_t *) 0); while (*rootp != (struct node_t *) 0) { /* Knuth's T1: */ int r; if ((r = (*compar) (key, (*rootp)->key)) == 0) /* T2: */ return (*rootp); /* we found it! */ rootp = (r < 0) ? &(*rootp)->left : /* T3: follow left branch */ &(*rootp)->right; /* T4: follow right branch */ } return NULL; } #endif #ifndef HAVE_TFIND #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif /* delete node with given key char *key; key to be deleted register node **rootp; address of the root of tree int (*compar)(); comparison function */ void *tdelete(__const void *key, void **vrootp, __compar_fn_t compar) { node *p; register node *q; register node *r; int cmp; register node **rootp = (node **) vrootp; if (rootp == (struct node_t **) 0 || (p = *rootp) == (struct node_t *) 0) return ((struct node_t *) 0); while ((cmp = (*compar) (key, (*rootp)->key)) != 0) { p = *rootp; rootp = (cmp < 0) ? &(*rootp)->left : /* follow left branch */ &(*rootp)->right; /* follow right branch */ if (*rootp == (struct node_t *) 0) return ((struct node_t *) 0); /* key not found */ } r = (*rootp)->right; /* D1: */ if ((q = (*rootp)->left) == (struct node_t *) 0) /* Left (struct node_t *)0? */ q = r; else if (r != (struct node_t *) 0) { /* Right link is null? */ if (r->left == (struct node_t *) 0) { /* D2: Find successor */ r->left = q; q = r; } else { /* D3: Find (struct node_t *)0 link */ for (q = r->left; q->left != (struct node_t *) 0; q = r->left) r = q; r->left = q->right; q->left = (*rootp)->left; q->right = (*rootp)->right; } } free((struct node_t *) *rootp); /* D4: Free node */ *rootp = q; /* link parent to new node */ return (p); } #endif #ifndef HAVE_TWALK #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif /* Walk the nodes of a tree register node *root; Root of the tree to be walked register void (*action)(); Function to be called at each node register int level; */ static void trecurse(__const void *vroot, __action_fn_t action, int level) { register node *root = (node *) vroot; if (root->left == (struct node_t *) 0 && root->right == (struct node_t *) 0) (*action) (root, leaf, level); else { (*action) (root, preorder, level); if (root->left != (struct node_t *) 0) trecurse(root->left, action, level + 1); (*action) (root, postorder, level); if (root->right != (struct node_t *) 0) trecurse(root->right, action, level + 1); (*action) (root, endorder, level); } } /* void twalk(root, action) Walk the nodes of a tree node *root; Root of the tree to be walked void (*action)(); Function to be called at each node PTR */ void twalk(__const void *vroot, __action_fn_t action) { register __const node *root = (node *) vroot; if (root != (node *) 0 && action != (__action_fn_t) 0) trecurse(root, action, 0); } #endif owfs-3.1p5/module/ownet/c/src/c/error.c0000644000175000001440000002125712654730021014675 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* error.c stolen nearly verbatim from "Unix Network Programming Volume 1 The Sockets Networking API (3rd Ed)" by W. Richard Stevens, Bill Fenner, Andrew M Rudoff Addison-Wesley Professional Computing Series Addison-Wesley, Boston 2003 http://www.unpbook.com * * Although it's been considerably modified over time -- don't blame the authors'' */ #include #include "owfs_config.h" #include "ow.h" #include #ifdef HAVE_SYS_UIO_H #include #endif const char mutex_init_failed[] = "mutex_init failed rc=%d [%s]\n"; const char mutex_destroy_failed[] = "mutex_destroy failed rc=%d [%s]\n"; const char mutex_lock_failed[] = "mutex_lock failed rc=%d [%s]\n"; const char mutex_unlock_failed[] = "mutex_unlock failed rc=%d [%s]\n"; const char mutexattr_init_failed[] = "mutexattr_init failed rc=%d [%s]\n"; const char mutexattr_destroy_failed[] = "mutexattr_destroy failed rc=%d [%s]\n"; const char mutexattr_settype_failed[] = "mutexattr_settype failed rc=%d [%s]\n"; const char rwlock_init_failed[] = "rwlock_init failed rc=%d [%s]\n"; const char rwlock_read_lock_failed[] = "rwlock_read_lock failed rc=%d [%s]\n"; const char rwlock_read_unlock_failed[] = "rwlock_read_unlock failed rc=%d [%s]\n"; const char cond_timedwait_failed[] = "cond_timedwait failed rc=%d [%s]\n"; const char cond_signal_failed[] = "cond_signal failed rc=%d [%s]\n"; const char cond_broadcast_failed[] = "cond_broadcast failed rc=%d [%s]\n"; const char cond_wait_failed[] = "cond_wait failed rc=%d [%s]\n"; const char cond_init_failed[] = "cond_init failed rc=%d [%s]\n"; const char cond_destroy_failed[] = "cond_destroy failed rc=%d [%s]\n"; const char sem_init_failed[] = "sem_init failed rc=%d [%s]\n"; const char sem_post_failed[] = "sem_post failed rc=%d [%s]\n"; const char sem_wait_failed[] = "sem_wait failed rc=%d [%s]\n"; const char sem_trywait_failed[] = "sem_trywait failed rc=%d [%s]\n"; const char sem_timedwait_failed[] = "sem_timedwait failed rc=%d [%s]\n"; const char sem_destroy_failed[] = "sem_destroy failed rc=%d [%s]\n"; static void err_format(char * format, int errno_save, const char * level_string, const char * file, int line, const char * func, const char * fmt); static void hex_print( const char * buf, int length ) ; static void ascii_print( const char * buf, int length ) ; /* See man page for explanation */ int log_available = 0; /* Limits for prettier byte printing */ #define HEX_PRINT_BYTES_PER_LINE 16 #define HEX_PRINT_MAX_LINES 4 /* Print message and return to caller * Caller specifies "errnoflag" and "level" */ #define MAXLINE 1023 void print_timestamp_(const char * file, int line, const char * func, const char *fmt, ...) { struct timeval tv; char buf[MAXLINE + 3]; char format[MAXLINE + 3]; va_list va; gettimeofday(&tv, NULL); snprintf(format, MAXLINE, "%s:%s(%d) %s", file,func,line,fmt); /* safe */ va_start(va, fmt); #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, va); /* safe */ #else vsprintf(buf, format, va); /* not safe */ #endif va_end(va); fprintf(stderr, "%ld DEFAULT: %s %ld.%06ld\n", time(NULL), buf, (long int) tv.tv_sec, (long int) tv.tv_usec); fflush(stderr); } void err_msg(enum e_err_type errnoflag, enum e_err_level level, const char * file, int line, const char * func, const char *fmt, ...) { int errno_save = (errnoflag==e_err_type_error)?errno:0; /* value caller might want printed */ char format[MAXLINE + 3]; char buf[MAXLINE + 3]; va_list ap; const char * level_string ; switch (level) { case e_err_default: level_string = "DEFAULT: "; break; case e_err_connect: level_string = "CONNECT: "; break; case e_err_call: level_string = " CALL: "; break; case e_err_data: level_string = " DATA: "; break; case e_err_detail: level_string = " DETAIL: "; break; case e_err_debug: case e_err_beyond: default: level_string = " DEBUG: "; break; } va_start(ap, fmt); err_format( format, errno_save, level_string, file, line, func, fmt) ; UCLIBCLOCK; /* Create output string */ #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, ap); /* safe */ #else vsprintf(buf, format, ap); /* not safe */ #endif UCLIBCUNLOCK; va_end(ap); //printf("About to output an error \n"); fputs(buf, stderr); fflush(stderr); return; } /* Purely a debugging routine -- print an arbitrary buffer of bytes */ void _Debug_Bytes(const char *title, const unsigned char *buf, int length) { /* title line */ fprintf(stderr,"Byte buffer %s, length=%d", title ? title : "anonymous", (int) length); if (length < 0) { fprintf(stderr,"\n-- Attempt to write with bad length\n"); return; } else if ( length == 0 ) { fprintf(stderr,"\n"); return ; } if (buf == NULL) { fprintf(stderr,"\n-- NULL buffer\n"); return; } hex_print( (const char *) buf, length ) ; ascii_print( (const char *) buf, length ) ; } /* calls exit() so never returns */ void fatal_error(const char * file, int line, const char * func, const char *fmt, ...) { va_list ap; char format[MAXLINE + 1]; char buf[MAXLINE + 1]; va_start(ap, fmt); err_format( format, 0, "FATAL ERROR: ", file, line, func, fmt) ; #ifdef OWNETC_OW_DEBUG { fprintf(stderr, "%s:%d ", file, line); #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, ap); #else vsprintf(buf, fmt, ap); #endif fprintf(stderr, "%s", buf); } #else /* OWNETC_OW_DEBUG */ if(Globals.fatal_debug) { #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, ap); #else vsprintf(buf, format, ap); #endif /* Print where? */ switch (Globals.error_print) { case e_err_print_mixed: switch (Globals.daemon_status) { case e_daemon_want_bg: case e_daemon_bg: sl = e_err_print_syslog ; break ; default: sl = e_err_print_console; break ; } break; case e_err_print_syslog: sl = e_err_print_syslog; break; case e_err_print_console: sl = e_err_print_console; break; default: va_end(ap); return; } if (sl == e_err_print_syslog) { /* All output to syslog */ if (!log_available) { openlog("OWFS", LOG_PID, LOG_DAEMON); log_available = 1; } syslog(LOG_USER|LOG_INFO, "%s\n", buf); } else { fflush(stdout); /* in case stdout and stderr are the same */ fputs(buf, stderr); fprintf(stderr,"\n"); fflush(stderr); } } if(Globals.fatal_debug_file != NULL) { FILE *fp; char filename[64]; sprintf(filename, "%s.%d", Globals.fatal_debug_file, getpid()); if((fp = fopen(filename, "a")) != NULL) { if(!Globals.fatal_debug) { #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, ap); #else vsprintf(buf, format, ap); #endif } fprintf(fp, "%s:%d %s\n", file, line, buf); fclose(fp); } } #endif /* OWNETC_OW_DEBUG */ va_end(ap); debug_crash(); // Core-dump to make it possible to trace down the problem! //exit(EXIT_FAILURE) ; } static void err_format(char * format, int errno_save, const char * level_string, const char * file, int line, const char * func, const char * fmt) { UCLIBCLOCK; /* Create output string */ #ifdef HAVE_VSNPRINTF if (errno_save) { snprintf(format, MAXLINE, "%s%s:%s(%d) [%s] %s", level_string,file,func,line,strerror(errno_save),fmt); /* safe */ } else { snprintf(format, MAXLINE, "%s%s:%s(%d) %s", level_string,file,func,line,fmt); /* safe */ } #else if (errno_save) { sprintf(format, "%s%s:%s(%d) [%s] %s", level_string,file,func,line,strerror(errno_save),fmt); /* not safe */ } else { sprintf(format, "%s%s:%s(%d) %s", level_string,file,func,line,fmt); /* not safe */ } #endif UCLIBCUNLOCK; /* Add CR at end */ } static void hex_print( const char * buf, int length ) { int i = 0 ; /* hex lines */ for (i = 0; i < length; ++i) { if ((i % HEX_PRINT_BYTES_PER_LINE) == 0) { // switch lines fprintf(stderr,"\n--%3.3d:",i); } fprintf(stderr," %.2X", (unsigned char)buf[i]); if( i >= ( HEX_PRINT_BYTES_PER_LINE * HEX_PRINT_MAX_LINES -1 ) ) { /* Sorry for this, but I think it's better to strip off all huge 8192 packages in the debug-output. */ fprintf(stderr,"\n--%3.3d: == abridged ==",i); break; } } } static void ascii_print( const char * buf, int length ) { int i ; /* char line -- printable or . */ fprintf(stderr,"\n <"); for (i = 0; i < length; ++i) { char c = buf[i]; fprintf(stderr,"%c", isprint( (int) c) ? c : '.'); if(i >= ( HEX_PRINT_BYTES_PER_LINE * HEX_PRINT_MAX_LINES -1 )) { /* Sorry for this, but I think it's better to strip off all huge 8192 packages in the debug-output. */ break; } } fprintf(stderr,">\n"); } owfs-3.1p5/module/ownet/c/src/c/getaddrinfo.c0000644000175000001440000007164412654730021016037 00000000000000/* $USAGI: getaddrinfo.c,v 1.16 2001/10/04 09:52:03 sekiya Exp $ */ /* The Inner Net License, Version 2.00 The author(s) grant permission for redistribution and use in source and binary forms, with or without modification, of the software and documentation provided that the following conditions are met: 0. If you receive a version of the software that is specifically labelled as not being for redistribution (check the version message and/or README), you are not permitted to redistribute that version of the software in any way or form. 1. All terms of the all other applicable copyrights and licenses must be followed. 2. Redistributions of source code must retain the authors' copyright notice(s), this list of conditions, and the following disclaimer. 3. Redistributions in binary form must reproduce the authors' copyright notice(s), this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 4. All advertising materials mentioning features or use of this software must display the following acknowledgement with the name(s) of the authors as specified in the copyright notice(s) substituted where indicated: This product includes software developed by , The Inner Net, and other contributors. 5. Neither the name(s) of the author(s) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY ITS AUTHORS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. If these license terms cause you a real problem, contact the author. */ /* This software is Copyright 1996 by Craig Metz, All Rights Reserved. */ #include #include "owfs_config.h" #ifdef HAVE_PTHREAD #include #endif #ifndef HAVE_GETADDRINFO #define _GNU_SOURCE 1 #define __FORCE_GLIBC #ifdef HAVE_FEATURES_H #include #endif #include #include #include #include "compat_netdb.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_RESOLV_H #include #endif #include "ow_debug.h" /* The following declarations and definitions have been removed from * the public header since we don't want people to use them. */ #define AI_V4MAPPED 0x0008 /* IPv4-mapped addresses are acceptable. */ #define AI_ALL 0x0010 /* Return both IPv4 and IPv6 addresses. */ #define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type. */ #define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG) #define GAIH_OKIFUNSPEC 0x0100 #define GAIH_EAI ~(GAIH_OKIFUNSPEC) struct gaih_service { const char *name; int num; }; struct gaih_servtuple { struct gaih_servtuple *next; int socktype; int protocol; int port; }; static const struct gaih_servtuple nullserv; struct gaih_addrtuple { struct gaih_addrtuple *next; int family; char addr[16]; uint32_t scopeid; }; struct gaih_typeproto { int socktype; int protocol; char name[4]; int protoflag; }; /* Values for `protoflag'. */ #define GAI_PROTO_NOSERVICE 1 #define GAI_PROTO_PROTOANY 2 static const struct gaih_typeproto gaih_inet_typeproto[] = { {0, 0, "", 0}, {SOCK_STREAM, IPPROTO_TCP, "tcp", 0}, {SOCK_DGRAM, IPPROTO_UDP, "udp", 0}, {SOCK_RAW, 0, "raw", GAI_PROTO_PROTOANY | GAI_PROTO_NOSERVICE}, {0, 0, "", 0} }; struct gaih { int family; int (*gaih) (const char *name, const struct gaih_service * service, const struct addrinfo * req, struct addrinfo ** pai); }; #if PF_UNSPEC == 0 static const struct addrinfo default_hints; #else static const struct addrinfo default_hints = { 0, PF_UNSPEC, 0, 0, 0, NULL, NULL, NULL }; #endif static int addrconfig(sa_family_t af) { int s; int ret; int saved_errno = errno; s = socket(af, SOCK_DGRAM, 0); if (s < 0) ret = (errno == EMFILE) ? 1 : 0; else { close(s); ret = 1; } __set_errno(saved_errno); return ret; } #if 0 #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX 108 #endif /* Using Unix sockets this way is a security risk. */ static int gaih_local(const char *name, const struct gaih_service *service, const struct addrinfo *req, struct addrinfo **pai) { struct utsname utsname; if ((name != NULL) && (req->ai_flags & AI_NUMERICHOST)) return GAIH_OKIFUNSPEC | -EAI_NONAME; if ((name != NULL) || (req->ai_flags & AI_CANONNAME)) if (uname(&utsname) < 0) return -EAI_SYSTEM; if (name != NULL) { if (strcmp(name, "localhost") && strcmp(name, "local") && strcmp(name, "unix") && strcmp(name, utsname.nodename)) return GAIH_OKIFUNSPEC | -EAI_NONAME; } if (req->ai_protocol || req->ai_socktype) { const struct gaih_typeproto *tp = gaih_inet_typeproto + 1; while (tp->name[0] && ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0 || (req->ai_socktype != 0 && req->ai_socktype != tp->socktype) || (req->ai_protocol != 0 && !(tp->protoflag & GAI_PROTO_PROTOANY) && req->ai_protocol != tp->protocol))) ++tp; if (!tp->name[0]) { if (req->ai_socktype) return (GAIH_OKIFUNSPEC | -EAI_SOCKTYPE); else return (GAIH_OKIFUNSPEC | -EAI_SERVICE); } } *pai = malloc(sizeof(struct addrinfo) + sizeof(struct sockaddr_un) + ((req->ai_flags & AI_CANONNAME) ? (strlen(utsname.nodename) + 1) : 0)); if (*pai == NULL) return -EAI_MEMORY; (*pai)->ai_next = NULL; (*pai)->ai_flags = req->ai_flags; (*pai)->ai_family = AF_LOCAL; (*pai)->ai_socktype = req->ai_socktype ? req->ai_socktype : SOCK_STREAM; (*pai)->ai_protocol = req->ai_protocol; (*pai)->ai_addrlen = sizeof(struct sockaddr_un); (*pai)->ai_addr = (void *) (*pai) + sizeof(struct addrinfo); #ifdef HAVE_SA_LEN ((struct sockaddr_un *) (*pai)->ai_addr)->sun_len = sizeof(struct sockaddr_un); #endif /* HAVE_SA_LEN */ ((struct sockaddr_un *) (*pai)->ai_addr)->sun_family = AF_LOCAL; memset(((struct sockaddr_un *) (*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX); if (service) { struct sockaddr_un *sunp = (struct sockaddr_un *) (*pai)->ai_addr; if (strchr(service->name, '/') != NULL) { if (strlen(service->name) >= sizeof(sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; strcpy(sunp->sun_path, service->name); } else { if (strlen(P_tmpdir "/") + 1 + strlen(service->name) >= sizeof(sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; __stpcpy(__stpcpy(sunp->sun_path, P_tmpdir "/"), service->name); } } else { /* This is a dangerous use of the interface since there is a time window between the test for the file and the actual creation (done by the caller) in which a file with the same name could be created. */ char *buf = ((struct sockaddr_un *) (*pai)->ai_addr)->sun_path; if (__builtin_expect(__path_search(buf, L_tmpnam, NULL, NULL, 0), 0) != 0 || __builtin_expect(__gen_tempname(buf, __GT_NOCREATE), 0) != 0) return -EAI_SYSTEM; } if (req->ai_flags & AI_CANONNAME) (*pai)->ai_canonname = strcpy((char *) *pai + sizeof(struct addrinfo) + sizeof(struct sockaddr_un), utsname.nodename); else (*pai)->ai_canonname = NULL; return 0; } #endif /* 0 */ #ifndef HAVE_GETHOSTBYNAME_R struct hostent *gethostbyname_r(const char *name, struct hostent *result, char *buf, size_t buflen, int *h_errnop) { #ifdef HAVE_PTHREAD static pthread_mutex_t gethostbyname_lock = PTHREAD_MUTEX_INITIALIZER; #endif struct hostent *res; (void) buf; // not used (void) buflen; // not used #ifdef HAVE_PTHREAD my_pthread_mutex_lock(&gethostbyname_lock); #endif res = gethostbyname(name); if (res) { memcpy(result, res, sizeof(struct hostent)); } else { *h_errnop = errno; } #ifdef HAVE_PTHREAD my_pthread_mutex_unlock(&gethostbyname_lock); #endif return res; } #endif #ifndef HAVE_GETSERVBYNAME_R struct servent *getservbyname_r(const char *name, const char *proto, struct servent *result, char *buf, size_t buflen) { #ifdef HAVE_PTHREAD static pthread_mutex_t getservbyname_lock = PTHREAD_MUTEX_INITIALIZER; #endif struct servent *res; (void) buf; // not used (void) buflen; // not used #ifdef HAVE_PTHREAD my_pthread_mutex_lock(&getservbyname_lock); #endif res = getservbyname(name, proto); if (res) memcpy(result, res, sizeof(struct servent)); #ifdef HAVE_PTHREAD my_pthread_mutex_unlock(&getservbyname_lock); #endif return res; } #endif static int gaih_inet_serv(const char *servicename, const struct gaih_typeproto *tp, const struct addrinfo *req, struct gaih_servtuple *st) { struct servent *s; size_t tmpbuflen = 1024; struct servent ts; char *tmpbuf; int r; do { tmpbuf = alloca(tmpbuflen); #if 0 r = getservbyname_r(servicename, tp->name, &ts, tmpbuf, tmpbuflen, &s); if (!s) r = errno; if (r != 0 || s == NULL) { if (r == ERANGE) tmpbuflen *= 2; else return GAIH_OKIFUNSPEC | -EAI_SERVICE; } #else s = getservbyname_r(servicename, tp->name, &ts, tmpbuf, tmpbuflen); if (s == NULL) { r = errno; if (r == ERANGE) tmpbuflen *= 2; else return GAIH_OKIFUNSPEC | -EAI_SERVICE; } else { r = 0; } #endif } while (r); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) ? req->ai_protocol : tp->protocol); st->port = s->s_port; return 0; } #define gethosts(_family, _type) \ { \ int i, herrno; \ size_t tmpbuflen; \ struct hostent th; \ char *tmpbuf; \ tmpbuflen = 512; \ no_data = 0; \ do { \ tmpbuflen *= 2; \ tmpbuf = alloca (tmpbuflen); \ rc = 0; \ h = gethostbyname_r (name, &th, tmpbuf, \ tmpbuflen, &herrno); \ if(!h) rc = errno; \ } while (rc == ERANGE && herrno == NETDB_INTERNAL); \ if (rc != 0) \ { \ if (herrno == NETDB_INTERNAL) \ { \ __set_h_errno (herrno); \ return -EAI_SYSTEM; \ } \ if (herrno == TRY_AGAIN) \ no_data = EAI_AGAIN; \ else \ no_data = herrno == NO_DATA; \ } \ else if (h != NULL) \ { \ for (i = 0; h->h_addr_list[i]; i++) \ { \ if (*pat == NULL) { \ *pat = alloca (sizeof(struct gaih_addrtuple)); \ (*pat)->scopeid = 0; \ } \ (*pat)->next = NULL; \ (*pat)->family = _family; \ memcpy ((*pat)->addr, h->h_addr_list[i], \ sizeof(_type)); \ pat = &((*pat)->next); \ } \ } \ } #ifndef HAVE_GETHOSTBYNAME2_R struct hostenv *gethostbyname2_r(const char *name, int af, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop) { /* Don't support this if it doesn't exists... (eg. IPV6 will fail on cygwin for example) */ (void) name; (void) af; (void) ret; (void) buf; (void) buflen; (void) result; (void) h_errnop; return NULL; } #endif #if __HAS_IPV6__ #define gethosts2(_family, _type) \ { \ int i, herrno; \ size_t tmpbuflen; \ struct hostent th; \ char *tmpbuf; \ tmpbuflen = 512; \ no_data = 0; \ do { \ tmpbuflen *= 2; \ tmpbuf = alloca (tmpbuflen); \ rc = gethostbyname2_r (name, _family, &th, tmpbuf, \ tmpbuflen, &h, &herrno); \ } while (rc == ERANGE && herrno == NETDB_INTERNAL); \ if (rc != 0) \ { \ if (herrno == NETDB_INTERNAL) \ { \ __set_h_errno (herrno); \ return -EAI_SYSTEM; \ } \ if (herrno == TRY_AGAIN) \ no_data = EAI_AGAIN; \ else \ no_data = herrno == NO_DATA; \ } \ else if (h != NULL) \ { \ for (i = 0; h->h_addr_list[i]; i++) \ { \ if (*pat == NULL) { \ *pat = alloca (sizeof(struct gaih_addrtuple)); \ (*pat)->scopeid = 0; \ } \ (*pat)->next = NULL; \ (*pat)->family = _family; \ memcpy ((*pat)->addr, h->h_addr_list[i], \ sizeof(_type)); \ pat = &((*pat)->next); \ } \ } \ } #endif #ifndef HAVE_GETHOSTBYADDR_R struct hostent *gethostbyaddr_r(const char *name, int len, int type, struct hostent *result, char *buf, size_t buflen, int *h_errnop) { #ifdef HAVE_PTHREAD static pthread_mutex_t gethostbyaddr_lock = PTHREAD_MUTEX_INITIALIZER; #endif struct hostent *res; (void) buf; // not used (void) buflen; // not used #ifdef HAVE_PTHREAD my_pthread_mutex_lock(&gethostbyaddr_lock); #endif res = gethostbyaddr(name, len, type); if (res) { memcpy(result, res, sizeof(struct hostent)); } else { *h_errnop = errno; } #ifdef HAVE_PTHREAD my_pthread_mutex_unlock(&gethostbyaddr_lock); #endif return res; } #endif static int gaih_inet(const char *name, const struct gaih_service *service, const struct addrinfo *req, struct addrinfo **pai) { const struct gaih_typeproto *tp = gaih_inet_typeproto; struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv; struct gaih_addrtuple *at = NULL; int rc; int v4mapped = (req->ai_family == PF_UNSPEC #if __HAS_IPV6__ || req->ai_family == PF_INET6 #endif ) && (req->ai_flags & AI_V4MAPPED); if (req->ai_protocol || req->ai_socktype) { ++tp; while (tp->name[0] && ((req->ai_socktype != 0 && req->ai_socktype != tp->socktype) || (req->ai_protocol != 0 && !(tp->protoflag & GAI_PROTO_PROTOANY) && req->ai_protocol != tp->protocol))) ++tp; if (!tp->name[0]) { if (req->ai_socktype) return (GAIH_OKIFUNSPEC | -EAI_SOCKTYPE); else return (GAIH_OKIFUNSPEC | -EAI_SERVICE); } } if (service != NULL) { if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0) return (GAIH_OKIFUNSPEC | -EAI_SERVICE); if (service->num < 0) { if (tp->name[0]) { st = (struct gaih_servtuple *) alloca(sizeof(struct gaih_servtuple)); if ((rc = gaih_inet_serv(service->name, tp, req, st))) return rc; } else { struct gaih_servtuple **pst = &st; for (tp++; tp->name[0]; tp++) { struct gaih_servtuple *newp; if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0) continue; if (req->ai_socktype != 0 && req->ai_socktype != tp->socktype) continue; if (req->ai_protocol != 0 && !(tp->protoflag & GAI_PROTO_PROTOANY) && req->ai_protocol != tp->protocol) continue; newp = (struct gaih_servtuple *) alloca(sizeof(struct gaih_servtuple)); if ((rc = gaih_inet_serv(service->name, tp, req, newp))) { if (rc & GAIH_OKIFUNSPEC) continue; return rc; } *pst = newp; pst = &(newp->next); } if (st == (struct gaih_servtuple *) &nullserv) return (GAIH_OKIFUNSPEC | -EAI_SERVICE); } } else { st = alloca(sizeof(struct gaih_servtuple)); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) ? req->ai_protocol : tp->protocol); st->port = htons(service->num); } } else if (req->ai_socktype || req->ai_protocol) { st = alloca(sizeof(struct gaih_servtuple)); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) ? req->ai_protocol : tp->protocol); st->port = 0; } else { /* * Neither socket type nor protocol is set. Return all socket types * we know about. */ struct gaih_servtuple **lastp = &st; for (++tp; tp->name[0]; ++tp) { struct gaih_servtuple *newp; newp = alloca(sizeof(struct gaih_servtuple)); newp->next = NULL; newp->socktype = tp->socktype; newp->protocol = tp->protocol; newp->port = 0; *lastp = newp; lastp = &newp->next; } } if (name != NULL) { at = alloca(sizeof(struct gaih_addrtuple)); at->family = AF_UNSPEC; at->scopeid = 0; at->next = NULL; if (inet_pton(AF_INET, name, at->addr) > 0) { if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET || v4mapped) at->family = AF_INET; else return -EAI_FAMILY; } #if __HAS_IPV6__ if (at->family == AF_UNSPEC) { char *namebuf = strdupa(name); char *scope_delim; scope_delim = strchr(namebuf, SCOPE_DELIMITER); if (scope_delim != NULL) *scope_delim = '\0'; if (inet_pton(AF_INET6, namebuf, at->addr) > 0) { if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6) at->family = AF_INET6; else return -EAI_FAMILY; if (scope_delim != NULL) { int try_numericscope = 0; if (IN6_IS_ADDR_LINKLOCAL(at->addr) || IN6_IS_ADDR_MC_LINKLOCAL(at->addr)) { at->scopeid = if_nametoindex(scope_delim + 1); if (at->scopeid == 0) try_numericscope = 1; } else try_numericscope = 1; if (try_numericscope != 0) { char *end; assert(sizeof(uint32_t) <= sizeof(unsigned long)); at->scopeid = (uint32_t) strtoul(scope_delim + 1, &end, 10); if (*end != '\0') return GAIH_OKIFUNSPEC | -EAI_NONAME; } } } } #endif if (at->family == AF_UNSPEC && (req->ai_flags & AI_NUMERICHOST) == 0) { struct hostent *h; struct gaih_addrtuple **pat = &at; int no_data = 0; int no_inet6_data; /* * If we are looking for both IPv4 and IPv6 address we don't want * the lookup functions to automatically promote IPv4 addresses to * IPv6 addresses. */ #if __HAS_IPV6__ if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6) gethosts(AF_INET6, struct in6_addr); #endif no_inet6_data = no_data; if (req->ai_family == AF_INET || (!v4mapped && req->ai_family == AF_UNSPEC) || (v4mapped && (no_inet6_data != 0 || (req->ai_flags & AI_ALL)))) #if __HAS_IPV6__ gethosts2(AF_INET, struct in_addr); #else gethosts(AF_INET, struct in_addr); #endif if (no_data != 0 && no_inet6_data != 0) { /* If both requests timed out report this. */ if (no_data == EAI_AGAIN && no_inet6_data == EAI_AGAIN) return -EAI_AGAIN; /* * We made requests but they turned out no data. * The name is known, though. */ return (GAIH_OKIFUNSPEC | -EAI_AGAIN); } } if (at->family == AF_UNSPEC) return (GAIH_OKIFUNSPEC | -EAI_NONAME); } else { struct gaih_addrtuple *atr; atr = at = alloca(sizeof(struct gaih_addrtuple)); memset(at, '\0', sizeof(struct gaih_addrtuple)); if (req->ai_family == 0) { at->next = alloca(sizeof(struct gaih_addrtuple)); memset(at->next, '\0', sizeof(struct gaih_addrtuple)); } #if __HAS_IPV6__ if (req->ai_family == 0 || req->ai_family == AF_INET6) { extern const struct in6_addr __in6addr_loopback; at->family = AF_INET6; if ((req->ai_flags & AI_PASSIVE) == 0) memcpy(at->addr, &__in6addr_loopback, sizeof(struct in6_addr)); atr = at->next; } #endif if (req->ai_family == 0 || req->ai_family == AF_INET) { atr->family = AF_INET; if ((req->ai_flags & AI_PASSIVE) == 0) *(uint32_t *) atr->addr = htonl(INADDR_LOOPBACK); } } if (pai == NULL) return 0; { const char *c = NULL; struct gaih_servtuple *st2; struct gaih_addrtuple *at2 = at; size_t socklen, namelen; sa_family_t family; /* * buffer is the size of an unformatted IPv6 address in * printable format. */ char buffer[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"]; while (at2 != NULL) { if (req->ai_flags & AI_CANONNAME) { struct hostent *h = NULL; int herrno; struct hostent th; size_t tmpbuflen = 512; char *tmpbuf; do { tmpbuflen *= 2; tmpbuf = alloca(tmpbuflen); if (tmpbuf == NULL) return -EAI_MEMORY; rc = 0; h = gethostbyaddr_r(at2->addr, #if __HAS_IPV6__ ((at2->family == AF_INET6) ? sizeof(struct in6_addr) : sizeof(struct in_addr)), #else sizeof(struct in_addr), #endif at2->family, &th, tmpbuf, tmpbuflen, &herrno); if (!h) rc = errno; } while (rc == errno && herrno == NETDB_INTERNAL); if (rc != 0 && herrno == NETDB_INTERNAL) { __set_h_errno(herrno); return -EAI_SYSTEM; } if (h == NULL) c = inet_ntop(at2->family, at2->addr, buffer, sizeof(buffer)); else c = h->h_name; if (c == NULL) return GAIH_OKIFUNSPEC | -EAI_NONAME; namelen = strlen(c) + 1; } else namelen = 0; #if __HAS_IPV6__ if (at2->family == AF_INET6 || v4mapped) { family = AF_INET6; socklen = sizeof(struct sockaddr_in6); } else #endif { family = AF_INET; socklen = sizeof(struct sockaddr_in); } for (st2 = st; st2 != NULL; st2 = st2->next) { *pai = malloc(sizeof(struct addrinfo) + socklen + namelen); if (*pai == NULL) return -EAI_MEMORY; (*pai)->ai_flags = req->ai_flags; (*pai)->ai_family = family; (*pai)->ai_socktype = st2->socktype; (*pai)->ai_protocol = st2->protocol; (*pai)->ai_addrlen = socklen; (*pai)->ai_addr = (void *) (*pai) + sizeof(struct addrinfo); #ifdef HAVE_SA_LEN (*pai)->ai_addr->sa_len = socklen; #endif /* HAVE_SA_LEN */ (*pai)->ai_addr->sa_family = family; #if __HAS_IPV6__ if (family == AF_INET6) { struct sockaddr_in6 *sin6p = (struct sockaddr_in6 *) (*pai)->ai_addr; sin6p->sin6_flowinfo = 0; if (at2->family == AF_INET6) { memcpy(&sin6p->sin6_addr, at2->addr, sizeof(struct in6_addr)); } else { sin6p->sin6_addr.s6_addr32[0] = 0; sin6p->sin6_addr.s6_addr32[1] = 0; sin6p->sin6_addr.s6_addr32[2] = htonl(0x0000ffff); memcpy(&sin6p->sin6_addr.s6_addr32[3], at2->addr, sizeof(sin6p->sin6_addr.s6_addr32[3])); } sin6p->sin6_port = st2->port; sin6p->sin6_scope_id = at2->scopeid; } else #endif { struct sockaddr_in *sinp = (struct sockaddr_in *) (*pai)->ai_addr; memcpy(&sinp->sin_addr, at2->addr, sizeof(struct in_addr)); sinp->sin_port = st2->port; memset(sinp->sin_zero, '\0', sizeof(sinp->sin_zero)); } if (c) { (*pai)->ai_canonname = ((void *) (*pai) + sizeof(struct addrinfo) + socklen); strcpy((*pai)->ai_canonname, c); } else (*pai)->ai_canonname = NULL; (*pai)->ai_next = NULL; pai = &((*pai)->ai_next); } at2 = at2->next; } } return 0; } static struct gaih gaih[] = { #if __HAS_IPV6__ {PF_INET6, gaih_inet}, #endif {PF_INET, gaih_inet}, #if 0 {PF_LOCAL, gaih_local}, #endif {PF_UNSPEC, NULL} }; int getaddrinfo(const char *name, const char *service, const struct addrinfo *hints, struct addrinfo **pai) { int i = 0, j = 0, last_i = 0; struct addrinfo *p = NULL, **end; struct gaih *g = gaih, *pg = NULL; struct gaih_service gaih_service, *pservice; if (name != NULL && name[0] == '*' && name[1] == 0) name = NULL; if (service != NULL && service[0] == '*' && service[1] == 0) service = NULL; if (name == NULL && service == NULL) return EAI_NONAME; if (hints == NULL) hints = &default_hints; if (hints->ai_flags & ~(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_ADDRCONFIG | AI_V4MAPPED | AI_ALL)) return EAI_BADFLAGS; if ((hints->ai_flags & AI_CANONNAME) && name == NULL) return EAI_BADFLAGS; if (service && service[0]) { char *c; gaih_service.name = service; gaih_service.num = strtoul(gaih_service.name, &c, 10); if (*c) gaih_service.num = -1; else /* * Can't specify a numerical socket unless a protocol * family was given. */ if (hints->ai_socktype == 0 && hints->ai_protocol == 0) return EAI_SERVICE; pservice = &gaih_service; } else pservice = NULL; if (pai) end = &p; else end = NULL; while (g->gaih) { if (hints->ai_family == g->family || hints->ai_family == AF_UNSPEC) { if ((hints->ai_flags & AI_ADDRCONFIG) && !addrconfig(g->family)) continue; j++; if (pg == NULL || pg->gaih != g->gaih) { pg = g; i = g->gaih(name, pservice, hints, end); if (i != 0) { last_i = i; if (hints->ai_family == AF_UNSPEC && (i & GAIH_OKIFUNSPEC)) continue; if (p) freeaddrinfo(p); return -(i & GAIH_EAI); } if (end) while (*end) end = &((*end)->ai_next); } } ++g; } if (j == 0) return EAI_FAMILY; if (p) { *pai = p; return 0; } if (pai == NULL && last_i == 0) return 0; if (p) freeaddrinfo(p); return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME; } void freeaddrinfo(struct addrinfo *ai) { struct addrinfo *p; while (ai != NULL) { p = ai; ai = ai->ai_next; free(p); } } #define N_(x) x static struct { int code; const char *msg; } values[] = { { EAI_ADDRFAMILY, N_("Address family for hostname not supported")}, { EAI_AGAIN, N_("Temporary failure in name resolution")}, { EAI_BADFLAGS, N_("Bad value for ai_flags")}, { EAI_FAIL, N_("Non-recoverable failure in name resolution")}, { EAI_FAMILY, N_("ai_family not supported")}, { EAI_MEMORY, N_("Memory allocation failure")}, { EAI_NODATA, N_("No address associated with hostname")}, { EAI_NONAME, N_("Name or service not known")}, { EAI_SERVICE, N_("Servname not supported for ai_socktype")}, { EAI_SOCKTYPE, N_("ai_socktype not supported")}, { EAI_SYSTEM, N_("System error")}, { EAI_INPROGRESS, N_("Processing request in progress")}, { EAI_CANCELED, N_("Request canceled")}, { EAI_NOTCANCELED, N_("Request not canceled")}, { EAI_ALLDONE, N_("All requests done")}, { EAI_INTR, N_("Interrupted by a signal")} }; const char *gai_strerror(int code) { size_t i; for (i = 0; i < sizeof(values) / sizeof(values[0]); ++i) if (values[i].code == code) return (values[i].msg); return ("Unknown error"); } #endif /* HAVE_GETADDRINFO */ #ifndef HAVE_INET_NTOP /* char * * inet_ntop4(src, dst, size) * format an IPv4 address * return: * `dst' (as a const) * notes: * (1) uses no statics * (2) takes a u_char* not an in_addr as input * author: * Paul Vixie, 1996. */ static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size) { char tmp[sizeof("255.255.255.255") + 1] = "\0"; int octet; int i; i = 0; for (octet = 0; octet <= 3; octet++) { if (src[octet] > 255) { __set_errno(ENOSPC); return (NULL); } tmp[i++] = '0' + src[octet] / 100; if (tmp[i - 1] == '0') { tmp[i - 1] = '0' + (src[octet] / 10 % 10); if (tmp[i - 1] == '0') i--; } else { tmp[i++] = '0' + (src[octet] / 10 % 10); } tmp[i++] = '0' + src[octet] % 10; tmp[i++] = '.'; } tmp[i - 1] = '\0'; if (strlen(tmp) > size) { __set_errno(ENOSPC); return (NULL); } return strcpy(dst, tmp); } /* char * * inet_ntop(af, src, dst, size) * convert a network format address to presentation format. * return: * pointer to presentation format address (`dst'), or NULL (see errno). * author: * Paul Vixie, 1996. */ const char *inet_ntop(af, src, dst, size) int af; const void *src; char *dst; socklen_t size; { switch (af) { case AF_INET: return (inet_ntop4(src, dst, size)); #if __HAS_IPV6__ case AF_INET6: return (inet_ntop6(src, dst, size)); #endif default: __set_errno(EAFNOSUPPORT); return (NULL); } /* NOTREACHED */ } #endif /* HAVE_INET_NTOP */ #ifndef HAVE_INET_PTON /* int * inet_pton4(src, dst) * like inet_aton() but without all the hexadecimal and shorthand. * return: * 1 if `src' is a valid dotted quad, else 0. * notice: * does not touch `dst' unless it's returning 1. * author: * Paul Vixie, 1996. */ static int inet_pton4(const char *src, unsigned char *dst) { int saw_digit, octets, ch; unsigned char tmp[4], *tp; saw_digit = 0; octets = 0; *(tp = tmp) = 0; while ((ch = *src++) != '\0') { if (ch >= '0' && ch <= '9') { unsigned int new = *tp * 10 + (ch - '0'); if (new > 255) return (0); *tp = new; if (!saw_digit) { if (++octets > 4) return (0); saw_digit = 1; } } else if (ch == '.' && saw_digit) { if (octets == 4) return (0); *++tp = 0; saw_digit = 0; } else return (0); } if (octets < 4) return (0); memcpy(dst, tmp, 4); return (1); } /* int * inet_pton(af, src, dst) * convert from presentation format (which usually means ASCII printable) * to network format (which is usually some kind of binary format). * return: * 1 if the address was valid for the specified address family * 0 if the address wasn't valid (`dst' is untouched in this case) * -1 if some other error occurred (`dst' is untouched in this case, too) * author: * Paul Vixie, 1996. */ int inet_pton(af, src, dst) int af; const char *src; void *dst; { switch (af) { case AF_INET: return (inet_pton4(src, dst)); #if __HAS_IPV6__ case AF_INET6: return (inet_pton6(src, dst)); #endif default: __set_errno(EAFNOSUPPORT); return (-1); } /* NOTREACHED */ } #endif /* HAVE_INET_PTON */ owfs-3.1p5/module/ownet/c/src/c/getopt.c0000644000175000001440000005543512654730021015053 00000000000000/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * Modified for uClibc by Manuel Novoa III on 1/5/01. * Modified once again for uClibc by Erik Andersen 8/7/02 */ #include #include "owfs_config.h" #include "compat_getopt.h" #include "ow.h" // only for UINT #ifndef HAVE_GETOPT_LONG #include #include #include #include #undef _ #define _(X) X /* Treat '-W foo' the same as the long option '--foo', * disabled for the moment since it costs about 2k... */ #undef SPECIAL_TREATMENT_FOR_W /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ extern int _getopt_internal(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only); /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ static int __getopt_initialized; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; # include # define my_index strchr /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange(char **argv) { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ static const char *_getopt_initialize(int argc, char *const *argv, const char *optstring) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (getenv("POSIXLY_CORRECT") != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) { int print_errors = opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize(argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp(argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index(optstring, argv[optind] [1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((UINT) (nameend - nextchar) == (UINT) strlen(p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { fprintf(stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); } nextchar += strlen(nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { if (argv[optind - 1][1] == '-') { /* --option */ fprintf(stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); } else { /* +option or -option */ fprintf(stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } } nextchar += strlen(nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { fprintf(stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); } nextchar += strlen(nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen(nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index(optstring, *nextchar) == NULL) { if (print_errors) { if (argv[optind][1] == '-') { /* --option */ fprintf(stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); } else { /* +option or -option */ fprintf(stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index(optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf(stderr, _("%s: illegal option -- %c\n"), argv[0], c); } optopt = c; return '?'; } #ifdef SPECIAL_TREATMENT_FOR_W /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf(stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((UINT) (nameend - nextchar) == strlen(p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { fprintf(stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); } nextchar += strlen(nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { fprintf(stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); } nextchar += strlen(nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { fprintf(stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); } nextchar += strlen(nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen(nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } #endif if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf(stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt_long(int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal(argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only(int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal(argc, argv, options, long_options, opt_index, 1); } #endif /* HAVE_GETOPT_LONG */ #ifndef HAVE_GETOPT int getopt(int argc, char *const *argv, const char *optstring) { return _getopt_internal(argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* HAVE_GETOPT */ owfs-3.1p5/module/ownet/c/src/c/globals.c0000644000175000001440000000210412654730021015155 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_server.h" /* Globals for port and bus communication */ /* connections globals stored in ow_connect.c */ /* i.e. connection_in * head_inbound_list ... */ /* State information, sent to remote or kept locally */ /* presencecheck, tempscale, devform */ int32_t SemiGlobal = ((uint8_t) fdi) << 24 | ((uint8_t) temp_celsius) << 16 | ((uint8_t) 1) << 8 | ((uint8_t) 1); struct global Globals = { #if OW_ZERO .browse = NULL, #endif .progname = NULL, // "One Wire File System" , Can't allocate here since it's freed .error_level = e_err_default, .readonly = 0, }; /* Statistics globals are stored in ow_stats.c */ #include "ow_server.h" struct ow_global ow_Global = { .timeout_network = 1, .timeout_server = 10, .autoserver = 0, }; owfs-3.1p5/module/ownet/c/src/c/ow_browse.c0000644000175000001440000001424512654730021015551 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #if OW_ZERO #include "ow_connection.h" struct RefStruct { DNSServiceRef sref; }; struct BrowseStruct { char *name; char *type; char *domain; }; static struct connection_in *FindIn(struct BrowseStruct *bs); static struct BrowseStruct *BSCreate(const char *name, const char *type, const char *domain); static void BSKill(struct BrowseStruct *bs); static void *Process(void *v); static void ResolveBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *n, const char *host, uint16_t port, uint16_t tl, const char *t, void *c); static void BrowseBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *name, const char *type, const char *domain, void *context); /* Look for new services with Bonjour -- will block so done in a separate thread */ static void *Process(void *v) { struct RefStruct *rs = v; pthread_detach(pthread_self()); while (DNSServiceProcessResult(rs->sref) == kDNSServiceErr_NoError) { //printf("DNSServiceProcessResult ref %ld\n",(long int)rs->sref) ; continue; } DNSServiceRefDeallocate(rs->sref); free(rs); LEVEL_DEBUG("Browse: Normal exit.\n"); return NULL; } static void ResolveBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *n, const char *host, uint16_t port, uint16_t tl, const char *t, void *c) { ASCII name[121]; struct BrowseStruct *bs = c; struct connection_in *in; (void) tl; (void) t; //printf("ResolveBack ref=%ld flags=%d index=%d, error=%d name=%s host=%s port=%d\n",(long int)s,f,i,e,name,host,ntohs(port)) ; //printf("ResolveBack ref=%ld flags=%d index=%d, error=%d name=%s type=%s domain=%s\n",(long int)s,f,i,e,bs->name,bs->type,bs->domain) ; LEVEL_DETAIL("ResolveBack ref=%d flags=%d index=%d, error=%d name=%s host=%s port=%d\n", (long int) s, f, i, e, n, host, ntohs(port)); /* remove trailing .local. */ if (snprintf(name, 120, "%s:%d", SAFESTRING(host), ntohs(port)) < 0) { ERROR_CONNECT("Trouble with zeroconf resolve return %s\n", n); } else { if ((in = FindIn(bs)) == NULL) { // new or old connection_in slot? if ((in = NewIn())) { BUSLOCKIN(in); in->name = strdup(name); in->busmode = bus_server; } } if (in) { if (Zero_detect(in)) { printf("Zero_detect failed\n"); exit(1); } else { in->tcp.type = strdup(bs->type); in->tcp.domain = strdup(bs->domain); in->tcp.fqdn = strdup(n); } BUSUNLOCKIN(in); } } BSKill(bs); } static struct BrowseStruct *BSCreate(const char *name, const char *type, const char *domain) { struct BrowseStruct *bs = malloc(sizeof(struct BrowseStruct)); if (bs) { bs->name = name ? strdup(name) : NULL; bs->type = type ? strdup(type) : NULL; bs->domain = domain ? strdup(domain) : NULL; } return bs; } static void BSKill(struct BrowseStruct *bs) { if (bs) { if (bs->name) free(bs->name); if (bs->type) free(bs->type); if (bs->domain) free(bs->domain); free(bs); } } static struct connection_in *FindIn(struct BrowseStruct *bs) { struct connection_in *now; for (now = head_inbound_list; now; now = now->next) { if (now->busmode != bus_zero || strcasecmp(now->name, bs->name) || strcasecmp(now->tcp.type, bs->type) || strcasecmp(now->tcp.domain, bs->domain) ) continue; BUSLOCKIN(now); break; } return now; } /* Sent back from Bounjour -- arbitrarily use it to set the Ref for Deallocation */ static void BrowseBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *name, const char *type, const char *domain, void *context) { (void) context; //printf("BrowseBack ref=%ld flags=%d index=%d, error=%d name=%s type=%s domain=%s\n",(long int)s,f,i,e,name,type,domain) ; LEVEL_DETAIL("BrowseBack ref=%ld flags=%d index=%d, error=%d name=%s type=%s domain=%s\n", (long int) s, f, i, e, name, type, domain); if (e == kDNSServiceErr_NoError) { struct BrowseStruct *bs = BSCreate(name, type, domain); CONNIN_WLOCK; if (bs) { struct connection_in *in = FindIn(bs); if (in) { FreeClientAddr(in); BUSUNLOCKIN(in); } if (f & kDNSServiceFlagsAdd) { // Add DNSServiceRef sr; if (DNSServiceResolve(&sr, 0, 0, name, type, domain, ResolveBack, bs) == kDNSServiceErr_NoError) { FILE_DESCRIPTOR_OR_ERROR file_descriptor = DNSServiceRefSockFD(sr); DNSServiceErrorType err = kDNSServiceErr_Unknown; if (file_descriptor > FILE_DESCRIPTOR_BAD) { while (1) { fd_set readfd; struct timeval tv = { 120, 0 }; FD_ZERO(&readfd); FD_SET(file_descriptor, &readfd); if (select(file_descriptor + 1, &readfd, NULL, NULL, &tv) > 0) { if (FD_ISSET(file_descriptor, &readfd)) { err = DNSServiceProcessResult(sr); } } else if (errno == EINTR) { continue; } else { ERROR_CONNECT("Resolve timeout error for %s\n", name); } break; } } DNSServiceRefDeallocate(sr); if (err == kDNSServiceErr_NoError) { // Successful exit CONNIN_WUNLOCK; return; } } } BSKill(bs); } CONNIN_WUNLOCK; } return; } void OW_Browse(void) { struct RefStruct *rs = malloc(sizeof(struct RefStruct)); DNSServiceErrorType dnserr; if ( rs == NULL) { return; } dnserr = DNSServiceBrowse(&Globals.browse, 0, 0, "_owserver._tcp", NULL, BrowseBack, NULL); rs->sref = Globals.browse; if (dnserr == kDNSServiceErr_NoError) { pthread_t thread; int err; //printf("Browse %ld %s|%s|%s\n",(long int)Globals.browse,"","_owserver._tcp","") ; err = pthread_create(&thread, 0, Process, (void *) rs); if (err) { ERROR_CONNECT("Zeroconf/Bounjour browsing thread error %d).\n", err); free(rs) ; } } else { LEVEL_CONNECT("DNSServiceBrowse error = %d\n", dnserr); free( rs ) ; } } #else /* OW_ZERO */ void OW_Browse(void) { LEVEL_CONNECT("OWFS is compiled without Zeroconf/Bonjour support.\n"); } #endif /* OW_ZERO */ owfs-3.1p5/module/ownet/c/src/c/ow_charblob.c0000644000175000001440000001042012654730021016013 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 2006 dirblob */ #include #include "owfs_config.h" #include "ow.h" /* A "charblob" is a structure holding a list of files Most interesting, it allocates memory dynamically. */ void CharblobClear(struct charblob *cb) { if (cb->blob) { free(cb->blob); } CharblobInit(cb); } void CharblobInit(struct charblob *cb) { cb->used = 0; cb->allocated = 0; cb->blob = 0; cb->troubled = 0; } int CharblobPure(struct charblob *cb) { return !cb->troubled; } int CharblobAdd(const ASCII * a, size_t s, struct charblob *cb) { size_t incr = 1024; if (incr < s) incr = s; // make more room? -- blocks of 1k if (cb->used) CharblobAddChar(',', cb); // add a comma if (cb->used + s > cb->allocated) { int newalloc = cb->allocated + incr; ASCII *temp = realloc(cb->blob, newalloc); if (temp) { memset(&temp[cb->allocated], 0, incr); // set the new memory to blank cb->allocated = newalloc; cb->blob = temp; } else { // allocation failed -- keep old cb->troubled = 1; return -ENOMEM; } } memcpy(&cb->blob[cb->used], a, s); cb->used += s; return 0; } int CharblobAddChar(ASCII a, struct charblob *cb) { // make more room? -- blocks of 1k if (cb->used + 1 > cb->allocated) { int newalloc = cb->allocated + 1024; ASCII *temp = realloc(cb->blob, newalloc); if (temp) { memset(&temp[cb->allocated], 0, 1024); // set the new memory to blank cb->allocated = newalloc; cb->blob = temp; } else { // allocation failed -- keep old cb->troubled = 1; return -ENOMEM; } } cb->blob[cb->used] = a; ++cb->used; return 0; } size_t CharblobLength( struct charblob * cb ) { return cb->used ; } ASCII * CharblobData(struct charblob * cb) { return cb->blob ; } owfs-3.1p5/module/ownet/c/src/c/ow_connect.c0000644000175000001440000000476012654730021015702 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" /* Routines for handling a linked list of connections in and out */ /* connections are to */ /* Globals */ struct connection_in *head_inbound_list = NULL; int count_inbound_connections = 0; struct connection_in *find_connection_in(OWNET_HANDLE handle) { struct connection_in *c_in; // step through head_inbound_list linked list for (c_in = head_inbound_list; c_in != NULL; c_in = c_in->next) { if (c_in->handle == handle) { return c_in; } } return NULL; } enum bus_mode get_busmode(struct connection_in *in) { if (in == NULL) return bus_unknown; return in->busmode; } /* Make a new head_inbound_list, and place it in the chain */ struct connection_in *NewIn(void) { struct connection_in *now; now = malloc(sizeof(struct connection_in)); if (now != NULL) { memset(now, 0, sizeof(struct connection_in)); now->next = head_inbound_list; /* put in linked list at start */ now->prior = NULL ; // new pointer to start of list head_inbound_list = now; // old start of list now points here if ( now->next ) { now->next->prior = now ; } now->handle = count_inbound_connections++; now->file_descriptor = FILE_DESCRIPTOR_BAD ; my_pthread_mutex_init(&(now->bus_mutex), Mutex.pmattr); } return now; } void FreeIn(struct connection_in *target) { if (target == NULL) { return; } if (target->tcp.type) { free(target->tcp.type); } if (target->tcp.domain) { free(target->tcp.domain); } if (target->tcp.fqdn) { free(target->tcp.fqdn); } LEVEL_DEBUG("FreeClientAddr\n"); FreeClientAddr(target); if (target->name) { free(target->name); target->name = NULL; } my_pthread_mutex_destroy(&(target->bus_mutex)); // file descriptor if ( target->file_descriptor > FILE_DESCRIPTOR_BAD ) { close( target->file_descriptor ) ; } // Fix link of prior connection in list if ( target->prior ) { target->prior->next = target->next ; } else { head_inbound_list = target->next ; } // Fix link of next connection in list if ( target->next ) { target->next->prior = target->prior ; } free( target ) ; } void FreeInAll( void ) { while ( head_inbound_list ) { FreeIn(head_inbound_list); } } owfs-3.1p5/module/ownet/c/src/c/ow_dl.c0000644000175000001440000000173012654730021014642 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_dl.h" #if OW_ZERO DLHANDLE DL_open(const char *pathname, int mode) { #if OW_CYGWIN return LoadLibrary(pathname); #elif defined(HAVE_DLOPEN) return dlopen(pathname, mode); #endif } void *DL_sym(DLHANDLE handle, const char *name) { #if OW_CYGWIN return (void *) GetProcAddress(handle, name); #elif defined(HAVE_DLOPEN) return dlsym(handle, name); #endif } int DL_close(DLHANDLE handle) { #if OW_CYGWIN if (FreeLibrary(handle)) return 0; return -1; #elif defined(HAVE_DLOPEN) return dlclose(handle); #endif } char *DL_error(void) { #if OW_CYGWIN return "Error in WIN32 DL"; #elif defined(HAVE_DLOPEN) return dlerror(); #endif } #endif owfs-3.1p5/module/ownet/c/src/c/ow_dnssd.c0000644000175000001440000000737712654730021015373 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2006 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #if OW_ZERO #include "ow.h" #include "ow_dl.h" #include "ow_dnssd.h" DLHANDLE libdnssd = NULL; #if OW_CYGWIN #ifdef HAVE_DLFCN_H #include #endif #endif _DNSServiceRefSockFD DNSServiceRefSockFD; _DNSServiceProcessResult DNSServiceProcessResult; _DNSServiceRefDeallocate DNSServiceRefDeallocate; _DNSServiceResolve DNSServiceResolve; _DNSServiceBrowse DNSServiceBrowse; _DNSServiceRegister DNSServiceRegister; _DNSServiceReconfirmRecord DNSServiceReconfirmRecord; _DNSServiceCreateConnection DNSServiceCreateConnection; _DNSServiceEnumerateDomains DNSServiceEnumerateDomains; int OW_Load_dnssd_library(void) { int i = 0; #if OW_CYGWIN char libdirs[3][80] = { //{ "/opt/owfs/lib/libdns_sd.dll" }, {"libdns_sd.dll"}, {""} }; while (*libdirs[i]) { /* Cygwin has dlopen and it seems to be ok to use it actually. */ if (!(libdnssd = DL_open(libdirs[i], 0))) { /* Couldn't open that lib, but continue anyway */ #if 0 char *derr; derr = DL_error(); fprintf(stderr, "dlopen [%s] failed [%s]\n", libdirs[i], derr); #endif i++; continue; } else { //fprintf(stderr, "DL_open [%s] success\n", libdirs[i]); break; } } #if 0 /* This file compiled with Microsoft Visual C doesn't work actually... */ if (!libdnssd) { char file[255]; strcpy(file, "dnssd.dll"); if (!(libdnssd = DL_open(file, 0))) { /* Couldn't open that lib, but continue anyway */ } } #endif #elif OW_DARWIN // MacOSX have dnssd functions in libSystem char libdirs[2][80] = { {"libSystem.dylib"}, {""} }; while (*libdirs[i]) { if (!(libdnssd = DL_open(libdirs[i], RTLD_LAZY))) { /* Couldn't open that lib, but continue anyway */ #if 0 char *derr; derr = DL_error(); fprintf(stderr, "DL_open [%s] failed [%s]\n", libdirs[i], derr); #endif i++; continue; } else { //fprintf(stderr, "DL_open [%s] success\n", libdirs[i]); break; } } #elif defined(HAVE_DLOPEN) char libdirs[3][80] = { {"/opt/owfs/lib/libdns_sd.so"}, {"libdns_sd.so"}, {""} }; while (*libdirs[i]) { if (!(libdnssd = DL_open(libdirs[i], RTLD_LAZY))) { /* Couldn't open that lib, but continue anyway */ #if 0 char *derr; derr = DL_error(); fprintf(stderr, "DL_open [%s] failed [%s]\n", libdirs[i], derr); #endif i++; continue; } else { //fprintf(stderr, "DL_open [%s] success\n", libdirs[i]); break; } } #endif if (libdnssd == NULL) { //fprintf(stderr, "Zeroconf/Bonjour is disabled since dnssd library isn't found\n"); return -1; } DNSServiceRefSockFD = (_DNSServiceRefSockFD) DL_sym(libdnssd, "DNSServiceRefSockFD"); DNSServiceProcessResult = (_DNSServiceProcessResult) DL_sym(libdnssd, "DNSServiceProcessResult"); DNSServiceRefDeallocate = (_DNSServiceRefDeallocate) DL_sym(libdnssd, "DNSServiceRefDeallocate"); DNSServiceResolve = (_DNSServiceResolve) DL_sym(libdnssd, "DNSServiceResolve"); DNSServiceBrowse = (_DNSServiceBrowse) DL_sym(libdnssd, "DNSServiceBrowse"); DNSServiceRegister = (_DNSServiceRegister) DL_sym(libdnssd, "DNSServiceRegister"); DNSServiceReconfirmRecord = (_DNSServiceReconfirmRecord) DL_sym(libdnssd, "DNSServiceReconfirmRecord"); DNSServiceCreateConnection = (_DNSServiceCreateConnection) DL_sym(libdnssd, "DNSServiceCreateConnection"); DNSServiceEnumerateDomains = (_DNSServiceEnumerateDomains) DL_sym(libdnssd, "DNSServiceEnumerateDomains"); return 0; } int OW_Free_dnssd_library(void) { int rc = -1; if (libdnssd) { rc = DL_close(libdnssd); libdnssd = NULL; } return rc; } #endif /* OW_ZERO */ owfs-3.1p5/module/ownet/c/src/c/ow_locks.c0000644000175000001440000000454012654730021015360 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* locks are to handle multithreading */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" /* ------- Globalss ----------- */ #ifdef __UCLIBC__ #if ((__UCLIBC_MAJOR__ << 16)+(__UCLIBC_MINOR__ << 8)+(__UCLIBC_SUBLEVEL__) < 0x00091D) /* If uClibc < 0.9.29, then re-initialize internal pthread-structs */ extern char *__pthread_initial_thread_bos; void __pthread_initialize(void); #endif /* UCLIBC_VERSION */ #endif /* __UCLIBC */ struct mutexes Mutex = { #ifdef __UCLIBC__ /* vsnprintf() doesn't seem to be thread-safe in uClibc even if thread-support is enabled. */ .uclibc_mutex = PTHREAD_MUTEX_INITIALIZER, #endif /* __UCLIBC__ */ /* mutex attribute -- needed for uClibc programming */ /* we create at start, and destroy at end */ .pmattr = NULL, }; /* Essentially sets up mutexes to protect global data/devices */ void LockSetup(void) { #ifdef __UCLIBC__ #if ((__UCLIBC_MAJOR__ << 16)+(__UCLIBC_MINOR__ << 8)+(__UCLIBC_SUBLEVEL__) < 0x00091D) /* If uClibc < 0.9.29, then re-initialize internal pthread-structs * pthread and mutexes doesn't work after daemon() is called and * the main-process is gone. * * This workaround will probably be fixed in uClibc-0.9.28 * Other uClibc developers have noticed similar problems which are * trigged when pthread functions are used in shared libraries. */ __pthread_initial_thread_bos = NULL; __pthread_initialize(); #endif /* UCLIBC_VERSION */ /* global mutex attribute */ my_pthread_mutexattr_init(&Mutex.mattr); my_pthread_mutexattr_settype(&Mutex.mattr, PTHREAD_MUTEX_ADAPTIVE_NP); Mutex.pmattr = &Mutex.mattr; #endif /* __UCLIBC */ my_rwlock_init(&Mutex.lib); my_rwlock_init(&Mutex.connin); #ifdef __UCLIBC__ my_pthread_mutex_init(&Mutex.uclibc_mutex, Mutex.pmattr); #endif /* UCLIBC */ } void BUS_lock_in(struct connection_in *in) { //printf("BUS_lock_in: in=%p\n", in); if (in) { my_pthread_mutex_lock(&(in->bus_mutex)); } } void BUS_unlock_in(struct connection_in *in) { //printf("BUS_unlock_in: in=%p\n", in); if (in) { my_pthread_mutex_unlock(&(in->bus_mutex)); } } owfs-3.1p5/module/ownet/c/src/c/ow_net_client.c0000644000175000001440000000577712654730021016406 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_net holds the network utility routines. Many stolen unashamedly from Steven's Book */ /* Much modification by Christian Magnusson especially for Valgrind and embedded */ /* non-threaded fixes by Jerry Scharf */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" int ClientAddr(char *sname, struct connection_in *in) { struct addrinfo hint; char *p; int ret; if (sname == NULL || sname[0] == '\0') { sname = "4304"; } if ((p = strrchr(sname, ':'))) { /* : exists */ p[0] = '\0'; /* Separate tokens in the string */ in->tcp.host = strdup(sname); in->tcp.service = strdup(&p[1]); p[0] = ':'; /* restore name string */ } else { #if OW_CYGWIN in->tcp.host = strdup("127.0.0.1"); #else in->tcp.host = NULL; #endif in->tcp.service = strdup(sname); } memset(&hint, 0, sizeof(struct addrinfo)); hint.ai_socktype = SOCK_STREAM; #if OW_CYGWIN hint.ai_family = AF_INET; #else hint.ai_family = AF_UNSPEC; #endif //printf("ClientAddr: [%s] [%s]\n", in->connin.tcp.host, in->connin.tcp.service); if ((ret = getaddrinfo(in->tcp.host, in->tcp.service, &hint, &in->tcp.ai))) { LEVEL_CONNECT("GetAddrInfo error %s\n", gai_strerror(ret)); return -1; } return 0; } void FreeClientAddr(struct connection_in *in) { if (in->tcp.host) { free(in->tcp.host); in->tcp.host = NULL; } if (in->tcp.service) { free(in->tcp.service); in->tcp.service = NULL; } if (in->tcp.ai) { freeaddrinfo(in->tcp.ai); in->tcp.ai = NULL; } } /* Usually called with BUS locked, to protect ai settings */ FILE_DESCRIPTOR_OR_ERROR ClientConnect(struct connection_in *in) { FILE_DESCRIPTOR_OR_ERROR file_descriptor; struct addrinfo *ai; if (in->tcp.ai == NULL) { LEVEL_DEBUG("Client address not yet parsed\n"); return FILE_DESCRIPTOR_BAD; } /* Can't change ai_ok without locking the in-device. * First try the last working address info, if it fails lock * the in-device and loop through the list until it works. * Not a perfect solution, but it should work at least. */ ai = in->tcp.ai_ok; if (ai) { file_descriptor = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if (file_descriptor >= 0) { if (connect(file_descriptor, ai->ai_addr, ai->ai_addrlen) == 0) { return file_descriptor; } close(file_descriptor); } } ai = in->tcp.ai; // loop from first address info since it failed. do { file_descriptor = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if (file_descriptor >= 0) { if (connect(file_descriptor, ai->ai_addr, ai->ai_addrlen) == 0) { in->tcp.ai_ok = ai; return file_descriptor; } close(file_descriptor); } } while ((ai = ai->ai_next)); in->tcp.ai_ok = NULL; ERROR_CONNECT("ClientConnect: Socket problem\n"); return FILE_DESCRIPTOR_BAD; } owfs-3.1p5/module/ownet/c/src/c/ownet_close.c0000644000175000001440000000220512654730021016055 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include "ownetapi.h" #include "ow_server.h" /* void OWNET_close( OWNET_HANDLE h) close a particular owserver connection */ void OWNET_close(OWNET_HANDLE h) { CONNIN_WLOCK; FreeIn(find_connection_in(h)); CONNIN_WUNLOCK; } /* void OWNET_closeall( void ) close all owserver connections */ void OWNET_closeall(void) { struct connection_in *target = head_inbound_list ; CONNIN_WLOCK; // step through head_inbound_list linked list while ( target != NULL ) { struct connection_in * next = target->next ; FreeIn(target); target = next ; } CONNIN_WUNLOCK; } /* void OWNET_finish( void ) close all owserver connections and free all memory */ void OWNET_finish(void) { CONNIN_WLOCK; FreeInAll(); head_inbound_list = NULL; CONNIN_WUNLOCK; } owfs-3.1p5/module/ownet/c/src/c/ownet_dir.c0000644000175000001440000000361012654730021015527 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include "ownetapi.h" #include "ow_server.h" static void dirlist_callback(void *v, const char *data_element) { struct charblob *cb = v; CharblobAdd(data_element, strlen(data_element), cb); } int OWNET_dirlist(OWNET_HANDLE h, const char *onewire_path, char **return_string) { struct charblob s_charblob; struct charblob *cb = &s_charblob; int return_value; struct request_packet s_request_packet; struct request_packet *rp = &s_request_packet; memset(rp, 0, sizeof(struct request_packet)); CONNIN_RLOCK; rp->owserver = find_connection_in(h); if (rp->owserver == NULL) { CONNIN_RUNLOCK; return -EBADF; } rp->path = (onewire_path == NULL) ? "/" : onewire_path; CharblobInit(cb); if (ServerDir(dirlist_callback, cb, rp) < 0) { CharblobClear(cb); return_value = -EINVAL; } else { return_string[0] = CharblobData(cb); return_value = CharblobLength(cb); } CONNIN_RUNLOCK; return return_value; } int OWNET_dirprocess(OWNET_HANDLE h, const char *onewire_path, void (*dirfunc) (void *passed_on_value, const char *directory_element), void *passed_on_value) { struct request_packet s_request_packet; struct request_packet *rp = &s_request_packet; int return_value; memset(rp, 0, sizeof(struct request_packet)); CONNIN_RLOCK; rp->owserver = find_connection_in(h); if (rp->owserver == NULL) { CONNIN_RUNLOCK; return -EBADF; } rp->path = (onewire_path == NULL) ? "/" : onewire_path; return_value = ServerDir(dirfunc, passed_on_value, rp); CONNIN_RUNLOCK; return return_value; } owfs-3.1p5/module/ownet/c/src/c/ownet_init.c0000644000175000001440000000242012654730021015712 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include "ownetapi.h" #include "ow_server.h" OWNET_HANDLE OWNET_init(const char *owserver_tcp_address_and_port) { OWNET_HANDLE handle; struct connection_in *slot_found; static int deja_vue = 0; // poor man's lock for the Lib Setup and Lock Setup if (++deja_vue == 1) { /* Setup the multithreading synchronizing locks */ LockSetup(); } CONNIN_WLOCK; slot_found = NewIn(); // Could we create or reclaim a slot? if (slot_found == NULL) { handle = -ENOMEM; } else { if (owserver_tcp_address_and_port == NULL || owserver_tcp_address_and_port[0] == '\0') { slot_found->name = strdup("4304"); } else { slot_found->name = strdup(owserver_tcp_address_and_port); } slot_found->busmode = bus_server; if (Server_detect(slot_found) == 0) { handle = slot_found->handle; } else { FreeIn(slot_found); handle = -EADDRNOTAVAIL; } } CONNIN_WUNLOCK; return handle; } owfs-3.1p5/module/ownet/c/src/c/ownet_read.c0000644000175000001440000000370012654730021015664 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include "ownetapi.h" #include "ow_server.h" int OWNET_read(OWNET_HANDLE h, const char *onewire_path, char **return_string) { unsigned char buffer[MAX_READ_BUFFER_SIZE]; int return_value; struct request_packet s_request_packet; struct request_packet *rp = &s_request_packet; memset(rp, 0, sizeof(struct request_packet)); CONNIN_RLOCK; rp->owserver = find_connection_in(h); if (rp->owserver == NULL) { CONNIN_RUNLOCK; return -EBADF; } rp->path = (onewire_path == NULL) ? "/" : onewire_path; rp->read_value = buffer; rp->data_length = MAX_READ_BUFFER_SIZE; rp->data_offset = 0; /* Fix from nleonard671 to add a terminating NULL */ return_value = ServerRead(rp); if (return_value > 0) { *return_string = malloc(return_value+1); if (*return_string == NULL) { return_value = -ENOMEM; } else { memcpy(*return_string, buffer, return_value); (*return_string)[return_value] = '\0' ; } } CONNIN_RUNLOCK; return return_value; } int OWNET_lread(OWNET_HANDLE h, const char *onewire_path, char *return_string, size_t size, off_t offset) { struct request_packet s_request_packet; struct request_packet *rp = &s_request_packet; int return_value; memset(rp, 0, sizeof(struct request_packet)); CONNIN_RLOCK; rp->owserver = find_connection_in(h); if (rp->owserver == NULL) { CONNIN_RUNLOCK; return -EBADF; } rp->path = (onewire_path == NULL) ? "/" : onewire_path; rp->read_value = (unsigned char *)return_string; rp->data_length = size; rp->data_offset = offset; return_value = ServerRead(rp); CONNIN_RUNLOCK; return return_value; } owfs-3.1p5/module/ownet/c/src/c/ownet_present.c0000644000175000001440000000210012654730021016422 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include "ownetapi.h" #include "ow_server.h" int OWNET_present(OWNET_HANDLE h, const char *onewire_path) { unsigned char buffer[MAX_READ_BUFFER_SIZE]; int return_value; struct request_packet s_request_packet; struct request_packet *rp = &s_request_packet; memset(rp, 0, sizeof(struct request_packet)); CONNIN_RLOCK; rp->owserver = find_connection_in(h); if (rp->owserver == NULL) { CONNIN_RUNLOCK; return -EBADF; } rp->path = (onewire_path == NULL) ? "/" : onewire_path; rp->read_value = buffer; rp->data_length = MAX_READ_BUFFER_SIZE; rp->data_offset = 0; return_value = ServerPresence(rp); /* 0 is ok, <0 not found */ CONNIN_RUNLOCK; return return_value; } owfs-3.1p5/module/ownet/c/src/c/ownet_setget.c0000644000175000001440000000536212654730021016252 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include "ownetapi.h" #include "ow_server.h" void OWNET_set_temperature_scale(char temperature_scale) { switch (temperature_scale) { case 'R': case 'r': set_semiglobal(&ow_Global.control_flags, TEMPSCALE_MASK, TEMPSCALE_BIT, temp_rankine); break; case 'K': case 'k': set_semiglobal(&ow_Global.control_flags, TEMPSCALE_MASK, TEMPSCALE_BIT, temp_kelvin); break; case 'F': case 'f': set_semiglobal(&ow_Global.control_flags, TEMPSCALE_MASK, TEMPSCALE_BIT, temp_fahrenheit); break; case 'C': case 'c': default: set_semiglobal(&ow_Global.control_flags, TEMPSCALE_MASK, TEMPSCALE_BIT, temp_celsius); break; } } char OWNET_get_temperature_scale(void) { switch (TemperatureScale) { case temp_rankine: return 'R'; case temp_kelvin: return 'K'; case temp_fahrenheit: return 'F'; case temp_celsius: default: return 'C'; } } void OWNET_set_device_format(const char *device_format) { if (device_format == NULL) { set_semiglobal(&ow_Global.control_flags, DEVFORMAT_MASK, DEVFORMAT_BIT, fdi); } else if (0 == strcasecmp(device_format, "f.i")) { set_semiglobal(&ow_Global.control_flags, DEVFORMAT_MASK, DEVFORMAT_BIT, fdi); } else if (0 == strcasecmp(device_format, "fi")) { set_semiglobal(&ow_Global.control_flags, DEVFORMAT_MASK, DEVFORMAT_BIT, fi); } else if (0 == strcasecmp(device_format, "f.i.c")) { set_semiglobal(&ow_Global.control_flags, DEVFORMAT_MASK, DEVFORMAT_BIT, fdidc); } else if (0 == strcasecmp(device_format, "f.ic")) { set_semiglobal(&ow_Global.control_flags, DEVFORMAT_MASK, DEVFORMAT_BIT, fdic); } else if (0 == strcasecmp(device_format, "fi.c")) { set_semiglobal(&ow_Global.control_flags, DEVFORMAT_MASK, DEVFORMAT_BIT, fidc); } else if (0 == strcasecmp(device_format, "fic")) { set_semiglobal(&ow_Global.control_flags, DEVFORMAT_MASK, DEVFORMAT_BIT, fic); } else { set_semiglobal(&ow_Global.control_flags, DEVFORMAT_MASK, DEVFORMAT_BIT, fdi); } } const char *OWNET_get_device_format(void) { switch (DeviceFormat) { case fi: return "fi"; case fic: return "fic"; case fdidc: return "f.i.c"; case fdic: return "f.ic"; case fidc: return "fi.c"; case fdi: default: return "f.i"; } } void OWNET_set_trim( int trim_state ) { ow_Global.control_flags &= ~TRIM ; // clear trim ow_Global.control_flags |= trim_state ? TRIM : 0 ; } int OWNET_get_trim( void ) { return (ow_Global.control_flags & TRIM) != 0 ; } owfs-3.1p5/module/ownet/c/src/c/ownet_write.c0000644000175000001440000000323512654730021016106 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include "ownetapi.h" #include "ow_server.h" int OWNET_put(OWNET_HANDLE h, const char *onewire_path, const char *value_string, size_t size) { struct request_packet s_request_packet; struct request_packet *rp = &s_request_packet; int return_value; memset(rp, 0, sizeof(struct request_packet)); CONNIN_RLOCK; rp->owserver = find_connection_in(h); if (rp->owserver == NULL) { CONNIN_RUNLOCK; return -EBADF; } rp->path = (onewire_path == NULL) ? "/" : onewire_path; rp->write_value = (const unsigned char *) value_string; rp->data_length = size; rp->data_offset = 0; return_value = ServerWrite(rp); CONNIN_RUNLOCK; return return_value; } int OWNET_lwrite(OWNET_HANDLE h, const char *onewire_path, const char *value_string, size_t size, off_t offset) { struct request_packet s_request_packet; struct request_packet *rp = &s_request_packet; int return_value; memset(rp, 0, sizeof(struct request_packet)); CONNIN_RLOCK; rp->owserver = find_connection_in(h); if (rp->owserver == NULL) { CONNIN_RUNLOCK; return -EBADF; } rp->path = (onewire_path == NULL) ? "/" : onewire_path; rp->write_value = (const unsigned char *) value_string; rp->data_length = size; rp->data_offset = offset; return_value = ServerWrite(rp); CONNIN_RUNLOCK; return return_value; } owfs-3.1p5/module/ownet/c/src/c/ow_rwlock.c0000644000175000001440000000530112654730021015542 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* locks are to handle multithreading */ /* From: Communications of the ACM :Concurrent Control with "Readers" and "Writers" P.J. Courtois,* F. H, 1971 */ #include #include "owfs_config.h" #include "ow.h" #define _MUTEX_INIT(m) my_pthread_mutex_init( &(m) , Mutex.pmattr ) #define _MUTEX_DESTROY(m) my_pthread_mutex_destroy( &(m) ) #define _MUTEX_LOCK(m) my_pthread_mutex_lock( &(m) ) #define _MUTEX_UNLOCK(m) my_pthread_mutex_unlock( &(m) ) void my_rwlock_init(my_rwlock_t * my_rwlock) { _MUTEX_INIT(my_rwlock->protect_reader); // mutex 3 in article _MUTEX_INIT(my_rwlock->protect_writer); // mutex 2 in article _MUTEX_INIT(my_rwlock->protect_reader_count); // mutex 1 in article _SEM_INIT( my_rwlock->allow_readers, 0, 1); // r in article _SEM_INIT( my_rwlock->allow_writers , 0, 1); // w in article my_rwlock->readcount = 0; my_rwlock->writecount = 0; } inline void my_rwlock_write_lock(my_rwlock_t * my_rwlock) { _MUTEX_LOCK(my_rwlock->protect_writer); ++my_rwlock->writecount ; if ( my_rwlock->writecount == 1 ) { sem_wait(&(my_rwlock->allow_readers)); } _MUTEX_UNLOCK(my_rwlock->protect_writer); sem_wait(&(my_rwlock->allow_writers)); } inline void my_rwlock_write_unlock(my_rwlock_t * my_rwlock) { sem_post(&(my_rwlock->allow_writers)); _MUTEX_LOCK(my_rwlock->protect_writer); --my_rwlock->writecount ; if ( my_rwlock->writecount == 0 ) { sem_post(&(my_rwlock->allow_readers)); } _MUTEX_UNLOCK(my_rwlock->protect_writer); } inline void my_rwlock_read_lock(my_rwlock_t * my_rwlock) { _MUTEX_LOCK(my_rwlock->protect_reader); sem_wait(&(my_rwlock->allow_readers)); _MUTEX_LOCK(my_rwlock->protect_reader_count); ++my_rwlock->readcount ; if ( my_rwlock->readcount == 1 ) { sem_wait(&(my_rwlock->allow_writers)); } _MUTEX_UNLOCK(my_rwlock->protect_reader_count); sem_post(&(my_rwlock->allow_readers)); _MUTEX_UNLOCK(my_rwlock->protect_reader); } inline void my_rwlock_read_unlock(my_rwlock_t * my_rwlock) { _MUTEX_LOCK(my_rwlock->protect_reader_count); --my_rwlock->readcount ; if ( my_rwlock->readcount == 0 ) { sem_post(&(my_rwlock->allow_writers)); } _MUTEX_UNLOCK(my_rwlock->protect_reader_count); } void my_rwlock_destroy(my_rwlock_t * my_rwlock) { _MUTEX_DESTROY(my_rwlock->protect_reader_count); _MUTEX_DESTROY(my_rwlock->protect_reader); _MUTEX_DESTROY(my_rwlock->protect_writer); sem_destroy(&(my_rwlock->allow_readers)); sem_destroy(&(my_rwlock->allow_writers)); } owfs-3.1p5/module/ownet/c/src/c/ow_server.c0000644000175000001440000004660012654730021015556 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include #include "owfs_config.h" #include "ow.h" #include "ow_server.h" struct server_connection_state { FILE_DESCRIPTOR_OR_ERROR file_descriptor ; enum persistent_state { persistent_yes, persistent_no, } persistence ; struct connection_in * in ; } ; static uint32_t SetupSemi(int persistent); static void Release_Persistent( struct server_connection_state * scs, int granted ) ; static void Close_Persistent( struct server_connection_state * scs) ; static int To_Server( struct server_connection_state * scs, struct server_msg * sm, struct serverpackage *sp) ; static int WriteToServer(int file_descriptor, struct server_msg *sm, struct serverpackage *sp); static int From_Server( struct server_connection_state * scs, struct client_msg *cm, char *msg, size_t size); static void *From_ServerAlloc(struct server_connection_state * scs, struct client_msg *cm) ; static int ServerDIR(void (*dirfunc) (void *, const char *), void *v, struct request_packet *rp); static int ServerDIRALL(void (*dirfunc) (void *, const char *), void *v, struct request_packet *rp); // bus_zero is a server found by zeroconf/Bonjour // It differs in that the server must respond int Zero_detect(struct connection_in *in) { // if ( Server_detect(in) || ServerNOP(in) ) // if ( ServerNOP(in) ) return -1 ; if (in->name == NULL) return -1; if (ClientAddr(in->name, in)) return -1; in->file_descriptor = FILE_DESCRIPTOR_BAD; // No persistent connection yet in->busmode = bus_zero; return 0; } // Set up inbound connection to an owserver // Actual tcp connection created as needed int Server_detect(struct connection_in *in) { if (in->name == NULL) return -1; if (ClientAddr(in->name, in)) return -1; in->file_descriptor = FILE_DESCRIPTOR_BAD; // No persistent connection yet in->busmode = bus_server; return 0; } // Send to an owserver using the READ message int ServerRead(struct request_packet *rp) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { rp->path, NULL, 0, rp->tokenstring, rp->tokens, }; int persistent = 1; struct server_connection_state scs ; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_read; sm.size = rp->data_length; sm.offset = rp->data_offset; scs.persistence = persistent_yes ; scs.persistence = persistent_yes ; scs.in =rp->owserver ; LEVEL_CALL("SERVER READ path=%s\n", SAFESTRING(rp->path)); // Send to owserver sm.control_flags = SetupSemi(persistent); if ( To_Server( &scs, &sm, &sp) == 1 ) { Release_Persistent( &scs, 0); return -EIO ; } // Receive from owserver if ( From_Server( &scs, &cm, (ASCII *) rp->read_value, rp->data_length) < 0 ) { Release_Persistent( &scs, 0); return -EIO ; } Release_Persistent( &scs, cm.control_flags & PERSISTENT_MASK); return cm.ret; } // Send to an owserver using the PRESENT message int ServerPresence(struct request_packet *rp) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { rp->path, NULL, 0, rp->tokenstring, rp->tokens, }; int persistent = 1; struct server_connection_state scs ; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_presence; scs.persistence = persistent_yes ; scs.in =rp->owserver ; LEVEL_CALL("SERVER PRESENCE path=%s\n", SAFESTRING(rp->path)); // Send to owserver sm.control_flags = SetupSemi(persistent); if ( To_Server( &scs, &sm, &sp) == 1 ) { Release_Persistent( &scs, 0 ) ; return 1 ; } // Receive from owserver if (From_Server(&scs, &cm, NULL, 0) < 0) { Release_Persistent(&scs, 0 ); return 1 ; } Release_Persistent(&scs, cm.control_flags & PERSISTENT_MASK); return cm.ret; } // Send to an owserver using the WRITE message int ServerWrite(struct request_packet *rp) { struct server_msg sm; struct client_msg cm; #if ( __GNUC__ > 4 ) || (__GNUC__ == 4 && __GNUC_MINOR__ > 4 ) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" struct serverpackage sp = { rp->path, (BYTE *) rp->write_value, rp->data_length, rp->tokenstring, rp->tokens, }; #pragma GCC diagnostic pop #else struct serverpackage sp = { rp->path, (BYTE *) rp->write_value, rp->data_length, rp->tokenstring, rp->tokens, }; #endif int persistent = 1; struct server_connection_state scs ; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_write; sm.size = rp->data_length; sm.offset = rp->data_offset; scs.persistence = persistent_yes ; scs.in =rp->owserver ; LEVEL_CALL("SERVER WRITE path=%s\n", SAFESTRING(rp->path)); // Send to owserver sm.control_flags = SetupSemi(persistent); if ( To_Server( &scs, &sm, &sp) == 1 ) { Release_Persistent( &scs, 0 ) ; return -EIO ; } // Receive from owserver if ( From_Server( &scs, &cm, NULL, 0) < 0) { Release_Persistent( &scs, 0 ) ; return -EIO ; } { uint32_t control_flags = cm.control_flags & ~(SHOULD_RETURN_BUS_LIST | PERSISTENT_MASK ); if (ow_Global.control_flags != control_flags) { // replace control flags (except safemode persists) ow_Global.control_flags = control_flags; } } Release_Persistent(&scs, cm.control_flags & PERSISTENT_MASK); return cm.ret; } // Send to an owserver using either the DIR or DIRALL message int ServerDir(void (*dirfunc) (void *, const char *), void *v, struct request_packet *rp) { int ret; // Do we know this server doesn't support DIRALL? if (rp->owserver->tcp.no_dirall) { return ServerDIR(dirfunc, v, rp); } // try DIRALL and see if supported if ((ret = ServerDIRALL(dirfunc, v, rp)) == -ENOMSG) { rp->owserver->tcp.no_dirall = 1; return ServerDIR(dirfunc, v, rp); } return ret; } // Send to an owserver using the DIR message static int ServerDIR(void (*dirfunc) (void *, const char *), void *v, struct request_packet *rp) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { rp->path, NULL, 0, rp->tokenstring, rp->tokens, }; int persistent = 1; struct server_connection_state scs ; char *return_path; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_dir; scs.persistence = persistent_yes ; scs.in =rp->owserver ; LEVEL_CALL("SERVER DIR path=%s\n", SAFESTRING(rp->path)); // Send to owserver sm.control_flags = SetupSemi(persistent); if ( To_Server( &scs, &sm, &sp) == 1 ) { Release_Persistent( &scs, 0 ) ; return -EIO ; } // Receive from owserver -- in a loop for each directory entry while ( (return_path = From_ServerAlloc(&scs, &cm)) != NULL ) { return_path[cm.payload - 1] = '\0'; /* Ensure trailing null */ LEVEL_DEBUG("ServerDir: got=[%s]\n", return_path); dirfunc(v, return_path); free(return_path); } Release_Persistent(&scs, cm.control_flags & PERSISTENT_MASK); return cm.ret; } // Send to an owserver using the DIRALL message static int ServerDIRALL(void (*dirfunc) (void *, const char *), void *v, struct request_packet *rp) { ASCII *comma_separated_list; struct server_msg sm; struct client_msg cm; struct serverpackage sp = { rp->path, NULL, 0, rp->tokenstring, rp->tokens, }; int persistent = 1; struct server_connection_state scs ; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_dirall; scs.persistence = persistent_yes ; scs.in =rp->owserver ; LEVEL_CALL("SERVER DIRALL path=%s\n", SAFESTRING(rp->path)); // Send to owserver sm.control_flags = SetupSemi(persistent); if ( To_Server( &scs, &sm, &sp) == 1 ) { Release_Persistent( &scs, 0 ) ; return -EIO ; } // Receive from owserver comma_separated_list = From_ServerAlloc(&scs, &cm); LEVEL_DEBUG("DIRALL got %s\n", SAFESTRING(comma_separated_list)); if (cm.ret == 0) { ASCII *current_file; ASCII *rest_of_comma_list = comma_separated_list; LEVEL_DEBUG("DIRALL start parsing\n"); while ((current_file = strsep(&rest_of_comma_list, ",")) != NULL) { LEVEL_DEBUG("ServerDirall: got=[%s]\n", current_file); dirfunc(v, current_file); } } // free the allocated memory if (comma_separated_list != NULL) { free(comma_separated_list); } Release_Persistent( &scs, cm.control_flags & PERSISTENT_MASK ); return cm.ret; } /* flag the sg for "virtual root" -- the remote bus was specifically requested */ static uint32_t SetupSemi(int persistent) { uint32_t sg = ow_Global.control_flags; sg &= ~PERSISTENT_MASK; if (persistent) { sg |= PERSISTENT_MASK; } /* End user -- add full bus list and apply aliases */ sg |= SHOULD_RETURN_BUS_LIST | ALIAS_REQUEST ; return sg; } /* Request a persistent connection Three possibilities: 1. no persistent connection currently (in->file_descriptor = -1) create one, flag in->file_descriptor as -2, and return file_descriptor or return -1 if a new one can't be created 2. persistent available (in->file_descriptor > -1 ) use it, flag in->file_descriptor as -2, and return in->file_descriptor 3. in use, (in->file_descriptor = -2) return -1 */ /* Clean up at end of routine, either leave connection open and persistent flag available, or close */ static void Release_Persistent( struct server_connection_state * scs, int granted ) { if ( granted == 0 ) { Close_Persistent( scs ) ; return ; } if ( scs->file_descriptor <= FILE_DESCRIPTOR_BAD ) { Close_Persistent( scs ) ; return ; } if (scs->persistence == persistent_no) { // non-persistence from the start Close_Persistent( scs ) ; return ; } // mark as available BUSLOCKIN(scs->in); scs->in->file_descriptor = scs->file_descriptor; BUSUNLOCKIN(scs->in); scs->persistence = persistent_no ; // we no longer own this connection scs->file_descriptor = FILE_DESCRIPTOR_BAD ; } static void Close_Persistent( struct server_connection_state * scs) { // First set up the file descriptor based on persistent state if (scs->persistence == persistent_yes) { // no persistence wanted BUSLOCKIN(scs->in); scs->in->file_descriptor = FILE_DESCRIPTOR_BAD ; BUSUNLOCKIN(scs->in); } scs->persistence = persistent_no ; if ( scs->file_descriptor > FILE_DESCRIPTOR_BAD ) { close(scs->file_descriptor) ; scs->file_descriptor = FILE_DESCRIPTOR_BAD ; } } /* return 0 good, 1 bad */ static int To_Server( struct server_connection_state * scs, struct server_msg * sm, struct serverpackage *sp) { struct connection_in * in = scs->in ; // for convenience BYTE test_read[1] ; int old_flags ; ssize_t rcv_value ; int saved_errno ; // initialize the variables scs->file_descriptor = FILE_DESCRIPTOR_BAD ; // First set up the file descriptor based on persistent state if (scs->persistence == persistent_no) { // no persistence wanted scs->file_descriptor = ClientConnect(in); } else { // Persistence desired BUSLOCKIN(in); switch ( in->file_descriptor ) { case FILE_DESCRIPTOR_PERSISTENT_IN_USE: // Currently in use, so make new non-persistent connection scs->file_descriptor = ClientConnect(in); scs->persistence = persistent_no ; break ; case FILE_DESCRIPTOR_BAD: // no conection currently, so make a new one scs->file_descriptor = ClientConnect(in); if ( scs->file_descriptor > FILE_DESCRIPTOR_BAD ) { in->file_descriptor = FILE_DESCRIPTOR_PERSISTENT_IN_USE ; } break ; default: // persistent connection idle and waiting for use // connection_in is locked so this is safe scs->file_descriptor = in->file_descriptor; in->file_descriptor = FILE_DESCRIPTOR_PERSISTENT_IN_USE; break ; } BUSUNLOCKIN(in); } // Check if the server closed the connection // This is contributed by Jacob Joseph to fix a timeout problem. // http://permalink.gmane.org/gmane.comp.file-systems.owfs.devel/7306 //rcv_value = recv(scs->file_descriptor, test_read, 1, MSG_DONTWAIT | MSG_PEEK) ; old_flags = fcntl( scs->file_descriptor, F_GETFL, 0 ) ; // save socket flags if ( old_flags == -1 ) { rcv_value = -2 ; } else if ( scs->file_descriptor < 0 ) { rcv_value = 0 ; // bad file descriptor -- need to reset } else if ( fcntl( scs->file_descriptor, F_SETFL, old_flags | O_NONBLOCK ) == -1 ) { // set non-blocking rcv_value = -2 ; } else { rcv_value = recv(scs->file_descriptor, test_read, 1, MSG_PEEK) ; // test read the socket to see if closed saved_errno = errno ; if ( fcntl( scs->file_descriptor, F_SETFL, old_flags ) == -1 ) { // restore socket flags rcv_value = -2 ; } } switch ( rcv_value ) { case -1: if ( saved_errno==EAGAIN || saved_errno==EWOULDBLOCK ) { // No data to be read -- so connection healthy break ; } // real error, fall through to close connection case case -2: // fnctl error, fall through again case 0: LEVEL_DEBUG("Server connection was closed. Reconnecting."); Close_Persistent( scs); scs->file_descriptor = ClientConnect(in); if ( scs->file_descriptor > FILE_DESCRIPTOR_BAD ) { in->file_descriptor = FILE_DESCRIPTOR_PERSISTENT_IN_USE ; } break ; default: // data to be read, so a good connection break ; } // Now test if ( scs->file_descriptor <= FILE_DESCRIPTOR_BAD ) { Close_Persistent( scs ) ; return 1 ; } // Do the real work if (WriteToServer(scs->file_descriptor, sm, sp) >= 0) { // successful message return 0; } // This is where it gets a bit tricky. For non-persistent conections we're done' if ( scs->persistence == persistent_no ) { // not persistent, so no reconnection needed Close_Persistent( scs ) ; return 1 ; } // perhaps the persistent connection is stale? // Make a new one scs->file_descriptor = ClientConnect(in) ; // Now retest if ( scs->file_descriptor <= FILE_DESCRIPTOR_BAD ) { // couldn't make that new connection -- free everything Close_Persistent( scs ) ; return 1 ; } // Leave in->file_descriptor = FILE_DESCRIPTOR_PERSISTENT_IN_USE // Second attempt at the write, now with new connection if (WriteToServer(scs->file_descriptor, sm, sp) >= 0) { // successful message return 0; } // bad write the second time -- clear everything Close_Persistent( scs ) ; return 1 ; } // should be const char * data but iovec has problems with const arguments static int WriteToServer(int file_descriptor, struct server_msg *sm, struct serverpackage *sp) { int payload = 0; int tokens = 0; int nio = 0; struct iovec io[5] = { {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, }; struct server_msg net_sm ; // First block to send, the header // We'll do this last since the header values (e.g. payload) change nio++; // Next block, the path if (sp->path != 0) { // send path (if not null) // writev should take const data pointers, but I can't fix the library #if ( __GNUC__ > 4 ) || (__GNUC__ == 4 && __GNUC_MINOR__ > 4 ) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" io[nio].iov_base = (char *) sp->path ; // gives a spurious compiler error -- constant is OK HERE! #pragma GCC diagnostic pop #else io[nio].iov_base = (char *) sp->path ; // gives a spurious compiler error -- constant is OK HERE! #endif io[nio].iov_len = strlen(sp->path) + 1; payload = io[nio].iov_len ; nio++; LEVEL_DEBUG("ToServer path=%s\n", sp->path); } // Next block, data (only for writes) if ((sp->datasize>0) && (sp->data!=NULL)) { // send data only for writes (if datasize not zero) io[nio].iov_base = sp->data ; io[nio].iov_len = sp->datasize ; payload += sp->datasize; nio++; LEVEL_DEBUG("ToServer data size=%d bytes\n", sp->datasize); } // Next block, old tokens (there aren't any since this isn't an owserver) // Next block, new token (there aren't any since this isn't an owserver) sp->tokens = 0; // ownet isn't a server // First block to send, the header // revisit now that the header values are set sm->version = MakeServerprotocol(OWSERVER_PROTOCOL_VERSION); // encode in network order (just the header) net_sm.version = htonl( sm->version ); net_sm.payload = htonl( payload ); net_sm.size = htonl( sm->size ); net_sm.type = htonl( sm->type ); net_sm.control_flags = htonl( sm->control_flags ); net_sm.offset = htonl( sm->offset ); io[0].iov_base = &net_sm; io[0].iov_len = sizeof(struct server_msg); // debug data on packet LEVEL_DEBUG("version=%u payload=%d size=%d type=%d SG=%X offset=%d",sm->version,payload,sm->size,sm->type,sm->control_flags,sm->offset); // Now do the actual write return writev(file_descriptor, io, nio) != (ssize_t) (payload + sizeof(struct server_msg) + tokens * sizeof(struct antiloop)); } /* Read from server -- return negative on error, return 0 or positive giving size of data element */ static int From_Server( struct server_connection_state * scs, struct client_msg *cm, char *msg, size_t size) { size_t rtry; size_t actual_read ; struct timeval tv1 = { ow_Global.timeout_network + 1, 0, }; struct timeval tv2 = { ow_Global.timeout_network + 1, 0, }; do { // read regular header, or delay (delay when payload<0) actual_read = tcp_read(scs->file_descriptor, (BYTE *) cm, sizeof(struct client_msg), &tv1); if (actual_read != sizeof(struct client_msg)) { cm->size = 0; cm->ret = -EIO; return -EIO; } cm->payload = ntohl(cm->payload); cm->size = ntohl(cm->size); cm->ret = ntohl(cm->ret); cm->control_flags = ntohl(cm->control_flags); cm->offset = ntohl(cm->offset); } while (cm->payload < 0); // flag to show a delay message if (cm->payload == 0) { return 0; // No payload, done. } rtry = cm->payload < (ssize_t) size ? (size_t) cm->payload : size; actual_read = tcp_read(scs->file_descriptor, (BYTE *) msg, rtry, &tv2); // read expected payload now. if (actual_read != rtry) { LEVEL_DEBUG("Read only %d of %d\n",(int)actual_read,(int)rtry) ; cm->ret = -EIO; return -EIO; } if (cm->payload > (ssize_t) size) { // Uh oh. payload bigger than expected. close the connection Close_Persistent( scs ) ; return size; } return cm->payload; } /* read from server, you must free return pointer if not Null */ /* Adds an extra null byte at end */ static void *From_ServerAlloc(struct server_connection_state * scs, struct client_msg *cm) { BYTE *msg; struct timeval tv1 = { ow_Global.timeout_network + 1, 0, }; struct timeval tv2 = { ow_Global.timeout_network + 1, 0, }; size_t actual_size ; do { /* loop until non delay message (payload>=0) */ actual_size = tcp_read(scs->file_descriptor, (BYTE *) cm, sizeof(struct client_msg), &tv1 ); if (actual_size != sizeof(struct client_msg)) { memset(cm, 0, sizeof(struct client_msg)); cm->ret = -EIO; return NULL; } cm->payload = ntohl(cm->payload); cm->size = ntohl(cm->size); cm->ret = ntohl(cm->ret); cm->control_flags = ntohl(cm->control_flags); cm->offset = ntohl(cm->offset); } while (cm->payload < 0); if (cm->payload == 0) { return NULL; } if (cm->ret < 0) { return NULL; } if (cm->payload > MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE) { return NULL; } msg = malloc((size_t) cm->payload + 1) ; if ( msg != NULL ) { actual_size = tcp_read(scs->file_descriptor, msg, (size_t) (cm->payload), &tv2 ); if ((ssize_t)actual_size != cm->payload) { cm->payload = 0; cm->offset = 0; cm->ret = -EIO; free(msg); msg = NULL; } } if(msg != NULL) { msg[cm->payload] = '\0'; // safety NULL } return msg; } owfs-3.1p5/module/ownet/c/src/c/ow_tcp_read.c0000644000175000001440000000412112654730021016021 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_net holds the network utility routines. Many stolen unashamedly from Steven's Book */ /* Much modification by Christian Magnusson especially for Valgrind and embedded */ /* non-threaded fixes by Jerry Scharf */ #include #include "owfs_config.h" #include "ow.h" /* Read "n" bytes from a descriptor. */ /* Stolen from Unix Network Programming by Stevens, Fenner, Rudoff p89 */ ssize_t tcp_read(int file_descriptor, void *vptr, size_t n, const struct timeval * ptv) { size_t nleft; ssize_t nread; char *ptr; //printf("NetRead attempt %d bytes Time:(%ld,%ld)\n",(int)n,ptv->tv_sec,ptv->tv_usec ) ; ptr = vptr; nleft = n; while (nleft > 0) { int rc; fd_set readset; struct timeval tv = { ptv->tv_sec, ptv->tv_usec, }; /* Initialize readset */ FD_ZERO(&readset); FD_SET(file_descriptor, &readset); /* Read if it doesn't timeout first */ rc = select(file_descriptor + 1, &readset, NULL, NULL, &tv); if (rc > 0) { /* Is there something to read? */ if (FD_ISSET(file_descriptor, &readset) == 0) { return -EIO; /* error */ } //update_max_delay(pn); if ((nread = read(file_descriptor, ptr, nleft)) < 0) { if (errno == EINTR) { errno = 0; // clear errno. We never use it anyway. nread = 0; /* and call read() again */ } else { ERROR_DATA("Network data read error\n"); return (-1); } } else if (nread == 0) { break; /* EOF */ } //Debug_Bytes( "NETREAD",ptr, nread ) ; nleft -= nread; ptr += nread; } else if (rc < 0) { /* select error */ if (errno == EINTR) { /* select() was interrupted, try again */ continue; } ERROR_DATA("Selection error (network)\n"); return -EINTR; } else { /* timed out */ LEVEL_CONNECT("TIMEOUT after %d bytes\n", n - nleft); return -EAGAIN; } } return (n - nleft); /* return >= 0 */ } owfs-3.1p5/module/ownet/c/src/include/0000755000175000001440000000000013022537101014644 500000000000000owfs-3.1p5/module/ownet/c/src/include/Makefile.am0000644000175000001440000000125712654730021016633 00000000000000headerdir = ${prefix}/include header_DATA = ownetapi.h EXTRA_DIST = ${header_DATA} \ compat_getopt.h \ compat.h \ compat_netdb.h \ ow_charblob.h \ ow_connection.h \ ow_debug.h \ ow_dl.h \ ow_dnssd.h \ ow_functions.h \ ow_global.h \ ow.h \ ow_localtypes.h \ ow_message.h \ ow_mutex.h \ ow_mutexes.h \ ownetapi.h \ ow_pressure.h \ ow_server.h \ ow_stub.h \ ow_temperature.h \ rwlock.h \ sem.h owfs-3.1p5/module/ownet/c/src/include/Makefile.in0000644000175000001440000004621213022537052016643 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/ownet/c/src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(headerdir)" DATA = $(header_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ headerdir = ${prefix}/include header_DATA = ownetapi.h EXTRA_DIST = ${header_DATA} \ compat_getopt.h \ compat.h \ compat_netdb.h \ ow_charblob.h \ ow_connection.h \ ow_debug.h \ ow_dl.h \ ow_dnssd.h \ ow_functions.h \ ow_global.h \ ow.h \ ow_localtypes.h \ ow_message.h \ ow_mutex.h \ ow_mutexes.h \ ownetapi.h \ ow_pressure.h \ ow_server.h \ ow_stub.h \ ow_temperature.h \ rwlock.h \ sem.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) --foreign module/ownet/c/src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/ownet/c/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-headerDATA: $(header_DATA) @$(NORMAL_INSTALL) @list='$(header_DATA)'; test -n "$(headerdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(headerdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(headerdir)" || 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)$(headerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(headerdir)" || exit $$?; \ done uninstall-headerDATA: @$(NORMAL_UNINSTALL) @list='$(header_DATA)'; test -n "$(headerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(headerdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(headerdir)"; 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-libtool 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-headerDATA 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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-headerDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-headerDATA \ 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 mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-headerDATA .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: owfs-3.1p5/module/ownet/c/src/include/ownetapi.h0000644000175000001440000001227012665167763016616 00000000000000/* $Id$ OWFS (owfs, owhttpd, owserver, owperl, owtcl, owphp, owpython, owcapi) one-wire file system and related programs By Paul H Alfille {c} 2008 GPL paul.alfille@gmail.com */ /* This is the libownet header a C programmikng interface to easily access owserver and thus the entire Dallas/Maxim 1-wire system. This header has all the public routines for a program linking in the library */ /* OWNETAPI - specific header */ /* OWNETAPI is the simple C library for OWFS */ #ifndef OWNETAPI_H #define OWNETAPI_H #ifdef __CYGWIN__ #define __BSD_VISIBLE 1 /* for u_int */ #endif /* __CYGWIN__ */ #ifdef __cplusplus extern "C" { #endif #include #define MAX_READ_BUFFER_SIZE 10000 /* OWNET_HANDLE A (non-negative) integer corresponding to a particular owserver connection. It is used for each function call, and allows multiple owservers to be accessed */ typedef int OWNET_HANDLE; /* OWNET_HANDLE OWNET_init( const char * owserver ) Starting routine -- takes a string corresponding to the tcp address of owserver e.g. "192.168.0.1:5000" or "5001" or even "" for the default localhost:4304 returns a non-negative HANDLE, or <0 for error */ OWNET_HANDLE OWNET_init(const char *owserver_tcp_address_and_port); /* int OWNET_dirlist( OWNET_HANDLE h, const char * onewire_path, char ** return_string ) Get the 1-wire directory as a comma-separated list. return_string is allocated by this program, and must be free-ed by your program. return non-negative length of return_string on success return <0 error and NULL on error */ int OWNET_dirlist(OWNET_HANDLE h, const char *onewire_path, char **return_string); /* int OWNET_dirprocess( OWNET_HANDLE h, const char * onewire_path, void (*dirfunc) (void * passed_on_value, const char* directory_element), void * passed_on_value ) Get the 1-wire directory corresponding to the given path Call function dirfunc on each element passed_on_value is an arbitrary pointer that gets included in the dirfunc call to add some state information returns number of elements processed, or <0 for error */ int OWNET_dirprocess(OWNET_HANDLE h, const char *onewire_path, void (*dirfunc) (void *passed_on_value, const char *directory_element), void *passed_on_value); /* int OWNET_present( OWNET_HANDLE h, const char * onewire_path) Check if a one-wire device is present returns = 0 on success, returns <0 on error */ int OWNET_present(OWNET_HANDLE h, const char *onewire_path); /* int OWNET_read( OWNET_HANDLE h, const char * onewire_path, unsigned char ** return_string ) Read a value from a one-wire device property return_string has the result but must be free-ed by the calling program. returns length of result on success, returns <0 on error */ int OWNET_read(OWNET_HANDLE h, const char *onewire_path, char **return_string); /* int OWNET_lread( OWNET_HANDLE h, const char * onewire_path, unsigned char * return_string, size_t size, off_t offset ) Read a value from a one-wire device property Buffer should be pre-allocated, and size and offset specified. return_string has the result. returns length of result on success, returns <0 on error */ int OWNET_lread(OWNET_HANDLE h, const char *onewire_path, char *return_string, size_t size, off_t offset); /* int OWNET_put( OWNET_HANDLE h, const char * onewire_path, const unsigned char * value_string, size_t size) Write a value to a one-wire device property, of specified size and offset return 0 on success return <0 on error */ int OWNET_put(OWNET_HANDLE h, const char *onewire_path, const char *value_string, size_t size); /* int OWNET_lwrite( OWNET_HANDLE h, const char * onewire_path, const unsigned char * value_string, size_t size, off_t offset ) Write a value to a one-wire device property, of specified size and offset return 0 on success return <0 on error */ int OWNET_lwrite(OWNET_HANDLE h, const char *onewire_path, const char *value_string, size_t size, off_t offset); /* void OWNET_close( OWNET_HANDLE h) close a particular owserver connection */ void OWNET_close(OWNET_HANDLE h); /* void OWNET_closeall( void ) close all owserver connections */ void OWNET_closeall(void); /* void OWNET_finish( void ) close all owserver connections and free all memory */ void OWNET_finish(void); /* get and set temperature scale Note that temperature scale applies to all HANDLES C - celsius F - farenheit R - rankine K - kelvin 0 -> set default (C) */ void OWNET_set_temperature_scale(char temperature_scale); char OWNET_get_temperature_scale(void); /* get and set device format Note that device format applies to all HANDLES f.i default f.i.c fi.c fi f.ic fic NULL or "" -> set default */ void OWNET_set_device_format(const char *device_format); const char *OWNET_get_device_format(void); /* get and set trim state * This just means removing extra spaces from * numeric values * which is easier for some data parsing Note that trim state applies to all HANDLES */ void OWNET_set_trim( int trim_state ) ; int OWNET_get_trim( void ) ; #ifdef __cplusplus } #endif #endif /* OWNETAPI_H */ owfs-3.1p5/module/ownet/c/src/include/compat_getopt.h0000644000175000001440000001354512654730021017620 00000000000000/* Declarations for getopt. Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include "owfs_config.h" #ifndef _COMP_GETOPT_H #define _COMP_GETOPT_H /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifdef __cplusplus extern "C" { #endif #ifndef HAVE_GETOPT /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #endif /* HAVE_GETOPT */ #ifndef HAVE_GETOPT_LONG /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* HAVE_GETOPT_LONG */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #ifndef HAVE_GETOPT /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt(int __argc, char *const *__argv, const char *__shortopts); #endif #ifndef HAVE_GETOPT_LONG extern int getopt_long(int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); extern int getopt_long_only(int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal(int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); #endif #ifdef __cplusplus } #endif #endif /* _COMP_GETOPT_H */ owfs-3.1p5/module/ownet/c/src/include/compat.h0000644000175000001440000001131212673103261016225 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- */ #ifndef COMPAT_H #define COMPAT_H #include #include "owfs_config.h" #ifdef HAVE_FEATURES_H #include #endif #ifndef HAVE_GETADDRINFO #include "compat_netdb.h" #endif #include "compat_getopt.h" #ifndef HAVE_STRSEP char *strsep(char **stringp, const char *delim); #endif #if defined(__UCLIBC__) #if ((__UCLIBC_MAJOR__ << 16)+(__UCLIBC_MINOR__ << 8)+(__UCLIBC_SUBLEVEL__) <= 0x000913) #undef HAVE_TDESTROY #else /* Older than 0.9.19 */ #define HAVE_TDESTROY 1 #endif /* Older than 0.9.19 */ #else #endif /* __UCLIBC__ */ #ifndef HAVE_TDESTROY void tdestroy(void *vroot, void (*freefct) (void *)); #endif #ifndef __COMPAR_FN_T # define __COMPAR_FN_T typedef int (*__compar_fn_t) (__const void *, __const void *); #endif #ifndef HAVE_TSEARCH void *tsearch(__const void *__key, void **__rootp, __compar_fn_t __compar); #endif #ifndef HAVE_TFIND void *tfind(__const void *__key, void *__const * __rootp, __compar_fn_t __compar); #endif #ifndef HAVE_TDELETE void *tdelete(__const void *__restrict __key, void **__restrict __rootp, __compar_fn_t __compar); #endif #if defined(_SEARCH_H) || defined(_SEARCH_H_) /* VISIT is always defined in search.h on MacOSX. */ #else typedef enum { preorder, postorder, endorder, leaf } VISIT; #endif /* SEARCH_H */ #ifndef __ACTION_FN_T # define __ACTION_FN_T typedef void (*__action_fn_t) (__const void *__nodep, VISIT __value, int __level); #endif #ifndef HAVE_TWALK void twalk(__const void *__root, __action_fn_t __action); #endif #ifdef __UCLIBC__ #if defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) && defined(__UCLIBC_SUBLEVEL__) #if ((__UCLIBC_MAJOR__<<16) + (__UCLIBC_MINOR__<<8) + (__UCLIBC_SUBLEVEL__)) <= 0x000913 /* Since syslog will hang forever with uClibc-0.9.19 if syslogd is not * running, then we don't use it unless we really wants it * WRT45G usually have syslogd running. uClinux-dist might not have it. */ #ifndef USE_SYSLOG #define syslog(a,...) { /* ignore_syslog */ } #define openlog(a,...) { /* ignore_openlog */ } #define closelog() { /* ignore_closelog */ } #endif #endif /* __UCLIBC__ */ #endif /* __UCLIBC__ */ #endif /* __UCLIBC__ */ #endif owfs-3.1p5/module/ownet/c/src/include/compat_netdb.h0000644000175000001440000001432512665167763017432 00000000000000/* Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* All data returned by the network data base library are supplied in host order and returned in network order (suitable for use in system calls). */ #ifndef _COMPAT_NETDB_H #define _COMPAT_NETDB_H 1 #include #include "owfs_config.h" #ifdef HAVE_FEATURES_H #include #endif #ifndef __USE_GNU #define __USE_GNU #endif /* Doesn't exist for Solaris, make a test for it later */ /* #undef HAVE_SA_LEN */ #ifndef __HAS_IPV6__ #define __HAS_IPV6__ 0 #endif #ifndef __USE_POSIX #define __USE_POSIX #endif #ifndef __THROW #define __THROW #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_STDINT_H #include #endif #ifdef __USE_MISC /* This is necessary to make this include file properly replace the Sun version. */ # include #endif #ifdef HAVE_BITS_NETDB_H #include #endif /* Absolute file name for network data base files. */ #define _PATH_HEQUIV "/etc/hosts.equiv" #define _PATH_HOSTS "/etc/hosts" #define _PATH_NETWORKS "/etc/networks" #define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf" #define _PATH_PROTOCOLS "/etc/protocols" #define _PATH_SERVICES "/etc/services" #ifndef __set_errno #define __set_errno(x) (errno = (x)) #endif #ifndef __set_h_errno #define __set_h_errno(x) (h_errno = (x)) #endif #ifndef HAVE_INET_NTOP const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); #endif #ifndef HAVE_INET_PTON int inet_pton(int af, const char *src, void *dst); #endif #ifndef HAVE_GETADDRINFO /* Possible values left in `h_errno'. */ #define NETDB_INTERNAL -1 /* See errno. */ #define NETDB_SUCCESS 0 /* No problem. */ #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */ #define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL. */ #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP. */ #define NO_DATA 4 /* Valid name, no data record of requested type. */ #define NO_ADDRESS NO_DATA /* No address, look for MX record. */ #ifdef __USE_XOPEN2K /* Highest reserved Internet port number. */ # define IPPORT_RESERVED 1024 #endif #ifdef __USE_GNU /* Scope delimiter for getaddrinfo(), getnameinfo(). */ # define SCOPE_DELIMITER '%' #endif /* Extension from POSIX.1g. */ #if defined(__USE_POSIX) && !defined(__CYGWIN__) /* Structure to contain information about address of a service provider. */ struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Protocol family for socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol for socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address for socket. */ char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; # ifdef __USE_GNU /* Lookup mode. */ # define GAI_WAIT 0 # define GAI_NOWAIT 1 # endif /* Possible values for `ai_flags' field in `addrinfo' structure. */ # define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ # define AI_CANONNAME 0x0002 /* Request for canonical name. */ # define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ /* Error values for `getaddrinfo' function. */ # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ # define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ # define EAI_AGAIN -3 /* Temporary failure in name resolution. */ # define EAI_FAIL -4 /* Non-recoverable failure in name res. */ # define EAI_NODATA -5 /* No address associated with NAME. */ # define EAI_FAMILY -6 /* `ai_family' not supported. */ # define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ # define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ # define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ # define EAI_MEMORY -10 /* Memory allocation failure. */ # define EAI_SYSTEM -11 /* System error returned in `errno'. */ # ifdef __USE_GNU # define EAI_INPROGRESS -100 /* Processing request in progress. */ # define EAI_CANCELED -101 /* Request canceled. */ # define EAI_NOTCANCELED -102 /* Request not canceled. */ # define EAI_ALLDONE -103 /* All requests done. */ # define EAI_INTR -104 /* Interrupted by a signal. */ # endif # define NI_MAXHOST 1025 # define NI_MAXSERV 32 # define NI_NUMERICHOST 1 /* Don't try to look up hostname. */ # define NI_NUMERICSERV 2 /* Don't convert port number to name. */ # define NI_NOFQDN 4 /* Only return nodename portion. */ # define NI_NAMEREQD 8 /* Don't return numeric addresses. */ # define NI_DGRAM 16 /* Look up UDP service rather than TCP. */ /* Translate name of a service location and/or a service name to set of socket addresses. */ extern int getaddrinfo(__const char *__restrict __name, __const char *__restrict __service, __const struct addrinfo *__restrict __req, struct addrinfo **__restrict __pai) __THROW; /* Free `addrinfo' structure AI including associated storage. */ extern void freeaddrinfo(struct addrinfo *__ai) __THROW; /* Convert error return from getaddrinfo() to a string. */ extern const char *gai_strerror(int __ecode) __THROW; #endif /* HAVE_GETADDRINFO */ #endif /* POSIX */ #endif /* COMPAT_NETDB_H */ owfs-3.1p5/module/ownet/c/src/include/ow_charblob.h0000644000175000001440000000613612654730021017232 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 2006 dirblob */ #ifndef OW_CHARBLOB_H /* tedious wrapper */ #define OW_CHARBLOB_H struct charblob { int troubled; size_t allocated; size_t used; ASCII *blob; }; void CharblobClear(struct charblob *cb); void CharblobInit(struct charblob *cb); int CharblobPure(struct charblob *cb); int CharblobAdd(const ASCII * a, size_t s, struct charblob *cb); int CharblobAddChar(ASCII a, struct charblob *cb); size_t CharblobLength( struct charblob * cb ) ; ASCII * CharblobData(struct charblob * cb) ; #endif /* OW_CHARBLOB_H */ owfs-3.1p5/module/ownet/c/src/include/ow_connection.h0000644000175000001440000001152312654730021017611 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_CONNECTION_H /* tedious wrapper */ #define OW_CONNECTION_H /* Jan 21, 2007 from the IANA: owserver 4304/tcp One-Wire Filesystem Server owserver 4304/udp One-Wire Filesystem Server # Paul Alfille January 2007 See: http://www.iana.org/assignments/port-numbers */ #define DEFAULT_PORT "4304" #include "ow.h" #include #include "ownetapi.h" /* large enough for arrays of 2048 elements of ~49 bytes each */ #define MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE 100050 struct connection_in; /* -------------------------------------------- */ struct connin_tcp { char *host; char *service; struct addrinfo *ai; struct addrinfo *ai_ok; char *type; // for zeroconf char *domain; // for zeroconf char *fqdn; // fully qualified domain name int no_dirall; // flag that server doesn't support DIRALL }; //enum server_type { srv_unknown, srv_direct, srv_client, src_ /* Network connection structure */ enum bus_mode { bus_unknown = 0, bus_server, bus_zero, }; struct connection_in { struct connection_in *next; struct connection_in *prior; int handle; char *name; FILE_DESCRIPTOR_OR_ERROR file_descriptor; pthread_mutex_t bus_mutex; enum bus_mode busmode; /* Static buffer for conmmunication */ /* Since only used during actual transfer to/from the adapter, should be protected from contention even when multithreading allowed */ size_t bundling_length; struct connin_tcp tcp; }; extern struct connection_in *head_inbound_list; /* This bug-fix/workaround function seem to be fixed now... At least on * the platforms I have tested it on... printf() in owserver/src/c/owserver.c * returned very strange result on c->busmode before... but not anymore */ enum bus_mode get_busmode(struct connection_in *c); void FreeIn(struct connection_in *target); void FreeInAll(void); struct connection_in *NewIn(void); struct connection_in *find_connection_in(OWNET_HANDLE handle); /* Bonjour registration */ void OW_Browse(void); /* Low-level functions slowly being abstracted and separated from individual interface type details */ int Server_detect(struct connection_in *in); int Zero_detect(struct connection_in *in); #endif /* OW_CONNECTION_H */ owfs-3.1p5/module/ownet/c/src/include/ow_debug.h0000644000175000001440000001226312654730021016542 00000000000000/* Debug and error messages Meant to be included in ow.h Separated just for readability */ /* OWFS source code 1-wire filesystem for linux {c} 2006 Paul H Alfille License GPL2.0 */ #ifndef OW_DEBUG_H #define OW_DEBUG_H #include #include "owfs_config.h" #ifdef HAVE_SYS_UIO_H #include #endif #include /* rwlocks in pthread is preferred. If not, use own implementation with semaphores. */ #define PTHREAD_RWLOCK 1 #if OW_MUTEX_DEBUG // Detect double unlock etc. (PTHREAD_MUTEX_ERRORCHECK) // This should not be used for smaller embedded systems #define EXTENDED_MUTEX_DEBUG // Allow debugging rwlocks. #define EXTENDED_RWLOCK_DEBUG #else #undef EXTENDED_MUTEX_DEBUG #undef EXTENDED_RWLOCK_DEBUG #endif /* module/ownet/c/src/include/ow_debug.h & module/owlib/src/include/ow_debug.h are identical except this define */ #define OWNETC_OW_DEBUG 1 /* error functions */ enum e_err_level { e_err_default, e_err_connect, e_err_call, e_err_data, e_err_detail, e_err_debug, e_err_beyond, }; enum e_err_type { e_err_type_level, e_err_type_error, }; enum e_err_print { e_err_print_mixed, e_err_print_syslog, e_err_print_console, }; void err_msg(enum e_err_type errnoflag, enum e_err_level level, const char * file, int line, const char * func, const char *fmt, ...); void _Debug_Bytes(const char *title, const unsigned char *buf, int length); void fatal_error(const char * file, int line, const char * func, const char *fmt, ...); static inline int return_ok(void) { return 0; } void print_timestamp_(const char * file, int line, const char * func, const char *fmt, ...); #define print_timestamp(...) print_timestamp_(__FILE__,__LINE__,__func__,__VA_ARGS__); extern int log_available; #define debug_crash() { \ char *crash_ptr = NULL; \ print_timestamp_(__FILE__,__LINE__,__func__,"debug_crash"); \ *crash_ptr = '\000'; /* Crash with segmentation-fault */ \ } #if OW_DEBUG #define LEVEL_DEFAULT(...) if (Globals.error_level>=e_err_default) {\ err_msg(e_err_type_level,e_err_default,__FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_CONNECT(...) if (Globals.error_level>=e_err_connect) {\ err_msg(e_err_type_level,e_err_connect,__FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_CALL(...) if (Globals.error_level>=e_err_call) {\ err_msg(e_err_type_level,e_err_call, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_DATA(...) if (Globals.error_level>=e_err_data) {\ err_msg(e_err_type_level,e_err_data, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_DETAIL(...) if (Globals.error_level>=e_err_detail) {\ err_msg(e_err_type_level,e_err_detail, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_DEBUG(...) if (Globals.error_level>=e_err_debug) {\ err_msg(e_err_type_level,e_err_debug, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_DEFAULT(...) if (Globals.error_level>=e_err_default) {\ err_msg(e_err_type_error,e_err_default,__FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_CONNECT(...) if (Globals.error_level>=e_err_connect) {\ err_msg(e_err_type_error,e_err_connect,__FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_CALL(...) if (Globals.error_level>=e_err_call) {\ err_msg(e_err_type_error,e_err_call, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_DATA(...) if (Globals.error_level>=e_err_data) {\ err_msg(e_err_type_error,e_err_data, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_DETAIL(...) if (Globals.error_level>=e_err_detail) {\ err_msg(e_err_type_error,e_err_detail, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_DEBUG(...) if (Globals.error_level>=e_err_debug) {\ err_msg(e_err_type_error,e_err_debug, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define FATAL_ERROR(...) fatal_error(__FILE__, __LINE__, __func__, __VA_ARGS__) #define Debug_OWQ(owq) if (Globals.error_level>=e_err_debug) { _print_owq(owq); } #define Debug_Bytes(title,buf,length) if (Globals.error_level>=e_err_beyond) { _Debug_Bytes(title,buf,length) ; } #else /* not OW_DEBUG */ #define LEVEL_DEFAULT(...) do { } while (0) #define LEVEL_CONNECT(...) do { } while (0) #define LEVEL_CALL(...) do { } while (0) #define LEVEL_DATA(...) do { } while (0) #define LEVEL_DETAIL(...) do { } while (0) #define LEVEL_DEBUG(...) do { } while (0) #define ERROR_DEFAULT(...) do { } while (0) #define ERROR_CONNECT(...) do { } while (0) #define ERROR_CALL(...) do { } while (0) #define ERROR_DATA(...) do { } while (0) #define ERROR_DETAIL(...) do { } while (0) #define ERROR_DEBUG(...) do { } while (0) #define FATAL_ERROR(...) do { exit(EXIT_FAILURE); } while (0) #define Debug_Bytes(title,buf,length) do { } while (0) #define Debug_OWQ(owq) do { } while (0) #endif /* OW_DEBUG */ /* Make sure strings are safe for printf */ #define SAFESTRING(x) ((x) ? (x):"") /* Easy way to show 64bit serial numbers */ #define SNformat "%.2X %.2X %.2X %.2X %.2X %.2X %.2X %.2X" #define SNvar(sn) (sn)[0],(sn)[1],(sn)[2],(sn)[3],(sn)[4],(sn)[5],(sn)[6],(sn)[7] #include "ow_mutex.h" #endif /* OW_DEBUG_H */ owfs-3.1p5/module/ownet/c/src/include/ow_dl.h0000644000175000001440000000125212654730021016047 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 All the error and statistics counters are declared here, including handling macros */ #ifndef OW_DL_H #define OW_DL_H #include #include "owfs_config.h" #if OW_ZERO #if OW_CYGWIN #include typedef HMODULE DLHANDLE; #elif defined(HAVE_DLOPEN) #include typedef void *DLHANDLE; #endif /* OW_CYGWIN */ DLHANDLE DL_open(const char *pathname, int mode); void *DL_sym(DLHANDLE handle, const char *name); int DL_close(DLHANDLE handle); char *DL_error(void); #else /* OW_ZERO */ typedef void *DLHANDLE; #endif /* OW_ZERO */ extern DLHANDLE libdnssd; #endif owfs-3.1p5/module/ownet/c/src/include/ow_dnssd.h0000644000175000001440000022766312654730021016603 00000000000000/* * Copyright (c) 2003-2004, Apple Computer, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef OW_DNSSD_H #define OW_DNSSD_H #define ORIGINAL_DNSSD_INCLUDE 0 #ifdef __cplusplus extern "C" { #endif /* */ int OW_Load_dnssd_library(void); int OW_Free_dnssd_library(void); /* standard calling convention under Win32 is __stdcall */ /* Note: When compiling Intel EFI (Extensible Firmware Interface) under MS Visual Studio, the */ /* _WIN32 symbol is defined by the compiler even though it's NOT compiling code for Windows32 */ #if defined(_WIN32) && !defined(EFI32) && !defined(EFI64) #define DNSSD_API __stdcall #else /* */ #define DNSSD_API #endif /* */ /* stdint.h does not exist on FreeBSD 4.x; its types are defined in sys/types.h instead */ #if defined(__FreeBSD_version) && (__FreeBSD_version < 500000) #include /* Likewise, on Sun, standard integer types are in sys/types.h */ #elif defined(__sun__) #include /* EFI does not have stdint.h, or anything else equivalent */ #elif defined(EFI32) || defined(EFI64) typedef UINT8 uint8_t; typedef INT8 int8_t; typedef UINT16 uint16_t; typedef INT16 int16_t; typedef UINT32 uint32_t; typedef INT32 int32_t; /* Windows has its own differences */ #elif defined(_WIN32) #include #define _UNUSED #define bzero(a, b) memset(a, 0, b) #ifndef _MSL_STDINT_H typedef UINT8 uint8_t; typedef INT8 int8_t; typedef UINT16 uint16_t; typedef INT16 int16_t; typedef UINT32 uint32_t; typedef INT32 int32_t; #endif /* */ /* All other Posix platforms use stdint.h */ #else /* */ #include #endif /* */ /* DNSServiceRef, DNSRecordRef * * Opaque internal data types. * Note: client is responsible for serializing access to these structures if * they are shared between concurrent threads. */ typedef struct _DNSServiceRef_t *DNSServiceRef; typedef struct _DNSRecordRef_t *DNSRecordRef; /* General flags used in functions defined below */ enum { kDNSServiceFlagsMoreComing = 0x1, /* MoreComing indicates to a callback that at least one more result is * queued and will be delivered following immediately after this one. * Applications should not update their UI to display browse * results when the MoreComing flag is set, because this would * result in a great deal of ugly flickering on the screen. * Applications should instead wait until until MoreComing is not set, * and then update their UI. * When MoreComing is not set, that doesn't mean there will be no more * answers EVER, just that there are no more answers immediately * available right now at this instant. If more answers become available * in the future they will be delivered as usual. */ kDNSServiceFlagsAdd = 0x2, kDNSServiceFlagsDefault = 0x4, /* Flags for domain enumeration and browse/query reply callbacks. * "Default" applies only to enumeration and is only valid in * conjuction with "Add". An enumeration callback with the "Add" * flag NOT set indicates a "Remove", i.e. the domain is no longer * valid. */ kDNSServiceFlagsNoAutoRename = 0x8, /* Flag for specifying renaming behavior on name conflict when registering * non-shared records. By default, name conflicts are automatically handled * by renaming the service. NoAutoRename overrides this behavior - with this * flag set, name conflicts will result in a callback. The NoAutorename flag * is only valid if a name is explicitly specified when registering a service * (i.e. the default name is not used.) */ kDNSServiceFlagsShared = 0x10, kDNSServiceFlagsUnique = 0x20, /* Flag for registering individual records on a connected * DNSServiceRef. Shared indicates that there may be multiple records * with this name on the network (e.g. PTR records). Unique indicates that the * record's name is to be unique on the network (e.g. SRV records). */ kDNSServiceFlagsBrowseDomains = 0x40, kDNSServiceFlagsRegistrationDomains = 0x80, /* Flags for specifying domain enumeration type in DNSServiceEnumerateDomains. * BrowseDomains enumerates domains recommended for browsing, RegistrationDomains * enumerates domains recommended for registration. */ kDNSServiceFlagsLongLivedQuery = 0x100, /* Flag for creating a long-lived unicast query for the DNSServiceQueryRecord call. */ kDNSServiceFlagsAllowRemoteQuery = 0x200, /* Flag for creating a record for which we will answer remote queries * (queries from hosts more than one hop away; hosts not directly connected to the local link). */ kDNSServiceFlagsForceMulticast = 0x400 /* Flag for signifying that a query or registration should be performed exclusively via multicast DNS, * even for a name in a domain (e.g. foo.apple.com.) that would normally imply unicast DNS. */ }; /* * The values for DNS Classes and Types are listed in RFC 1035, and are available * on every OS in its DNS header file. Unfortunately every OS does not have the * same header file containing DNS Class and Type constants, and the names of * the constants are not consistent. For example, BIND 8 uses "T_A", * BIND 9 uses "ns_t_a", Windows uses "DNS_TYPE_A", etc. * For this reason, these constants are also listed here, so that code using * the DNS-SD programming APIs can use these constants, so that the same code * can compile on all our supported platforms. */ enum { kDNSServiceClass_IN = 1 /* Internet */ }; enum { kDNSServiceType_A = 1, /* Host address. */ kDNSServiceType_NS = 2, /* Authoritative server. */ kDNSServiceType_MD = 3, /* Mail destination. */ kDNSServiceType_MF = 4, /* Mail forwarder. */ kDNSServiceType_CNAME = 5, /* Canonical name. */ kDNSServiceType_SOA = 6, /* Start of authority zone. */ kDNSServiceType_MB = 7, /* Mailbox domain name. */ kDNSServiceType_MG = 8, /* Mail group member. */ kDNSServiceType_MR = 9, /* Mail rename name. */ kDNSServiceType_NULL = 10, /* Null resource record. */ kDNSServiceType_WKS = 11, /* Well known service. */ kDNSServiceType_PTR = 12, /* Domain name pointer. */ kDNSServiceType_HINFO = 13, /* Host information. */ kDNSServiceType_MINFO = 14, /* Mailbox information. */ kDNSServiceType_MX = 15, /* Mail routing information. */ kDNSServiceType_TXT = 16, /* One or more text strings. */ kDNSServiceType_RP = 17, /* Responsible person. */ kDNSServiceType_AFSDB = 18, /* AFS cell database. */ kDNSServiceType_X25 = 19, /* X_25 calling address. */ kDNSServiceType_ISDN = 20, /* ISDN calling address. */ kDNSServiceType_RT = 21, /* Router. */ kDNSServiceType_NSAP = 22, /* NSAP address. */ kDNSServiceType_NSAP_PTR = 23, /* Reverse NSAP lookup (deprecated). */ kDNSServiceType_SIG = 24, /* Security signature. */ kDNSServiceType_KEY = 25, /* Security key. */ kDNSServiceType_PX = 26, /* X.400 mail mapping. */ kDNSServiceType_GPOS = 27, /* Geographical position (withdrawn). */ kDNSServiceType_AAAA = 28, /* Ip6 Address. */ kDNSServiceType_LOC = 29, /* Location Information. */ kDNSServiceType_NXT = 30, /* Next domain (security). */ kDNSServiceType_EID = 31, /* Endpoint identifier. */ kDNSServiceType_NIMLOC = 32, /* Nimrod Locator. */ kDNSServiceType_SRV = 33, /* Server Selection. */ kDNSServiceType_ATMA = 34, /* ATM Address */ kDNSServiceType_NAPTR = 35, /* Naming Authority PoinTeR */ kDNSServiceType_KX = 36, /* Key Exchange */ kDNSServiceType_CERT = 37, /* Certification record */ kDNSServiceType_A6 = 38, /* IPv6 address (deprecates AAAA) */ kDNSServiceType_DNAME = 39, /* Non-terminal DNAME (for IPv6) */ kDNSServiceType_SINK = 40, /* Kitchen sink (experimentatl) */ kDNSServiceType_OPT = 41, /* EDNS0 option (meta-RR) */ kDNSServiceType_TKEY = 249, /* Transaction key */ kDNSServiceType_TSIG = 250, /* Transaction signature. */ kDNSServiceType_IXFR = 251, /* Incremental zone transfer. */ kDNSServiceType_AXFR = 252, /* Transfer zone of authority. */ kDNSServiceType_MAILB = 253, /* Transfer mailbox records. */ kDNSServiceType_MAILA = 254, /* Transfer mail agent records. */ kDNSServiceType_ANY = 255 /* Wildcard match. */ }; /* possible error code values */ enum { kDNSServiceErr_NoError = 0, kDNSServiceErr_Unknown = -65537, /* 0xFFFE FFFF */ kDNSServiceErr_NoSuchName = -65538, kDNSServiceErr_NoMemory = -65539, kDNSServiceErr_BadParam = -65540, kDNSServiceErr_BadReference = -65541, kDNSServiceErr_BadState = -65542, kDNSServiceErr_BadFlags = -65543, kDNSServiceErr_Unsupported = -65544, kDNSServiceErr_NotInitialized = -65545, kDNSServiceErr_AlreadyRegistered = -65547, kDNSServiceErr_NameConflict = -65548, kDNSServiceErr_Invalid = -65549, kDNSServiceErr_Firewall = -65550, kDNSServiceErr_Incompatible = -65551, /* client library incompatible with daemon */ kDNSServiceErr_BadInterfaceIndex = -65552, kDNSServiceErr_Refused = -65553, kDNSServiceErr_NoSuchRecord = -65554, kDNSServiceErr_NoAuth = -65555, kDNSServiceErr_NoSuchKey = -65556, kDNSServiceErr_NATTraversal = -65557, kDNSServiceErr_DoubleNAT = -65558, kDNSServiceErr_BadTime = -65559 /* mDNS Error codes are in the range * FFFE FF00 (-65792) to FFFE FFFF (-65537) */ }; /* Maximum length, in bytes, of a service name represented as a */ /* literal C-String, including the terminating NULL at the end. */ #define kDNSServiceMaxServiceName 64 /* Maximum length, in bytes, of a domain name represented as an *escaped* C-String */ /* including the final trailing dot, and the C-String terminating NULL at the end. */ #define kDNSServiceMaxDomainName 1005 /* * Notes on DNS Name Escaping * -- or -- * "Why is kDNSServiceMaxDomainName 1005, when the maximum legal domain name is 255 bytes?" * * All strings used in DNS-SD are UTF-8 strings. * With few exceptions, most are also escaped using standard DNS escaping rules: * * '\\' represents a single literal '\' in the name * '\.' represents a single literal '.' in the name * '\ddd', where ddd is a three-digit decimal value from 000 to 255, * represents a single literal byte with that value. * A bare unescaped '.' is a label separator, marking a boundary between domain and subdomain. * * The exceptions, that do not use escaping, are the routines where the full * DNS name of a resource is broken, for convenience, into servicename/regtype/domain. * In these routines, the "servicename" is NOT escaped. It does not need to be, since * it is, by definition, just a single literal string. Any characters in that string * represent exactly what they are. The "regtype" portion is, technically speaking, * escaped, but since legal regtypes are only allowed to contain letters, digits, * and hyphens, there is nothing to escape, so the issue is moot. The "domain" * portion is also escaped, though most domains in use on the public Internet * today, like regtypes, don't contain any characters that need to be escaped. * As DNS-SD becomes more popular, rich-text domains for service discovery will * become common, so software should be written to cope with domains with escaping. * * The servicename may be up to 63 bytes of UTF-8 text (not counting the C-String * terminating NULL at the end). The regtype is of the form _service._tcp or * _service._udp, where the "service" part is 1-14 characters, which may be * letters, digits, or hyphens. The domain part of the three-part name may be * any legal domain, providing that the resulting servicename+regtype+domain * name does not exceed 255 bytes. * * For most software, these issues are transparent. When browsing, the discovered * servicenames should simply be displayed as-is. When resolving, the discovered * servicename/regtype/domain are simply passed unchanged to DNSServiceResolve(). * When a DNSServiceResolve() succeeds, the returned fullname is already in * the correct format to pass to standard system DNS APIs such as res_query(). * For converting from servicename/regtype/domain to a single properly-escaped * full DNS name, the helper function DNSServiceConstructFullName() is provided. * * The following (highly contrived) example illustrates the escaping process. * Suppose you have an service called "Dr. Smith\Dr. Johnson", of type "_ftp._tcp" * in subdomain "4th. Floor" of subdomain "Building 2" of domain "apple.com." * The full (escaped) DNS name of this service's SRV record would be: * Dr\.\032Smith\\Dr\.\032Johnson._ftp._tcp.4th\.\032Floor.Building\0322.apple.com. */ /* * Constants for specifying an interface index * * Specific interface indexes are identified via a 32-bit unsigned integer returned * by the if_nametoindex() family of calls. * * If the client passes 0 for interface index, that means "do the right thing", * which (at present) means, "if the name is in an mDNS local multicast domain * (e.g. 'local.', '254.169.in-addr.arpa.', '0.8.E.F.ip6.arpa.') then multicast * on all applicable interfaces, otherwise send via unicast to the appropriate * DNS server." Normally, most clients will use 0 for interface index to * automatically get the default sensible behaviour. * * If the client passes a positive interface index, then for multicast names that * indicates to do the operation only on that one interface. For unicast names the * interface index is ignored unless kDNSServiceFlagsForceMulticast is also set. * * If the client passes kDNSServiceInterfaceIndexLocalOnly when registering * a service, then that service will be found *only* by other local clients * on the same machine that are browsing using kDNSServiceInterfaceIndexLocalOnly * or kDNSServiceInterfaceIndexAny. * If a client has a 'private' service, accessible only to other processes * running on the same machine, this allows the client to advertise that service * in a way such that it does not inadvertently appear in service lists on * all the other machines on the network. * * If the client passes kDNSServiceInterfaceIndexLocalOnly when browsing * then it will find *all* records registered on that same local machine. * Clients explicitly wishing to discover *only* LocalOnly services can * accomplish this by inspecting the interfaceIndex of each service reported * to their DNSServiceBrowseReply() callback function, and discarding those * where the interface index is not kDNSServiceInterfaceIndexLocalOnly. */ #define kDNSServiceInterfaceIndexAny 0 #define kDNSServiceInterfaceIndexLocalOnly ( (uint32_t) -1 ) typedef uint32_t DNSServiceFlags; typedef int32_t DNSServiceErrorType; /********************************************************************************************* * * Unix Domain Socket access, DNSServiceRef deallocation, and data processing functions * *********************************************************************************************/ /* DNSServiceRefSockFD() * * Access underlying Unix domain socket for an initialized DNSServiceRef. * The DNS Service Discovery implmementation uses this socket to communicate between * the client and the mDNSResponder daemon. The application MUST NOT directly read from * or write to this socket. Access to the socket is provided so that it can be used as a * run loop source, or in a select() loop: when data is available for reading on the socket, * DNSServiceProcessResult() should be called, which will extract the daemon's reply from * the socket, and pass it to the appropriate application callback. By using a run loop or * select(), results from the daemon can be processed asynchronously. Without using these * constructs, DNSServiceProcessResult() will block until the response from the daemon arrives. * The client is responsible for ensuring that the data on the socket is processed in a timely * fashion - the daemon may terminate its connection with a client that does not clear its * socket buffer. * * sdRef: A DNSServiceRef initialized by any of the DNSService calls. * * return value: The DNSServiceRef's underlying socket descriptor, or -1 on * error. */ #if ORIGINAL_DNSSD_INCLUDE int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdRef); #else /* */ typedef int DNSSD_API(*_DNSServiceRefSockFD) (DNSServiceRef sdRef); extern _DNSServiceRefSockFD DNSServiceRefSockFD; #endif /* */ /* DNSServiceProcessResult() * * Read a reply from the daemon, calling the appropriate application callback. This call will * block until the daemon's response is received. Use DNSServiceRefSockFD() in * conjunction with a run loop or select() to determine the presence of a response from the * server before calling this function to process the reply without blocking. Call this function * at any point if it is acceptable to block until the daemon's response arrives. Note that the * client is responsible for ensuring that DNSServiceProcessResult() is called whenever there is * a reply from the daemon - the daemon may terminate its connection with a client that does not * process the daemon's responses. * * sdRef: A DNSServiceRef initialized by any of the DNSService calls * that take a callback parameter. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns * an error code indicating the specific failure that occurred. */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdRef); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceProcessResult) (DNSServiceRef sdRef); extern _DNSServiceProcessResult DNSServiceProcessResult; #endif /* */ /* DNSServiceRefDeallocate() * * Terminate a connection with the daemon and free memory associated with the DNSServiceRef. * Any services or records registered with this DNSServiceRef will be deregistered. Any * Browse, Resolve, or Query operations called with this reference will be terminated. * * Note: If the reference's underlying socket is used in a run loop or select() call, it should * be removed BEFORE DNSServiceRefDeallocate() is called, as this function closes the reference's * socket. * * Note: If the reference was initialized with DNSServiceCreateConnection(), any DNSRecordRefs * created via this reference will be invalidated by this call - the resource records are * deregistered, and their DNSRecordRefs may not be used in subsequent functions. Similarly, * if the reference was initialized with DNSServiceRegister, and an extra resource record was * added to the service via DNSServiceAddRecord(), the DNSRecordRef created by the Add() call * is invalidated when this function is called - the DNSRecordRef may not be used in subsequent * functions. * * Note: This call is to be used only with the DNSServiceRef defined by this API. It is * not compatible with dns_service_discovery_ref objects defined in the legacy Mach-based * DNSServiceDiscovery.h API. * * sdRef: A DNSServiceRef initialized by any of the DNSService calls. * */ #if ORIGINAL_DNSSD_INCLUDE void DNSSD_API DNSServiceRefDeallocate(DNSServiceRef sdRef); #else /* */ typedef void DNSSD_API(*_DNSServiceRefDeallocate) (DNSServiceRef sdRef); extern _DNSServiceRefDeallocate DNSServiceRefDeallocate; #endif /* */ /********************************************************************************************* * * Domain Enumeration * *********************************************************************************************/ /* DNSServiceEnumerateDomains() * * Asynchronously enumerate domains available for browsing and registration. * * The enumeration MUST be cancelled via DNSServiceRefDeallocate() when no more domains * are to be found. * * Note that the names returned are (like all of DNS-SD) UTF-8 strings, * and are escaped using standard DNS escaping rules. * (See "Notes on DNS Name Escaping" earlier in this file for more details.) * A graphical browser displaying a hierarchical tree-structured view should cut * the names at the bare dots to yield individual labels, then de-escape each * label according to the escaping rules, and then display the resulting UTF-8 text. * * DNSServiceDomainEnumReply Callback Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceEnumerateDomains(). * * flags: Possible values are: * kDNSServiceFlagsMoreComing * kDNSServiceFlagsAdd * kDNSServiceFlagsDefault * * interfaceIndex: Specifies the interface on which the domain exists. (The index for a given * interface is determined via the if_nametoindex() family of calls.) * * errorCode: Will be kDNSServiceErr_NoError (0) on success, otherwise indicates * the failure that occurred (other parameters are undefined if errorCode is nonzero). * * replyDomain: The name of the domain. * * context: The context pointer passed to DNSServiceEnumerateDomains. * */ typedef void (DNSSD_API * DNSServiceDomainEnumReply) ( DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *replyDomain, void *context ); /* DNSServiceEnumerateDomains() Parameters: * * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the enumeration operation will run indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * flags: Possible values are: * kDNSServiceFlagsBrowseDomains to enumerate domains recommended for browsing. * kDNSServiceFlagsRegistrationDomains to enumerate domains recommended * for registration. * * interfaceIndex: If non-zero, specifies the interface on which to look for domains. * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Most applications will pass 0 to enumerate domains on * all interfaces. See "Constants for specifying an interface index" for more details. * * callBack: The function to be called when a domain is found or the call asynchronously * fails. * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is not invoked and the DNSServiceRef * is not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceEnumerateDomains ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceDomainEnumReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceEnumerateDomains) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceDomainEnumReply callBack, void *context /* may be NULL */ ); extern _DNSServiceEnumerateDomains DNSServiceEnumerateDomains; #endif /* */ /********************************************************************************************* * * Service Registration * *********************************************************************************************/ /* Register a service that is discovered via Browse() and Resolve() calls. * * * DNSServiceRegisterReply() Callback Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceRegister(). * * flags: Currently unused, reserved for future use. * * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will * indicate the failure that occurred (including name conflicts, * if the kDNSServiceFlagsNoAutoRename flag was used when registering.) * Other parameters are undefined if errorCode is nonzero. * * name: The service name registered (if the application did not specify a name in * DNSServiceRegister(), this indicates what name was automatically chosen). * * regtype: The type of service registered, as it was passed to the callout. * * domain: The domain on which the service was registered (if the application did not * specify a domain in DNSServiceRegister(), this indicates the default domain * on which the service was registered). * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceRegisterReply) ( DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode, const char *name, const char *regtype, const char *domain, void *context ); /* DNSServiceRegister() Parameters: * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the registration will remain active indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * interfaceIndex: If non-zero, specifies the interface on which to register the service * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Most applications will pass 0 to register on all * available interfaces. See "Constants for specifying an interface index" for more details. * * flags: Indicates the renaming behavior on name conflict (most applications * will pass 0). See flag definitions above for details. * * name: If non-NULL, specifies the service name to be registered. * Most applications will not specify a name, in which case the computer * name is used (this name is communicated to the client via the callback). * If a name is specified, it must be 1-63 bytes of UTF-8 text. * If the name is longer than 63 bytes it will be automatically truncated * to a legal length, unless the NoAutoRename flag is set, * in which case kDNSServiceErr_BadParam will be returned. * * regtype: The service type followed by the protocol, separated by a dot * (e.g. "_ftp._tcp"). The service type must be an underscore, followed * by 1-14 characters, which may be letters, digits, or hyphens. * The transport protocol must be "_tcp" or "_udp". New service types * should be registered at . * * domain: If non-NULL, specifies the domain on which to advertise the service. * Most applications will not specify a domain, instead automatically * registering in the default domain(s). * * host: If non-NULL, specifies the SRV target host name. Most applications * will not specify a host, instead automatically using the machine's * default host name(s). Note that specifying a non-NULL host does NOT * create an address record for that host - the application is responsible * for ensuring that the appropriate address record exists, or creating it * via DNSServiceRegisterRecord(). * * port: The port, in network byte order, on which the service accepts connections. * Pass 0 for a "placeholder" service (i.e. a service that will not be discovered * by browsing, but will cause a name conflict if another client tries to * register that same name). Most clients will not use placeholder services. * * txtLen: The length of the txtRecord, in bytes. Must be zero if the txtRecord is NULL. * * txtRecord: The TXT record rdata. A non-NULL txtRecord MUST be a properly formatted DNS * TXT record, i.e. ... * Passing NULL for the txtRecord is allowed as a synonym for txtLen=1, txtRecord="", * i.e. it creates a TXT record of length one containing a single empty string. * RFC 1035 doesn't allow a TXT record to contain *zero* strings, so a single empty * string is the smallest legal DNS TXT record. * * callBack: The function to be called when the registration completes or asynchronously * fails. The client MAY pass NULL for the callback - The client will NOT be notified * of the default values picked on its behalf, and the client will NOT be notified of any * asynchronous errors (e.g. out of memory errors, etc.) that may prevent the registration * of the service. The client may NOT pass the NoAutoRename flag if the callback is NULL. * The client may still deregister the service at any time via DNSServiceRefDeallocate(). * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is never invoked and the DNSServiceRef * is not initialized.) * */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceRegister ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, /* may be NULL */ const char *regtype, const char *domain, /* may be NULL */ const char *host, /* may be NULL */ uint16_t port, uint16_t txtLen, const void *txtRecord, /* may be NULL */ DNSServiceRegisterReply callBack, /* may be NULL */ void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceRegister) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, /* may be NULL */ const char *regtype, const char *domain, /* may be NULL */ const char *host, /* may be NULL */ uint16_t port, uint16_t txtLen, const void *txtRecord, /* may be NULL */ DNSServiceRegisterReply callBack, /* may be NULL */ void *context /* may be NULL */ ); extern _DNSServiceRegister DNSServiceRegister; #endif /* */ /* DNSServiceAddRecord() * * Add a record to a registered service. The name of the record will be the same as the * registered service's name. * The record can later be updated or deregistered by passing the RecordRef initialized * by this function to DNSServiceUpdateRecord() or DNSServiceRemoveRecord(). * * * Parameters; * * sdRef: A DNSServiceRef initialized by DNSServiceRegister(). * * RecordRef: A pointer to an uninitialized DNSRecordRef. Upon succesfull completion of this * call, this ref may be passed to DNSServiceUpdateRecord() or DNSServiceRemoveRecord(). * If the above DNSServiceRef is passed to DNSServiceRefDeallocate(), RecordRef is also * invalidated and may not be used further. * * flags: Currently ignored, reserved for future use. * * rrtype: The type of the record (e.g. kDNSServiceType_TXT, kDNSServiceType_SRV, etc) * * rdlen: The length, in bytes, of the rdata. * * rdata: The raw rdata to be contained in the added resource record. * * ttl: The time to live of the resource record, in seconds. Pass 0 to use a default value. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns an * error code indicating the error that occurred (the RecordRef is not initialized). */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceAddRecord ( DNSServiceRef sdRef, DNSRecordRef * RecordRef, DNSServiceFlags flags, uint16_t rrtype, uint16_t rdlen, const void *rdata, uint32_t ttl ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceAddRecord) ( DNSServiceRef sdRef, DNSRecordRef * RecordRef, DNSServiceFlags flags, uint16_t rrtype, uint16_t rdlen, const void *rdata, uint32_t ttl ); extern _DNSServiceAddRecord DNSServiceAddRecord; #endif /* */ /* DNSServiceUpdateRecord * * Update a registered resource record. The record must either be: * - The primary txt record of a service registered via DNSServiceRegister() * - A record added to a registered service via DNSServiceAddRecord() * - An individual record registered by DNSServiceRegisterRecord() * * * Parameters: * * sdRef: A DNSServiceRef that was initialized by DNSServiceRegister() * or DNSServiceCreateConnection(). * * RecordRef: A DNSRecordRef initialized by DNSServiceAddRecord, or NULL to update the * service's primary txt record. * * flags: Currently ignored, reserved for future use. * * rdlen: The length, in bytes, of the new rdata. * * rdata: The new rdata to be contained in the updated resource record. * * ttl: The time to live of the updated resource record, in seconds. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns an * error code indicating the error that occurred. */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceUpdateRecord ( DNSServiceRef sdRef, DNSRecordRef RecordRef, /* may be NULL */ DNSServiceFlags flags, uint16_t rdlen, const void *rdata, uint32_t ttl ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceUpdateRecord) ( DNSServiceRef sdRef, DNSRecordRef RecordRef, /* may be NULL */ DNSServiceFlags flags, uint16_t rdlen, const void *rdata, uint32_t ttl ); extern _DNSServiceUpdateRecord DNSServiceUpdateRecord; #endif /* */ /* DNSServiceRemoveRecord * * Remove a record previously added to a service record set via DNSServiceAddRecord(), or deregister * an record registered individually via DNSServiceRegisterRecord(). * * Parameters: * * sdRef: A DNSServiceRef initialized by DNSServiceRegister() (if the * record being removed was registered via DNSServiceAddRecord()) or by * DNSServiceCreateConnection() (if the record being removed was registered via * DNSServiceRegisterRecord()). * * recordRef: A DNSRecordRef initialized by a successful call to DNSServiceAddRecord() * or DNSServiceRegisterRecord(). * * flags: Currently ignored, reserved for future use. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns an * error code indicating the error that occurred. */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceRemoveRecord ( DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceRemoveRecord) ( DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags ); extern _DNSServiceRemoveRecord DNSServiceRemoveRecord; #endif /* */ /********************************************************************************************* * * Service Discovery * *********************************************************************************************/ /* Browse for instances of a service. * * * DNSServiceBrowseReply() Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceBrowse(). * * flags: Possible values are kDNSServiceFlagsMoreComing and kDNSServiceFlagsAdd. * See flag definitions for details. * * interfaceIndex: The interface on which the service is advertised. This index should * be passed to DNSServiceResolve() when resolving the service. * * errorCode: Will be kDNSServiceErr_NoError (0) on success, otherwise will * indicate the failure that occurred. Other parameters are undefined if * the errorCode is nonzero. * * serviceName: The discovered service name. This name should be displayed to the user, * and stored for subsequent use in the DNSServiceResolve() call. * * regtype: The service type, which is usually (but not always) the same as was passed * to DNSServiceBrowse(). One case where the discovered service type may * not be the same as the requested service type is when using subtypes: * The client may want to browse for only those ftp servers that allow * anonymous connections. The client will pass the string "_ftp._tcp,_anon" * to DNSServiceBrowse(), but the type of the service that's discovered * is simply "_ftp._tcp". The regtype for each discovered service instance * should be stored along with the name, so that it can be passed to * DNSServiceResolve() when the service is later resolved. * * domain: The domain of the discovered service instance. This may or may not be the * same as the domain that was passed to DNSServiceBrowse(). The domain for each * discovered service instance should be stored along with the name, so that * it can be passed to DNSServiceResolve() when the service is later resolved. * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceBrowseReply) ( DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *serviceName, const char *regtype, const char *replyDomain, void *context ); /* DNSServiceBrowse() Parameters: * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the browse operation will run indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * flags: Currently ignored, reserved for future use. * * interfaceIndex: If non-zero, specifies the interface on which to browse for services * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Most applications will pass 0 to browse on all available * interfaces. See "Constants for specifying an interface index" for more details. * * regtype: The service type being browsed for followed by the protocol, separated by a * dot (e.g. "_ftp._tcp"). The transport protocol must be "_tcp" or "_udp". * * domain: If non-NULL, specifies the domain on which to browse for services. * Most applications will not specify a domain, instead browsing on the * default domain(s). * * callBack: The function to be called when an instance of the service being browsed for * is found, or if the call asynchronously fails. * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is not invoked and the DNSServiceRef * is not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceBrowse ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *regtype, const char *domain, /* may be NULL */ DNSServiceBrowseReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceBrowse) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *regtype, const char *domain, /* may be NULL */ DNSServiceBrowseReply callBack, void *context /* may be NULL */ ); extern _DNSServiceBrowse DNSServiceBrowse; #endif /* */ /* DNSServiceResolve() * * Resolve a service name discovered via DNSServiceBrowse() to a target host name, port number, and * txt record. * * Note: Applications should NOT use DNSServiceResolve() solely for txt record monitoring - use * DNSServiceQueryRecord() instead, as it is more efficient for this task. * * Note: When the desired results have been returned, the client MUST terminate the resolve by calling * DNSServiceRefDeallocate(). * * Note: DNSServiceResolve() behaves correctly for typical services that have a single SRV record * and a single TXT record. To resolve non-standard services with multiple SRV or TXT records, * DNSServiceQueryRecord() should be used. * * DNSServiceResolveReply Callback Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceResolve(). * * flags: Currently unused, reserved for future use. * * interfaceIndex: The interface on which the service was resolved. * * errorCode: Will be kDNSServiceErr_NoError (0) on success, otherwise will * indicate the failure that occurred. Other parameters are undefined if * the errorCode is nonzero. * * fullname: The full service domain name, in the form ... * (This name is escaped following standard DNS rules, making it suitable for * passing to standard system DNS APIs such as res_query(), or to the * special-purpose functions included in this API that take fullname parameters. * See "Notes on DNS Name Escaping" earlier in this file for more details.) * * hosttarget: The target hostname of the machine providing the service. This name can * be passed to functions like gethostbyname() to identify the host's IP address. * * port: The port, in network byte order, on which connections are accepted for this service. * * txtLen: The length of the txt record, in bytes. * * txtRecord: The service's primary txt record, in standard txt record format. * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceResolveReply) ( DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *fullname, const char *hosttarget, uint16_t port, uint16_t txtLen, const char *txtRecord, void *context ); /* DNSServiceResolve() Parameters * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the resolve operation will run indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * flags: Currently ignored, reserved for future use. * * interfaceIndex: The interface on which to resolve the service. If this resolve call is * as a result of a currently active DNSServiceBrowse() operation, then the * interfaceIndex should be the index reported in the DNSServiceBrowseReply * callback. If this resolve call is using information previously saved * (e.g. in a preference file) for later use, then use interfaceIndex 0, because * the desired service may now be reachable via a different physical interface. * See "Constants for specifying an interface index" for more details. * * name: The name of the service instance to be resolved, as reported to the * DNSServiceBrowseReply() callback. * * regtype: The type of the service instance to be resolved, as reported to the * DNSServiceBrowseReply() callback. * * domain: The domain of the service instance to be resolved, as reported to the * DNSServiceBrowseReply() callback. * * callBack: The function to be called when a result is found, or if the call * asynchronously fails. * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is never invoked and the DNSServiceRef * is not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceResolve ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, const char *regtype, const char *domain, DNSServiceResolveReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceResolve) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, const char *regtype, const char *domain, DNSServiceResolveReply callBack, void *context /* may be NULL */ ); extern _DNSServiceResolve DNSServiceResolve; #endif /* */ /********************************************************************************************* * * Special Purpose Calls (most applications will not use these) * *********************************************************************************************/ /* DNSServiceCreateConnection() * * Create a connection to the daemon allowing efficient registration of * multiple individual records. * * * Parameters: * * sdRef: A pointer to an uninitialized DNSServiceRef. Deallocating * the reference (via DNSServiceRefDeallocate()) severs the * connection and deregisters all records registered on this connection. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns * an error code indicating the specific failure that occurred (in which * case the DNSServiceRef is not initialized). */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceCreateConnection(DNSServiceRef * sdRef); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceCreateConnection) (DNSServiceRef * sdRef); extern _DNSServiceCreateConnection DNSServiceCreateConnection; #endif /* */ /* DNSServiceRegisterRecord * * Register an individual resource record on a connected DNSServiceRef. * * Note that name conflicts occurring for records registered via this call must be handled * by the client in the callback. * * * DNSServiceRegisterRecordReply() parameters: * * sdRef: The connected DNSServiceRef initialized by * DNSServiceDiscoveryConnect(). * * RecordRef: The DNSRecordRef initialized by DNSServiceRegisterRecord(). If the above * DNSServiceRef is passed to DNSServiceRefDeallocate(), this DNSRecordRef is * invalidated, and may not be used further. * * flags: Currently unused, reserved for future use. * * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will * indicate the failure that occurred (including name conflicts.) * Other parameters are undefined if errorCode is nonzero. * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceRegisterRecordReply) ( DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags, DNSServiceErrorType errorCode, void *context ); /* DNSServiceRegisterRecord() Parameters: * * sdRef: A DNSServiceRef initialized by DNSServiceCreateConnection(). * * RecordRef: A pointer to an uninitialized DNSRecordRef. Upon succesfull completion of this * call, this ref may be passed to DNSServiceUpdateRecord() or DNSServiceRemoveRecord(). * (To deregister ALL records registered on a single connected DNSServiceRef * and deallocate each of their corresponding DNSServiceRecordRefs, call * DNSServiceRefDealloocate()). * * flags: Possible values are kDNSServiceFlagsShared or kDNSServiceFlagsUnique * (see flag type definitions for details). * * interfaceIndex: If non-zero, specifies the interface on which to register the record * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Passing 0 causes the record to be registered on all interfaces. * See "Constants for specifying an interface index" for more details. * * fullname: The full domain name of the resource record. * * rrtype: The numerical type of the resource record (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) * * rrclass: The class of the resource record (usually kDNSServiceClass_IN) * * rdlen: Length, in bytes, of the rdata. * * rdata: A pointer to the raw rdata, as it is to appear in the DNS record. * * ttl: The time to live of the resource record, in seconds. Pass 0 to use a default value. * * callBack: The function to be called when a result is found, or if the call * asynchronously fails (e.g. because of a name conflict.) * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is never invoked and the DNSRecordRef is * not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceRegisterRecord ( DNSServiceRef sdRef, DNSRecordRef * RecordRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, DNSServiceRegisterRecordReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceRegisterRecord) ( DNSServiceRef sdRef, DNSRecordRef * RecordRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, DNSServiceRegisterRecordReply callBack, void *context /* may be NULL */ ); extern _DNSServiceRegisterRecord DNSServiceRegisterRecord; #endif /* */ /* DNSServiceQueryRecord * * Query for an arbitrary DNS record. * * * DNSServiceQueryRecordReply() Callback Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceQueryRecord(). * * flags: Possible values are kDNSServiceFlagsMoreComing and * kDNSServiceFlagsAdd. The Add flag is NOT set for PTR records * with a ttl of 0, i.e. "Remove" events. * * interfaceIndex: The interface on which the query was resolved (the index for a given * interface is determined via the if_nametoindex() family of calls). * See "Constants for specifying an interface index" for more details. * * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will * indicate the failure that occurred. Other parameters are undefined if * errorCode is nonzero. * * fullname: The resource record's full domain name. * * rrtype: The resource record's type (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) * * rrclass: The class of the resource record (usually kDNSServiceClass_IN). * * rdlen: The length, in bytes, of the resource record rdata. * * rdata: The raw rdata of the resource record. * * ttl: The resource record's time to live, in seconds. * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceQueryRecordReply) ( DNSServiceRef DNSServiceRef_, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, void *context ); /* DNSServiceQueryRecord() Parameters: * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the query operation will run indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * flags: Pass kDNSServiceFlagsLongLivedQuery to create a "long-lived" unicast * query in a non-local domain. Without setting this flag, unicast queries * will be one-shot - that is, only answers available at the time of the call * will be returned. By setting this flag, answers (including Add and Remove * events) that become available after the initial call is made will generate * callbacks. This flag has no effect on link-local multicast queries. * * interfaceIndex: If non-zero, specifies the interface on which to issue the query * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Passing 0 causes the name to be queried for on all * interfaces. See "Constants for specifying an interface index" for more details. * * fullname: The full domain name of the resource record to be queried for. * * rrtype: The numerical type of the resource record to be queried for * (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) * * rrclass: The class of the resource record (usually kDNSServiceClass_IN). * * callBack: The function to be called when a result is found, or if the call * asynchronously fails. * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is never invoked and the DNSServiceRef * is not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceQueryRecord ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, DNSServiceQueryRecordReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceQueryRecord) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, DNSServiceQueryRecordReply callBack, void *context /* may be NULL */ ); extern _DNSServiceQueryRecord DNSServiceQueryRecord; #endif /* */ /* DNSServiceReconfirmRecord * * Instruct the daemon to verify the validity of a resource record that appears to * be out of date (e.g. because tcp connection to a service's target failed.) * Causes the record to be flushed from the daemon's cache (as well as all other * daemons' caches on the network) if the record is determined to be invalid. * * Parameters: * * flags: Currently unused, reserved for future use. * * interfaceIndex: If non-zero, specifies the interface of the record in question. * Passing 0 causes all instances of this record to be reconfirmed. * * fullname: The resource record's full domain name. * * rrtype: The resource record's type (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) * * rrclass: The class of the resource record (usually kDNSServiceClass_IN). * * rdlen: The length, in bytes, of the resource record rdata. * * rdata: The raw rdata of the resource record. * */ #if ORIGINAL_DNSSD_INCLUDE void DNSSD_API DNSServiceReconfirmRecord ( DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata ); #else /* */ typedef void DNSSD_API(*_DNSServiceReconfirmRecord) ( DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata ); extern _DNSServiceReconfirmRecord DNSServiceReconfirmRecord; #endif /* */ /********************************************************************************************* * * General Utility Functions * *********************************************************************************************/ /* DNSServiceConstructFullName() * * Concatenate a three-part domain name (as returned by the above callbacks) into a * properly-escaped full domain name. Note that callbacks in the above functions ALREADY ESCAPE * strings where necessary. * * Parameters: * * fullName: A pointer to a buffer that where the resulting full domain name is to be written. * The buffer must be kDNSServiceMaxDomainName (1005) bytes in length to * accommodate the longest legal domain name without buffer overrun. * * service: The service name - any dots or backslashes must NOT be escaped. * May be NULL (to construct a PTR record name, e.g. * "_ftp._tcp.apple.com."). * * regtype: The service type followed by the protocol, separated by a dot * (e.g. "_ftp._tcp"). * * domain: The domain name, e.g. "apple.com.". Literal dots or backslashes, * if any, must be escaped, e.g. "1st\. Floor.apple.com." * * return value: Returns 0 on success, -1 on error. * */ #if ORIGINAL_DNSSD_INCLUDE int DNSSD_API DNSServiceConstructFullName ( char *fullName, const char *service, /* may be NULL */ const char *regtype, const char *domain ); #else /* */ typedef int DNSSD_API(*_DNSServiceConstructFullName) ( char *fullName, const char *service, /* may be NULL */ const char *regtype, const char *domain ); extern _DNSServiceConstructFullName DNSServiceConstructFullName; #endif /* */ /********************************************************************************************* * * TXT Record Construction Functions * *********************************************************************************************/ /* * A typical calling sequence for TXT record construction is something like: * * Client allocates storage for TXTRecord data (e.g. declare buffer on the stack) * TXTRecordCreate(); * TXTRecordSetValue(); * TXTRecordSetValue(); * TXTRecordSetValue(); * ... * DNSServiceRegister( ... TXTRecordGetLength(), TXTRecordGetBytesPtr() ... ); * TXTRecordDeallocate(); * Explicitly deallocate storage for TXTRecord data (if not allocated on the stack) */ /* TXTRecordRef * * Opaque internal data type. * Note: Represents a DNS-SD TXT record. */ typedef union _TXTRecordRef_t { char PrivateData[16]; char *ForceNaturalAlignment; } TXTRecordRef; /* TXTRecordCreate() * * Creates a new empty TXTRecordRef referencing the specified storage. * * If the buffer parameter is NULL, or the specified storage size is not * large enough to hold a key subsequently added using TXTRecordSetValue(), * then additional memory will be added as needed using malloc(). * * On some platforms, when memory is low, malloc() may fail. In this * case, TXTRecordSetValue() will return kDNSServiceErr_NoMemory, and this * error condition will need to be handled as appropriate by the caller. * * You can avoid the need to handle this error condition if you ensure * that the storage you initially provide is large enough to hold all * the key/value pairs that are to be added to the record. * The caller can precompute the exact length required for all of the * key/value pairs to be added, or simply provide a fixed-sized buffer * known in advance to be large enough. * A no-value (key-only) key requires (1 + key length) bytes. * A key with empty value requires (1 + key length + 1) bytes. * A key with non-empty value requires (1 + key length + 1 + value length). * For most applications, DNS-SD TXT records are generally * less than 100 bytes, so in most cases a simple fixed-sized * 256-byte buffer will be more than sufficient. * Recommended size limits for DNS-SD TXT Records are discussed in * * * Note: When passing parameters to and from these TXT record APIs, * the key name does not include the '=' character. The '=' character * is the separator between the key and value in the on-the-wire * packet format; it is not part of either the key or the value. * * txtRecord: A pointer to an uninitialized TXTRecordRef. * * bufferLen: The size of the storage provided in the "buffer" parameter. * * buffer: Optional caller-supplied storage used to hold the TXTRecord data. * This storage must remain valid for as long as * the TXTRecordRef. */ void DNSSD_API TXTRecordCreate ( TXTRecordRef * txtRecord, uint16_t bufferLen, void *buffer ); /* TXTRecordDeallocate() * * Releases any resources allocated in the course of preparing a TXT Record * using TXTRecordCreate()/TXTRecordSetValue()/TXTRecordRemoveValue(). * Ownership of the buffer provided in TXTRecordCreate() returns to the client. * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * */ void DNSSD_API TXTRecordDeallocate ( TXTRecordRef * txtRecord ); /* TXTRecordSetValue() * * Adds a key (optionally with value) to a TXTRecordRef. If the "key" already * exists in the TXTRecordRef, then the current value will be replaced with * the new value. * Keys may exist in four states with respect to a given TXT record: * - Absent (key does not appear at all) * - Present with no value ("key" appears alone) * - Present with empty value ("key=" appears in TXT record) * - Present with non-empty value ("key=value" appears in TXT record) * For more details refer to "Data Syntax for DNS-SD TXT Records" in * * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * * key: A null-terminated string which only contains printable ASCII * values (0x20-0x7E), excluding '=' (0x3D). Keys should be * 8 characters or less (not counting the terminating null). * * valueSize: The size of the value. * * value: Any binary value. For values that represent * textual data, UTF-8 is STRONGLY recommended. * For values that represent textual data, valueSize * should NOT include the terminating null (if any) * at the end of the string. * If NULL, then "key" will be added with no value. * If non-NULL but valueSize is zero, then "key=" will be * added with empty value. * * return value: Returns kDNSServiceErr_NoError on success. * Returns kDNSServiceErr_Invalid if the "key" string contains * illegal characters. * Returns kDNSServiceErr_NoMemory if adding this key would * exceed the available storage. */ DNSServiceErrorType DNSSD_API TXTRecordSetValue ( TXTRecordRef * txtRecord, const char *key, uint8_t valueSize, /* may be zero */ const void *value /* may be NULL */ ); /* TXTRecordRemoveValue() * * Removes a key from a TXTRecordRef. The "key" must be an * ASCII string which exists in the TXTRecordRef. * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * * key: A key name which exists in the TXTRecordRef. * * return value: Returns kDNSServiceErr_NoError on success. * Returns kDNSServiceErr_NoSuchKey if the "key" does not * exist in the TXTRecordRef. * */ DNSServiceErrorType DNSSD_API TXTRecordRemoveValue ( TXTRecordRef * txtRecord, const char *key ); /* TXTRecordGetLength() * * Allows you to determine the length of the raw bytes within a TXTRecordRef. * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * * return value: Returns the size of the raw bytes inside a TXTRecordRef * which you can pass directly to DNSServiceRegister() or * to DNSServiceUpdateRecord(). * Returns 0 if the TXTRecordRef is empty. * */ uint16_t DNSSD_API TXTRecordGetLength ( const TXTRecordRef * txtRecord ); /* TXTRecordGetBytesPtr() * * Allows you to retrieve a pointer to the raw bytes within a TXTRecordRef. * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * * return value: Returns a pointer to the raw bytes inside the TXTRecordRef * which you can pass directly to DNSServiceRegister() or * to DNSServiceUpdateRecord(). * */ const void *DNSSD_API TXTRecordGetBytesPtr ( const TXTRecordRef * txtRecord ); /********************************************************************************************* * * TXT Record Parsing Functions * *********************************************************************************************/ /* * A typical calling sequence for TXT record parsing is something like: * * Receive TXT record data in DNSServiceResolve() callback * if (TXTRecordContainsKey(txtLen, txtRecord, "key")) then do something * val1ptr = TXTRecordGetValuePtr(txtLen, txtRecord, "key1", &len1); * val2ptr = TXTRecordGetValuePtr(txtLen, txtRecord, "key2", &len2); * ... * bcopy(val1ptr, myval1, len1); * bcopy(val2ptr, myval2, len2); * ... * return; * * If you wish to retain the values after return from the DNSServiceResolve() * callback, then you need to copy the data to your own storage using bcopy() * or similar, as shown in the example above. * * If for some reason you need to parse a TXT record you built yourself * using the TXT record construction functions above, then you can do * that using TXTRecordGetLength and TXTRecordGetBytesPtr calls: * TXTRecordGetValue(TXTRecordGetLength(x), TXTRecordGetBytesPtr(x), key, &len); * * Most applications only fetch keys they know about from a TXT record and * ignore the rest. * However, some debugging tools wish to fetch and display all keys. * To do that, use the TXTRecordGetCount() and TXTRecordGetItemAtIndex() calls. */ /* TXTRecordContainsKey() * * Allows you to determine if a given TXT Record contains a specified key. * * txtLen: The size of the received TXT Record. * * txtRecord: Pointer to the received TXT Record bytes. * * key: A null-terminated ASCII string containing the key name. * * return value: Returns 1 if the TXT Record contains the specified key. * Otherwise, it returns 0. * */ int DNSSD_API TXTRecordContainsKey ( uint16_t txtLen, const void *txtRecord, const char *key ); /* TXTRecordGetValuePtr() * * Allows you to retrieve the value for a given key from a TXT Record. * * txtLen: The size of the received TXT Record * * txtRecord: Pointer to the received TXT Record bytes. * * key: A null-terminated ASCII string containing the key name. * * valueLen: On output, will be set to the size of the "value" data. * * return value: Returns NULL if the key does not exist in this TXT record, * or exists with no value (to differentiate between * these two cases use TXTRecordContainsKey()). * Returns pointer to location within TXT Record bytes * if the key exists with empty or non-empty value. * For empty value, valueLen will be zero. * For non-empty value, valueLen will be length of value data. */ const void *DNSSD_API TXTRecordGetValuePtr ( uint16_t txtLen, const void *txtRecord, const char *key, uint8_t * valueLen ); /* TXTRecordGetCount() * * Returns the number of keys stored in the TXT Record. The count * can be used with TXTRecordGetItemAtIndex() to iterate through the keys. * * txtLen: The size of the received TXT Record. * * txtRecord: Pointer to the received TXT Record bytes. * * return value: Returns the total number of keys in the TXT Record. * */ uint16_t DNSSD_API TXTRecordGetCount ( uint16_t txtLen, const void *txtRecord ); /* TXTRecordGetItemAtIndex() * * Allows you to retrieve a key name and value pointer, given an index into * a TXT Record. Legal index values range from zero to TXTRecordGetCount()-1. * It's also possible to iterate through keys in a TXT record by simply * calling TXTRecordGetItemAtIndex() repeatedly, beginning with index zero * and increasing until TXTRecordGetItemAtIndex() returns kDNSServiceErr_Invalid. * * On return: * For keys with no value, *value is set to NULL and *valueLen is zero. * For keys with empty value, *value is non-NULL and *valueLen is zero. * For keys with non-empty value, *value is non-NULL and *valueLen is non-zero. * * txtLen: The size of the received TXT Record. * * txtRecord: Pointer to the received TXT Record bytes. * * index: An index into the TXT Record. * * keyBufLen: The size of the string buffer being supplied. * * key: A string buffer used to store the key name. * On return, the buffer contains a null-terminated C string * giving the key name. DNS-SD TXT keys are usually * 8 characters or less. To hold the maximum possible * key name, the buffer should be 256 bytes long. * * valueLen: On output, will be set to the size of the "value" data. * * value: On output, *value is set to point to location within TXT * Record bytes that holds the value data. * * return value: Returns kDNSServiceErr_NoError on success. * Returns kDNSServiceErr_NoMemory if keyBufLen is too short. * Returns kDNSServiceErr_Invalid if index is greater than * TXTRecordGetCount()-1. */ DNSServiceErrorType DNSSD_API TXTRecordGetItemAtIndex ( uint16_t txtLen, const void *txtRecord, uint16_t index_, uint16_t keyBufLen, char *key, uint8_t * valueLen, const void **value ); #ifdef __APPLE_API_PRIVATE /* * Mac OS X specific functionality * 3rd party clients of this API should not depend on future support or availability of this routine */ /* DNSServiceSetDefaultDomainForUser() * * Set the default domain for the caller's UID. Future browse and registration * calls by this user that do not specify an explicit domain will browse and * register in this wide-area domain in addition to .local. In addition, this * domain will be returned as a Browse domain via domain enumeration calls. * * * Parameters: * * flags: Pass kDNSServiceFlagsAdd to add a domain for a user. Call without * this flag set to clear a previously added domain. * * domain: The domain to be used for the caller's UID. * * return value: Returns kDNSServiceErr_NoError on succeses, otherwise returns * an error code indicating the error that occurred */ DNSServiceErrorType DNSSD_API DNSServiceSetDefaultDomainForUser ( DNSServiceFlags flags, const char *domain ); #endif //__APPLE_API_PRIVATE // Some C compiler cleverness. We can make the compiler check certain things for us, // and report errors at compile-time if anything is wrong. The usual way to do this would // be to use a run-time "if" statement or the conventional run-time "assert" mechanism, but // then you don't find out what's wrong until you run the software. This way, if the assertion // condition is false, the array size is negative, and the complier complains immediately. struct DNS_SD_CompileTimeAssertionChecks { char assert0[(sizeof(union _TXTRecordRef_t) == 16) ? 1 : -1]; }; #ifdef __cplusplus } #endif /* */ #endif /* _DNS_SD_H */ owfs-3.1p5/module/ownet/c/src/include/ow_functions.h0000644000175000001440000000704312654730021017464 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Cannot stand alone -- part of ow.h but separated for clarity */ #ifndef OW_FUNCTION_H /* tedious wrapper */ #define OW_FUNCTION_H void LockSetup(void); ssize_t tcp_read(int file_descriptor, void *vptr, size_t n, const struct timeval *ptv); int ClientAddr(char *sname, struct connection_in *in); FILE_DESCRIPTOR_OR_ERROR ClientConnect(struct connection_in *in); void FreeClientAddr(struct connection_in *in); void BUS_lock_in(struct connection_in *in); void BUS_unlock_in(struct connection_in *in); #endif /* OW_FUNCTION_H */ owfs-3.1p5/module/ownet/c/src/include/ow_global.h0000644000175000001440000000546312654730021016720 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* CAnn stand alone -- separated out of ow.h for clarity */ #ifndef OW_GLOBAL_H /* tedious wrapper */ #define OW_GLOBAL_H /* Globals information (for local control) */ struct global { #if OW_ZERO DNSServiceRef browse; #endif ASCII *progname; struct antiloop Token; int error_level; int readonly; }; extern struct global Globals; #endif /* OW_GLOBAL_H */ owfs-3.1p5/module/ownet/c/src/include/ow.h0000644000175000001440000001363012665167763015416 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 libownet: GPL v2 or MIT where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ #ifndef OW_H /* tedious wrapper */ #define OW_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif // Define this to avoid some VALGRIND warnings... (just for testing) // Warning: This will partially remove the multithreaded support since ow_net.c // will wait for a thread to complete before executing a new one. //#define VALGRIND 1 #define _FILE_OFFSET_BITS 64 #ifdef __CYGWIN__ #define __BSD_VISIBLE 1 /* for strep and u_int */ #include /* for anything select on newer cygwin */ #endif /* __CYGWIN__ */ #ifdef HAVE_FEATURES_H #include #endif /* HAVE_FEATURES_H */ #ifdef HAVE_FEATURE_TESTS_H #include #endif /* HAVE_FEATURE_TESTS_H */ #ifdef HAVE_SYS_STAT_H #include /* for stat */ #endif /* HAVE_SYS_STAT_H */ #ifdef HAVE_SYS_TYPES_H #include /* for stat */ #endif /* HAVE_SYS_TYPES_H */ #include /* for times */ #include #include #include #include #ifdef __APPLE__ #include /* for strcasecmp */ #endif /* __APPLE__ */ #include #include #ifdef HAVE_STDINT_H #include /* for bit twiddling */ #if OW_CYGWIN #define _MSL_STDINT_H #endif /* OW_CYGWIN */ #endif /* HAVE_STDINT_H */ #include #include #ifndef __USE_XOPEN #define __USE_XOPEN /* for strptime fuction */ #include #undef __USE_XOPEN /* for strptime fuction */ #else /* __USE_XOPEN */ #include #endif /* __USE_XOPEN */ #include #include #include #ifdef HAVE_GETOPT_H #include /* for long options */ #endif /* HAVE_GETOPT_H */ #include #include /* for gettimeofday */ #ifdef HAVE_SYS_SOCKET_H #include #endif /* HAVE_SYS_SOCKET_H */ #ifdef HAVE_NETINET_IN_H #include #endif /* HAVE_NETINET_IN_H */ #include /* addrinfo */ #ifdef HAVE_SYS_MKDEV_H #include /* for major() */ #endif /* HAVE_SYS_MKDEV_H */ /* Can't include search.h when compiling owperl on Fedora Core 1. */ #ifndef SKIP_SEARCH_H #ifndef __USE_GNU #define __USE_GNU #include #undef __USE_GNU #else /* __USE_GNU */ #include #endif /* __USE_GNU */ #endif /* SKIP_SEARCH_H */ /* Parport enabled uses two flags (one a holdover from the embedded work) */ #ifdef USE_NO_PARPORT #undef OW_PARPORT #endif /* USE_NO_PARPORT */ #if OW_ZERO /* Zeroconf / Bonjour */ #include "ow_dl.h" #include "ow_dnssd.h" #endif /* OW_ZERO */ /* Include some compatibility functions */ #include "compat.h" /* Debugging and error messages separated out for readability */ #include "ow_debug.h" #ifndef PATH_MAX #define PATH_MAX 2048 #endif /* Some errnos are not defined for MacOSX and gcc3.3 */ #ifndef EBADMSG #define EBADMSG ENOMSG #endif /* EBADMSG */ #ifndef EPROTO #define EPROTO EIO #endif /* EPROTO */ /* File descriptors */ typedef int FILE_DESCRIPTOR_OR_ERROR ; #define FILE_DESCRIPTOR_BAD -1 #define FILE_DESCRIPTOR_PERSISTENT_IN_USE -2 /* Define our understanding of integers, floats, ... */ #include "ow_localtypes.h" /* Directory blob (strings) separated out for readability */ #include "ow_charblob.h" /* Many mutexes separated out for readability */ #include "rwlock.h" #include "ow_mutexes.h" /* OW -- One Wire Globals variables -- each invokation will have it's own data */ /* Several different structures: device -- one for each type of 1-wire device filetype -- one for each type of file parsedname -- translates a path into usable form */ /* --------------------------------------------------------- */ /* Filetypes -- directory entries for each 1-wire chip found */ /* predeclare connection_in/out */ struct connection_in; /* Exposed connection info */ extern int count_inbound_connections; /* Maximum length of a file or directory name, and extension */ #define OW_NAME_MAX (32) #define OW_EXT_MAX (6) #define OW_FULLNAME_MAX (OW_NAME_MAX+OW_EXT_MAX) #define OW_DEFAULT_LENGTH (128) /* device display format */ enum deviceformat { fdi, fi, fdidc, fdic, fidc, fic }; void SetSignals(void); /* Temperature scale handling */ #include "ow_temperature.h" /* Pressure scale handling */ #include "ow_pressure.h" /* OWSERVER messages */ #include "ow_message.h" /* Globals information (for local control) */ /* Separated out into ow_global.h for readability */ #include "ow_global.h" /* Prototypes */ /* Separated out to ow_functions.h for clarity */ #include "ow_functions.h" #endif /* OW_H */ owfs-3.1p5/module/ownet/c/src/include/ow_localtypes.h0000644000175000001440000000701512654730021017632 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_LOCALTYPES_H /* tedious wrapper */ #define OW_LOCALTYPES_H #include /* Floating point */ /* I hate to do this, making everything a double */ /* The compiler complains mercilessly, however */ /* 1-wire really is low precision -- float is more than enough */ /* FLOAT and DATE collides with cygwin windows include-files. */ typedef double _FLOAT; typedef time_t _DATE; typedef unsigned char BYTE; typedef char ASCII; typedef unsigned int UINT; typedef int INT; #endif /* OW_LOCALTYPES_H */ owfs-3.1p5/module/ownet/c/src/include/ow_message.h0000644000175000001440000000456112654730021017102 00000000000000/* $Id$ Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ /* definitions and stuctures for the owserver messages */ /* This file doesn't stand alone, it must be included in ow.h */ #ifndef OW_MESSAGE_H /* tedious wrapper */ #define OW_MESSAGE_H /* Unique token for owserver loop checks */ struct antiloop { BYTE uuid[16]; }; /* Server (Socket-based) interface */ enum msg_classification { msg_error, msg_nop, msg_read, msg_write, msg_dir, msg_size, // No longer used, leave here to compatibility msg_presence, msg_dirall, msg_get, msg_dirallslash, msg_getslash, }; /* message to owserver */ struct server_msg { int32_t version; int32_t payload; int32_t type; int32_t control_flags; int32_t size; int32_t offset; }; /* message to client */ struct client_msg { int32_t version; int32_t payload; int32_t ret; int32_t control_flags; int32_t size; int32_t offset; }; struct serverpackage { const ASCII *path; BYTE *data; size_t datasize; BYTE *tokenstring; size_t tokens; }; // Current version of the protocol #define OWSERVER_PROTOCOL_VERSION 0 // lower 16 bits is token size (only FROM owserver of course) #define Servertokens(tokens) ((tokens)&0xFFFF) #define MakeServertokens(tokens) (tokens) // bit 17 is FROM server flag #define ServermessageMASK (((int32_t)1)<<16) #define MakeServermessage ServermessageMASK #define isServermessage(version) (((version) & ServermessageMASK) == ServermessageMASK) //owserver protocol #define ServerprotocolMASK ((0xFF)<<17) #define Serverprotocol(version) (((version) & ServerprotocolMASK) >> 17 ) #define MakeServerprotocol(protocol) ((protocol) << 17) #endif /* OW_MESSAGE_H */ owfs-3.1p5/module/ownet/c/src/include/ow_mutex.h0000644000175000001440000002562312654730021016622 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Cannot stand alone -- part of ow.h and only separated out for clarity */ #ifndef OW_MUTEX_H /* tedious wrapper */ #define OW_MUTEX_H extern const char mutex_init_failed[]; extern const char mutex_destroy_failed[]; extern const char mutex_lock_failed[]; extern const char mutex_unlock_failed[]; extern const char mutexattr_init_failed[]; extern const char mutexattr_destroy_failed[]; extern const char mutexattr_settype_failed[]; extern const char rwlock_init_failed[]; extern const char rwlock_read_lock_failed[]; extern const char rwlock_read_unlock_failed[]; extern const char cond_timedwait_failed[]; extern const char cond_signal_failed[]; extern const char cond_broadcast_failed[]; extern const char cond_wait_failed[]; extern const char cond_init_failed[]; extern const char cond_destroy_failed[]; extern const char sem_init_failed[]; extern const char sem_post_failed[]; extern const char sem_wait_failed[]; extern const char sem_trywait_failed[]; extern const char sem_timedwait_failed[]; extern const char sem_destroy_failed[]; /* FreeBSD might fail on sem_init() since they are limited per machine */ #define my_sem_init(sem, shared, value) \ do { \ int mrc = sem_init(sem, shared, value); \ if(mrc != 0) { \ FATAL_ERROR(sem_init_failed, mrc, strerror(mrc)); \ } \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("sem_init %lX, %d, %d\n", (unsigned long)sem, shared, value); \ } \ } while(0) #define my_sem_post(sem) \ do { \ int mrc = sem_post(sem); \ if(mrc != 0) { \ FATAL_ERROR(sem_post_failed, mrc, strerror(mrc)); \ } \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("sem_post %lX done", (unsigned long)sem); \ } \ } while(0) #define my_sem_wait(sem) \ do { \ int mrc = sem_wait(sem); \ if(mrc != 0) { \ FATAL_ERROR(sem_wait_failed, mrc, strerror(mrc)); \ } \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("sem_wait %lX done", (unsigned long)sem); \ } \ } while(0) #define my_sem_trywait(sem, res) \ do { \ int mrc = sem_trywait(sem); \ if((mrc < 0) && (errno != EAGAIN)) { \ FATAL_ERROR(sem_trywait_failed, mrc, strerror(mrc)); \ } \ *(res) = mrc; \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("sem_trywait %lX done", (unsigned long)sem); \ } \ } while(0) #define my_sem_timedwait(sem, ts, res) \ do { \ int mrc; \ while(((mrc = sem_timedwait(sem, ts)) == -1) && (errno == EINTR)) { \ continue; /* Restart if interrupted by handler */ \ } \ if((mrc < 0) && (errno != ETIMEDOUT)) { \ FATAL_ERROR(sem_timedwait_failed, mrc, strerror(mrc)); \ } \ *(res) = mrc; /* res=-1 timeout, res=0 succeed */ \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("sem_timedwait %lX done", (unsigned long)sem); \ } \ } while(0) #define my_sem_destroy(sem) \ do { \ int mrc = sem_destroy(sem); \ if(mrc != 0) { \ FATAL_ERROR(sem_destroy_failed, mrc, strerror(mrc)); \ } \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("sem_destroy %lX", (unsigned long)sem); \ } \ } while(0) #define my_pthread_mutex_init(mutex, attr) \ do { \ int mrc; \ if (Globals.error_level>=e_err_debug) { \ LEVEL_DEFAULT("pthread_mutex_init %lX begin", (unsigned long)mutex); \ } \ mrc = pthread_mutex_init(mutex, attr); \ if(mrc != 0) { \ FATAL_ERROR(mutex_init_failed, mrc, strerror(mrc)); \ } \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("pthread_mutex_init %lX done", (unsigned long)mutex); \ } \ } while(0) #define my_pthread_mutex_destroy(mutex) \ do { \ int mrc = pthread_mutex_destroy(mutex); \ if (Globals.error_level>=e_err_debug) { \ LEVEL_DEFAULT("pthread_mutex_destroy %lX begin", (unsigned long)mutex); \ } \ if(mrc != 0) { \ LEVEL_DEFAULT(mutex_destroy_failed, mrc, strerror(mrc)); \ } \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("pthread_mutex_destroy %lX done", (unsigned long)mutex); \ } \ } while(0) #define my_pthread_mutex_lock(mutex) \ do { \ int mrc; \ if (Globals.error_level>=e_err_debug) { \ LEVEL_DEFAULT("pthread_mutex_lock %lX begin", (unsigned long)mutex); \ } \ mrc = pthread_mutex_lock(mutex); \ if(mrc != 0) { \ FATAL_ERROR(mutex_lock_failed, mrc, strerror(mrc)); \ } \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("pthread_mutex_lock %lX done", (unsigned long)mutex); \ } \ } while(0) #define my_pthread_mutex_unlock(mutex) \ do { \ int mrc; \ if (Globals.error_level>=e_err_debug) { \ LEVEL_DEFAULT("pthread_mutex_unlock %lX begin", (unsigned long)mutex); \ } \ mrc = pthread_mutex_unlock(mutex); \ if(mrc != 0) { \ FATAL_ERROR(mutex_unlock_failed, mrc, strerror(mrc)); \ } \ if (Globals.error_level>=10) { \ LEVEL_DEFAULT("pthread_mutex_unlock %lX done", (unsigned long)mutex); \ } \ } while(0) #define my_pthread_mutexattr_init(attr) \ do { \ int mrc = pthread_mutexattr_init(attr); \ if(mrc != 0) { \ FATAL_ERROR(mutexattr_init_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_mutexattr_destroy(attr) \ do { \ int mrc = pthread_mutexattr_destroy(attr); \ if(mrc != 0) { \ FATAL_ERROR(mutexattr_destroy_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_mutexattr_settype(attr, typ) \ do { \ int mrc = pthread_mutexattr_settype(attr, typ); \ if(mrc != 0) { \ FATAL_ERROR(mutexattr_settype_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_timedwait(cond, mutex, abstime) \ do { \ int mrc = pthread_cond_timedwait(cond, mutex, abstime); \ if(mrc != 0) { \ FATAL_ERROR(cond_timedwait_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_wait(cond, mutex) \ do { \ int mrc = pthread_cond_wait(cond, mutex); \ if(mrc != 0) { \ FATAL_ERROR(cond_wait_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_signal(cond) \ do { \ int mrc = pthread_cond_signal(cond); \ if(mrc != 0) { \ FATAL_ERROR(cond_signal_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_broadcast(cond) \ do { \ int mrc = pthread_cond_broadcast(cond); \ if(mrc != 0) { \ FATAL_ERROR(cond_broadcast_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_init(cond, attr) \ do { \ int mrc = pthread_cond_init(cond, attr); \ if(mrc != 0) { \ FATAL_ERROR(cond_init_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_destroy(cond) \ do { \ int mrc = pthread_cond_destroy(cond); \ if(mrc != 0) { \ FATAL_ERROR(cond_destroy_failed, mrc, strerror(mrc)); \ } \ } while(0) #endif owfs-3.1p5/module/ownet/c/src/include/ow_mutexes.h0000644000175000001440000000764212654730021017153 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Cannot stand alone -- part of ow.h and only separated out for clarity */ #ifndef OW_MUTEXES_H /* tedious wrapper */ #define OW_MUTEXES_H #include #include "ow_mutex.h" extern struct mutexes { pthread_mutexattr_t *pmattr; my_rwlock_t lib; my_rwlock_t connin; #ifdef __UCLIBC__ pthread_mutexattr_t mattr; pthread_mutex_t uclibc_mutex; #endif /* __UCLIBC__ */ } Mutex; #define _SEM_INIT(sem, shared, value) my_sem_init( &(sem) , (shared), (value) ) #define LIB_WLOCK my_rwlock_write_lock( &Mutex.lib ) ; #define LIB_WUNLOCK my_rwlock_write_unlock( &Mutex.lib ) ; #define LIB_RLOCK my_rwlock_read_lock( &Mutex.lib ) ; #define LIB_RUNLOCK my_rwlock_read_unlock( &Mutex.lib ) ; #define CONNIN_WLOCK my_rwlock_write_lock( &Mutex.connin ) ; #define CONNIN_WUNLOCK my_rwlock_write_unlock( &Mutex.connin ) ; #define CONNIN_RLOCK my_rwlock_read_lock( &Mutex.connin ) ; #define CONNIN_RUNLOCK my_rwlock_read_unlock( &Mutex.connin ) ; #define BUSLOCK(pn) BUS_lock(pn) #define BUSUNLOCK(pn) BUS_unlock(pn) #define BUSLOCKIN(in) BUS_lock_in(in) #define BUSUNLOCKIN(in) BUS_unlock_in(in) #ifdef __UCLIBC__ #define UCLIBCLOCK my_pthread_mutex_lock( &Mutex.uclibc_mutex) #define UCLIBCUNLOCK my_pthread_mutex_unlock(&Mutex.uclibc_mutex) #else /* __UCLIBC__ */ #define UCLIBCLOCK return_ok() #define UCLIBCUNLOCK return_ok() #endif /* __UCLIBC__ */ #endif /* OW_MUTEXES_H */ owfs-3.1p5/module/ownet/c/src/include/ow_pressure.h0000644000175000001440000000225012654730021017317 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ /* Cannot stand alone -- separated out of ow.h for clarity */ #ifndef OW_PRESSURE_H /* tedious wrapper */ #define OW_PRESSURE_H /* Global pressure scale up tp 8 */ enum pressure_type { pressure_mbar, pressure_atm, pressure_mmhg, pressure_inhg, pressure_psi, pressure_Pa, pressure_end_mark, }; #endif /* OW_PRESSURE_H */ owfs-3.1p5/module/ownet/c/src/include/ow_server.h0000644000175000001440000000510412654730021016756 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. 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. */ #ifndef OW_SERVER_H /* tedious wrapper */ #define OW_SERVER_H #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" struct request_packet { struct connection_in *owserver; const ASCII *path; unsigned char *read_value; const unsigned char *write_value; size_t data_length; off_t data_offset; int error_code; int tokens; /* for anti-loop work */ BYTE *tokenstring; /* List of tokens from owservers passed */ }; extern struct ow_global { uint32_t control_flags; int timeout_network; int timeout_server; int autoserver; } ow_Global; #define SHOULD_RETURN_BUS_LIST ( (UINT) 0x00000002 ) #define PERSISTENT_MASK ( (UINT) 0x00000004 ) #define PERSISTENT_BIT 2 #define ALIAS_REQUEST ( (UINT) 0x00000008 ) #define TEMPSCALE_MASK ( (UINT) 0x00FF0000 ) #define TEMPSCALE_BIT 16 #define DEVFORMAT_MASK ( (UINT) 0xFF000000 ) #define DEVFORMAT_BIT 24 #define TRIM ( (UINT) 0x00000040 ) #define IsPersistent ( ow_Global.control_flags & PERSISTENT_MASK ) #define SetPersistent(b) UT_Setbit(ow_Global.control_flags,PERSISTENT_BIT,(b)) #define TemperatureScale ( (enum temp_type) ((ow_Global.control_flags & TEMPSCALE_MASK) >> TEMPSCALE_BIT) ) #define SGTemperatureScale(x) ( (enum temp_type)(((x) & TEMPSCALE_MASK) >> TEMPSCALE_BIT) ) #define DeviceFormat ( (enum deviceformat) ((ow_Global.control_flags & DEVFORMAT_MASK) >> DEVFORMAT_BIT) ) #define set_semiglobal(s, mask, bit, val) do { *(s) = (*(s) & ~(mask)) | ((val)< #include "sem.h" typedef struct { pthread_mutex_t protect_reader; // mutex 3 in article pthread_mutex_t protect_writer; // mutex 2 in article pthread_mutex_t protect_reader_count; // mutex 2 in article int readcount; int writecount; sem_t allow_readers; // 'r' sem_t allow_writers; // 'w' } my_rwlock_t; void my_rwlock_init(my_rwlock_t * rwlock); void my_rwlock_write_lock(my_rwlock_t * rwlock); void my_rwlock_write_unlock(my_rwlock_t * rwlock); void my_rwlock_read_lock(my_rwlock_t * rwlock); void my_rwlock_read_unlock(my_rwlock_t * rwlock); void my_rwlock_destroy(my_rwlock_t * rwlock); #endif /* RWLOCK */ owfs-3.1p5/module/ownet/c/src/include/sem.h0000644000175000001440000000362312654730021015533 00000000000000/* From Geo Carncross geocar@internetconnection.net -- GPL */ /* File for incomplete semaphore implementations */ /* Note: gcc wants inline before int */ #ifndef __semaphore_h #define __semaphore_h #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1050 /* Newer OSX deprecates semaphore */ #undef HAVE_SEMAPHORE_H #endif #ifdef HAVE_SEMAPHORE_H #include #else /* HAVE_SEMAPHORE_H */ #include #include #include typedef struct { pthread_mutex_t m; pthread_cond_t c; volatile unsigned int v, w; } sem_t; //static int inline sem_destroy(sem_t * s) { static inline int sem_destroy(sem_t * s) { pthread_mutex_lock(&s->m); if (s->w) { pthread_mutex_unlock(&s->m); errno = EBUSY; return -1; } pthread_cond_destroy(&s->c); pthread_mutex_unlock(&s->m); pthread_mutex_destroy(&s->m); return 0; } //static int inline sem_init(sem_t * s, int ign, int val) { static inline int sem_init(sem_t * s, int ign, int val) { if (ign != 0) { errno = ENOSYS; return -1; } if (pthread_mutex_init(&s->m, NULL) != 0) { return -1; } if (pthread_cond_init(&s->c, NULL) != 0) { return -1; } s->v = val; s->w = 0; return 0; } //static int inline sem_post(sem_t * s) { static inline int sem_post(sem_t * s) { int ok = -1 ; if (pthread_mutex_lock(&s->m) == -1) { return -1; } s->v++; if (s->w == 1) { ok = pthread_cond_signal(&s->c); } else if (s->w > 1) { ok = pthread_cond_broadcast(&s->c); } pthread_mutex_unlock(&s->m); return ok; } //static int inline sem_wait(sem_t *s) { static inline int sem_wait(sem_t * s) { int ok = 0; if (pthread_mutex_lock(&s->m) == -1) { return -1; } while (s->v == 0) { s->w++; if (pthread_cond_wait(&s->c, &s->m) == -1) { ok = -1; break; } s->w--; } s->v--; pthread_mutex_unlock(&s->m); return ok; } #endif /* HAVE_SEMAPHORE_H */ #endif /* __semaphore_h */ owfs-3.1p5/module/ownet/c/Makefile.am0000644000175000001440000000001612654730021014411 00000000000000SUBDIRS = src owfs-3.1p5/module/ownet/c/Makefile.in0000644000175000001440000005500713022537052014433 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/ownet/c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src 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) --foreign module/ownet/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/ownet/c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/ownet/php/0000755000175000001440000000000013022537101012777 500000000000000owfs-3.1p5/module/ownet/php/examples/0000755000175000001440000000000013022537101014615 500000000000000owfs-3.1p5/module/ownet/php/examples/ownet_example.php.in0000644000175000001440000000421612654730021020533 00000000000000get("/",OWNET_MSG_DIR,true)); var_dump($ow->get("/10.67C6697351FF/temperature",OWNET_MSG_READ,true)); var_dump($ow->get("/10.67C6697351FF",OWNET_MSG_PRESENCE,true)); var_dump($ow->get("/WRONG VALUE",OWNET_MSG_PRESENCE,true)); var_dump($ow->get("/",OWNET_MSG_DIR,false)); var_dump($ow->get("/10.67C6697351FF/temperature",OWNET_MSG_READ,false)); var_dump($ow->get("/10.67C6697351FF",OWNET_MSG_PRESENCE,false)); var_dump($ow->get("/WRONG VALUE",OWNET_MSG_PRESENCE,false)); ?> owfs-3.1p5/module/ownet/php/examples/bcadd.php0000644000175000001440000000336112654730021016314 00000000000000 strlen($real_part)) { for ($i=0;$i<=($scale - strlen($real_part));$i++) $real_part .= "0"; } // end checking for more precision needed // return built string return $int_part . "." . substr($real_part, 0, $scale); } // end function bcadd ?> owfs-3.1p5/module/ownet/php/Makefile.am0000644000175000001440000000024712654730021014764 00000000000000EXTRA_DIST = ownet.php examples/bcadd.php examples/ownet_example.php.in DISTCLEANFILES = examples/ownet_example.php phpdir=${datadir}/php/OWNet php_DATA=ownet.php owfs-3.1p5/module/ownet/php/Makefile.in0000644000175000001440000004514513022537052015002 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/ownet/php ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(phpdir)" DATA = $(php_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = ownet.php examples/bcadd.php examples/ownet_example.php.in DISTCLEANFILES = examples/ownet_example.php phpdir = ${datadir}/php/OWNet php_DATA = ownet.php 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) --foreign module/ownet/php/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/ownet/php/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-phpDATA: $(php_DATA) @$(NORMAL_INSTALL) @list='$(php_DATA)'; test -n "$(phpdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(phpdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(phpdir)" || 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)$(phpdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(phpdir)" || exit $$?; \ done uninstall-phpDATA: @$(NORMAL_UNINSTALL) @list='$(php_DATA)'; test -n "$(phpdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(phpdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(phpdir)"; 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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-libtool 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-phpDATA 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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-phpDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-phpDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-phpDATA .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: owfs-3.1p5/module/ownet/php/ownet.php0000644000175000001440000010011012654730021014563 00000000000000 pack / unpack builtin function from linux sources #include uint32_t (pack format = 'N') htonl(uint32_t hostlong); uint16_t (pack format = 'n') htons(uint16_t hostshort); uint32_t (pack format = 'n') ntohl(uint32_t netlong); uint16_t (pack format = 'n') ntohs(uint16_t netshort); from http://www.linuxjournal.com/article/6788 IP's byte order also is big endian. */ // Constants for the OWNet class define('OWNET_DEFAULT_HOST' ,'127.0.0.1'); define('OWNET_DEFAULT_PORT' ,4304); define('OWNET_LINK_TYPE_SOCKET' ,0); define('OWNET_LINK_TYPE_STREAM' ,1); define('OWNET_LINK_TYPE_TCP' ,0); define('OWNET_LINK_TYPE_UDP' ,1); /* Constants for the owserver api message types. from ow.h enum msg_classification { msg_error, msg_nop, msg_read, msg_write, msg_dir, msg_size, // No longer used, leave here to compatibility msg_presence, }; */ define('OWNET_MSG_ERROR' ,0); define('OWNET_MSG_NOP' ,1); define('OWNET_MSG_READ' ,2); define('OWNET_MSG_WRITE' ,3); define('OWNET_MSG_DIR' ,4); define('OWNET_MSG_SIZE' ,5); define('OWNET_MSG_PRESENCE' ,6); define('OWNET_MSG_DIR_ALL' ,7); define('OWNET_MSG_READ_ANY' ,99999); if (!defined('TCP_NODELAY')) define('TCP_NODELAY',1); if (!defined('IPPROTO_TCP')) define('IPPROTO_TCP',6); $OWNET_GLOBAL_CACHE_STRUCTURE=array(); // cache value types length read write.... class OWNet{ protected $link=0; protected $host=''; protected $port=0; protected $sock_type=OWNET_LINK_TYPE_TCP; protected $link_type=OWNET_LINK_TYPE_SOCKET; protected $link_connected=false; protected $timeout=0; protected $use_swig_dir=true; function __construct($host='',$timeout=5,$use_swig_dir=true){ // just set default configurations $this->setHost($host); $this->timeout=abs((double)$timeout); $this->use_swig_dir=(bool)$use_swig_dir; } function setTimeout($timeout=5){ $this->timeout=abs((double)$timeout); } function getTimeout(){ return($this->timeout); } function setUseSwigDir($use){ $this->use_swig_dir=(bool)$use; } function getUseSwigDir(){ return($this->use_swig_dir); } function setHost($host=''){ // host must be "anything://host:port" or "anything://host" OR 'anything that don't parse_url and get default values' // use "stream://host:port" or "ow-stream://host:port" to prefer stream instead sockets $tmp_path =@parse_url($host); // get URL information from host if (!isset($tmp_path['scheme'])) $tmp_path =@parse_url("tcp://$host"); $this->host = (!isset($tmp_path['host'])?OWNET_DEFAULT_HOST:$tmp_path['host']); // if don't have host get default host $this->port =(int) (!isset($tmp_path['port'])?OWNET_DEFAULT_PORT:$tmp_path['port']); // if don't have port get default port $prefer_sock =(isset($tmp_path['scheme'])? ($tmp_path['scheme']!='stream' && $tmp_path['scheme']!='ow-stream' && $tmp_path['scheme']!='stream-udp' && $tmp_path['scheme']!='ow-stream-udp') :true); // check if prefer using streams instead socket if (strpos($tmp_path['scheme'],'udp')!==false) $this->sock_type=OWNET_LINK_TYPE_UDP; else $this->sock_type=OWNET_LINK_TYPE_TCP; unset($tmp_path); if (function_exists('socket_connect') && $prefer_sock){ $this->link_type=OWNET_LINK_TYPE_SOCKET; // prefer socks }else{ $this->link_type=OWNET_LINK_TYPE_STREAM; // prefer stream } $this->link_connected =false; return(true); } function getHost(){ // return and URI that can be used with setHost again if ($this->link_type==OWNET_LINK_TYPE_STREAM) return('ow-stream'.($this->sock_type==OWNET_LINK_TYPE_UDP?'-udp':'').'://'.$this->host.':'.$this->port); // using streams return('ow'.($this->sock_type==OWNET_LINK_TYPE_UDP?'-udp':'').'://'.$this->host.':'.$this->port); // using sockets if possible } protected function pack_htonl( $val ){ // builtin function to use htonl, big endian style $bval =str_pad(decbin(bcadd($val,0,0)),8*4,'0',STR_PAD_LEFT); $b1 =bindec(substr($bval,0,8)); $b2 =bindec(substr($bval,8,8)); $b3 =bindec(substr($bval,16,8)); $b4 =bindec(substr($bval,24,8)); return(chr($b1).chr($b2).chr($b3).chr($b4)); } protected function unpack_ntohl($str){ // builtin function to use ntohl, big endian style, not shure if it's right $size=strlen($str)/4; $ret=array(); for($i=0;$i<$size;$i++){ $bval =substr($str,$i*4,4); $b1 =ord(substr($bval,0,1)); $b2 =ord(substr($bval,1,1)); $b3 =ord(substr($bval,2,1)); $b4 =ord(substr($bval,3,1)); $value =$b4 + ($b3<<8) + ($b2<<16) + ($b1<<24); $ret[$i]=$value; } return($ret); } private function disconnect(){ // disconnect link if ($this->link_type==OWNET_LINK_TYPE_SOCKET){ // socket @socket_set_block($this->link); if ($this->sock_type==OWNET_LINK_TYPE_TCP) @socket_shutdown($this->link,2); @socket_close($this->link); }else{ @fclose($this->link); // streams } $this->link=NULL; $this->link_connected=false; } private function connect(){ // connect with sockets or stream if ($this->link_connected) return(true); // if connected don't continue if ($this->link_type==OWNET_LINK_TYPE_SOCKET){ // socket if ($this->sock_type==OWNET_LINK_TYPE_TCP){ $this->link=@socket_create(AF_INET, SOCK_STREAM, SOL_TCP); // create socket if ($this->link){ @socket_set_block($this->link); // set it to blocking $ok=@socket_connect($this->link,$this->host,$this->port); // try to connect if (!$ok){ $errno =@socket_last_error(); // get error when connecting $errstr =@socket_strerror(socket_last_error()); trigger_error("Can't create socket [ow://".$this->host.":".$this->port."], errno: $errno, error: $errstr",E_USER_NOTICE); @socket_shutdown($this->link,2); // unload socket @socket_close($this->link); $this->link=NULL; return(false); // return false on error or can't connect } // socket created and connected }else{ $errno =@socket_last_error(); // get error when creating socket $errstr =@socket_strerror(@socket_last_error()); trigger_error("Can't create socket [ow://".$this->host.":".$this->port."], errno: $errno, error: $errstr",E_USER_NOTICE); return(false); // return false on error or can't connect } }else{ // udp $this->link=@socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); // create socket if ($this->link){ @socket_set_block($this->link); // set it to blocking }else{ $errno =@socket_last_error(); // get error when creating socket $errstr =@socket_strerror(@socket_last_error()); trigger_error("Can't create socket [ow-udp://".$this->host.":".$this->port."], errno: $errno, error: $errstr",E_USER_NOTICE); return(false); // return false on error or can't connect } } }else{ // stream $this->link =@stream_socket_client( ($this->sock_type==OWNET_LINK_TYPE_TCP?'tcp://':'udp://'). $this->host.":".$this->port, $errno, $errstr, $this->timeout); // connect with streams, could be with fsockopen but stream_socket_client is faster (we will use PHP 5+) if (!$this->link){ trigger_error("Can't create stream [ow-stream".($this->sock_type!=OWNET_LINK_TYPE_TCP?'-udp':'')."://".$this->host.":".$this->port."], errno: $errno, error: $errstr",E_USER_NOTICE); return(false); // return false on error or can't connect } } $this->set_link_options(); // set socket options or stream options $this->link_connected=true; return(true); // ok } private function set_link_options(){ // set link options if (!$this->link_connected) return(false); if ($this->link_type==OWNET_LINK_TYPE_SOCKET){ // socket socket_set_block( $this->link); // set blocking mode if ($this->sock_type==OWNET_LINK_TYPE_TCP){ socket_set_option( $this->link,SOL_SOCKET, SO_RCVTIMEO, array("sec"=>0, "usec"=>100)); // receive timeout socket_set_option( $this->link,SOL_SOCKET, SO_SNDTIMEO, array("sec"=>0, "usec"=>100)); // send timeout socket_set_option($this->link, SOL_SOCKET, SO_REUSEADDR, 1); // reuse address socket_set_option($this->link, SOL_SOCKET, SO_OOBINLINE, 1); // out off band inline @socket_set_option($this->link, IPPROTO_TCP, TCP_NODELAY, 1); // no delay can have bug with windows?! } socket_set_option($this->link, SOL_SOCKET, SO_RCVBUF, 8192); // set receive buffer socket_set_option($this->link, SOL_SOCKET, SO_SNDBUF, 8192); // set send buffer }else{ stream_set_timeout($this->link ,20); // set timeout stream_set_blocking($this->link ,1); // set blocking mode stream_set_write_buffer($this->link ,0); // flush everything directly without buffer (faster than with buffer=8192) } return(true); } private function get_msg($msg_size=24){ // return false on error // get messagem from server $num_changed_sockets =0; $read_data =''; $last_read =microtime(1); $t1=intval($this->timeout); $t2=($this->timeout*1000000)%1000000; while ($num_changed_sockets<=0){ // can loop forever? owserver must send something! or disconnect! $read=array($this->link); if ($this->link_type==OWNET_LINK_TYPE_SOCKET) $num_changed_sockets = socket_select($read, $write = NULL, $except = NULL, $t1,$t2); // use socket_select else $num_changed_sockets = stream_select($read, $write = NULL, $except = NULL, $t1,$t2); // use stream_select if ($num_changed_sockets===false){ // error handling select $this->disconnect(); trigger_error("Error handling get_msg#1",E_USER_NOTICE); return(false); // return false when have error }elseif($num_changed_sockets>0){ // we can read! if ($this->link_type==OWNET_LINK_TYPE_SOCKET){ if ($this->sock_type==OWNET_LINK_TYPE_TCP){ $read_data=socket_read($this->link,$msg_size,PHP_BINARY_READ); // read with sockets }else{ $ret=socket_recvfrom($this->link,$read_data,$msg_size,$tmp_host,$tmp_port); // read with sockets if ($ret>0){ $this->host=$tmp_host; $this->port=$tmp_port; } } }else $read_data=fread($this->link,$msg_size); // read with streams if ($read_data==''){ // disconnected :'( $this->disconnect(); trigger_error("Disconnected",E_USER_NOTICE); return(false); // return false when have error }else $last_read =microtime(1); break; }else break; if (microtime(1)-$last_read>$this->timeout) break; } return($read_data); // return data } private function send_msg($string){ // return false on error and true on success, trigger error on disconnection // send message to server if (!$this->link_connected) return(false); $num_changed_sockets=0; while ($num_changed_sockets<=0){ $write=array($this->link); if ($this->link_type==OWNET_LINK_TYPE_SOCKET) $num_changed_sockets = socket_select($read = NULL, $write , $except = NULL, 0,1000); // use socket_select else $num_changed_sockets = stream_select($read = NULL, $write , $except = NULL, 0,1000); // use stream_select if ($num_changed_sockets===false){ // error handling $this->disconnect(); trigger_error("Error handling send_msg#1",E_USER_NOTICE); return(false); // return false on error } } $size=strlen($string); $sent=0; while($sent<$size){ // we will not use select, using can be slower, and without work! :D if ($this->link_type==OWNET_LINK_TYPE_SOCKET){ if ($this->sock_type==OWNET_LINK_TYPE_TCP) $ret=socket_write($this->link, $string, strlen($string)); // write and get sent bytes else $ret=socket_sendto($this->link, $string, strlen($string),0,$this->host,$this->port); // write and get sent bytes }else $ret=fwrite($this->link,$string,strlen($string)); // write and get sent bytes if ($ret===false){ // error sending $this->disconnect(); trigger_error("Error writing send_msg#1",E_USER_NOTICE); return(false); // return false on error } $sent+=$ret; // add sent bytes } return(true); // ok everything sent } function read($path,$parse_value=true){ // return NULL on error or no file // if $parse_value return php parsed value type (boolean,double,string), if not return an string value return($this->get($path,OWNET_MSG_READ,false,$parse_value)); // return get with right flags } function dir($path){ // return NULL on error or no directory // return numeric array starting from 0 with directory list return($this->get($path,OWNET_MSG_DIR_ALL,false,false)); // return get with right flags } function presence($path){ // return NULL on error // return true or false on success return($this->get($path,OWNET_MSG_PRESENCE,false,false)); // return get with right flags } function get($path='/',$get_type=OWNET_MSG_READ,$return_full_info_array=false,$parse_php_type=true){ // return NULL on error // path = path of file or directory // get_type = OWNET_MSG_READ_ANY (READ AND DIR) // OWNET_MSG_READ read an file // OWNET_MSG_DIR or OWNET_MSG_DIR_ALL read an directory (output is an array) // OWNET_MSG_PRESENCE check presence output is true or false // return_full_info_array if true return everything from comunication and unit if variables is an temperature, ['data'] is returned data and ['data_php'] is an parsed data in (double) or (string) types // parse_php_type if true try to get right data_php variable type // return NULL on error or not founded // return an array on OWNET_MSG_DIR or when return_full_info_array=true // return true or false when OWNET_MSG_PRESENCE $path=trim($path); // trim path if ($get_type==OWNET_MSG_READ_ANY){ // getting first read $ret=$this->get($path,OWNET_MSG_READ,$return_full_info_array,$parse_php_type); if ($ret!==NULL) return($ret); // ok we get and result return($this->get($path,OWNET_MSG_DIR_ALL,$return_full_info_array,$parse_php_type)); // return dir } if ($get_type!=OWNET_MSG_DIR && $get_type!=OWNET_MSG_DIR_ALL){ if (substr($path,strlen($path)-1,1)=='/') // isn't a dir, dir must end with characters != '/' return(NULL); } $this->disconnect(); // be sure that we are disconnected $this->connect(); // try to connect if (!$this->link_connected){ trigger_error("Can't connect get#1",E_USER_NOTICE); return(NULL); } // get value if ($get_type==OWNET_MSG_DIR || $get_type==OWNET_MSG_DIR_ALL){ // get right send function $msg=$this->pack($get_type ,strlen($path)+1,0 ); }elseif ($get_type==OWNET_MSG_PRESENCE){ $msg=$this->pack(OWNET_MSG_PRESENCE ,strlen($path)+1,0 ); }else{ $get_type=OWNET_MSG_READ; $msg=$this->pack(OWNET_MSG_READ ,strlen($path)+1,8192 ); } if ( $this->send_msg($msg)===false ){ trigger_error("Can't write to resource get#1",E_USER_NOTICE); return(NULL); // error sending } if ( $this->send_msg($path.chr(0))===false){ trigger_error("Can't write to resource get#2",E_USER_NOTICE); return(NULL); // error sending } if ($parse_php_type) global $OWNET_GLOBAL_CACHE_STRUCTURE; // we will use for parse_php_type // get return $return=NULL; // set to NULL if nothing returned while(1){ unset($ret,$data,$tmp_ret,$start,$data_len); $data='';$tmp_ret=''; $start=microtime(1); while(1){ $tmp_ret=$this->get_msg(24); if ($tmp_ret===false){ trigger_error("Can't read from resource get#3",E_USER_NOTICE); $this->disconnect(); return(NULL); } if (strlen($tmp_ret)>0) $start=microtime(1); $data.=$tmp_ret; unset($tmp_ret); if(strlen($data)>=24 || (microtime(1)-$start)>$this->timeout) break; } $ret=$this->unpack(substr($data,0,24)); // unpack 24bytes into 6 data if (count($ret)<6){ if ($get_type==OWNET_MSG_DIR_ALL) // old servers return($this->get($path,OWNET_MSG_DIR,$return_full_info_array,$parse_php_type)); $data=substr($data,0,24); trigger_error("Error unpacking data get#1 [".strlen($data)."] ".$data,E_USER_NOTICE); $this->disconnect(); return(NULL); } if ($get_type==OWNET_MSG_PRESENCE){ // check presence if (!isset($ret[2])) return(NULL); // error ?! maybe not (count < 6) return($ret[2]===0); // ret[2]!=0 => not present } $data=substr($data,24); // if any data was read with more than 24 bytes if (!isset($ret[1])) $ret[1]=false; // just to be sure that will not get into $ret parsing if ($ret[1]>0){ if ($get_type==OWNET_MSG_DIR || $get_type==OWNET_MSG_DIR_ALL) // reading directory use $ret[1] for read data $data_len=$ret[1]; else $data_len=$ret[2]; // reading file use $ret[2] for read data $tmp_ret=''; $start=microtime(1); // set start time for timeout read if ($data_len>0) while(1){ $tmp_ret=$this->get_msg($data_len); if ($tmp_ret===false){ trigger_error("Can't read from resource get#4",E_USER_NOTICE); // error receiving $this->disconnect(); return(NULL); // return NULL on error } if (strlen($tmp_ret)>0) $start=microtime(1); $data.=$tmp_ret;unset($tmp_ret); if(strlen($data)>=$data_len || (microtime(1)-$start)>$this->timeout) // timedout or got every data that we need break; } if (!$return_full_info_array && strlen($data)!=$data_len){ // if just return value and data < data_len return as an error trigger_error("Can't read full data get#1",E_USER_NOTICE); $this->disconnect(); return(NULL); // return NULL on error } if ($get_type==OWNET_MSG_DIR){ // reading dir $ret['data'] =$data; $ret['data_len']=strlen($data); $ret['data_php']=substr($data,0,$ret[4]); // ret[4] is the right filename size ?! it's work :D if ($return===NULL) $return=array(); // se return as an array to get values if ($return_full_info_array) $return[]=$ret; // return an array else $return[]=$ret['data_php']; // return file name // continue while... }else{ $ret['data'] =substr($data,0,$data_len); // data_php length is the same as $ret[2] $ret['data_len']=strlen($data); $this->disconnect(); // disconnect from server $type=false; // check type? if ($parse_php_type && $get_type!=OWNET_MSG_DIR_ALL){ $tmp =explode('/',$path);$c=count($tmp)-1; if ($c>0){ // must be something like '/dir/file' array('dir', 'file'), count()-1 = 1 > 0 $variavel =$tmp[$c]; // get last two uri args $ow =$tmp[$c-1]; unset($tmp); if (preg_match('/([0-9A-F]{2})[\.]{0,1}[0-9A-F]{12}/',$ow,$tmp)){ // check if ow is an OW id ("XX.ZZZZZZZZZZZZ or XXZZZZZZZZZZZZ") $tmp=$tmp[1]; if (!isset($OWNET_GLOBAL_CACHE_STRUCTURE[$tmp.'/'.$variavel])){ // check if we have structure information $tmp_v=@$this->get("/structure/$tmp/$variavel",OWNET_MSG_READ,false,false); // get estrutucture information if ($tmp_v!==NULL){ $tmp_v=explode(',',$tmp_v); // ok :D we will get real php values now! $OWNET_GLOBAL_CACHE_STRUCTURE[$tmp.'/'.$variavel]=$tmp_v; $type=$tmp_v; } }else $type=$OWNET_GLOBAL_CACHE_STRUCTURE[$tmp.'/'.$variavel]; } } unset($tmp,$tmp_v,$variavel,$ow,$c); } if ($type!==false){ // get real php values $ret['data_php']=$ret['data']; if($type[0]=='i'){ $ret['data_php']=bcadd($ret['data_php'],0,0); // integer (using bcmath for bigger precision) }elseif($type[0]=='u'){ $ret['data_php']=bcadd($ret['data_php'],0,0); // unsigned integer (using bcmath for bigger precision) if (bccmp($ret['data_php'],0,0)==-1){ $ret['data_php']=substr($ret['data_php'],1); // be shure that it's unsigned } }elseif(in_array($type[0],array('f','t',chr(152)))){ $ret['data_php']=(double)$ret['data_php']; // using float (double) values, maybe sprinf("%.50f",$value) could get an string representation if ($return_full_info_array){ if ($type[0]=='t'){ // temperature (last owserver versions... maybe an 'v' for volts and 'A' for amps could be implemented) // we can't cache cause server may restart or change configurations while we have old cache information, here we will have +- .1 seconds of performace lost, set return full information off if you don't want it $tmp_v=@$this->get("/settings/units/temperature_scale",OWNET_MSG_READ,false,false); // get server current scale if ($tmp_v!==NULL) // just for compatible with old owservers $ret['unit']=$tmp_v; // use unit if return full information } } }elseif(in_array($type[0],array('a','b','d'))){ $ret['data_php']=(string)$ret['data_php']; // string (maybe without it could work too, but's it's pretty :D ) }elseif($type[0]=='y'){ $ret['data_php']=($ret['data_php']==1?true:false); // boolean content } // another contents are parsed as string too }else{ $ret['data_php']=&$ret['data']; // we will use not parsed values (we use it when getting structure information! or setting $parse_php_type=false) } if ($get_type==OWNET_MSG_DIR_ALL){ $return=& $ret; break; } if ($return_full_info_array){ return($ret); // return array }else{ return($ret['data_php']); // return just php parsed value } } }else{ break; } } $this->disconnect(); // disconnect from server (dir listing) if ($get_type==OWNET_MSG_DIR_ALL && $return===NULL) // old servers return($this->get($path,OWNET_MSG_DIR,$return_full_info_array,$parse_php_type)); if ($return!==NULL){ if ($this->use_swig_dir && !$return_full_info_array && $get_type==OWNET_MSG_DIR) if (is_array($return)) $return=implode(',',$return); if ($this->use_swig_dir==false && $get_type==OWNET_MSG_DIR_ALL){ if ($return_full_info_array){ $tmp=explode(',',$return['data_php']); $r=array(); for ($i=0;$i$return[0], 1=>$return[1], 2=>$return[2], 3=>$return[3], 4=>$return[4], 5=>$return[5], 'data'=>$return['data'], 'data_len'=>$return['data_len'], 'data_php'=>$tmp[$i] ); $return=$r; unset($tmp,$r); }else $return=explode(',',$return); } } return($return); } function set($path,$value=''){ // set and value to path checking before if path is readonly or not $path=trim($path); // trim path $tmp =explode('/',$path);$c=count($tmp)-1; $type=false; if ($c>0){ // try to get information about structure, if file is readonly or not $variavel =$tmp[$c]; $ow =$tmp[$c-1]; unset($tmp); if (preg_match('/([0-9A-F]{2})[\.]{0,1}[0-9A-F]{12}/',$ow,$tmp)){ $tmp=$tmp[1]; if (!isset($OWNET_GLOBAL_CACHE_STRUCTURE[$tmp.'/'.$variavel])){ $tmp_v=@$this->get("/structure/$tmp/$variavel",OWNET_MSG_READ,false,false); // get estrutucture information if ($tmp_v!==NULL){ $tmp_v=explode(',',$tmp_v); $OWNET_GLOBAL_CACHE_STRUCTURE[$tmp.'/'.$variavel]=$tmp_v; // ok we will test it $type=$tmp_v; } }else $type=$OWNET_GLOBAL_CACHE_STRUCTURE[$tmp.'/'.$variavel]; // very fine, it was cached! :D performace boost } } if ($type!==false){ if ($type[3]=='ro'){ // read only file trigger_error("Read only value set#1 [$path]",E_USER_NOTICE); return(false); // return false on error } } unset($type,$tmp,$tmp_v,$variavel,$ow,$c); $this->disconnect(); $this->connect(); if (!$this->link_connected){ trigger_error("Can't connect set#1",E_USER_NOTICE); return(false); // return false on error } if (!is_string($value)) $value=(string)$value; // be sure that's an string $msg=$this->pack(OWNET_MSG_WRITE,strlen($path)+1+strlen($value)+1,strlen($value)+1); // pack data if ( $this->send_msg($msg)===false ){ trigger_error("Can't write to resource set#1",E_USER_NOTICE); return(false); // error sending } if ( $this->send_msg($path.chr(0).$value.chr(0))===false ){ trigger_error("Can't write to resource set#2",E_USER_NOTICE); return(false); // error sending value } $data='';$tmp_ret=''; $start=microtime(1); // start timeout counter while(1){ $tmp_ret=$this->get_msg(24); if ($tmp_ret===false){ trigger_error("Can't read from resource set#1",E_USER_NOTICE); $this->disconnect(); return(false); // error reading return } if (strlen($tmp_ret)>0) $start=microtime(1); $data.=$tmp_ret;unset($tmp_ret); if(strlen($data)>=24 || (microtime(1)-$start)>$this->timeout) // timed out or got content break; } $ret=$this->unpack($data); // unpack data return if (count($ret)<6){ trigger_error("Error unpacking data set#1 [".strlen($data)."] ".$data,E_USER_NOTICE); $this->disconnect(); return(false); // return false on error } if (!isset($ret[2])) $ret[2]=1; // be sure that we will work with error_reporting(E_ALL) if ($ret[2]!=0) $ret=false; // return false on error $this->disconnect(); // disconnect from server if ($ret!==false) return(true); // very fine :) return($ret); // :( } private function unpack($data){ // unpack returned contents (24 bytes data) $unpack=$this->unpack_ntohl($data); return($unpack); // version= 0, payload_len=1, ret_value=2, format_flags=3, data_len=4, offset=5 } private function pack($function,$payload_len,$data_len){ // pack msg information (24 bytes) $pack= $this->pack_htonl(0). $this->pack_htonl($payload_len). $this->pack_htonl($function). $this->pack_htonl(258). $this->pack_htonl($data_len). $this->pack_htonl(0); return($pack); } } /* explanation: EVERY FUNCTION TRIGGER AN ERROR! you should use @$ow->function to don't handle errors $ow=new OWNet($host,$timeout=5,$use_swig_dir=true); in top of file we have some constants: (line 58) define('OWNET_DEFAULT_HOST' ,'127.0.0.1'); define('OWNET_DEFAULT_PORT' ,4304); i don't know what's the default OW port, i'm using today 4304 :) for OWNet($host) we can use this types of host value: "scheme://host:port" "scheme://host" "anything that can't be parsed with parseurl" if port isn't set we get default port, if host isn't set we get default host if scheme == "stream" or scheme == "ow-stream" we will prefer to use PHP stream_socket_client functions else if function socket_create exists we will use socket_connect() with sockets we can set TCP_NODELAY SO_REUSEADDR SO_OOBINLINE(we use it?) SO_RCVBUF SO_SNDBUF $ow->setHost($host) is the same thing that new OWNet($host) $ow->getHost() get host URI owstream://host:port if using stream_socket_client ow://host:port if using sockets $ow->setTimeout($timeout=5) set read timeout, default 5 $ow->getTimeout() get read timeout $ow->set($path,$value='') set an value to path true on success false on error or if file is readonly $ow->read($path,$parse_value=true) return value if parse_value return an php parsed value, if not return an string $ow->dir($path) return an dir (see setUserSwigDir and OWNet constructor) $ow->presence($path) get presence $ow->get($path='/',$get_type=OWNET_MSG_READ_ANY,$return_full_info_array=false,$parse_php_type=true) on error return NULL get_type can be: OWNET_MSG_READ (execute OWNET_MSG_READ and if don't find execute OWNET_MSG_DIR) OWNET_MSG_READ *default read an file from owserver OWNET_MSG_DIR read an dir from owserver OWNET_MSG_PRESENCE read presence from owserver (return false or true) return_full_info_array if true return an array with everything that was received from owserver more data_php and unit if file is an temperature value parse_php_type try to check what type is an file (temperature, boolean, string, number (double or integer)) $ow->setUseSwigDir($use) // use swig dir style (dir,dir,dir) and not php array (array(dir,dir,dir)) $ow->getUseSwigDir() // get if using swig dir style END :) examples: $ow=new OWNet("tcp://172.16.1.100:4304"); var_dump($ow->get("/",OWNET_MSG_DIR,true)); var_dump($ow->get("/10.E8C1C9000800/temperature",OWNET_MSG_READ,true)); var_dump($ow->get("/10.E8C1C9000800",OWNET_MSG_PRESENCE,true)); var_dump($ow->get("/WRONG VALUE",OWNET_MSG_PRESENCE,true)); var_dump($ow->get("/",OWNET_MSG_DIR,false)); var_dump($ow->get("/10.E8C1C9000800/temperature",OWNET_MSG_READ,false)); var_dump($ow->get("/10.E8C1C9000800",OWNET_MSG_PRESENCE,false)); var_dump($ow->get("/WRONG VALUE",OWNET_MSG_PRESENCE,false)); return: array(9) { [0]=> array(9) { [0]=> int(0) [1]=> int(42) [2]=> int(0) [3]=> int(258) [4]=> int(5) [5]=> int(0) ["data"]=> string(42) "bus.0athaðãaPÜa»a0" ["data_len"]=> int(42) ["data_php"]=> string(5) "bus.0" } [1]=> array(9) { [0]=> int(0) [1]=> int(42) [2]=> int(0) [3]=> int(258) [4]=> int(8) [5]=> int(0) ["data"]=> string(42) "settings0" ["data_len"]=> int(42) ["data_php"]=> string(8) "settings" } [2]=> array(9) { [0]=> int(0) [1]=> int(42) [2]=> int(0) [3]=> int(258) [4]=> int(6) [5]=> int(0) ["data"]=> string(42) "system0" ["data_len"]=> int(42) ["data_php"]=> string(6) "system" } [3]=> array(9) { [0]=> int(0) [1]=> int(42) [2]=> int(0) [3]=> int(258) [4]=> int(10) [5]=> int(0) ["data"]=> string(42) "statistics0" ["data_len"]=> int(42) ["data_php"]=> string(10) "statistics" } [4]=> array(9) { [0]=> int(0) [1]=> int(42) [2]=> int(0) [3]=> int(258) [4]=> int(16) [5]=> int(0) ["data"]=> string(42) "/10.E8C1C9000800P×aàÑa »a0" ["data_len"]=> int(42) ["data_php"]=> string(16) "/10.E8C1C9000800" } [5]=> array(9) { [0]=> int(0) [1]=> int(42) [2]=> int(0) [3]=> int(258) [4]=> int(16) [5]=> int(0) ["data"]=> string(42) "/10.54FDED000800P×aàÑa »a0" ["data_len"]=> int(42) ["data_php"]=> string(16) "/10.54FDED000800" } [6]=> array(9) { [0]=> int(0) [1]=> int(42) [2]=> int(0) [3]=> int(258) [4]=> int(16) [5]=> int(0) ["data"]=> string(42) "/10.6F7EC9000800P×aàÑa »a0" ["data_len"]=> int(42) ["data_php"]=> string(16) "/10.6F7EC9000800" } [7]=> array(9) { [0]=> int(0) [1]=> int(42) [2]=> int(0) [3]=> int(258) [4]=> int(16) [5]=> int(0) ["data"]=> string(42) "/28.924FE0000000P×aàÑa »a0" ["data_len"]=> int(42) ["data_php"]=> string(16) "/28.924FE0000000" } [8]=> array(9) { [0]=> int(0) [1]=> int(42) [2]=> int(0) [3]=> int(258) [4]=> int(16) [5]=> int(0) ["data"]=> string(42) "/28.5D59E0000000P×aàÑa »a0" ["data_len"]=> int(42) ["data_php"]=> string(16) "/28.5D59E0000000" } } array(10) { [0]=> int(0) [1]=> int(8192) [2]=> int(12) [3]=> int(0) [4]=> int(12) [5]=> int(0) ["data"]=> string(12) " 28.625" ["data_len"]=> int(12) ["data_php"]=> float(28.625) ["unit"]=> string(1) "C" } bool(true) bool(false) array(9) { [0]=> string(5) "bus.0" [1]=> string(8) "settings" [2]=> string(6) "system" [3]=> string(10) "statistics" [4]=> string(16) "/10.E8C1C9000800" [5]=> string(16) "/10.54FDED000800" [6]=> string(16) "/10.6F7EC9000800" [7]=> string(16) "/28.924FE0000000" [8]=> string(16) "/28.5D59E0000000" } float(28.625) bool(true) */ ?> owfs-3.1p5/module/ownet/Makefile.am0000644000175000001440000000055712654730021014201 00000000000000if ENABLE_OWPHP if ENABLE_PHP OWNET_SUBDIRPHP = php endif endif if ENABLE_OWPYTHON if ENABLE_PYTHON OWNET_SUBDIRPYTHON = python endif endif if ENABLE_OWPERL if ENABLE_PERL OWNET_SUBDIRPERL = perl5 endif endif if ENABLE_OWNETLIB OWNET_SUBDIROWNETLIB = c endif SUBDIRS = $(OWNET_SUBDIROWNETLIB) $(OWNET_SUBDIRPHP) $(OWNET_SUBDIRPYTHON) $(OWNET_SUBDIRPERL) owfs-3.1p5/module/ownet/Makefile.in0000644000175000001440000005551013022537052014210 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/ownet ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 = c php python perl5 am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @ENABLE_OWPHP_TRUE@@ENABLE_PHP_TRUE@OWNET_SUBDIRPHP = php @ENABLE_OWPYTHON_TRUE@@ENABLE_PYTHON_TRUE@OWNET_SUBDIRPYTHON = python @ENABLE_OWPERL_TRUE@@ENABLE_PERL_TRUE@OWNET_SUBDIRPERL = perl5 @ENABLE_OWNETLIB_TRUE@OWNET_SUBDIROWNETLIB = c SUBDIRS = $(OWNET_SUBDIROWNETLIB) $(OWNET_SUBDIRPHP) $(OWNET_SUBDIRPYTHON) $(OWNET_SUBDIRPERL) 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) --foreign module/ownet/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/ownet/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/ownet/python/0000755000175000001440000000000013022537102013532 500000000000000owfs-3.1p5/module/ownet/python/examples/0000755000175000001440000000000013022537102015350 500000000000000owfs-3.1p5/module/ownet/python/examples/check_ow.py0000644000175000001440000000454412654730021017440 00000000000000#! /usr/bin/env python """ $Id$ $HeadURL: http://void/svn/peter/playground/nud/categories.py $ Copyright (c) 2006 Peter Kropf. All rights reserved. Nagios (http://nagios.org) plugin to check the value of a 1-wire sensor. """ import ownet import sys import os from optparse import OptionParser import socket class nagios: ok = (0, 'OK') warning = (1, 'WARNING') critical = (2, 'CRITICAL') unknown = (3, 'UNKNOWN') # FIXME: need to add more help text in the init_string and sensor_path parameters parser = OptionParser(usage='usage: %prog [options] server port sensor_path', version='%prog ' + ownet.__version__) parser.add_option('-v', dest='verbose', action='count', help='multiple -v increases the level of debugging output.') parser.add_option('-w', dest='warning', type='int', help='warning level.') parser.add_option('-c', dest='critical', type='int', help='critical level.') parser.add_option('-f', dest='field', help='sensor field to be used for monitoring.', default='temperature') options, args = parser.parse_args() if len(args) != 3: print 'OW ' + nagios.unknown[1] + ' - ' + 'missing command line arguments' parser.print_help() sys.exit(nagios.unknown[0]) server = args[0] port = int(args[1]) path = args[2] try: s = ownet.Sensor(path, server=server, port=port) except ownet.exUnknownSensor, ex: print 'OW ' + nagios.unknown[1] + ' - unknown sensor ' + str(ex) sys.exit(nagios.unknown[0]) except socket.error, ex: print 'OW ' + nagios.unknown[1] + ' - communication error ' + str(ex) sys.exit(nagios.unknown[0]) if options.verbose == 1: print s elif options.verbose > 1: print s print 'entryList:', s.entryList() print 'sensorList:', s.sensorList() if not hasattr(s, options.field): print 'OW ' + nagios.unknown[1] + ' - ' + 'unknown field: ' + options.field sys.exit(nagios.unknown[0]) val = getattr(s, options.field) if val >= options.critical: status = nagios.critical[1] exit_code = nagios.critical[0] elif val >= options.warning: status = nagios.warning[1] exit_code = nagios.warning[0] else: status = nagios.ok[1] exit_code = nagios.ok[0] print 'OW %s - %s %s: %i| %s/%s=%i' % (status, path, options.field, val, path, options.field, val) sys.exit(exit_code) owfs-3.1p5/module/ownet/python/examples/temperatures.py0000644000175000001440000000061112654730021020365 00000000000000#! /usr/bin/env python # $Id$ import sys import ownet if len(sys.argv) != 3: print 'temperatures.py server port' sys.exit(1) r = ownet.Sensor('/', server=sys.argv[1], port=int(sys.argv[2])) e = r.entryList() s = r.sensorList() print 'r:', r print 'r.entryList():', e print 'r.sensorList():', s for x in r.sensors(): if hasattr(x, 'temperature'): print x, x.temperature owfs-3.1p5/module/ownet/python/ownet/0000755000175000001440000000000013022537102014666 500000000000000owfs-3.1p5/module/ownet/python/ownet/__init__.py0000644000175000001440000003300612654730021016726 00000000000000""" ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/ow/__init__.py $ Copyright (c) 2006 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH 1-wire sensor network interface. ownet provides standalone access to a owserver without the need to compile the core ow libraries on the local system. As a result, ownet can run on almost any platform that support Python. OWFS is an open source project developed by Paul Alfille and hosted at http://www.owfs.org """ # avoid error with python2.2 from __future__ import generators import sys import os from connection import Connection __author__ = 'Peter Kropf' __email__ = 'pkropf@gmail.com' __version__ = '0.3' # # exceptions used and thrown by the ownet classes # class exError(Exception): """base exception for all one wire raised exceptions.""" class exErrorValue(exError): """Base exception for all one wire raised exceptions with a value.""" def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class exNoController(exError): """Exception raised when a controller cannot be initialized.""" class exNotInitialized(exError): """Exception raised when a controller has not been initialized.""" class exUnknownSensor(exErrorValue): """Exception raised when a specified sensor is not found.""" # # _server and _port are the default server and port values to be used # if a Sensor is initialized without specifying a server and port. # _server = None _port = None # # Initialize and cleanup the _server and _port default values. # def init(iface): """ Initialize the interface mechanism to be used for communications to the 1-wire network. Only socket connections to owserver are supported. Examples: ownet.init('remote_system:3003') Will initialize the 1-wire interface to use the owserver running on remote_system on port 3003. """ #print 'ownet.init(%s)' % iface global _server global _port pair = iface.split(':') if len(pair) != 2: raise exNoController _server = pair[0] _port = pair[1] def finish(): """ Cleanup the OWFS library, freeing any used resources. """ #print 'ownet.finish()' global _server global _port _server = None _port = None # # 1-wire sensors # class Sensor(object): """ A Sensor is the basic component of a 1-wire network. It represents a individual 1-wire element as it exists on the network. """ def __init__(self, path, server = None, port = None, connection=None): """ Create a new Sensor as it exists at the specified path. """ #print 'Sensor.__init__(%s, server="%s", port=%s)' % (path, str(server), str(port)) # setup the connection to use for connunication with the owsensor server if connection: self._connection = connection elif not server or not port: global _server global _port if not _server or not _port: raise exNotInitialized else: self._connection = Connection(server, port) else: self._connection = Connection(server, port) self._attrs = {} if path == '/': self._path = path self._useCache = True elif path == '/uncached': self._path = '/' self._useCache = False else: if path[:len('/uncached')] == '/uncached': self._path = path[len('/uncached'):] self._useCache = False else: self._path = path self._useCache = True self.useCache(self._useCache) def __str__(self): """ Print a string representation of the Sensor in the form of: server:port/path - type Example: >>> print Sensor('/') xyzzy:9876/ - DS9490 """ #print 'Sensor.__str__' return "%s%s - %s" % (str(self._connection), self._usePath, self._type) def __repr__(self): """ Print a representation of the Sensor in the form of: Sensor(path) Example: >>> Sensor('/') Sensor("/", server="xyzzy", port=9876) """ #print 'Sensor.__repr__' return 'Sensor("%s", server="%s", port=%i)' % (self._usePath, self._connection._server, self._connection._port) def __eq__(self, other): """ Two sensors are considered equal if their paths are equal. This is done by comparing their _path attributes so that cached and uncached Sensors compare equal. Examples: >>> Sensor('/') == Sensor('/1F.440701000000') False >>> Sensor('/') == Sensor('/uncached') True """ #print 'Sensor.__eq__(%s)' % str(other) return self._path == other._path def __hash__(self): """ Return a hash for the Sensor object's name. This allows Sensors to be used better in sets.Set. """ #print 'Sensor.__hash__' return hash(self._path) def __getattr__(self, name): """ Retreive an attribute from the sensor. __getattr__ is called only if the named item doesn't exist in the Sensor's namespace. If it's not in the namespace, look for the attribute on the physical sensor. Usage: s = ownet.Sensor('/1F.5D0B01000000') print s.family, s.PIO_0 will result in the family and PIO.0 values being read from the sensor and printed. In this example, the family would be 1F and thr PIO.0 might be 1. """ try: #print 'Sensor.__getattr__(%s)' % name attr = self._connection.read(object.__getattribute__(self, '_attrs')[name]) except: raise AttributeError, name return attr def __setattr__(self, name, value): """ Set the value of a sensor attribute. This is accomplished by first determining if the physical sensor has the named attribute. If it does, then the value is written to the name. Otherwise, the Sensor's dictionary is updated with the name and value. Usage: s = ownet.Sensor('/1F.5D0B01000000') s.PIO_1 = '1' will set the value of PIO.1 to 1. """ #print 'Sensor.__setattr__(%s, %s)' % (name, value) # Life can get tricky when using __setattr__. Self doesn't # have an _attrs atribute when it's initially created. _attrs # is only there after it's been set in __init__. So we can # only reference it if it's already been added. if hasattr(self, '_attrs'): if name in self._attrs: self._connection.write(self._attrs[name], value) else: self.__dict__[name] = value else: self.__dict__[name] = value def useCache(self, use_cache): """ Set the sensor to use the underlying owfs cache (or not) depending on the use_cache parameter. Usage: s = ownet.Sensor('/1F.5D0B01000000') s.useCache(False) will set the internal sensor path to /uncached/1F.5D0B01000000. Also: s = ownet.Sensor('/uncached/1F.5D0B01000000') s.useCache(True) will set the internal sensor path to /1F.5D0B01000000. """ #print 'Sensor.useCache(%s)' % str(use_cache) self._useCache = use_cache if self._useCache: self._usePath = self._path else: if self._path == '/': self._usePath = '/uncached' else: self._usePath = '/uncached' + self._path if self._path == '/': self._type = self._connection.read('/system/adapter/name.0') else: self._type = self._connection.read('%s/type' % self._usePath) self._attrs = dict([(n.replace('.', '_'), self._usePath + '/' + n) for n in self.entries()]) def entries(self): """ Generator which yields the attributes of a sensor. """ #print 'Sensor.entries()' list = self._connection.dir(self._usePath) if self._path == '/': for entry in list: if not '/' in entry: yield entry else: for entry in list: yield entry.split('/')[-1] def entryList(self): """ List of the sensor's attributes. Example: >>> Sensor("/10.B7B64D000800").entryList() ['address', 'crc8', 'die', 'family', 'id', 'power', 'present', 'temperature', 'temphigh', 'templow', 'trim', 'trimblanket', 'trimvalid', 'type'] """ #print 'Sensor.entryList()' return [e for e in self.entries()] def sensors(self, names = ['main', 'aux']): """ Generator which yields all the sensors that are associated with the current sensor. In the event that the current sensor is the adapter (such as a DS9490 USB adapter) the list of sensors directly attached to the 1-wire network will be yielded. In the event that the current sensor is a microlan controller (such as a DS2409) the list of directories found in the names list parameter will be searched and any sensors found will be yielded. The names parameter defaults to ['main', 'aux']. """ #print 'Sensor.sensors(%s)' % str(names) if self._type == 'DS2409': for branch in names: path = self._usePath + '/' + branch list = filter(lambda x: '/' in x, self._connection.dir(path)) if list: namelist = ','.join(list) #print 'Sensor.sensors namelist(%s)' % str(namelist) for branch_entry in namelist.split(','): # print 'branch_entry(%s)' % str(branch_entry) try: self._connection.read(branch_entry + '/type') except exUnknownSensor, ex: continue yield Sensor(branch_entry, connection=self._connection) else: list = self._connection.dir(self._usePath) if self._path == '/': for entry in list: if '/' in entry: yield Sensor(entry, connection=self._connection) def sensorList(self, names = ['main', 'aux']): """ List of all the sensors that are associated with the current sensor. In the event that the current sensor is the adapter (such as a DS9490 USB adapter) the list of sensors directly attached to the 1-wire network will be yielded. In the event that the current sensor is a microlan controller (such as a DS2409) the list of directories found in the names list parameter will be searched and any sensors found will be yielded. The names parameter defaults to ['main', 'aux']. Example: >>> Sensor("/1F.440701000000").sensorList() [Sensor("/1F.440701000000/main/29.400900000000")] """ #print 'Sensor.sensorList(%s)' % str(names) return [s for s in self.sensors()] def find(self, **keywords): """ Generator which yields all the sensors whose attributes match those past in. By default, any matched attribute will yield a sensor. If the parameter all is passed to the find call, then all the supplied attributes must match to yield a sensor. Usage: for s in Sensor('/').find(type = 'DS2408'): print s will print all the sensors whose type is DS2408. root = Sensor('/') print len([s for s in root.find(all = True, family = '1F', type = 'DS2409')]) will print the count of sensors whose family is 1F and whose type is DS2409. """ #print 'Sensor.find', keywords #recursion = keywords.pop('recursion', False) all = keywords.pop('all', False) for sensor in self.sensors(): match = 0 for attribute in keywords: if hasattr(sensor, attribute): if keywords[attribute]: if getattr(sensor, attribute) == keywords[attribute]: match = match + 1 else: if hasattr(sensor, attribute): match = match + 1 if not all and match: yield sensor elif all and match == len(keywords): yield sensor owfs-3.1p5/module/ownet/python/ownet/connection.py0000644000175000001440000001520312654730021017325 00000000000000# -*- coding: utf-8 -*- """ ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/ow/__init__.py $ Copyright (c) 2006 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH OWFS is an open source project developed by Paul Alfille and hosted at http://www.owfs.org """ import sys import os import socket import struct import re __author__ = 'Peter Kropf' __email__ = 'pkropf@gmail.com' __version__ = '1.9' class exError(Exception): """base exception for all one wire raised exceptions.""" class exErrorValue(exError): """Base exception for all one wire raised exceptions with a value.""" def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class exInvalidMessage(exErrorValue): """Exception raised when trying to unpack a message that doesn't meet specs.""" class exShortRead(exError): """Exception raised when too few bytes are received from the owserver.""" class OWMsg: """ Constants for the owserver api message types. """ error = 0 nop = 1 read = 2 write = 3 dir = 4 size = 5 presence = 6 class Connection(object): """ A Connection provides access to a owserver without the standard core ow libraries. Instead, it impliments the wire protocol for communicating with the owserver. This allows Python programs to interact with the ow sensors on any platform supported by Python. """ def __init__(self, server, port): """ Create a new connection object. """ #print 'Connection.__init__(%s, %i)' % (server, port) self._server = server self._port = port def __str__(self): """ Print a string representation of the Connection in the form of: server:port """ #print 'Connection.__str__' return "%s:%i" % (self._server, self._port) def __repr__(self): """ Print a representation of the Connection in the form of: Connection(server, port) Example: >>> Connection('xyzzy', 9876) Connection(server="xyzzy", port=9876) """ #print 'Connection.__repr__' return 'Connection("%s", %i)' % (self._server, self._port) def read(self, path): """ """ #print 'Connection.read("%s", %i, "%s")' % (path) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((self._server, self._port)) smsg = self.pack(OWMsg.read, len(path) + 1, 8192) s.sendall(smsg) s.sendall(path + '\x00') while 1: data = s.recv(24) if len(data) is not 24: raise exShortRead ret, payload_len, data_len = self.unpack(data) if payload_len >= 0: data = s.recv(payload_len) rtn = self.toNumber(data[:data_len]) break else: # ping response rtn = None break s.close() return rtn def write(self, path, value): """ """ #print 'Connection.write("%s", "%s")' % (path, str(value)) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((self._server, self._port)) value = str(value) smsg = self.pack(OWMsg.write, len(path) + 1 + len(value) + 1, len(value) + 1) s.sendall(smsg) s.sendall(path + '\x00' + value + '\x00') data = s.recv(24) if len(data) is not 24: raise exShortRead ret, payload_len, data_len = self.unpack(data) s.close() return ret def dir(self, path): """ """ #print 'Connection.dir("%s")' % (path) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((self._server, self._port)) smsg = self.pack(OWMsg.dir, len(path) + 1, 0) s.sendall(smsg) s.sendall(path + '\x00') fields = [] while 1: data = s.recv(24) if len(data) is not 24: raise exShortRead ret, payload_len, data_len = self.unpack(data) if payload_len > 0: data = s.recv(payload_len) fields.append(data[:data_len]) else: # end of dir list or 'ping' response break s.close() return fields def pack(self, function, payload_len, data_len): """ """ #print 'Connection.pack(%i, %i, %i)' % (function, payload_len, data_len) return struct.pack('iiiiii', socket.htonl(0), #version socket.htonl(payload_len), #payload length socket.htonl(function), #type of function call socket.htonl(258), #format flags -- 266 for alias upport socket.htonl(data_len), #size of data element for read or write socket.htonl(0), #offset for read or write ) def unpack(self, msg): """ """ #print 'Connection.unpack("%s")' % msg if len(msg) is not 24: raise exInvalidMessage, msg val = struct.unpack('iiiiii', msg) version = socket.ntohl(val[0]) payload_len = socket.ntohl(val[1]) try: ret_value = socket.ntohl(val[2]) except OverflowError: ret_value = 0 format_flags = socket.ntohl(val[3]) data_len = socket.ntohl(val[4]) offset = socket.ntohl(val[5]) return ret_value, payload_len, data_len def toNumber(self, str): """ """ stripped = str.strip() if re.compile('^-?\d+$').match(stripped) : return int(stripped) if re.compile('^-?\d*\.\d*$').match(stripped) : # Could crash if it matched '.' - let it. return float(stripped) return str owfs-3.1p5/module/ownet/python/Makefile.am0000644000175000001440000000114412654730021015513 00000000000000EXTRA_DIST = setup.py MANIFEST.in Readme.txt Readme_pypi.txt examples/check_ow.py examples/temperatures.py ownet/__init__.py ownet/connection.py install-data-local: # OpenSUSE is buggy and install libraries at /usr/local. # Need to add call "install_lib --install-dir" or call "install --install-lib" # $(PYTHON) setup.py install_lib --install-dir="/$(DESTDIR)$(PYSITEDIR)" $(PYTHON) setup.py install --install-lib="$(DESTDIR)$(PYSITEDIR)" # Other options are (but not needed): --install-data="/$(DESTDIR)$(PYSITEDIR)" --install-script="/$(DESTDIR)$(PYSITEDIR)" --install-header= clean-local: @RM@ -rf build owfs-3.1p5/module/ownet/python/Makefile.in0000644000175000001440000004170013022537052015525 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/ownet/python ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = setup.py MANIFEST.in Readme.txt Readme_pypi.txt examples/check_ow.py examples/temperatures.py ownet/__init__.py ownet/connection.py 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) --foreign module/ownet/python/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/ownet/python/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am 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 clean-libtool clean-local 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-data-local 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 mostlyclean-libtool 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 clean-libtool \ clean-local cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am .PRECIOUS: Makefile install-data-local: # OpenSUSE is buggy and install libraries at /usr/local. # Need to add call "install_lib --install-dir" or call "install --install-lib" # $(PYTHON) setup.py install_lib --install-dir="/$(DESTDIR)$(PYSITEDIR)" $(PYTHON) setup.py install --install-lib="$(DESTDIR)$(PYSITEDIR)" # Other options are (but not needed): --install-data="/$(DESTDIR)$(PYSITEDIR)" --install-script="/$(DESTDIR)$(PYSITEDIR)" --install-header= clean-local: @RM@ -rf build # 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: owfs-3.1p5/module/ownet/python/setup.py0000644000175000001440000000472712654730021015203 00000000000000""" ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/setup.py $ Copyright (c) 2006 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH ownet: access 1-wire sensors ownet is a standalone python module for accessing 1-wire sensors through an owserver. The ownet module does not use the core ow libraries. Instead, it impliments the wire protocol for owserver communication. This means that the ow core libraries do no have to be installed on all systems, just on the system running owserver. The ownet module can be installed on any system with Python. """ from distutils.core import setup, Extension classifiers = """ Development Status :: 4 - Beta Environment :: Console Intended Audience :: Developers Intended Audience :: System Administrators License :: OSI Approved :: GNU General Public License (GPL) Operating System :: MacOS Operating System :: Microsoft Operating System :: Microsoft :: Windows :: Windows NT/2000 Operating System :: Other OS Operating System :: POSIX Operating System :: Unix Programming Language :: Python Topic :: System :: Hardware Topic :: System :: Networking :: Monitoring Topic :: Utilities """ doclines = __doc__.split('::EOH')[1].split('\n')[1:] version = '0.3' setup( name = 'ownet', description = doclines[0], version = version, author = 'Peter Kropf', author_email = 'pkropf@gmail.com', maintainer = 'Peter Kropf', maintainer_email = 'pkropf@gmail.com', url = 'http://www.owfs.org/', license = 'GPL', platforms = ['any'], long_description = '\n'.join(doclines), classifiers = filter( None, classifiers.split( '\n' ) ), packages = ['ownet'], download_url = 'http://cheeseshop.python.org/packages/source/o/ownet/ownet-%s.tar.gz' % version ) owfs-3.1p5/module/ownet/python/MANIFEST.in0000644000175000001440000000014012654730021015210 00000000000000README.txt setup.py ownet/__init__.py ownet/connection.py recursive-include examples *.txt *.py owfs-3.1p5/module/ownet/python/Readme.txt0000644000175000001440000000516412654730021015423 00000000000000ownet ===== ownet is a standalone python module for accessing 1-wire sensors through an owserver. The ownet module does not use the core ow libraries. Instead, it impliments the wire protocol for owserver communication. This means that the ow core libraries do no have to be installed on all systems, just on the system running owserver. The ownet module can be installed on any system with Python. Installation ------------ Via easy_install ++++++++++++++++ If you have installed easy_install (http://peak.telecommunity.com/DevCenter/EasyInstall) installing is as simple as: $ easy_install ownet Searching for ownet Reading http://www.python.org/pypi/ownet/ Reading http://www.owfs.org/ Reading http://www.python.org/pypi/ownet/0.2 Best match: ownet 0.2 Downloading http://cheeseshop.python.org/packages/source/o/ownet/ownet-0.2.tar.gz Processing ownet-0.2.tar.gz Running ownet-0.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install--lFbng/ownet-0.2/egg-dist-tmp-ed4Ygq package init file 'examples/__init__.py' not found (or not a regular file) Creating missing __init__.py for examples zip_safe flag not set; analyzing archive contents... Adding ownet 0.2 to easy-install.pth file Installed /sw/lib/python2.5/site-packages/ownet-0.2-py2.5.egg Processing dependencies for ownet $ From CVS ++++++++ Installation of the ownet module follows the standard Python distutils installation. $ cd module/ownet/python $ sudo python setup.py install There should now be a module called ownet in the site-packages directory of the python installation. Examples -------- There are two sample programs in the examples directory - check_ow.py and temperatures.py. The check_ow.py program impliments a Nagios (http://www.nagios.org) plugin to monitor the value of a sensor field, like the temperature. Usage is beyond the scope of this document. See the Nagios documentation for configuring and monitoring via plugins. The temperatures.py will print out some details of the sensors along with the temperatures found on any sensor that has a field called temperature. Running it should print out something like: $ python ./examples/temperatures.py kuro2 9999 r: kuro2:9999/ - DS9490 r.entryList(): ['bus.0', 'settings', 'system', 'statistics'] r.sensorList(): [Sensor("/10.B7B64D000800", server="kuro2", port="9999"), Sensor("/26.AF2E15000000", server="kuro2", port="9999"), Sensor("/81.A44C23000000", server="kuro2", port="9999")] kuro2:9999/10.B7B64D000800 - DS18S20 22.4375 kuro2:9999/26.AF2E15000000 - DS2438 21.0938 $ where "kuro2" should be the host name where owserver is running and "9999" is the port to be used to communicate with the owserver. $Id$ owfs-3.1p5/module/ownet/python/Readme_pypi.txt0000644000175000001440000000226712654730021016465 00000000000000ownet on pypi ============= The ownet module has been registered on the `Python Cheese Shop `__ to allow for easier access. The Python Cheese Shop is the central location for finding and installing various Python programs, modules, tools, etc. Updating ownet on pypi ---------------------- 1) Register the latest version $ python setup.py register running register Using PyPI login from /Users/peter/.pypirc Server response (200): OK $ 2) Upload the latest version $ python setup.py sdist upload running sdist reading manifest file 'MANIFEST' creating ownet-0.2 creating ownet-0.2/examples creating ownet-0.2/ownet making hard links in ownet-0.2... hard linking README.txt -> ownet-0.2 hard linking setup.py -> ownet-0.2 hard linking examples/check_ow.py -> ownet-0.2/examples hard linking examples/temperatures.py -> ownet-0.2/examples hard linking ownet/__init__.py -> ownet-0.2/ownet hard linking ownet/connection.py -> ownet-0.2/ownet tar -cf dist/ownet-0.2.tar ownet-0.2 gzip -f9 dist/ownet-0.2.tar removing 'ownet-0.2' (and everything under it) running upload Submitting dist/ownet-0.2.tar.gz to http://www.python.org/pypi Server response (200): OK $ $Id$ owfs-3.1p5/module/ownet/perl5/0000755000175000001440000000000013022537102013240 500000000000000owfs-3.1p5/module/ownet/perl5/examples/0000755000175000001440000000000013022537102015056 500000000000000owfs-3.1p5/module/ownet/perl5/examples/test.pl0000755000175000001440000000137112654730021016324 00000000000000#!/usr/bin/perl -w # OWFS test program # See owfs.sourceforge.net for details # {copyright} 2007 Paul H. Alfille # GPL license # $Id$ # Start a test-server before running this script: # owserver -p 4304 --fake 10,10 use OWNet ; die ( "OWFS 1-wire OWNet perl program\n" ." by Paul Alfille 2007 see http://www.owfs.org\n" ."Syntax:\n" ."\t$0 \n" ."Example:\n" ."\t$0 127.0.0.1:4304\n" ) if ( $#ARGV != 0 ) ; my $ow ; $ow = OWNet->new($ARGV[0]) ; print "\nTry dir\n" ; print $ow->dir("/") ; die ("Cannot open OWNet connection") if (!defined($ow->{SOCK})) ; print "\nTry present\n" ; print $ow->present("/10.67C6697351FF") ; print "\nTry read\n" ; print $ow->read("/10.67C6697351FF/temperature") ; print "\n" ; owfs-3.1p5/module/ownet/perl5/examples/test2.pl0000755000175000001440000000134612654730021016410 00000000000000#!/usr/bin/perl -w # OWFS test program # See owfs.sourceforge.net for details # {copyright} 2007 Paul H. Alfille # GPL license # $Id$ # Start a test-server before running this script: # owserver -p 4304 --fake 10,10 use OWNet ; die ( "OWFS 1-wire OWNet perl program\n" ." by Paul Alfille 2007 see http://www.owfs.org\n" ."Syntax:\n" ."\t$0 \n" ."Example:\n" ."\t$0 127.0.0.1:4304\n" ) if ( $#ARGV != 0 ) ; print "\nCall dir\n" ; print OWNet::dir($ARGV[0] . " -v", "/") ; print "\nCall read\n" ; print OWNet::read($ARGV[0] . " -v", "/10.67C6697351FF/temperature") ; print "\nCall read (Fahrenheit)\n" ; print OWNet::read($ARGV[0] . " -v -F", "/10.67C6697351FF/temperature") ; print "\n" ; owfs-3.1p5/module/ownet/perl5/OWNet/0000755000175000001440000000000013022537102014234 500000000000000owfs-3.1p5/module/ownet/perl5/OWNet/lib/0000755000175000001440000000000013022537102015002 500000000000000owfs-3.1p5/module/ownet/perl5/OWNet/lib/OWNet.pm0000755000175000001440000005174212673103261016276 00000000000000package OWNet ; # OWNet module for perl # $Id$ # # Paul H Alfille -- copyright 2007 # Part of the OWFS suite: # http://www.owfs.org # http://owfs.sourceforge.net =head1 NAME OWNet - Light weight access to B =head1 SYNOPSIS OWNet is an easy way to access B and thence the 1-wire bus. Dallas Semiconductor's 1-wire system uses simple wiring and unique addresses for its interesting devices. The B is a suite of programs that hide 1-wire details behind a file system metaphor. B connects to the 1-wire bus and provides network access. B is a perl module that connects to B and allows reading, writing and listing the 1-wire bus. Example perl program that prints the temperature: use OWNet ; print OWNet::read( "localhost:4304" , "/10.67C6697351FF/temperature" ) ."\n" ; There is the alternative object oriented form: use OWNet ; my $owserver = OWNet->new( "localhost:4304" ) ; print $owserver->read( "/10.67C6697351FF/temperature" ) ."\n" ; =head1 SYNTAX =head2 methods =over =item B my $owserver = OWNet -> new( address ) ; =item B OWNet::read( address, path [,size [,offset]] ) $owserver -> read( path [,size [,offset]] ) =item B OWNet::write( address, path, value [,offset] ) $owserver -> write( path, value [,offset] ) =item B OWNet::dir( address, path ) $owserver -> dir( path ) =back =head2 I
TCP/IP I
of B. Valid forms: =over =item I test.owfs.net:4304 =item I number: 123.231.312.213:4304 =item I localhost:4304 =item I 4304 =back =head2 I Additional arguments to add to address Temperature scale can also be specified in the I
. Same syntax as the other OWFS programs: =over =item -C Celsius (Centigrade) =item -F Fahrenheit =item -K Kelvin =item -R Rankine =back Pressure scale can also be specified in the I
. Same syntax as the other OWFS programs: =over =item -mbar millibar (default) =item -atm atmosphere =item -mmHg mm Mercury =item -inHg inch Mercury =item -psi pounds per inch^2 =item -Pa pascal =back Device display format (1-wire unique address) can also be specified in the I
, with the general form of -ff[.]i[[.]c] (Iamily Id Irc): =over =item -ff.i /10.67C6697351FF (default) =item -ffi /1067C6697351FF =item -ff.i.c /10.67C6697351FF.8D =item -ff.ic /10.67C6697351FF8D =item -ffi.c /1067C6697351FF.8D =item -ffic /1067C6697351FF8D =back Show directories that are themselves directories with a '/' suffix ( e.g. /10.67C6697351FF/ ) =over =item --slash show directory elements =back Trim whitespace from numeric values =over =item -trim trim spaces =back Warning messages will only be displayed if verbose flag is specified in I
=over =item -v verbose =back =head2 I B-type I to an item on the 1-wire bus. Valid forms: =over =item main directories Used for the I method. E.g. "/" "/uncached" "/1F.321432320000/main" =item device directory Used for the I and I method. E.g. "/10.4300AC220000" "/statistics" =item device properties Used to I, I. E.g. "/10.4300AC220000/temperature" =back =head2 I New I for a device property. Used by I. =head1 METHODS =over =cut BEGIN { } use 5.008 ; use warnings ; use strict ; use IO::Socket::INET ; use bytes ; my $MSG_READ = 2 ; my $MSG_WRITE = 3 ; my $MSG_DIR = 4 ; my $MSG_PRESENCE = 6 ; my $MSG_DIRALL = 7 ; my $MSG_DIRALLSLASH = 9 ; # return value should be negative for error, but the networking layer uses 32bit unsigned integers. This is the boundary. my $MAX_RETURN = 66000 ; # Network timeout in ms my $MAX_WAIT = 3000 ; my $RECV_FLAGS = 0 ; my $SEND_FLAGS = 0 ; my $NO_OFFSET = 0 ; my $PERSISTENCE_BIT = 0x04 ; # PresenceCheck, Return bus list, and apply aliases my $DEFAULT_SG = 0x100 + 0x2 + 0x8 ; my $DEFAULT_BLOCK_LENGTH = 33000 ; our $VERSION=(split(/ /,q[$Revision$]))[1] ; sub _new($$) { my ($self,$addr) = @_ ; $addr =~ s/--/-/g ; my $tempscale = 0 ; TEMPSCALE: { $tempscale = 0x00000 , last TEMPSCALE if $addr =~ /-C/ ; $tempscale = 0x10000 , last TEMPSCALE if $addr =~ /-F/ ; $tempscale = 0x20000 , last TEMPSCALE if $addr =~ /-K/ ; $tempscale = 0x30000 , last TEMPSCALE if $addr =~ /-R/ ; } my $presscale = 0 ; PRESSCALE: { $presscale = 0x000000 , last PRESSCALE if $addr =~ /-mbar/i ; $presscale = 0x040000 , last PRESSCALE if $addr =~ /-atm/i ; $presscale = 0x080000 , last PRESSCALE if $addr =~ /-mmhg/i ; $presscale = 0x0C0000 , last PRESSCALE if $addr =~ /-inhg/i ; $presscale = 0x100000 , last PRESSCALE if $addr =~ /-psi/i ; $presscale = 0x140000 , last PRESSCALE if $addr =~ /-pa/i ; } my $format = 0 ; FORMAT: { $format = 0x2000000 , last FORMAT if $addr =~ /-ff\.i\.c/ ; $format = 0x4000000 , last FORMAT if $addr =~ /-ffi\.c/ ; $format = 0x3000000 , last FORMAT if $addr =~ /-ff\.ic/ ; $format = 0x5000000 , last FORMAT if $addr =~ /-ffic/ ; $format = 0x0000000 , last FORMAT if $addr =~ /-ff\.i/ ; $format = 0x1000000 , last FORMAT if $addr =~ /-ffi/ ; $format = 0x2000000 , last FORMAT if $addr =~ /-f\.i\.c/ ; $format = 0x4000000 , last FORMAT if $addr =~ /-fi\.c/ ; $format = 0x3000000 , last FORMAT if $addr =~ /-f\.ic/ ; $format = 0x5000000 , last FORMAT if $addr =~ /-fic/ ; $format = 0x0000000 , last FORMAT if $addr =~ /-f\.i/ ; $format = 0x1000000 , last FORMAT if $addr =~ /-fi/ ; } my $trim = 0 ; TRIM: { $trim = 0x00000040 , last TRIM if $addr =~ /-trim/ ; } # Verbose flag $self->{VERBOSE} = 1 if $addr =~ /-v/i ; # slash after directory elements $self->{SLASH} = 1 if $addr =~ /-slash/i ; $addr =~ s/-[\w\.]*//g ; $addr =~ s/ //g ; my $port ; if ( $addr =~ /(.*):(.*)/ ) { $addr = $1 ; $port = $2 ; } elsif ( $addr =~/\D/ ) { $port = '' ; } else { $port = $addr ; $addr = '' ; } $self->{ADDR} = $addr ; $self->{PORT} = $port ; $self->{SG} = $DEFAULT_SG + $tempscale + $presscale + $format + $trim ; $self->{VER} = 0 ; } sub _Sock($) { my $self = shift ; # persistent socket already there? if ( defined($self->{SOCK} && $self->{PERSIST} != 0 ) ) { return 1 ; } # defaults my $addr = $self->{ADDR} ; my $port = $self->{PORT} ; $addr = '127.0.0.1' if $addr eq '' ; $port = 'owserver(4304)' if $port eq '' ; # New socket $self->{SOCK} = IO::Socket::INET->new( PeerAddr=>$addr, PeerPort=>$port, Proto=>'tcp') || do { warn("Can't open $addr:$port ($!) \n") if $self->{VERBOSE} ; $self->{SOCK} = undef ; return ; } ; return 1 ; } sub _self($) { my $addr = shift ; my $self ; if ( ref($addr) ) { $self = $addr ; $self->{PERSIST} = $PERSISTENCE_BIT ; } else { $self = {} ; _new($self,$addr) ; $self->{PERSIST} = 0 ; } if ( ($self->{ADDR} eq '') && ($self->{PORT} eq '') ) { _BonjourLookup($self) || _Sock($self) || return ; } else { _Sock($self) || return ; } return $self; } sub _BonjourLookup($) { my $self = shift ; eval { require Net::Rendezvous; }; if ($@) { print "$@\n" if $self->{VERBOSE} ; return ; } my $owservers = Net::Rendezvous->new('owserver') || do { print "Unable to start owserver discovery via Net::Rendezvous $!\n" if $self->{VERBOSE} ; return ; } ; $owservers->discover ; my $owserver_selected = $owservers->shift_entry || do { print "No owserver discovered by Net::Rendezvous\n" if $self->{VERBOSE} ; return ; } ; print $owserver_selected->host.":".$owserver_selected->port."\n" if $self->{VERBOSE} ; # New socket $self->{SOCK} = IO::Socket::INET->new(PeerAddr=>$owserver_selected->host,PeerPort=>$owserver_selected->port,Proto=>'tcp') || do { warn("Can't open Bonjour (autodiscovered) port ($!) \n") if $self->{VERBOSE} ; $self->{SOCK} = undef ; return ; } ; $self->{ADDR} = $self->{SOCK}->peeraddr || return ; $self->{PORT} = $self->{SOCK}->peerport || return ; return 1 ; } sub _ToServer ($$$$;$) { my ($self, $msg_type, $size, $offset, $payload_data) = @_ ; my $f = "N6" ; my $payload_length = length($payload_data); $f .= 'A'.$payload_length ; my $message = pack($f,$self->{VER},$payload_length,$msg_type,$self->{SG}|$self->{PERSIST},$size,$offset,$payload_data) ; # try to send send( $self->{SOCK}, $message, $SEND_FLAGS ) && return 1 ; # maybe bad persistent connection if ( $self->{PERSIST} != 0 ) { $self->{SOCK} = undef ; _Sock($self) || return ; send( $self->{SOCK}, $message, $SEND_FLAGS ) && return 1 ; } warn("Send problem $! \n") if $self->{VERBOSE} ; return ; } sub _FromServerBinaryParse($$) { my $self = shift ; my $length_wanted = shift ; return '' if $length_wanted == 0 ; my $fileno = $self->{SOCK}->fileno or return undef ; my $selectreadbits = '' ; vec($selectreadbits,$fileno,1) = 1 ; my $remaininglength = $length_wanted ; my $fullread = '' ; do { select($selectreadbits,undef,undef,$MAX_WAIT) ; return if vec($selectreadbits,$fileno,1) == 0 ; my $partialread ; defined( recv( $self->{SOCK}, $partialread, $remaininglength, $RECV_FLAGS ) ) || do { warn("Trouble getting data back $! after $remaininglength of $length_wanted") if $self->{VERBOSE} ; return ; } ; $fullread .= $partialread ; $remaininglength = $length_wanted - length($fullread) ; } while $remaininglength > 0 ; return $fullread ; } sub _FromServer($) { my $self = shift ; my ( $version, $payload_length, $return_status, $sg, $size, $offset, $payload_data ) ; do { my $r = _FromServerBinaryParse( $self,24 ) || do { warn("Trouble getting header $!") if $self->{VERBOSE} ; return ; } ; ($version, $payload_length, $return_status, $sg, $size, $offset) = unpack('N6', $r ) ; return if $return_status > $MAX_RETURN ; } while $payload_length > $MAX_RETURN ; $payload_data = _FromServerBinaryParse( $self,$payload_length ) ; if ( !defined($payload_data) ) { warn("Trouble getting payload $!") if $self->{VERBOSE} ; return ; } ; $payload_data = substr($payload_data,0,$size) ; $self->{PERSIST} = $sg & $PERSISTENCE_BIT ; return ($version, $payload_length, $return_status, $sg, $size, $offset, $payload_data ) ; } =item B Object-oriented (only): B( I
) Create a new OWNet object -- corresponds to an B. Error (and undef return value) if: =over =item 1 Badly formed tcp/ip I
=item 2 No B at I
=back =cut sub new($$) { my $class = shift ; my $addr = shift || "" ; my $self = {} ; _new($self,$addr) ; if ( !defined($self->{ADDR}) ) { return ; } ; bless $self, $class ; return $self ; } =item B =over =item Non object-oriented: B( I
, I [ , I [ , I ] ] ) =item Object-oriented: $ownet->B( I [ , I [ , I ] ] ) =back Read the value of a 1-wire device property. Returns the (scalar string) value of the property. I (number of bytes to read) is optional I (number of bytes from start of field to start write) is optional Error (and undef return value) if: =over =item 1 (Non object) No B at I
=item 2 (Object form) Not called with a valid OWNet object =item 3 Bad I =item 4 I not a readable device property =back =cut sub read($$) { my $self = _self(shift) || return ; my $path = shift ; my $read_length = shift || $DEFAULT_BLOCK_LENGTH ; my $offset = shift || $NO_OFFSET ; _ToServer($self,$MSG_READ,$read_length,$offset,$path) ; my @r = _FromServer($self) ; if ( !@r ) { return ; } return $r[6] ; } =item B =over =item Non object-oriented: B( I
, I , I [ , I ] ) =item Object-oriented: $ownet->B( I , I [ , I ] ) =back Set the value of a 1-wire device property. Returns "1" on success. I (number of bytes from start of field to start write) is optional Error (and undef return value) if: =over =item 1 (Non object) No B at I
=item 2 (Object form) Not called with a valid OWNet object =item 3 Bad I =item 4 I not a writable device property =item 5 I incorrect size or format =back =cut sub write($$$;$) { my $self = _self(shift) || return ; my $path = shift ; my $val = shift ; my $offset = shift || $NO_OFFSET ; my $value_length = length($val) ; my $path_length = length($path)+1 ; my $payload = pack( 'Z'.$path_length.'A'.$value_length,$path,$val ) ; _ToServer($self,$MSG_WRITE,$value_length,$offset,$payload) ; my @r = _FromServer($self) ; if ( !@r ) { return; } return $r[2]>=0 ; } =item B =over =item Non object-oriented: B( I
, I ) =item Object-oriented: $ownet->B( I ) =back Return a comma-separated list of the entries in I. Entries are equivalent to "fully qualified names" -- full path names. Error (and undef return value) if: =over =item 1 (Non object) No B at I
=item 2 (Object form) Not called with a valid OWNet object =item 3 Bad I =item 4 I not a directory =back =cut sub dir($$) { my $self = _self(shift) || return ; my $path = shift ; # DIRALLSLASH method -- single packet with slash (/) after each dir entry if ( $self->{SLASH}) { _ToServer($self,$MSG_DIRALLSLASH,$DEFAULT_BLOCK_LENGTH,$NO_OFFSET,$path) || return ; my @r = _FromServer($self) ; if (@r) { $self->{SOCK} = undef if $self->{PERSIST} == 0 ; return $r[6] ; } ; } # new MSG_DIRALL method -- single packet _ToServer($self,$MSG_DIRALL,$DEFAULT_BLOCK_LENGTH,$NO_OFFSET,$path) || return ; my @r = _FromServer($self) ; return if !@r ; if (@r) { $self->{SOCK} = undef if $self->{PERSIST} == 0 ; return $r[6] ; } ; # old MSG_DIR method -- many packets _Sock($self) || return ; _ToServer($self,$MSG_DIR,$DEFAULT_BLOCK_LENGTH,$NO_OFFSET,$path) || return ; my $dirlist = '' ; while (1) { @r = _FromServer($self) || return ; return if !@r ; if ( $r[1] == 0 ) { # last null packet $self->{SOCK} = undef if $self->{PERSIST} == 0 ; return substr($dirlist,1) ; # not starting comma } $dirlist .= ','.$r[6] ; } } return 1 ; END { } =item B (deprecated) =over =item Non object-oriented: B( I
, I ) =item Object-oriented: $ownet->B( I ) =back Test if a 1-wire device exists. Error (and undef return value) if: =over =item 1 (Non object) No B at I
=item 2 (Object form) Not called with a valid OWNet object =item 3 Bad I =item 4 I not a device =back =cut sub present($$) { my $self = _self(shift) || return ; my $path = shift ; _ToServer($self,$MSG_PRESENCE,$DEFAULT_BLOCK_LENGTH,$NO_OFFSET,$path) ; my @r = _FromServer($self) ; return if !@r ; return $r[2]>=0 ; } =back =head1 DESCRIPTION =head2 OWFS I is a suite of programs that allows easy access to I's 1-wire bus and devices. I provides a consistent naming scheme, safe multplexing of 1-wire traffice, multiple methods of access and display, and network access. The basic I metaphor is a file-system, with the bus beinng the root directory, each device a subdirectory, and the the device properties (e.g. voltage, temperature, memory) a file. =head2 1-Wire I<1-wire> is a protocol allowing simple connection of inexpensive devices. Each device has a unique ID number (used in its OWFS address) and is individually addressable. The bus itself is extremely simple -- a data line and a ground. The data line also provides power. 1-wire devices come in a variety of packages -- chips, commercial boxes, and iButtons (stainless steel cans). 1-wire devices have a variety of capabilities, from simple ID to complex voltage, temperature, current measurements, memory, and switch control. =head2 Programs Connection to the 1-wire bus is either done by bit-banging a digital pin on the processor, or by using a bus master -- USB, serial, i2c, parallel. The heavy-weight I programs: B B B B and the heavy-weight perl module B all link in the full I library and can connect directly to the bus master(s) and/or to B. B is a light-weight module. It connects only to an B, does not link in the I library, and should be more portable.. =head2 Object-oriented B can be used in either a classical (non-object-oriented) manner, or with objects. The object stored the ip address of the B and a network socket to communicate. B will use persistent tcp connections for the object form -- potentially a performance boost over a slow network. =head1 EXAMPLES =head2 owserver B is a separate process that must be accessible on the network. It allows multiple clients, and can connect to many physical 1-wire adapters and 1-wire devices. It's address must be discoverable -- either set on the command line, or at it's default location, or by using Bonjour (zeroconf) service discovery. An example owserver invocation for a serial adapter and explicitly chooses the default port: owserver -d /dev/ttyS0 -p 4304 =head2 OWNet use OWNet ; # Create owserver object my $owserver = OWNet->new('localhost:4304 -v -F') ; #default location, verbose errors, Fahrenheit degrees # my $owserver = OWNet->new() ; #simpler, again default location, no error messages, default Celsius #print directory print $owserver->dir('/') ; #print temperature from known device (DS18S20, ID: 10.13224366A280) print "Temperature: ".$owserver->read('/uncached/10.13224366A280/temperature') ; # Now for some fun -- a tree of everything: sub Tree($$) { my $ow = shift ; my $path = shift ; print "$path\t" ; # first try to read my $value = $ow->read($path) ; if ( defined($value) ) { print "$value\n"; return ; } # not readable, try as directory my $dirstring = $ow->dir($path) ; if ( defined($dirstring) ) { print "\n" ; my @dir = split /,/ , $ow->dir($path) ; foreach (@dir) { Tree($ow,$_) ; } return ; } # can't read, not directory print "\n" ; return ; } Tree( $owserver, '/' ) ; =head1 INTERNALS =head2 Object properties (All private) =over =item ADDR literal sting for the IP address, in dotted-quad or host format. This property is also used to indicate a substantiated object. =item PORT string for the port number (or service name). Service name must be specified as :owserver or the like. =item SG Flag sent to server, and returned, that encodes temperature scale and display format. Persistence is also encoded in this word in the actual tcp message, but kept separately in the object. =item VERBOSE Print error messages? Set by "-v" in object invocation. =item SLASH Add "/" to the end of directory entries. Set by "-slash" in object invocation. =item SOCK Socket address (object) for communication. Stays defined for persistent connections, else deleted between calls. =item PERSIST State of socket connection (persistent means the same socket is used which speeds network communication). =item VER owprotocol version number (currently 0) =back =head2 Private methods =over =item _self Takes either the implicit object reference (if called on an object) or the ip address in non-object format. In either case a socket is created, the persistence bit is properly set, and the address parsed. Returns the object reference, or undef on error. Called by each external method (read,write,dir) on the first parameter. =item _new Takes command line invocation parameters (for an object or not) and properly parses and sets up the properties in a hash array. =item _Sock Socket processing, including tests for persistence and opening. If no host is specified, localhost (127.0.0.1) is used. If no port is specified, uses the IANA allocated well known port (4304) for owserver. First looks in /etc/services, then just tries 4304. =item _ToServer Sends a message to owserver. Formats in owserver protocol. If a persistent socket fails, retries after new socket created. =item _FromServerBinaryParse Reads a specified length from server =item _FromServer Reads whole packet from server, using _FromServerBinaryParse (first for header, then payload). Discards ping packets silently. =item _BonjourLookup Uses the mDNS service discovery protocol to find an available owserver. Employs NET::Rendezvous (an earlier name or Apple's Bonjour) This module is loaded only if available. (Uses the method of http://sial.org/blog/2006/12/optional_perl_module_loading.html) =back =head1 AUTHOR Paul H Alfille paul.alfille@gmail.com =head1 BUGS Support for proper timeout using the "select" function seems broken in perl. This might leave the routines vulnerable to network timing errors. =head1 SEE ALSO =over =item http://www.owfs.org Documentation for the full B program suite, including man pages for each of the supported 1-wire devices, and more extensive explanatation of owfs components. =item http://owfs.sourceforge.net/projects/owfs Location where source code is hosted. =back =head1 COPYRIGHT Copyright (c) 2007 Paul H Alfille. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut owfs-3.1p5/module/ownet/perl5/OWNet/t/0000755000175000001440000000000013022537102014477 500000000000000owfs-3.1p5/module/ownet/perl5/OWNet/t/OWNet.t0000644000175000001440000000072212654730021015606 00000000000000# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl OWNet.t' # $Id$ ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; BEGIN { use_ok('OWNet') }; ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. owfs-3.1p5/module/ownet/perl5/OWNet/README0000644000175000001440000000355312654730021015047 00000000000000OWNet version 1.20 $Id$ ================== OWNet is a light-weight module for accessing owserver. The overall goal is an easy way to use the 1-Wire bus and devices. Useful for monitoring, security, hobby, control. (Projects include weather monitoring, heating and cooling control, aquarium, tractor, motorcycle, swimming pool and others.) The full explanation can be found at http://www.owfs.org Basically 1-Wire is a simple and inexpensive way to connect chips made by Dallas Semicondictor to a computer. These chips each have a unique ID, and are individually addressable, even with a bus that has only a combined power/data line and ground. The underlying idea of OWFS (One Wire File System) is to make the whole 1-wire bus look like a file system. Devices are directories (named by their unique ID) and their properties (memory, contact, voltage, temperature,...) are files. owserver is one of the OWFS programs that connects and virtuallizes the 1-wire bus. It communicates via a well-documented tcp/ip protocol, see: http://www.owfs.org/index.php?page=owserver-protocol OWNet is a perl module to connect to a owserver process. There are four methods: read, write, dir, present All that's needed is the ip address of the owserver, and the "path" -- unique name or the 1-wire resource wanted. --------------- OWNet is pure perl. It uses the IO::Socket::INET module for tcp/ip communication. It should be usable on any system with perl, and a network stack. --------------- INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: IO::Socket::INET Net::Rendezvous (optional) COPYRIGHT AND LICENCE Copyright (C) 2007 by Paul H Alfille This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. owfs-3.1p5/module/ownet/perl5/OWNet/MANIFEST0000644000175000001440000000021212654730021015305 00000000000000Changes Makefile.PL MANIFEST README t/OWNet.t lib/OWNet.pm META.yml Module meta-data (added by MakeMaker) owfs-3.1p5/module/ownet/perl5/OWNet/Changes0000644000175000001440000000102312654730021015450 00000000000000Revision history for Perl extension OWNet. $Id$ 0.01 Wed Jan 3 21:42:03 2007 - original version; created by h2xs 1.23 with options -X -n OWNet -b 5.8.0 -O 1.5 1/25/2007 - Add persistent tcp support - Add default port (4304) - Add Bonjour support 1.20 6/14/2010 - Add pressure scale options - Add "-slash" to show trailing / on directory entries - Add optional offset to write - Add optional size and offset to read - Fix bug in write than shortened string - Fix typos in documentation owfs-3.1p5/module/ownet/perl5/OWNet/Makefile.PL0000644000175000001440000000114112654730021016130 00000000000000use 5.008; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. # $Id$ WriteMakefile( NAME => 'OWNet', VERSION_FROM => 'lib/OWNet.pm', # finds $VERSION PREREQ_PM => {}, # e.g., Module::Name => 1.1 ($] >= 5.008 ? ## Add these new keywords supported since 5.008 (ABSTRACT => 'Light-weight connection to owserver to access the Dallas 1-wire system for monitoring and control', POLLUTE => 1, AUTHOR => 'Paul H Alfille ') : ()), ); owfs-3.1p5/module/ownet/perl5/Makefile.am0000644000175000001440000000146212654730021015224 00000000000000EXTRA_DIST = OWNet/README OWNet/MANIFEST OWNet/Changes OWNet/Makefile.PL OWNet/lib/OWNet.pm OWNet/t/OWNet.t examples/test.pl examples/test2.pl all: OWNet/Makefile cd OWNet; $(MAKE) all # Can't really install the perl-modules under prefix-directory.. it should be site-global. OWNet/Makefile: OWNet/Makefile.PL if HAVE_DEBIAN cd OWNet; $(PERL) Makefile.PL INSTALLDIRS=vendor else cd OWNet; $(PERL) Makefile.PL endif install-data-local: OWNet/Makefile if HAVE_DEBIAN (cd OWNet && $(MAKE) install_vendor DESTDIR="$(DESTDIR)") else (cd OWNet && $(MAKE) install DESTDIR="$(DESTDIR)") endif # $(MAKE) -C OWNet install DESTDIR="$(DESTDIR)" # ( cd OWNet; $(MAKE) ; $(MAKE) test; $(MAKE) install ) clean-generic: if test -f OWNet/Makefile; then cd OWNet; $(MAKE) clean; fi @RM@ -f OWNet/Makefile.old OWNet/Makefile owfs-3.1p5/module/ownet/perl5/Makefile.in0000644000175000001440000004217013022537052015235 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/ownet/perl5 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = OWNet/README OWNet/MANIFEST OWNet/Changes OWNet/Makefile.PL OWNet/lib/OWNet.pm OWNet/t/OWNet.t examples/test.pl examples/test2.pl 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) --foreign module/ownet/perl5/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/ownet/perl5/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am 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: 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-libtool 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-data-local 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 mostlyclean-libtool 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 clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am .PRECIOUS: Makefile all: OWNet/Makefile cd OWNet; $(MAKE) all # Can't really install the perl-modules under prefix-directory.. it should be site-global. OWNet/Makefile: OWNet/Makefile.PL @HAVE_DEBIAN_TRUE@ cd OWNet; $(PERL) Makefile.PL INSTALLDIRS=vendor @HAVE_DEBIAN_FALSE@ cd OWNet; $(PERL) Makefile.PL install-data-local: OWNet/Makefile @HAVE_DEBIAN_TRUE@ (cd OWNet && $(MAKE) install_vendor DESTDIR="$(DESTDIR)") @HAVE_DEBIAN_FALSE@ (cd OWNet && $(MAKE) install DESTDIR="$(DESTDIR)") # $(MAKE) -C OWNet install DESTDIR="$(DESTDIR)" # ( cd OWNet; $(MAKE) ; $(MAKE) test; $(MAKE) install ) clean-generic: if test -f OWNet/Makefile; then cd OWNet; $(MAKE) clean; fi @RM@ -f OWNet/Makefile.old OWNet/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: owfs-3.1p5/module/owtcl/0000755000175000001440000000000013022537106012211 500000000000000owfs-3.1p5/module/owtcl/tcl.m40000644000175000001440000023232212654730021013162 00000000000000#------------------------------------------------------------------------ # SC_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([SC_PATH_TCLCONFIG], [AC_PREREQ(2.57)dnl # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, [ --with-tcl directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval}) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d ${libdir} 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib${LIBPOSTFIX} 2>/dev/null` \ ../../tcl \ `ls -dr /usr/lib${LIBPOSTFIX}/tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr /usr/lib${LIBPOSTFIX}/tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr /usr/lib${LIBPOSTFIX}/tcl[[8-9]].[[0-9]]* 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -dr /usr/lib/tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr /usr/lib/tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr /usr/lib/tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then # TCL_BIN_DIR="# no Tcl configs found" TCL_BIN_DIR="" AC_MSG_WARN(Can't find Tcl configuration definitions) # exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh) fi fi ]) #------------------------------------------------------------------------ # SC_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([SC_PATH_TKCONFIG], [AC_PREREQ(2.57)dnl # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, [ --with-tk directory containing tk configuration (tkConfig.sh)], with_tkconfig=${withval}) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" AC_MSG_WARN(Can't find Tk configuration definitions) exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} AC_MSG_RESULT(found $TK_BIN_DIR/tkConfig.sh) fi fi ]) #------------------------------------------------------------------------ # SC_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ AC_DEFUN([SC_LOAD_TCLCONFIG], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . $TCL_BIN_DIR/tclConfig.sh else AC_MSG_RESULT([file not found]) fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" AC_SUBST(TCL_VERSION) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) ]) #------------------------------------------------------------------------ # SC_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN([SC_LOAD_TKCONFIG], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING([for existence of $TK_BIN_DIR/tkConfig.sh]) if test -f "$TK_BIN_DIR/tkConfig.sh" ; then AC_MSG_RESULT([loading]) . $TK_BIN_DIR/tkConfig.sh else AC_MSG_RESULT([could not find $TK_BIN_DIR/tkConfig.sh]) fi AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) ]) #------------------------------------------------------------------------ # SC_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_SHARED], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, [ --enable-shared build and link with shared libraries [--enable-shared]], [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([shared]) SHARED_BUILD=1 else AC_MSG_RESULT([static]) SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD) fi ]) #------------------------------------------------------------------------ # SC_ENABLE_FRAMEWORK -- # # Allows the building of shared libraries into frameworks # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-framework=yes|no # # Sets the following vars: # FRAMEWORK_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_FRAMEWORK], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING([how to package libraries]) AC_ARG_ENABLE(framework, [ --enable-framework package shared libraries in MacOSX frameworks [--disable-framework]], [tcl_ok=$enableval], [tcl_ok=no]) if test "${enable_framework+set}" = set; then enableval="$enable_framework" tcl_ok=$enableval else tcl_ok=no fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([framework]) FRAMEWORK_BUILD=1 if test "${SHARED_BUILD}" = "0" ; then AC_MSG_WARN("Frameworks can only be built if --enable-shared is yes") FRAMEWORK_BUILD=0 fi else AC_MSG_RESULT([standard shared library]) FRAMEWORK_BUILD=0 fi ]) #------------------------------------------------------------------------ # SC_ENABLE_THREADS -- # # Specify if thread support should be enabled. TCL_THREADS is # checked so that if you are compiling an extension against a # threaded core, your extension must be compiled threaded as well. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-threads # # Sets the following vars: # THREADS_LIBS Thread library(s) # # Defines the following vars: # TCL_THREADS # _REENTRANT # _THREAD_SAFE # #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_THREADS], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING(for building with threads) AC_ARG_ENABLE(threads, [ --enable-threads build with threads], [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then if test "${TCL_THREADS}" = 1; then AC_MSG_RESULT([yes (threaded core)]) else AC_MSG_RESULT([yes]) fi TCL_THREADS=1 AC_DEFINE(TCL_THREADS) # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention AC_DEFINE(USE_THREAD_ALLOC) AC_DEFINE(_REENTRANT) if test "`uname -s`" = "SunOS" ; then AC_DEFINE(_POSIX_PTHREAD_SEMANTICS) fi AC_DEFINE(_THREAD_SAFE) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] AC_CHECK_LIB(pthread,__pthread_mutex_init,tcl_ok=yes,tcl_ok=no) fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else AC_CHECK_LIB(pthreads,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else AC_CHECK_LIB(c,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then AC_CHECK_LIB(c_r,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...") fi fi fi fi # Does the pthread-implementation provide # 'pthread_attr_setstacksize' ? ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" AC_CHECK_FUNCS(pthread_attr_setstacksize) AC_CHECK_FUNCS(pthread_atfork) LIBS=$ac_saved_libs AC_CHECK_FUNCS(readdir_r) if test "x$ac_cv_func_readdir_r" = "xyes"; then AC_MSG_CHECKING([how many args readdir_r takes]) # IRIX 5.3 has a 2 arg version of readdir_r # while other systems have a 3 arg version. AC_CACHE_VAL(tcl_cv_two_arg_readdir_r, AC_TRY_COMPILE([#include #include #ifdef NO_DIRENT_H # include /* logic from tcl/compat/dirent.h * # define dirent direct * */ #else # include #endif ], [readdir_r(NULL, NULL);], tcl_cv_two_arg_readdir_r=yes, tcl_cv_two_arg_readdir_r=no)) AC_CACHE_VAL(tcl_cv_three_arg_readdir_r, AC_TRY_COMPILE([#include #include #ifdef NO_DIRENT_H # include /* logic from tcl/compat/dirent.h * # define dirent direct * */ #else # include #endif ], [readdir_r(NULL, NULL, NULL);], tcl_cv_three_arg_readdir_r=yes, tcl_cv_three_arg_readdir_r=no)) if test "x$tcl_cv_two_arg_readdir_r" = "xyes" ; then AC_MSG_RESULT([2]) AC_DEFINE(HAVE_TWO_ARG_READDIR_R) elif test "x$tcl_cv_three_arg_readdir_r" = "xyes" ; then AC_MSG_RESULT([3]) AC_DEFINE(HAVE_THREE_ARG_READDIR_R) else AC_MSG_ERROR([unknown number of args for readdir_r]) fi fi else TCL_THREADS=0 AC_MSG_RESULT([no (default)]) fi AC_SUBST(TCL_THREADS) ]) #------------------------------------------------------------------------ # SC_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used. # Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging # can also be enabled. # # Arguments: # none # # Requires the following vars to be set in the Makefile: # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # LDFLAGS_DEBUG # LDFLAGS_OPTIMIZE # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true # Sets to $(CFLAGS_OPTIMIZE) if false # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true # Sets to $(LDFLAGS_OPTIMIZE) if false # DBGX Debug library extension # #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_SYMBOLS], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" AC_MSG_RESULT([no]) else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' DBGX=g if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG) fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_COMPILE_DEBUG) AC_DEFINE(TCL_COMPILE_STATS) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then AC_MSG_RESULT([enabled symbols mem compile debugging]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi ]) #------------------------------------------------------------------------ # SC_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. # This is only relevant for Unix. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-langinfo=yes|no (default is yes) # # Defines the following vars: # HAVE_LANGINFO Triggers use of nl_langinfo if defined. # #------------------------------------------------------------------------ AC_DEFUN([SC_ENABLE_LANGINFO], [AC_PREREQ(2.57)dnl AC_ARG_ENABLE(langinfo, [ --enable-langinfo use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic], [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then if test "$langinfo_ok" = "yes"; then AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) fi fi AC_MSG_CHECKING([whether to use nl_langinfo]) if test "$langinfo_ok" = "yes"; then AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);],[langinfo_ok=yes],[langinfo_ok=no]) if test "$langinfo_ok" = "no"; then langinfo_ok="no (could not compile with nl_langinfo)"; fi if test "$langinfo_ok" = "yes"; then AC_DEFINE(HAVE_LANGINFO) fi fi AC_MSG_RESULT([$langinfo_ok]) ]) #-------------------------------------------------------------------- # SC_CONFIG_MANPAGES # # Decide whether to use symlinks for linking the manpages, # whether to compress the manpages after installation, and # whether to add a package name suffix to the installed # manpages to avoidfile name clashes. # If compression is enabled also find out what file name suffix # the given compression program is using. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-man-symlinks # --enable-man-compression=PROG # --enable-man-suffix[=STRING] # # Defines the following variable: # # MAN_FLAGS - The apropriate flags for installManPage # according to the user's selection. # #-------------------------------------------------------------------- AC_DEFUN([SC_CONFIG_MANPAGES], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING([whether to use symlinks for manpages]) AC_ARG_ENABLE(man-symlinks, [ --enable-man-symlinks use symlinks for the manpages], test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks", enableval="no") AC_MSG_RESULT([$enableval]) AC_MSG_CHECKING([whether to compress the manpages]) AC_ARG_ENABLE(man-compression, [ --enable-man-compression=PROG compress the manpages with PROG], test "$enableval" = "yes" && AC_MSG_ERROR([missing argument to --enable-man-compression]) test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --compress $enableval", enableval="no") AC_MSG_RESULT([$enableval]) if test "$enableval" != "no"; then AC_MSG_CHECKING([for compressed file suffix]) touch TeST $enableval TeST Z=`ls TeST* | sed 's/^....//'` rm -f TeST* MAN_FLAGS="$MAN_FLAGS --extension $Z" AC_MSG_RESULT([$Z]) fi AC_MSG_CHECKING([whether to add a package name suffix for the manpages]) AC_ARG_ENABLE(man-suffix, [ --enable-man-suffix=STRING use STRING as a suffix to manpage file names (default: $1)], test "$enableval" = "yes" && enableval="$1" test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --suffix $enableval", enableval="no") AC_MSG_RESULT([$enableval]) AC_SUBST(MAN_FLAGS) ]) #-------------------------------------------------------------------- # SC_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # Arguments: # none # # Results: # # Defines and substitutes the following vars: # # DL_OBJS - Name of the object file that implements dynamic # loading for Tcl on this system. # DL_LIBS - Library file(s) to include in tclsh and other base # applications in order for the "load" command to work. # LDFLAGS - Flags to pass to the compiler when linking object # files into an executable application binary such # as tclsh. # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. Could # be the same as CC_SEARCH_FLAGS if ${CC} is used to link. # CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. # MAKE_LIB - Command to execute to build the a library; # differs when building shared or static. # MAKE_STUB_LIB - # Command to execute to build a stub library. # INSTALL_LIB - Command to execute to install a library; # differs when building shared or static. # INSTALL_STUB_LIB - # Command to execute to install a stub library. # STLIB_LD - Base command to use for combining object files # into a static library. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components # of a shared library (may request position-independent # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. # SHLIB_LD_FLAGS -Flags to pass when building a shared library. This # differes from the SHLIB_CFLAGS as it is not used # when building object files or executables. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when # creating shared libraries. This symbol typically # goes at the end of the "ld" commands that build # shared libraries. The value of the symbol is # "${LIBS}" if all of the dependent libraries should # be specified when creating a shared library. If # dependent libraries should not be specified (as on # SunOS 4.x, where they cause the link to fail, or in # general if Tcl and Tk aren't themselves shared # libraries), then this symbol has an empty string # as its value. # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable # extensions. An empty string means we don't know how # to use shared libraries on this platform. # TCL_SHLIB_LD_EXTRAS - Additional element which are added to SHLIB_LD_LIBS # TK_SHLIB_LD_EXTRAS for the build of Tcl and Tk, but not recorded in the # tclConfig.sh, since they are only used for the build # of Tcl and Tk. # Examples: MacOS X records the library version and # compatibility version in the shared library. But # of course the Tcl version of this is only used for Tcl. # LIB_SUFFIX - Specifies everything that comes after the "libfoo" # in a static or shared library name, using the $VERSION variable # to put the version in the right place. This is used # by platforms that need non-standard library names. # Examples: ${VERSION}.so.1.1 on NetBSD, since it needs # to have a version after the .so, and ${VERSION}.a # on AIX, since a shared library needs to have # a .a extension whereas shared objects for loadable # extensions have a .so extension. Defaults to # ${VERSION}${SHLIB_SUFFIX}. # TCL_NEEDS_EXP_FILE - # 1 means that an export file is needed to link to a # shared library. # TCL_EXP_FILE - The name of the installed export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # TCL_BUILD_EXP_FILE - # The name of the built export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # CFLAGS_DEBUG - # Flags used when running the compiler in debug mode # CFLAGS_OPTIMIZE - # Flags used when running the compiler in optimize mode # CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) # #-------------------------------------------------------------------- AC_DEFUN([SC_CONFIG_CFLAGS], [AC_PREREQ(2.57)dnl # Step 0.a: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)],,enableval="no") if test "$enableval" = "yes"; then do64bit=yes else do64bit=no fi AC_MSG_RESULT($do64bit) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support],,enableval="no") if test "$enableval" = "yes"; then # Force 64bit on with VIS do64bit=yes do64bitVIS=yes else do64bitVIS=no fi AC_MSG_RESULT($do64bitVIS) # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. AC_MSG_CHECKING([system version (for dynamic loading)]) if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_RESULT([unknown (can't find uname command)]) system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print $3}' /etc/.relid'` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi AC_MSG_RESULT($system) fi fi # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Require ranlib early so we can override it in special cases below. AC_REQUIRE([AC_PROG_RANLIB]) # Step 3: set configuration options based on system name and version. do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then CFLAGS_WARNING="-Wall -Wno-implicit-int -fno-strict-aliasing" else CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. dnl AC_CHECK_TOOL(AR, ar) AC_CHECK_PROG(AR, ar, ar) if test "${AR}" = "" ; then AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.]) fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" PLAT_OBJS="" case $system in AIX-5.*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used if test "${CC}" != "cc_r" ; then CC=${CC}_r fi AC_MSG_RESULT(Using $CC for compiling with threads) fi LIBS="$LIBS -lc" # AIX-5 uses ELF style dynamic libraries SHLIB_CFLAGS="" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN("64bit mode not supported with GCC on $system") else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS="$LDFLAGS -q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' fi ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used if test "${CC}" != "cc_r" ; then CC=${CC}_r fi AC_MSG_RESULT(Using $CC for compiling with threads) fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} LD_LIBRARY_PATH_VAR="LIBPATH" TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then LIBOBJS="$LIBOBJS tclLoadAix.o" DL_LIBS="-lld" fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN("64bit mode not supported with GCC on $system") else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS="$LDFLAGS -q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" AC_DEFINE(USE_DELTA_FOR_TZ) fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CC} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="cc -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible AC_DEFINE(_XOPEN_SOURCE) # Use the XOPEN network library AC_DEFINE(_XOPEN_SOURCE_EXTENDED) # Use the XOPEN network library LIBS="$LIBS -lxnet" # Use the XOPEN network library SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="gcc -shared" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS='' CC_SEARCH_FLAGS='' fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`gcc -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="gcc -shared" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS='' CC_SEARCH_FLAGS='' ;; *) AC_MSG_WARN("64bit mode not supported with GCC on $system") ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS="$LDFLAGS +DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported by gcc]) else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS="$LDFLAGS -64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-O2 # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS=""]) fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${LIBOBJS}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi # XIM peeking works under XFree86. AC_DEFINE(PEEK_XCLOSEIM) ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" DL_OBJS="" DL_LIBS="-ldld" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS=""]) fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[[1-2]].*) # Not available on all versions: check for include file. AC_CHECK_HEADER(dlfcn.h, [ # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' AC_MSG_CHECKING(for ELF) AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], AC_MSG_RESULT(yes) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so', AC_MSG_RESULT(no) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' ) ], [ SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' ]) # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" AC_MSG_CHECKING(for ELF) AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], [AC_MSG_RESULT(yes) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'], [AC_MSG_RESULT(no) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'] ) # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Rhapsody-*|Darwin-*) SHLIB_CFLAGS="-fno-common" SHLIB_LD="cc -dynamiclib \${LDFLAGS}" TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version \${VERSION} -install_name \${DYLIB_INSTALL_DIR}/\${TCL_LIB_FILE} -prebind -seg1addr 0xa000000" TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version \${VERSION} -install_name \${DYLIB_INSTALL_DIR}/\${TK_LIB_FILE} -prebind -seg1addr 0xb000000" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" PLAT_OBJS=\$\(MAC\_OSX_OBJS\) DL_LIBS="" LDFLAGS="$LDFLAGS -prebind" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" CFLAGS_OPTIMIZE="-Os" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" AC_DEFINE(MAC_OSX_TCL) AC_DEFINE(HAVE_CFBUNDLE) AC_DEFINE(USE_VFORK) AC_DEFINE(TCL_DEFAULT_ENCODING,"utf-8") LIBS="$LIBS -framework CoreFoundation" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="cc -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export $@:' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[[0-6]]*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS) SHLIB_CFLAGS="-KPIC" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS) SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN("64bit mode not supported with GCC on $system") else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS="$LDFLAGS -xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS="$LDFLAGS -xarch=v9" fi fi else AC_MSG_WARN("64bit mode only supported sparcv9 system") fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_LD="$CC -shared" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$GCC" != "yes" ; then CFLAGS="$CFLAGS -DHAVE_TZSET -std1" fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS AC_MSG_CHECKING(for ld accepts -Bexport flag) LDFLAGS="$LDFLAGS -Wl,-Bexport" AC_TRY_LINK(, [int i;], [found=yes], [LDFLAGS=$hold_ldflags found=no]) AC_MSG_RESULT($found) CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then AC_MSG_WARN("64bit support being disabled -- don\'t know magic for this platform") fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need # to determine which of several header files defines the a.out file # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we # support only a file format that is more or less version-7-compatible. # In particular, # - a.out files must begin with `struct exec'. # - the N_TXTOFF on the `struct exec' must compute the seek address # of the text segment # - The `struct exec' must contain a_magic, a_text, a_data, a_bss # and a_entry fields. # The following compilation should succeed if and only if either sys/exec.h # or a.out.h is usable for the purpose. # # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the # `struct exec' includes a second header that contains information that # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then AC_MSG_CHECKING(sys/exec.h) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT($tcl_ok) if test $tcl_ok = usable; then AC_DEFINE(USE_SYS_EXEC_H) else AC_MSG_CHECKING(a.out.h) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT($tcl_ok) if test $tcl_ok = usable; then AC_DEFINE(USE_A_OUT_H) else AC_MSG_CHECKING(sys/exec_aout.h) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT($tcl_ok) if test $tcl_ok = usable; then AC_DEFINE(USE_SYS_EXEC_AOUT_H) else DL_OBJS="" fi fi fi fi # Step 5: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, [ --disable-load disallow dynamic loading and "load" command], [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Rhapsody-*|Darwin-*) ;; RISCos-*) ;; SCO_SV-3.2*) ;; ULTRIX-4.*) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' fi if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o [$]@ ${SHLIB_LD_FLAGS} ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' else LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} if test "$RANLIB" = "" ; then MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}' INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' else MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@' INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))' fi dnl Not at all clear what this was doing in Tcl's configure.in dnl or why it was needed was needed. In any event, this sort of dnl things needs to be done in the big loop above. dnl REMOVE THIS BLOCK LATER! (mdejong) dnl case $system in dnl BSD/OS*) dnl ;; dnl AIX-[[1-4]].*) dnl ;; dnl *) dnl SHLIB_LD_LIBS="" dnl ;; dnl esac fi # Stub lib does not depend on shared/static configuration if test "$RANLIB" = "" ; then MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS}' INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)' else MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@' INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))' fi AC_SUBST(DL_LIBS) AC_SUBST(DL_OBJS) AC_SUBST(PLAT_OBJS) AC_SUBST(CFLAGS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS_DEBUG) AC_SUBST(LDFLAGS_OPTIMIZE) AC_SUBST(CC_SEARCH_FLAGS) AC_SUBST(LD_SEARCH_FLAGS) AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(TCL_SHLIB_LD_EXTRAS) AC_SUBST(TK_SHLIB_LD_EXTRAS) AC_SUBST(SHLIB_LD_FLAGS) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_SUFFIX) AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_STUB_LIB) AC_SUBST(INSTALL_LIB) AC_SUBST(INSTALL_STUB_LIB) AC_SUBST(RANLIB) ]) #-------------------------------------------------------------------- # SC_SERIAL_PORT # # Determine which interface to use to talk to the serial port. # Note that #include lines must begin in leftmost column for # some compilers to recognize them as preprocessor directives, # and some build environments have stdin not pointing at a # pseudo-terminal (usually /dev/null instead.) # # Arguments: # none # # Results: # # Defines only one of the following vars: # HAVE_SYS_MODEM_H # USE_TERMIOS # USE_TERMIO # USE_SGTTY # #-------------------------------------------------------------------- AC_DEFUN([SC_SERIAL_PORT], [AC_PREREQ(2.57)dnl AC_CHECK_HEADERS(sys/modem.h) AC_MSG_CHECKING([termios vs. termio vs. sgtty]) AC_CACHE_VAL(tcl_cv_api_serial, [ AC_TRY_RUN([ #include int main() { struct termios t; if (tcgetattr(0, &t) == 0) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include #include int main() { struct termios t; if (tcgetattr(0, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) fi]) case $tcl_cv_api_serial in termios) AC_DEFINE(USE_TERMIOS);; termio) AC_DEFINE(USE_TERMIO);; sgtty) AC_DEFINE(USE_SGTTY);; esac AC_MSG_RESULT($tcl_cv_api_serial) ]) #-------------------------------------------------------------------- # SC_MISSING_POSIX_HEADERS # # Supply substitutes for missing POSIX header files. Special # notes: # - stdlib.h doesn't define strtol, strtoul, or # strtod insome versions of SunOS # - some versions of string.h don't declare procedures such # as strstr # # Arguments: # none # # Results: # # Defines some of the following vars: # NO_DIRENT_H # NO_ERRNO_H # NO_VALUES_H # HAVE_LIMITS_H or NO_LIMITS_H # NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_UNISTD_H # HAVE_SYS_PARAM_H # # HAVE_STRING_H ? # #-------------------------------------------------------------------- AC_DEFUN([SC_MISSING_POSIX_HEADERS], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING(dirent.h) AC_TRY_LINK([#include #include ], [ #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ], tcl_ok=yes, tcl_ok=no) if test $tcl_ok = no; then AC_DEFINE(NO_DIRENT_H) fi AC_MSG_RESULT($tcl_ok) AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)]) AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)]) AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)]) AC_CHECK_HEADER(limits.h, [AC_DEFINE(HAVE_LIMITS_H)], [AC_DEFINE(NO_LIMITS_H)]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) if test $tcl_ok = 0; then AC_DEFINE(NO_STDLIB_H) fi AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then AC_DEFINE(NO_STRING_H) fi AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H)]) AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H)]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). AC_HAVE_HEADERS(unistd.h sys/param.h) ]) #-------------------------------------------------------------------- # SC_PATH_X # # Locate the X11 header files and the X11 library archive. Try # the ac_path_x macro first, but if it doesn't find the X stuff # (e.g. because there's no xmkmf program) then check through # a list of possible directories. Under some conditions the # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. # # Arguments: # none # # Results: # # Sets the the following vars: # XINCLUDES # XLIBSW # #-------------------------------------------------------------------- AC_DEFUN([SC_PATH_X], [AC_PREREQ(2.57)dnl AC_PATH_X not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then AC_TRY_CPP([#include ], , not_really_there="yes") else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then AC_MSG_CHECKING(for X11 header files) found_xincludes="no" AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then AC_MSG_RESULT($i) XINCLUDES=" -I$i" found_xincludes="yes" break fi done fi else if test "$x_includes" != ""; then XINCLUDES="-I$x_includes" found_xincludes="yes" fi fi if test found_xincludes = "no"; then AC_MSG_RESULT(couldn't find any!) fi if test "$no_x" = yes; then AC_MSG_CHECKING(for X11 libraries) XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then AC_MSG_RESULT($i) XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) fi if test "$XLIBSW" = nope ; then AC_MSG_RESULT(couldn't find any! Using -lX11.) XLIBSW=-lX11 fi ]) #-------------------------------------------------------------------- # SC_BLOCKING_STYLE # # The statements below check for systems where POSIX-style # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. # On these systems (mostly older ones), use the old BSD-style # FIONBIO approach instead. # # Arguments: # none # # Results: # # Defines some of the following vars: # HAVE_SYS_IOCTL_H # HAVE_SYS_FILIO_H # USE_FIONBIO # O_NONBLOCK # #-------------------------------------------------------------------- AC_DEFUN([SC_BLOCKING_STYLE], [AC_PREREQ(2.57)dnl AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print $3}' /etc/.relid'` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi fi fi case $system in # There used to be code here to use FIONBIO under AIX. However, it # was reported that FIONBIO doesn't work under AIX 3.2.5. Since # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO # code (JO, 5/31/97). OSF*) AC_DEFINE(USE_FIONBIO) AC_MSG_RESULT(FIONBIO) ;; SunOS-4*) AC_DEFINE(USE_FIONBIO) AC_MSG_RESULT(FIONBIO) ;; ULTRIX-4.*) AC_DEFINE(USE_FIONBIO) AC_MSG_RESULT(FIONBIO) ;; *) AC_MSG_RESULT(O_NONBLOCK) ;; esac ]) #-------------------------------------------------------------------- # SC_TIME_HANLDER # # Checks how the system deals with time.h, what time structures # are used on the system, and what fields the structures have. # # Arguments: # none # # Results: # # Defines some of the following vars: # USE_DELTA_FOR_TZ # HAVE_TM_GMTOFF # HAVE_TM_TZADJ # HAVE_TIMEZONE_VAR # #-------------------------------------------------------------------- AC_DEFUN([SC_TIME_HANDLER], [AC_PREREQ(2.57)dnl AC_CHECK_HEADERS(sys/time.h) AC_HEADER_TIME AC_STRUCT_TIMEZONE AC_CHECK_FUNCS(gmtime_r localtime_r) AC_MSG_CHECKING([tm_tzadj in struct tm]) AC_CACHE_VAL(tcl_cv_member_tm_tzadj, AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)) AC_MSG_RESULT($tcl_cv_member_tm_tzadj) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ) fi AC_MSG_CHECKING([tm_gmtoff in struct tm]) AC_CACHE_VAL(tcl_cv_member_tm_gmtoff, AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)) AC_MSG_RESULT($tcl_cv_member_tm_gmtoff) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF) fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # AC_MSG_CHECKING([long timezone variable]) AC_CACHE_VAL(tcl_cv_var_timezone, AC_TRY_COMPILE([#include ], [extern long timezone; timezone += 1; exit (0);], tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)) AC_MSG_RESULT($tcl_cv_timezone_long) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # AC_MSG_CHECKING([time_t timezone variable]) AC_CACHE_VAL(tcl_cv_timezone_time, AC_TRY_COMPILE([#include ], [extern time_t timezone; timezone += 1; exit (0);], tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)) AC_MSG_RESULT($tcl_cv_timezone_time) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR) fi fi ]) #-------------------------------------------------------------------- # SC_BUGGY_STRTOD # # Under Solaris 2.4, strtod returns the wrong value for the # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. # Also, on Compaq's Tru64 Unix 5.0, # strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none # # Results: # # Might defines some of the following vars: # strtod (=fixstrtod) # #-------------------------------------------------------------------- AC_DEFUN([SC_BUGGY_STRTOD], [AC_PREREQ(2.57)dnl AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) if test "$tcl_strtod" = 1; then AC_MSG_CHECKING([for Solaris2.4/Tru64 strtod bugs]) AC_CACHE_VAL(tcl_cv_strtod_buggy,[ AC_TRY_RUN([ extern double strtod(); int main() { char *infString="Inf", *nanString="NaN", *spaceString=" "; char *term; double value; value = strtod(infString, &term); if ((term != infString) && (term[-1] == 0)) { exit(1); } value = strtod(nanString, &term); if ((term != nanString) && (term[-1] == 0)) { exit(1); } value = strtod(spaceString, &term); if (term == (spaceString+1)) { exit(1); } exit(0); }], tcl_cv_strtod_buggy=1, tcl_cv_strtod_buggy=0, tcl_cv_strtod_buggy=0)]) if test "$tcl_cv_strtod_buggy" = 1; then AC_MSG_RESULT(ok) else AC_MSG_RESULT(buggy) LIBOBJS="$LIBOBJS fixstrtod.o" AC_DEFINE(strtod, fixstrtod) fi fi ]) #-------------------------------------------------------------------- # SC_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm) and socket stuff (-lsocket vs. # -lnsl) are dealt with here. # # Arguments: # Requires the following vars to be set in the Makefile: # DL_LIBS # LIBS # MATH_LIBS # # Results: # # Subst's the following var: # TCL_LIBS # MATH_LIBS # # Might append to the following vars: # LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_LINK_LIBS], [AC_PREREQ(2.57)dnl #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_HEADER(net/errno.h, [AC_DEFINE(HAVE_NET_ERRNO_H)]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call SC_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' AC_SUBST(TCL_LIBS) AC_SUBST(MATH_LIBS) ]) #-------------------------------------------------------------------- # SC_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _LARGEFILE64_SOURCE # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_EARLY_FLAG], [AC_PREREQ(2.57)dnl AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, AC_TRY_COMPILE([[#define ]$1[ 1 ]$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1) tcl_flags="$tcl_flags $1" fi]) AC_DEFUN([SC_TCL_EARLY_FLAGS], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], [struct stat64 buf; int i = stat64("/", &buf);]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT(none) else AC_MSG_RESULT(${tcl_flags}) fi]) #-------------------------------------------------------------------- # SC_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # TCL_WIDE_INT_TYPE # HAVE_STRUCT_DIRENT64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_64BIT_FLAGS], [AC_PREREQ(2.57)dnl AC_MSG_CHECKING([for 64-bit integer type]) AC_CACHE_VAL(tcl_cv_type_64bit,[ tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], tcl_type_64bit=__int64, tcl_type_64bit="long long") # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... AC_TRY_COMPILE(,[switch (0) { case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; }],tcl_cv_type_64bit=${tcl_type_64bit})]) if test "${tcl_cv_type_64bit}" = none ; then AC_DEFINE(TCL_WIDE_INT_IS_LONG) AC_MSG_RESULT(using long) else AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}) AC_MSG_RESULT(${tcl_cv_type_64bit}) # Now check for auxiliary declarations AC_MSG_CHECKING([for struct dirent64]) AC_CACHE_VAL(tcl_cv_struct_dirent64,[ AC_TRY_COMPILE([#include #include ],[struct dirent64 p;], tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64) fi AC_MSG_RESULT(${tcl_cv_struct_dirent64}) AC_MSG_CHECKING([for struct stat64]) AC_CACHE_VAL(tcl_cv_struct_stat64,[ AC_TRY_COMPILE([#include ],[struct stat64 p; ], tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64) fi AC_MSG_RESULT(${tcl_cv_struct_stat64}) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_TRY_COMPILE([#include ],[off64_t offset; ], tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) AC_CHECK_FUNCS(open64 lseek64) dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the dnl functions lseek64 and open64 are defined. if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi]) owfs-3.1p5/module/owtcl/example/0000755000175000001440000000000013022537106013644 500000000000000owfs-3.1p5/module/owtcl/example/owdir.tcl0000644000175000001440000000145112654730021015416 00000000000000#!/usr/bin/env tclsh # -*- Tcl -*- # File: owdir.tcl # # $Id$ # # Start script with this command: tclsh owdir.tcl # package require ow 0.2 puts [ ::OW::version ] if { $argc == 0 } { puts "Usage:" puts "\towdir.tcl 1wire-adapter \[dir\]" puts " 1wire-adapter (required):" puts "\t'u' for USB -or-" puts "\t--fake=10,28 for a fake-adapter with DS18S20 and DS18B20-sensor -or-" puts "\t/dev/ttyS0 (or whatever) serial port -or-" puts "\t4304 for remote-server at port 4304" puts "\t192.168.1.1:4304 for remote-server at 192.168.1.1:4304" exit; } set adapter [ lindex $argv 0 ]; if { $argc > 1 } { set dir [ lindex $argv 1 ]; } else { set dir "/"; } ::OW::init $adapter #::OW::set_error_print 2; #::OW::set_error_level 9; puts [ ::OW::get $dir ] ::OW::finish owfs-3.1p5/module/owtcl/example/test.tcl0000644000175000001440000000133512654730021015252 00000000000000#!/usr/bin/env tclsh # -*- Tcl -*- # File: test.tcl # # $Id$ # # Start script with this command: tclsh test.tcl # package require ow 0.2 puts "Version information:" puts [ ::OW::version ] ::OW::init --fake 28 --fake 10 puts "\nDirectory-listing of / (return string)" puts [ ::OW::get "/" ] puts "\nDirectory-listing of / (return list)" set list [ ::OW::get / -list ] puts $list puts "\nFirst object in directory list" puts [ lindex $list 0 ] puts "\nRead /10.67C6697351FF/temperature" puts [ ::OW::get "/10.67C6697351FF/temperature" ] puts "\nRead /10.67C6697351FF/type" puts [ ::OW::get "/10.67C6697351FF/type" ] puts "\nRead bus.0/interface/settings/name" puts [ ::OW::get "bus.0/interface/settings/name" ] ::OW::finish owfs-3.1p5/module/owtcl/Makefile.am0000644000175000001440000000517512654730021014176 00000000000000include version.h EXTRA_DIST = owtclInitScript.h tcl.m4 ow.tcl example/owdir.tcl example/test.tcl pkglib_LTLIBRARIES = ow.la ow_la_SOURCES = ow.c ow_la_LDFLAGS = -module -release $(OWTCL_VERSION) -shared -shrext "$(TCL_SHLIB_SUFFIX)" #ow_la_LIBADD = ../owlib/src/c/libow.la ../owcapi/src/c/libowcapi.la ow_la_LIBADD = $(TCL_LIB_SPEC) ../owlib/src/c/libow.la ../owcapi/src/c/libowcapi.la ${TCL_LIBS} ow_la_DEPENDENCIES = ../owlib/src/c/libow.la ../owcapi/src/c/libowcapi.la ow.lo: owtclInitScript.h ow.tcl.h version.h data_DATA = ow.tcl pkgIndex.tcl if HAVE_DARWIN noinst_DATA = darwin-relink endif PACKAGE = ow MAJOR_VERSION = $(OWTCL_MAJOR_VERSION) MINOR_VERSION = $(OWTCL_MINOR_VERSION) pkglibdir = @OWTCL_INSTALL_PATH@/owtcl-$(OWTCL_VERSION) #something like this. $(TCL_EXEC_PREFIX)/lib@LIBPOSTFIX@/owtcl-$(OWTCL_VERSION) datadir = $(pkglibdir) #SHLIB_SUFFIX = $(TCL_SHLIB_SUFFIX) LIBTOOL_DEPS = @LIBTOOL_DEPS@ AM_CFLAGS = -I../owlib/src/include \ -I../owcapi/src/include \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${EXTRACFLAGS} \ ${LIBUSB_CFLAGS} \ ${PTHREAD_CFLAGS} \ $(TCL_DEFS) \ $(TCL_SHLIB_CFLAGS) \ $(TCL_INCLUDE_SPEC) \ -DTCL_PACKAGE_PATH=\"'$(TCL_PACKAGE_PATH)'\" \ -DOWTCL_PACKAGE_PATH=\"$(pkglibdir)\" \ ${PIC_FLAGS} #LDADD = -L../owlib/src/c $(TCL_LIB_SPEC) -low -lowcapi ${TCL_LIBS} ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} #LDADD = $(TCL_LIB_SPEC) ../owlib/src/c/libow.la ../owcapi/src/c/libowcapi.la ${TCL_LIBS} ${PTHREAD_CFLAGS} ${PTHREAD_LIBS} #SHLIB_LD = $(TCL_SHLIB_LD) $(LIBS) -low ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} clean-local: @RM@ -f ow.tcl.h pkgIndex.tcl darwin-relink ow.tcl.h: ow.tcl ${ow_la_DEPENDENCIES} sed -e '/^$\#/d' -e '/^$$/d' -e 's/\\\"/\\\\"/g' -e 's/\"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $@ || { $(RM) $@; exit 1; } # Have to relink the library since it's generated with -bundle, it should be -dynamiclib darwin-relink: ow.la # mv .libs/ow-$(OWTCL_VERSION)$(TCL_SHLIB_SUFFIX) .libs/ow-$(OWTCL_VERSION)$(TCL_SHLIB_SUFFIX).old gcc -dynamiclib -flat_namespace -undefined suppress \ -o .libs/ow-$(OWTCL_VERSION)$(TCL_SHLIB_SUFFIX) \ .libs/ow.o \ ../owlib/src/c/.libs/libow.so \ ${LIBUSB_LIBS} \ ../owcapi/src/c/.libs/libowcapi.so \ -install_name $(pkglibdir)/ow-$(OWTCL_VERSION)$(TCL_SHLIB_SUFFIX) \ -compatibility_version 1 -current_version 1.0 touch $@ pkgIndex.tcl: (echo 'if {[catch {package require Tcl 8.1}]} return';\ echo 'package ifneeded $(PACKAGE) $(OWTCL_VERSION)\ [list load [file join $$dir $(PACKAGE)$(TCL_SHLIB_SUFFIX)] $(PACKAGE)]'\ ) > pkgIndex.tcl owfs-3.1p5/module/owtcl/Makefile.in0000644000175000001440000006752013022537053014211 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owtcl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(pkglibdir)" "$(DESTDIR)$(datadir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = am_ow_la_OBJECTS = ow.lo ow_la_OBJECTS = $(am_ow_la_OBJECTS) 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 = ow_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(ow_la_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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(ow_la_SOURCES) DIST_SOURCES = $(ow_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(data_DATA) $(noinst_DATA) 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 $(srcdir)/version.h \ $(top_srcdir)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibdir = @OWTCL_INSTALL_PATH@/owtcl-$(OWTCL_VERSION) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ #SHLIB_SUFFIX = $(TCL_SHLIB_SUFFIX) LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = ow PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ #something like this. $(TCL_EXEC_PREFIX)/lib@LIBPOSTFIX@/owtcl-$(OWTCL_VERSION) datadir = $(pkglibdir) datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #if 0 OWTCL_MAJOR_VERSION = 1 OWTCL_MINOR_VERSION = 0 OWTCL_VERSION = $(OWTCL_MAJOR_VERSION).$(OWTCL_MINOR_VERSION) EXTRA_DIST = owtclInitScript.h tcl.m4 ow.tcl example/owdir.tcl example/test.tcl pkglib_LTLIBRARIES = ow.la ow_la_SOURCES = ow.c ow_la_LDFLAGS = -module -release $(OWTCL_VERSION) -shared -shrext "$(TCL_SHLIB_SUFFIX)" #ow_la_LIBADD = ../owlib/src/c/libow.la ../owcapi/src/c/libowcapi.la ow_la_LIBADD = $(TCL_LIB_SPEC) ../owlib/src/c/libow.la ../owcapi/src/c/libowcapi.la ${TCL_LIBS} ow_la_DEPENDENCIES = ../owlib/src/c/libow.la ../owcapi/src/c/libowcapi.la data_DATA = ow.tcl pkgIndex.tcl @HAVE_DARWIN_TRUE@noinst_DATA = darwin-relink MAJOR_VERSION = $(OWTCL_MAJOR_VERSION) MINOR_VERSION = $(OWTCL_MINOR_VERSION) AM_CFLAGS = -I../owlib/src/include \ -I../owcapi/src/include \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${EXTRACFLAGS} \ ${LIBUSB_CFLAGS} \ ${PTHREAD_CFLAGS} \ $(TCL_DEFS) \ $(TCL_SHLIB_CFLAGS) \ $(TCL_INCLUDE_SPEC) \ -DTCL_PACKAGE_PATH=\"'$(TCL_PACKAGE_PATH)'\" \ -DOWTCL_PACKAGE_PATH=\"$(pkglibdir)\" \ ${PIC_FLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/version.h $(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) --foreign module/owtcl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owtcl/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(srcdir)/version.h $(am__empty): $(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-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } ow.la: $(ow_la_OBJECTS) $(ow_la_DEPENDENCIES) $(EXTRA_ow_la_DEPENDENCIES) $(AM_V_CCLD)$(ow_la_LINK) -rpath $(pkglibdir) $(ow_la_OBJECTS) $(ow_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow.Plo@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || 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)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) 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: $(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 $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(datadir)"; 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-libtool clean-local \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dataDATA uninstall-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-local clean-pkglibLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dataDATA 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-pkglibLTLIBRARIES \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-dataDATA \ uninstall-pkglibLTLIBRARIES .PRECIOUS: Makefile #endif #define OWTCL_MAJOR_VERSION 1 #define OWTCL_MINOR_VERSION 0 #define OWTCL_VERSION "1.0" ow.lo: owtclInitScript.h ow.tcl.h version.h #LDADD = -L../owlib/src/c $(TCL_LIB_SPEC) -low -lowcapi ${TCL_LIBS} ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} #LDADD = $(TCL_LIB_SPEC) ../owlib/src/c/libow.la ../owcapi/src/c/libowcapi.la ${TCL_LIBS} ${PTHREAD_CFLAGS} ${PTHREAD_LIBS} #SHLIB_LD = $(TCL_SHLIB_LD) $(LIBS) -low ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} clean-local: @RM@ -f ow.tcl.h pkgIndex.tcl darwin-relink ow.tcl.h: ow.tcl ${ow_la_DEPENDENCIES} sed -e '/^$\#/d' -e '/^$$/d' -e 's/\\\"/\\\\"/g' -e 's/\"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $@ || { $(RM) $@; exit 1; } # Have to relink the library since it's generated with -bundle, it should be -dynamiclib darwin-relink: ow.la # mv .libs/ow-$(OWTCL_VERSION)$(TCL_SHLIB_SUFFIX) .libs/ow-$(OWTCL_VERSION)$(TCL_SHLIB_SUFFIX).old gcc -dynamiclib -flat_namespace -undefined suppress \ -o .libs/ow-$(OWTCL_VERSION)$(TCL_SHLIB_SUFFIX) \ .libs/ow.o \ ../owlib/src/c/.libs/libow.so \ ${LIBUSB_LIBS} \ ../owcapi/src/c/.libs/libowcapi.so \ -install_name $(pkglibdir)/ow-$(OWTCL_VERSION)$(TCL_SHLIB_SUFFIX) \ -compatibility_version 1 -current_version 1.0 touch $@ pkgIndex.tcl: (echo 'if {[catch {package require Tcl 8.1}]} return';\ echo 'package ifneeded $(PACKAGE) $(OWTCL_VERSION)\ [list load [file join $$dir $(PACKAGE)$(TCL_SHLIB_SUFFIX)] $(PACKAGE)]'\ ) > pkgIndex.tcl # 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: owfs-3.1p5/module/owtcl/version.h0000644000175000001440000000032312654730021013766 00000000000000#if 0 OWTCL_MAJOR_VERSION = 1 OWTCL_MINOR_VERSION = 0 OWTCL_VERSION = $(OWTCL_MAJOR_VERSION).$(OWTCL_MINOR_VERSION) #endif #define OWTCL_MAJOR_VERSION 1 #define OWTCL_MINOR_VERSION 0 #define OWTCL_VERSION "1.0" owfs-3.1p5/module/owtcl/ow.c0000644000175000001440000003470012654730021012727 00000000000000// -*- C++ -*- // File: ow.c // // Created: Mon Jan 10 22:34:41 2005 // // $Id$ // // Some Ugly code to keep command line #define from being over_written by #define SAVE_FOR_NOW_PACKAGE_NAME PACKAGE_NAME #undef PACKAGE_NAME #define SAVE_FOR_NOW_PACKAGE_STRING PACKAGE_STRING #undef PACKAGE_STRING #define SAVE_FOR_NOW_PACKAGE_TARNAME PACKAGE_TARNAME #undef PACKAGE_TARNAME #define SAVE_FOR_NOW_PACKAGE_VERSION PACKAGE_VERSION #undef PACKAGE_VERSION #include // Now restore #undef PACKAGE_NAME #define PACKAGE_NAME SAVE_FOR_NOW_PACKAGE_NAME #undef PACKAGE_STRING #define PACKAGE_STRING SAVE_FOR_NOW_PACKAGE_STRING #undef PACKAGE_TARNAME #define PACKAGE_TARNAME SAVE_FOR_NOW_PACKAGE_TARNAME #undef PACKAGE_VERSION #define PACKAGE_VERSION SAVE_FOR_NOW_PACKAGE_VERSION #include "owfs_config.h" #ifdef HAVE_VASPRINTF #define _GNU_SOURCE 1 #endif #include #include "ow.h" #include "owcapi.h" #include "version.h" #include /* Shorthand macros for some cumbersome definitions. */ #define owtcl_ObjCmdProc(name) \ int name (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj **objv) #define owtcl_ArgObjIncr \ int objix; \ for (objix=0; objixused) { owtcl_Error(interp, "OWTCL", "CONNECTED", "owtcl already connected"); tcl_return = TCL_ERROR; goto common_exit; } /* Actually connect to onewire host(s). */ arg = Tcl_GetStringFromObj(objv[1], &con_len); r = OW_init(arg); if (r != 0) { owtcl_ErrorOWlib(interp); tcl_return = TCL_ERROR; goto common_exit; } /* Remember connected state. */ OwtclStatePtr->used = 1; common_exit: owtcl_ArgObjDecr; return tcl_return; } owtcl_ObjCmdProc(Owtcl_isConnect) { OwtclStateType *OwtclStatePtr = (OwtclStateType *) clientData; Tcl_Obj *resultPtr; owtcl_ArgObjIncr; resultPtr = Tcl_GetObjResult(interp); if (OwtclStatePtr->used) Tcl_SetIntObj(resultPtr, 1); else Tcl_SetIntObj(resultPtr, 0); owtcl_ArgObjDecr; return TCL_OK; } /* * Disconnect from onewire host(s). */ owtcl_ObjCmdProc(Owtcl_Delete) { OwtclStateType *OwtclStatePtr = (OwtclStateType *) clientData; (void) interp; // suppress compiler warning (void) objc; // suppress compiler warning (void) objv; // suppress compiler warning /* Disconnect if connected, otherwise ignore. */ if (OwtclStatePtr->used) OW_finish(); /* Remember disconnected state. */ OwtclStatePtr->used = 0; return TCL_OK; } /* * Set error_level */ owtcl_ObjCmdProc(Owtcl_Set_error_level) { OwtclStateType *OwtclStatePtr = (OwtclStateType *) clientData; char *arg; int arg_len; owtcl_ArgObjIncr; (void) interp; // suppress compiler warning (void) objc; // suppress compiler warning (void) objv; // suppress compiler warning if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "?value?"); owtcl_ArgObjDecr; return TCL_ERROR; } if (!OwtclStatePtr->used) { owtcl_Error(interp, "OWTCL", "DISCONNECTED", "owtcl disconnected"); owtcl_ArgObjDecr; return TCL_ERROR; } arg = Tcl_GetStringFromObj(objv[1], &arg_len); OW_set_error_level(arg); return TCL_OK; } /* * Set error_level */ owtcl_ObjCmdProc(Owtcl_Set_error_print) { OwtclStateType *OwtclStatePtr = (OwtclStateType *) clientData; char *arg; int arg_len; owtcl_ArgObjIncr; (void) interp; // suppress compiler warning (void) objc; // suppress compiler warning (void) objv; // suppress compiler warning if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "?value?"); owtcl_ArgObjDecr; return TCL_ERROR; } if (!OwtclStatePtr->used) { owtcl_Error(interp, "OWTCL", "DISCONNECTED", "owtcl disconnected"); owtcl_ArgObjDecr; return TCL_ERROR; } arg = Tcl_GetStringFromObj(objv[1], &arg_len); OW_set_error_print(arg); return TCL_OK; } /* * Change a owfs node's value. */ owtcl_ObjCmdProc(Owtcl_Put) { OwtclStateType *OwtclStatePtr = (OwtclStateType *) clientData; char *path, *value=NULL; Tcl_UniChar *uvalue; int path_len, value_len, r, v; int tcl_return = TCL_OK; owtcl_ArgObjIncr; /* Check for arguments to the commmand. */ if ((objc < 2) || (objc > 3)) { Tcl_WrongNumArgs(interp, 1, objv, "path ?value?"); tcl_return = TCL_ERROR; goto common_exit; } if (objc == 3) { uvalue = Tcl_GetUnicodeFromObj(objv[2], &value_len); value = malloc(value_len); if (value != NULL) for (v=0 ; v < value_len ; v++) value[v]=(char)uvalue[v]; } else { value=malloc(1); if (value != NULL) { value[0] = '\n'; value_len = 1; } } /* Check we are connected to onewire host(s). */ if (OwtclStatePtr->used == 0) { owtcl_Error(interp, "OWTCL", "DISCONNECTED", "owtcl disconnected"); tcl_return = TCL_ERROR; goto common_exit; } /* Change the owfs node's value. */ path = Tcl_GetStringFromObj(objv[1], &path_len); if ((r = OW_put(path, value, (size_t) value_len)) < 0) { owtcl_ErrorOWlib(interp); tcl_return = TCL_ERROR; goto common_exit; } common_exit: free(value); owtcl_ArgObjDecr; return tcl_return; } /* * Get a owfs node's value. (for directories a directory listing) */ owtcl_ObjCmdProc(Owtcl_Get) { OwtclStateType *OwtclStatePtr = (OwtclStateType *) clientData; char *arg, *path, *buf = NULL, *d, *p; Tcl_UniChar *uvalue; int v; int tcl_return = TCL_OK, r, s, lst; size_t ss; Tcl_Obj *resultPtr; owtcl_ArgObjIncr; /* Check for arguments and options to the commmand. */ path = ""; lst = 0; for (objix = 1; objix < objc; objix++) { arg = Tcl_GetStringFromObj(objv[objix], &s); if (!strncasecmp(arg, "-", 1)) { if (!strncasecmp(arg, "-list", 5)) { lst = 1; } else { owtcl_Error(interp, "NONE", NULL, "bad switch \"%s\": should be -list", arg); tcl_return = TCL_ERROR; goto common_exit; } } else { path = Tcl_GetStringFromObj(objv[objix], &s); } } /* Check we are connected to onewire host(s). */ if (OwtclStatePtr->used == 0) { owtcl_Error(interp, "OWTCL", "DISCONNECTED", "owtcl disconnected"); tcl_return = TCL_ERROR; goto common_exit; } /* Get the owfs node's value. */ r = OW_get(path, &buf, &ss); s = ss; // to get around OW_get uses size_t if (r < 0) { owtcl_ErrorOWlib(interp); if (buf != NULL) { free(buf); } tcl_return = TCL_ERROR; goto common_exit; } /* Arrange the value to form a proper tcl result. */ if (buf == NULL) { tcl_return = TCL_OK; goto common_exit; } buf[s] = 0; if (lst) { if (strchr(buf, ',')) { resultPtr = Tcl_NewListObj(0, NULL); p = buf; while ((d = strchr(p, ',')) != NULL) { Tcl_ListObjAppendElement(interp, resultPtr, Tcl_NewStringObj(p, d - p)); d++; p = d; } Tcl_ListObjAppendElement(interp, resultPtr, Tcl_NewStringObj(p, -1)); } else { resultPtr = Tcl_NewStringObj(buf, -1); } } else { if ((s==1) && (buf[0]==0)) { tcl_return = TCL_OK; goto common_exit; } uvalue = malloc(2*s); if (uvalue == NULL) { tcl_return = TCL_OK; goto common_exit; } for (v=0 ; v < s ; v++) uvalue[v]=(Tcl_UniChar)buf[v]; resultPtr = Tcl_NewUnicodeObj(uvalue, s); free(uvalue); } Tcl_SetObjResult(interp, resultPtr); free(buf); common_exit: owtcl_ArgObjDecr; return tcl_return; } /* * Get version info for owtcl and used owlib. */ owtcl_ObjCmdProc(Owtcl_Version) { OwtclStateType *OwtclStatePtr = (OwtclStateType *) clientData; char buf[128], *arg; Tcl_Obj *resultPtr; int tcl_return = TCL_OK, s, lst; owtcl_ArgObjIncr; (void) OwtclStatePtr; // suppress compiler warning (void) objc; // suppress compiler warning (void) objv; // suppress compiler warning lst = 0; for (objix = 1; objix < objc; objix++) { arg = Tcl_GetStringFromObj(objv[objix], &s); if (!strncasecmp(arg, "-list", 5)) { lst = 1; } else if (s > 0) { owtcl_Error(interp, "NONE", NULL, "bad switch \"%s\": should be -list", arg); tcl_return = TCL_ERROR; goto common_exit; } } if (lst) { resultPtr = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(interp, resultPtr, Tcl_NewStringObj(OWTCL_VERSION, -1)); Tcl_ListObjAppendElement(interp, resultPtr, Tcl_NewStringObj(VERSION, -1)); } else { sprintf(buf, "owtcl:\t%s\nlibow:\t%s", OWTCL_VERSION, VERSION); resultPtr = Tcl_NewStringObj(buf, -1); } Tcl_SetObjResult(interp, resultPtr); common_exit: owtcl_ArgObjDecr; return tcl_return; } /* * Check if a owfs node exists. */ owtcl_ObjCmdProc(Owtcl_Exists) { OwtclStateType *OwtclStatePtr = (OwtclStateType *) clientData; char *path; int s, r; struct parsedname pn; int tcl_return = TCL_OK; Tcl_Obj *resultPtr; owtcl_ArgObjIncr; /* Check for arguments to the commmand. */ if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "path"); tcl_return = TCL_ERROR; goto common_exit; } /* Check we are connected to onewire host(s). */ if (OwtclStatePtr->used == 0) { owtcl_Error(interp, "OWTCL", "DISCONNECTED", "owtcl disconnected"); tcl_return = TCL_ERROR; goto common_exit; } resultPtr = Tcl_GetObjResult(interp); /* Get the owfs node. */ path = Tcl_GetStringFromObj(objv[1], &s); if ((r = FS_ParsedName(path, &pn))) Tcl_SetIntObj(resultPtr, 0); else Tcl_SetIntObj(resultPtr, 1); common_exit: owtcl_ArgObjDecr; return tcl_return; } /* * Check if a owfs node is a directory. */ owtcl_ObjCmdProc(Owtcl_IsDir) { OwtclStateType *OwtclStatePtr = (OwtclStateType *) clientData; char *path; int s, r; struct parsedname pn; int tcl_return = TCL_OK; Tcl_Obj *resultPtr; owtcl_ArgObjIncr; /* Check for arguments to the commmand. */ if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "path"); tcl_return = TCL_ERROR; goto common_exit; } /* Check we are connected to onewire host(s). */ if (OwtclStatePtr->used == 0) { owtcl_Error(interp, "OWTCL", "DISCONNECTED", "owtcl disconnected"); tcl_return = TCL_ERROR; goto common_exit; } /* Get the owfs node. */ path = Tcl_GetStringFromObj(objv[1], &s); if ((r = FS_ParsedName(path, &pn))) { Tcl_SetErrno(ENOENT); /* No such file or directory */ owtcl_ErrorOWlib(interp); tcl_return = TCL_ERROR; goto common_exit; } /* Check if directory or file. */ resultPtr = Tcl_GetObjResult(interp); if (pn.selected_device == NO_DEVICE || pn.selected_filetype == NO_FILETYPE || pn.subdir) /* A directory of some kind */ Tcl_SetIntObj(resultPtr, 1); else Tcl_SetIntObj(resultPtr, 0); common_exit: owtcl_ArgObjDecr; return tcl_return; } /* *---------------------------------------------------------------------- * Ow_Init -- * perform all initialization for the owlib - Tcl interface. * * a call to Owtcl_Init should exist in Tcl_CreateInterp or * Tcl_CreateExtendedInterp. *---------------------------------------------------------------------- */ struct CmdListType { char *name; void *func; } OwtclCmdList[] = { { "::OW::_init", Owtcl_Connect}, { "::OW::isconnect", Owtcl_isConnect}, { "::OW::put", Owtcl_Put}, { "::OW::get", Owtcl_Get}, { "::OW::set_error_level", Owtcl_Set_error_level}, { "::OW::set_error_print", Owtcl_Set_error_print}, { "::OW::version", Owtcl_Version}, { "::OW::finish", Owtcl_Delete}, { "::OW::isdirectory", Owtcl_IsDir}, { "::OW::isdir", Owtcl_IsDir}, { "::OW::exists", Owtcl_Exists}, { NULL, NULL} }; int Ow_Init(Tcl_Interp * interp) { int i; /* This defines the static chars tkTable(Safe)InitScript */ #include "owtclInitScript.h" if ( #ifdef USE_TCL_STUBS Tcl_InitStubs(interp, "8.1", 0) #else Tcl_PkgRequire(interp, "Tcl", "8.1", 0) #endif == NULL) return TCL_ERROR; OwtclState.used = 0; /* Initialize the new Tcl commands */ i = 0; while (OwtclCmdList[i].name != NULL) { Tcl_CreateObjCommand(interp, OwtclCmdList[i].name, (Tcl_ObjCmdProc *) OwtclCmdList[i].func, (ClientData) & OwtclState, (Tcl_CmdDeleteProc *) NULL); i++; } /* Callback - clean up procs left open on interpreter deletetion. */ Tcl_CallWhenDeleted(interp, (Tcl_InterpDeleteProc *) Owtcl_Delete, (ClientData) & OwtclState); /* Announce successful package loading to "package require". */ if (Tcl_PkgProvide(interp, "ow", OWTCL_VERSION) != TCL_OK) return TCL_ERROR; /* * The init script can't make certain calls in a safe interpreter, * so we always have to use the embedded runtime for it */ return Tcl_Eval(interp, Tcl_IsSafe(interp) ? owtclSafeInitScript : owtclInitScript); } /* *---------------------------------------------------------------------- * Owtcl_SafeInit -- * call the standard init point. *---------------------------------------------------------------------- */ int Ow_SafeInit(Tcl_Interp * interp) { int result; result = Ow_Init(interp); return (result); } owfs-3.1p5/module/owtcl/owtclInitScript.h0000644000175000001440000000421512654730021015446 00000000000000// -*- C++ -*- // File: owtclInitScript.h // // Created: Mon Jan 10 22:53:33 2005 // // $Id$ // /* * The following string is the startup script executed when the ow is * loaded. It looks on disk in several different directories for a script * "ow.tcl" that is compatible with this version of owtcl. */ static char owtclInitScript[] = "if {[info proc owtclInit]==\"\"} {\n\ proc owtclInit {} {\n\ global tcl_pkgPath errorInfo env\n\ rename owtclInit {}\n\ set errors {}\n\ if {![info exists env(OWTCL_LIBRARY_FILE)]} {\n\ set env(OWTCL_LIBRARY_FILE) ow.tcl\n\ }\n\ if {[info exists env(OWTCL_LIBRARY)]} {\n\ lappend dirs $env(OWTCL_LIBRARY)\n\ }\n\ lappend dirs " OWTCL_PACKAGE_PATH "\n\ if {[info exists tcl_pkgPath]} {\n\ foreach i $tcl_pkgPath {\n\ lappend dirs [file join $i owtcl-" OWTCL_VERSION "] \\\n\ [file join $i owtcl] $i\n\ }\n\ }\n\ lappend dirs [pwd]\n\ foreach i $dirs {\n\ set try [file join $i $env(OWTCL_LIBRARY_FILE)]\n\ if {[file exists $try]} {\n\ if {![catch {uplevel #0 [list source $try]} msg]} {\n\ set env(OWTCL_LIBRARY) $i\n\ return\n\ } else {\n\ append errors \"$try: $msg\n$errorInfo\n\"\n\ }\n\ }\n\ }\n" #ifdef NO_EMBEDDED_RUNTIME " set msg \"Can't find a $env(OWTCL_LIBRARY_FILE) in the following directories: \n\"\n\ append msg \" $dirs\n\n$errors\n\n\"\n\ append msg \"This probably means that owtcl wasn't installed properly.\"\n\ return -code error $msg\n" #else " set env(OWTCL_LIBRARY) EMBEDDED_RUNTIME\n" " uplevel #0 {" # include "ow.tcl.h" " }\n" #endif " }\n\ }\n\ owtclInit"; /* * The init script can't make certain calls in a safe interpreter, * so we always have to use the embedded runtime for it */ static char owtclSafeInitScript[] = "if {[info proc owtclInit]==\"\"} {\n\ proc owtclInit {} {\n\ set env(OWTCL_LIBRARY) EMBEDDED_RUNTIME\n" #ifdef NO_EMBEDDED_RUNTIME " append msg \"owtcl requires embedded runtime to be compiled for\"\n\ append msg \" use in safe interpreters\"\n\ return -code error $msg\n" #endif " uplevel #0 {" # include "ow.tcl.h" " }" " }\n\ }\n\ owtclInit"; owfs-3.1p5/module/owtcl/ow.tcl0000644000175000001440000000724512654730021013273 00000000000000# -*- Tcl -*- # File: ow.tcl # # Created: Tue Jan 11 20:34:11 2005 # # $Id$ # namespace eval ::OW { proc ::OW { args } { return [eval ::OW::init $args] } proc ::ow { args } { return [eval ::OW::ow $args] } } proc ::OW::init {args} { array set oldopts { -format -f -celsius -C -fahenheit -F -kelvin -K -rankine -R -readonly -r -cache -t } set sargs "" foreach arg $args { if {[info exists oldopts($arg)]} { append sargs $oldopts($arg) { } } else { append sargs $arg { } } } set sargs [string trim $sargs] return [::OW::_init $sargs] } proc ::OW::ow {opt args} { switch -exact $opt { open { return [eval ::OW::init $args] } close { return [eval ::OW::finish $args] } version { return [eval ::OW::version $args] } error { return [eval ::OW::set_error $args] } opened { return [eval ::OW::isconnect $args] } get { return [eval ::OW::get $args] } put { return [eval ::OW::put $args] } isdir { return [eval ::OW::isdir $args] } isdirectory { return [eval ::OW::isdir $args] } set { return [eval ::OW::_set $args] } default { error "bad option \"$opt\": must be open, close, version, error, opened, get, put, set, isdir or isdirectory" } } } proc ::OW::_join {args} { foreach a $args { append res {/} [string trim $a {/}] } regsub -all {//} $res {/} res return $res } proc ::OW::_set {path} { set path "/[string trim $path {/}]" if {[exists $path]} { set id_set 0 while {[info commands [set nid "::OW::owcmd$id_set"]] != ""} { incr id_set } set evalstr [format {proc %s {args} {return [eval ::OW::device %s $args]}} $nid $path] eval $evalstr return $nid } else { error "node \"$path\" not exists" } } proc ::OW::device {base opt args} { set path $base switch -exact $opt { get { set lst {} if {[set x [lsearch -exact $args {-list}]] >= 0} { set lst {-list} set args [lreplace $args $x $x] } set path [_join $base [lindex $args 0]] return [eval ::OW::get $path $lst] } put { if {[llength $args] > 1} { set path [_join $base [lindex $args 0]] set args [lreplace $args 0 0] } return [eval ::OW::put $path $args] } isdir { return [eval ::OW::isdir [_join $base [lindex $args 0]]] } isdirectory { return [eval ::OW::isdir [_join $base [lindex $args 0]]] } set { return [eval ::OW::_set [_join $base [lindex $args 0]]] } path { return $path } default { error "bad option \"$opt\": must be get, put, set, path, isdir or isdirectory" } } } proc ::OW::set_error {opt args} { switch -exact $opt { level { if {$args == ""} { error "wrong # args: should be \"ow error level ?val?\"" } eval ::OW::set_error_level $args } print { if {$args == ""} { error "wrong # args: should be \"ow error print ?val?\"" } eval ::OW::set_error_print $args } default { error "bad option \"$opt\": must be level or print" } } } owfs-3.1p5/module/swig/0000755000175000001440000000000013022537105012031 500000000000000owfs-3.1p5/module/swig/perl5/0000755000175000001440000000000013022537105013060 500000000000000owfs-3.1p5/module/swig/perl5/OW/0000755000175000001440000000000013022537105013405 500000000000000owfs-3.1p5/module/swig/perl5/OW/Makefile.linux.in0000644000175000001440000000172212665167763016557 00000000000000#!/usr/bin/perl -w use Config ; use ExtUtils::MakeMaker ; WriteMakefile( 'CC' => '@CC@', 'ABSTRACT' => q[Perl interface to the 1-wire filesytem] , 'AUTHOR' => q[Paul H Alfille ] , 'VERSION' => q[@VERSION@], # Avoid compilation problem for Fedora Core 1 and Slackware 10.2 'DEFINE' => q[@PTHREAD_CFLAGS@ -D_FILE_OFFSET_BITS=64 -DSKIP_SEARCH_H @DEFS@], 'INC' => q[-I../../../../src/include -I../../../owlib/src/include @CPPFLAGS@ @LIBUSB_CFLAGS@], # Default value for LDDLFLAGS is $Config{lddlflags}="-shared -L/usr/local/lib" # but we want rpath to be @libdir@ or @exec_prefix@/lib # Also adding flags for hardening (Debian) 'LDDLFLAGS' => "$ENV{DEB_LDFLAGS} -shared -L../../../owlib/src/c/.libs", 'CCFLAGS' => "$Config{ccflags} $ENV{DEB_CFLAGS} $ENV{DEB_CPPFLAGS}", 'LIBS' => q[-L../../../owlib/src/c/.libs -low], 'OBJECT' => 'ow_wrap.o', 'NAME' => 'OW', 'POLLUTE' => 1, ) ; owfs-3.1p5/module/swig/perl5/OW/Makefile.osx.in0000644000175000001440000000156712654730021016215 00000000000000#!/usr/bin/perl -w use ExtUtils::MakeMaker ; WriteMakefile( 'CC' => '@CC@', 'ABSTRACT' => q[Perl interface to the 1-wire filesytem] , 'AUTHOR' => q[Paul H Alfille ] , 'VERSION' => q[@VERSION@], # Avoid compilation problem for Fedora Core 1 and Slackware 10.2 'DEFINE' => q[@PTHREAD_CFLAGS@ -D_FILE_OFFSET_BITS=64 -DSKIP_SEARCH_H @DEFS@], 'INC' => q[-I../../../../src/include -I../../../owlib/src/include @CPPFLAGS@ @LIBUSB_CFLAGS@], # Default value for LDDLFLAGS is $Config{lddlflags}="-shared -L/usr/local/lib" # but we want rpath to be @libdir@ or @exec_prefix@/lib 'LDDLFLAGS' => q[-bundle -flat_namespace -undefined suppress -Wl,-L../../../owlib/src/c/.libs], 'LIBS' => q[-L../../../owlib/src/c/.libs -low @PTHREAD_LIBS@ @LIBS@], 'OBJECT' => 'ow_wrap.o', 'NAME' => 'OW', 'POLLUTE' => 1, ) ; owfs-3.1p5/module/swig/perl5/OW/t/0000755000175000001440000000000013022537105013650 500000000000000owfs-3.1p5/module/swig/perl5/OW/t/OW.t0000644000175000001440000000070612654730021014307 00000000000000# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl OW.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; BEGIN { use_ok('OW') }; ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. owfs-3.1p5/module/swig/perl5/OW/META.yml0000644000175000001440000000075512654730021014607 00000000000000 name: OW abstract: Build and install OW module version: 1.13 author: - Paul H Alfille license: perl distribution_type: module requires: IO::Socket::INET: 0 perl: 5.005_03 recommends: Net::Rendezvous: 0 build_requires: Test: 0 provides: OW: file: OW.pm urls: license: http://dev.perl.org/licenses/ meta-spec: version: 1.3 url: http://module-build.sourceforge.net/META-spec-v1.3.html generated_by: Module::Build version 0.20 owfs-3.1p5/module/swig/perl5/OW/README0000644000175000001440000000354612654730021014217 00000000000000OWNet version 1.10 ================== OWNet is a light-weight module for accessing owserver. The overall goal is an easy way to use the 1-Wire bus and devices. Useful for monitoring, security, hobby, control. (Projects include weather monitoring, heating and cooling control, aquarium, tractor, motorcycle, swimming pool and others.) The full explanation can be found at http://www.owfs.org Basically 1-Wire is a simple and inexpensive way to connect chips made by Dallas Semicondictor to a computer. These chips each have a unique ID, and are individually addressable, even with a bus that has only a combined power/data line and ground. The underlying idea of OWFS (One Wire File System) is to make the whole 1-wire bus look like a file system. Devices are directories (named by their unique ID) and their properties (memory, contact, voltage, temperature,...) are files. owserver is one of the OWFS programs that connects and virtuallizes the 1-wire bus. It communicates via a well-documented tcp/ip protocol, see: http://www.owfs.org/index.php?page=owserver-protocol OWNet is a perl module to connect to a owserver process. There are four methods: read, write, dir, present All that's needed is the ip address of the owserver, and the "path" -- unique name or the 1-wire resource wanted. --------------- OWNet is pure perl. It uses the IO::Socket::INET module for tcp/ip communication. It should be usable on any system with perl, and a network stack. --------------- INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: IO::Socket::INET Net::Rendezvous (optional) COPYRIGHT AND LICENCE Copyright (C) 2007 by Paul H Alfille This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. owfs-3.1p5/module/swig/perl5/OW/MANIFEST0000644000175000001440000000017212654730021014460 00000000000000Changes Makefile.PL MANIFEST README t/OW.t META.yml Module meta-data (added by MakeMaker) owfs-3.1p5/module/swig/perl5/OW/Changes0000644000175000001440000000011112654730021014613 00000000000000Revision history for Perl extension OW. 0.01 Wed Jan 3 21:42:03 2007 owfs-3.1p5/module/swig/perl5/perl5.m40000644000175000001440000000447112654730021014301 00000000000000#---------------------------------------------------------------- # Look for Perl5 # $Id$ #---------------------------------------------------------------- AC_DEFUN([SC_PATH_PERL5], [AC_PREREQ(2.57)dnl PERLBIN= AC_ARG_WITH(perl5, [ --with-perl5 Set location of Perl executable],[ PERLBIN="$withval"], [PERLBIN=yes]) # First, check for "--without-perl5" or "--with-perl5=no". if test x"${PERLBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Perl5]) else # First figure out what the name of Perl5 is if test "x$PERLBIN" = xyes; then AC_CHECK_PROGS(PERL, perl perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl) else PERL="$PERLBIN" fi # This could probably be simplified as for all platforms and all versions of Perl the following apparently should be run to get the compilation options: # perl -MExtUtils::Embed -e ccopts AC_MSG_CHECKING(for Perl5 header files) if test -n "$PERL"; then PERL=`(which $PERL) 2>/dev/null` # Make it possible to force a directory during cross-compilation if test -z "$PERL5DIR"; then PERL5DIR=`($PERL -e 'use Config; print $Config{archlib}, "\n";') 2>/dev/null` fi if test -n "$PERL5DIR"; then dirs="$PERL5DIR $PERL5DIR/CORE" PERL5EXT=none for i in $dirs; do if test -r $i/perl.h; then AC_MSG_RESULT($i) PERL5EXT="$i" break; fi done if test "$PERL5EXT" = none; then PERL5EXT="$PERL5DIR/CORE" AC_MSG_RESULT(could not locate perl.h...using $PERL5EXT) fi AC_MSG_CHECKING(for Perl5 library) PERL5NAME=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; print $_, "\n"') 2>/dev/null` if test "$PERL5NAME" = "" ; then AC_MSG_RESULT(not found) else AC_MSG_RESULT($PERL5NAME) fi AC_MSG_CHECKING(for Perl5 compiler options) PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}, "\n"' | sed "s/-I/$ISYSTEM/") 2>/dev/null` if test "$PERL5CCFLAGS" = "" ; then AC_MSG_RESULT(not found) else AC_MSG_RESULT($PERL5CCFLAGS) fi else AC_MSG_RESULT(unable to determine perl5 configuration) PERL5EXT=$PERL5DIR fi else AC_MSG_RESULT(could not figure out how to run perl5) fi # Cygwin (Windows) needs the library for dynamic linking case $host in *-*-cygwin* | *-*-mingw*) PERL5DYNAMICLINKING="-L$PERL5EXT -l$PERL5NAME";; *)PERL5DYNAMICLINKING="";; esac fi ]) owfs-3.1p5/module/swig/perl5/example/0000755000175000001440000000000013022537105014513 500000000000000owfs-3.1p5/module/swig/perl5/example/owdir.pl0000755000175000001440000000155512654730021016127 00000000000000#!/usr/bin/perl -w # OWFS test program # See owfs.sourceforge.net for details # {copyright} 2004 Paul H. Alfille # GPL v2 license use OW ; die ( "OWFS 1-wire owdir perl program\n" ."Syntax:\n" ."\t$0 1wire-adapter [dir]\n" ." 1wire-adapter (required):\n" ."\t'u' for USB -or-\n" ."\t--fake=10,28 for a fake-adapter with DS18S20 and DS18B20-sensor -or-\n" ."\t/dev/ttyS0 (or whatever) serial port -or-\n" ."\t4304 for remote-server at port 4304\n" ."\t192.168.1.1:4304 for remote-server at 192.168.1.1:4304\n" ) if ( $#ARGV < 0 ) ; OW::init($ARGV[0]) or die "Cannot open 1wire port $ARGV[0]" ; #OW::set_error_print(2); #OW::set_error_level(9); if ( $#ARGV >= 1 ) { $dir = $ARGV[1]; } else { $dir = "/"; } my $res = OW::get($dir) or print "Error reading directory\n" ; print $res . "\n" if defined($res) ; OW::finish() ; owfs-3.1p5/module/swig/perl5/example/tree.pl0000755000175000001440000000252512654730021015740 00000000000000#!/usr/bin/perl -w # OWFS test program # See owfs.sourceforge.net for details # {copyright} 2004 Paul H. Alfille # GPL v2 license use OW ; die ( "OWFS 1-wire tree perl program\n" ." by Paul Alfille 2004 see http://www.owfs.org\n" ."Syntax:\n" ."\t$0 1wire-adapter\n" ." 1wire-adapter (required):\n" ."\t'u' for USB -or-\n" ."\t--fake=10,28 for a fake-adapter with DS18S20 and DS18B20-sensor -or-\n" ."\t/dev/ttyS0 (or whatever) serial port -or-\n" ."\t4304 for remote-server at port 4304\n" ."\t192.168.1.1:4304 for remote-server at 192.168.1.1:4304\n" ) if ( $#ARGV != 0 ) ; OW::init($ARGV[0]) or die "Cannot open 1wire port $ARGV[0]" ; #OW::set_error_print(2); #OW::set_error_level(9); # for "paging" #my $lin = 0 ; sub treelevel { my $lev = shift ; my $path = shift ; #sleep 1; #print "lev=$lev path=$path \n" ; my $res = OW::get($path) or return ; for (split(',',$res)) { for (1..$lev) { print("\t") } ; #for paging #if (++$lin == 30 ) { #$lin=0 ; #getc(); #} print $_ ; if ( m{/$} ) { # print "[".OW::get($path.$_)."]" ; print "\n" ; treelevel($lev+1,$path.$_) ; } else { my $r = OW::get($path.$_) ; print ": $r" if defined($r) ; print "\n" ; } } } treelevel(0,"/") ; OW::finish() ; owfs-3.1p5/module/swig/perl5/Makefile.am0000644000175000001440000000264612665167763015071 00000000000000EXTRA_DIST = perl5.m4 OW/META.yml OW/README OW/MANIFEST OW/Changes OW/Makefile.linux.in OW/Makefile.osx.in OW/t/OW.t example/owdir.pl example/tree.pl DISTCLEANFILES = OW/Makefile.linux OW/Makefile.osx #all: OW/Makefile all: OW/blib/lib/OW.pm OW/Makefile.PL: if HAVE_DARWIN cp OW/Makefile.osx OW/Makefile.PL else cp OW/Makefile.linux OW/Makefile.PL endif OW/Makefile: OW/Makefile.PL if HAVE_DARWIN ( cd OW; $(PERL) Makefile.PL ) else if HAVE_DEBIAN ( cd OW; $(PERL) Makefile.PL INSTALLDIRS=vendor ) cd OW ; for i in `grep -wl ^LD_RUN_PATH Makefile Makefile.[^P]*` ; do sed -i 's@^LD_RUN_PATH.*@LD_RUN_PATH=@' $$i ; done else ( cd OW; $(PERL) Makefile.PL ) if HAVE_FREEBSD $(PERL) -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' OW/Makefile # The FreeBSD Makefile trickery disables installing of perllocal.pod, as per http://lists.freebsd.org/pipermail/freebsd-perl/2005-June/000666.html endif endif endif OW/ow_wrap.c: ../ow.i OW/Makefile ${LIBOW} $(SWIG) -perl5 -o $@ ../ow.i OW/blib/lib/OW.pm: OW/ow_wrap.c $(MAKE) -C OW -fMakefile @INSTALL@ -d OW/blib/lib @INSTALL@ OW/OW.pm OW/blib/lib/ @ECHO@ >> OW/blib/lib/OW.pm 'our $$VERSION='\''@VERSION@'\'' ;' install-data-local: OW/Makefile OW/ow_wrap.c OW/blib/lib/OW.pm $(MAKE) -C OW install DESTDIR="$(DESTDIR)" clean-local: if test -f OW/Makefile; then cd OW; $(MAKE) clean; fi @RM@ -f OW/Makefile.old OW/Makefile OW/Makefile.PL OW/OW.pm OW/OW.bs OW/ow_wrap.c owfs-3.1p5/module/swig/perl5/Makefile.in0000644000175000001440000004365713022537053015066 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/swig/perl5 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = perl5.m4 OW/META.yml OW/README OW/MANIFEST OW/Changes OW/Makefile.linux.in OW/Makefile.osx.in OW/t/OW.t example/owdir.pl example/tree.pl DISTCLEANFILES = OW/Makefile.linux OW/Makefile.osx 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) --foreign module/swig/perl5/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/swig/perl5/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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-libtool clean-local 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-data-local 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 mostlyclean-libtool 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 clean-libtool \ clean-local cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am .PRECIOUS: Makefile #all: OW/Makefile all: OW/blib/lib/OW.pm OW/Makefile.PL: @HAVE_DARWIN_TRUE@ cp OW/Makefile.osx OW/Makefile.PL @HAVE_DARWIN_FALSE@ cp OW/Makefile.linux OW/Makefile.PL OW/Makefile: OW/Makefile.PL @HAVE_DARWIN_TRUE@ ( cd OW; $(PERL) Makefile.PL ) @HAVE_DARWIN_FALSE@@HAVE_DEBIAN_TRUE@ ( cd OW; $(PERL) Makefile.PL INSTALLDIRS=vendor ) @HAVE_DARWIN_FALSE@@HAVE_DEBIAN_TRUE@ cd OW ; for i in `grep -wl ^LD_RUN_PATH Makefile Makefile.[^P]*` ; do sed -i 's@^LD_RUN_PATH.*@LD_RUN_PATH=@' $$i ; done @HAVE_DARWIN_FALSE@@HAVE_DEBIAN_FALSE@ ( cd OW; $(PERL) Makefile.PL ) @HAVE_DARWIN_FALSE@@HAVE_DEBIAN_FALSE@@HAVE_FREEBSD_TRUE@ $(PERL) -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' OW/Makefile # The FreeBSD Makefile trickery disables installing of perllocal.pod, as per http://lists.freebsd.org/pipermail/freebsd-perl/2005-June/000666.html OW/ow_wrap.c: ../ow.i OW/Makefile ${LIBOW} $(SWIG) -perl5 -o $@ ../ow.i OW/blib/lib/OW.pm: OW/ow_wrap.c $(MAKE) -C OW -fMakefile @INSTALL@ -d OW/blib/lib @INSTALL@ OW/OW.pm OW/blib/lib/ @ECHO@ >> OW/blib/lib/OW.pm 'our $$VERSION='\''@VERSION@'\'' ;' install-data-local: OW/Makefile OW/ow_wrap.c OW/blib/lib/OW.pm $(MAKE) -C OW install DESTDIR="$(DESTDIR)" clean-local: if test -f OW/Makefile; then cd OW; $(MAKE) clean; fi @RM@ -f OW/Makefile.old OW/Makefile OW/Makefile.PL OW/OW.pm OW/OW.bs OW/ow_wrap.c # 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: owfs-3.1p5/module/swig/php/0000755000175000001440000000000013022537106012621 500000000000000owfs-3.1p5/module/swig/php/example/0000755000175000001440000000000013022537106014254 500000000000000owfs-3.1p5/module/swig/php/example/load_php_OW.php.in0000644000175000001440000000134412654730021017510 00000000000000 owfs-3.1p5/module/swig/php/example/owdir.php0000755000175000001440000000150612654730021016037 00000000000000 2 ) { $dir = $argv[2]; } else { $dir = "/"; } #initialize the 1-wire bus with given argument $init_result = init( $adapter ); if ( $init_result != '1' ) { echo "could not initialize the 1-wire bus.\n"; } else { $list_bus = get( $dir ); echo "list_bus result: $list_bus\n"; } finish(); ?> owfs-3.1p5/module/swig/php/php.m40000644000175000001440000000351612654730021013600 00000000000000#------------------------------------------------------------------------- # Look for Php5 or Php4 #------------------------------------------------------------------------- AC_DEFUN([SC_PATH_PHP], [AC_PREREQ(2.57)dnl PHP4BIN= #AC_ARG_WITH(php4, AS_HELP_STRING([--without-php4], [Disable PHP4]) #AS_HELP_STRING([--with-php4=path], [Set location of PHP4 executable]),[ PHP4BIN="$withval"], [PHP4BIN=yes]) AC_ARG_WITH(php, [ --with-php Set location of Php executable],[ PHPBIN="$withval"], [PHPBIN=yes]) AC_ARG_WITH(phpconfig, [ --with-phpconfig Set location of php-config executable],[ PHPCONFIGBIN="$withval"], [PHPCONFIGBIN=yes]) # First, check for "--without-php" or "--with-php=no". if test x"${PHPBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling PHP]) else if test "x$PHPBIN" = xyes; then AC_CHECK_PROGS(PHP, php php5 php4) else PHP="$PHPBIN" fi if test "x$PHPCONFIGBIN" = xyes; then AC_CHECK_PROGS(PHPCONFIG, php-config php5-config php-config5 php4-config php-config4) else PHPCONFIG="$PHPCONFIGBIN" fi AC_MSG_CHECKING(for PHP header files) PHPINC="`$PHPCONFIG --includes 2>/dev/null`" if test "$PHPINC"; then AC_MSG_RESULT($PHPINC) else dirs="/usr/include/php /usr/local/include/php /usr/include/php5 /usr/local/include/php5 /usr/include/php4 /usr/local/include/php4 /usr/local/apache/php" for i in $dirs; do echo $i if test -r $i/main/php_config.h -o -r $i/main/php_version.h; then AC_MSG_RESULT($i is found) PHPEXT="$i" PHPINC="-I$PHPEXT -I$PHPEXT/main -I$PHPEXT/TSRM -I$PHPEXT/Zend" break; fi done fi if test -z "$PHPINC"; then AC_MSG_RESULT(not found) fi AC_MSG_CHECKING(for PHP extension-dir) PHPLIBDIR="`$PHPCONFIG --extension-dir 2>/dev/null`" if test ! -z "$PHPLIBDIR"; then AC_MSG_RESULT($PHPLIBDIR) else AC_MSG_RESULT(not found) fi fi ]) owfs-3.1p5/module/swig/php/Makefile.am0000644000175000001440000000244212665167763014623 00000000000000 EXTRA_DIST = php.m4 example/owdir.php example/load_php_OW.php.in DISTCLEANFILES = example/load_php_OW.php #use libtool to build the php extension lib_LTLIBRARIES = libowphp.la libowphp_la_LIBADD = ../../owlib/src/c/libow.la libowphp_la_DEPENDENCIES = ../../owlib/src/c/libow.la libowphp_la_LDFLAGS = -shared -shrext .so # Older php installations doesn't handle owfs_config.h filename, and tries # to include non-existing config.h if HAVE_CONFIG_H is defined. #DEFS+= -UHAVE_CONFIG_H EXTENSION_DIR = @PHPLIBDIR@ # Something like /usr/lib/php4, /usr/lib/php5/20041030, /usr/lib/php/modules/ or /usr/lib64/php/modules/ libdir = $(EXTENSION_DIR) AM_CFLAGS = -fexceptions \ -I.. \ -I$(top_srcdir)/src/include \ -I$(top_srcdir)/module/owlib/src/include \ ${EXTRACFLAGS} \ ${LIBUSB_CFLAGS} \ ${PTHREAD_CFLAGS} \ @PHPINC@ LDADD = -L../../owlib/src/c -low nodist_libowphp_la_SOURCES = ow_wrap.c php_OW.h ow_wrap.c: ../ow.i if ENABLE_OWPHP $(SWIG) -php -o $@ ../ow.i endif #install-data-local: # @INSTALL@ -d $(DESTDIR)$(EXTENSION_DIR) # @INSTALL@ $(DESTDIR)${libdir}/libowphp.so $(DESTDIR)$(EXTENSION_DIR)/ # ln -sf ${exec_prefix}/lib/libowphp.so $(DESTDIR)$(EXTENSION_DIR)/libowphp.so # ln -sf ../../../lib/libowphp.so $(DESTDIR)$(EXTENSION_DIR)/php_OW.so clean-local: @RM@ -f OW.* ow_wrap.c php_OW.h owfs-3.1p5/module/swig/php/Makefile.in0000644000175000001440000006272713022537053014625 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/swig/php ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) nodist_libowphp_la_OBJECTS = ow_wrap.lo libowphp_la_OBJECTS = $(nodist_libowphp_la_OBJECTS) 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 = libowphp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libowphp_la_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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(nodist_libowphp_la_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) # 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)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ # Something like /usr/lib/php4, /usr/lib/php5/20041030, /usr/lib/php/modules/ or /usr/lib64/php/modules/ libdir = $(EXTENSION_DIR) libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = php.m4 example/owdir.php example/load_php_OW.php.in DISTCLEANFILES = example/load_php_OW.php #use libtool to build the php extension lib_LTLIBRARIES = libowphp.la libowphp_la_LIBADD = ../../owlib/src/c/libow.la libowphp_la_DEPENDENCIES = ../../owlib/src/c/libow.la libowphp_la_LDFLAGS = -shared -shrext .so # Older php installations doesn't handle owfs_config.h filename, and tries # to include non-existing config.h if HAVE_CONFIG_H is defined. #DEFS+= -UHAVE_CONFIG_H EXTENSION_DIR = @PHPLIBDIR@ AM_CFLAGS = -fexceptions \ -I.. \ -I$(top_srcdir)/src/include \ -I$(top_srcdir)/module/owlib/src/include \ ${EXTRACFLAGS} \ ${LIBUSB_CFLAGS} \ ${PTHREAD_CFLAGS} \ @PHPINC@ LDADD = -L../../owlib/src/c -low nodist_libowphp_la_SOURCES = ow_wrap.c php_OW.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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) --foreign module/swig/php/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/swig/php/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libowphp.la: $(libowphp_la_OBJECTS) $(libowphp_la_DEPENDENCIES) $(EXTRA_libowphp_la_DEPENDENCIES) $(AM_V_CCLD)$(libowphp_la_LINK) -rpath $(libdir) $(libowphp_la_OBJECTS) $(libowphp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_wrap.Plo@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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-libLTLIBRARIES clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool 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-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile ow_wrap.c: ../ow.i @ENABLE_OWPHP_TRUE@ $(SWIG) -php -o $@ ../ow.i #install-data-local: # @INSTALL@ -d $(DESTDIR)$(EXTENSION_DIR) # @INSTALL@ $(DESTDIR)${libdir}/libowphp.so $(DESTDIR)$(EXTENSION_DIR)/ # ln -sf ${exec_prefix}/lib/libowphp.so $(DESTDIR)$(EXTENSION_DIR)/libowphp.so # ln -sf ../../../lib/libowphp.so $(DESTDIR)$(EXTENSION_DIR)/php_OW.so clean-local: @RM@ -f OW.* ow_wrap.c php_OW.h # 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: owfs-3.1p5/module/swig/python/0000755000175000001440000000000013022537105013352 500000000000000owfs-3.1p5/module/swig/python/python.m40000644000175000001440000001643412654730021015067 00000000000000#------------------------------------------------------------------------ # SC_PATH_PYTHONCONFIG -- # # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-pythonconfig=... # --with-python=... # # Defines the following vars: # #------------------------------------------------------------------------ AC_DEFUN([SC_PATH_PYTHON], [AC_PREREQ(2.57)dnl #---------------------------------------------------------------- # Look for Python #---------------------------------------------------------------- PYCFLAGS= PYLDFLAGS= PYLIB= PYVERSION= PYSITEDIR= AC_ARG_WITH(python, [ --with-python Set location of Python executable],[ PYBIN="$withval"], [PYBIN=yes]) AC_ARG_WITH(pythonconfig, [ --with-pythonconfig Set location of python-config executable],[ PYTHONCONFIGBIN="$withval"], [PYTHONCONFIGBIN=yes]) if test "x$PYTHONCONFIGBIN" = xyes; then AC_CHECK_PROGS(PYTHONCONFIG, python-config python2.7-config python2.5-config python2.4-config python2.3-config) else PYTHONCONFIG="$PYTHONCONFIGBIN" fi # First, check for "--without-python" or "--with-python=no". if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then AC_MSG_NOTICE([Disabling Python]) else # First figure out the name of the Python executable if test "x$PYBIN" = xyes; then AC_CHECK_PROGS(PYTHON, python python2.7 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4 python) else PYTHON="$PYBIN" fi if test ! -z "$PYTHONCONFIG"; then # python-config available. AC_MSG_CHECKING(for Python cflags) PYTHONCFLAGS="`$PYTHONCONFIG --cflags 2>/dev/null`" if test -z "$PYTHONCFLAGS"; then AC_MSG_RESULT(not found) else AC_MSG_RESULT($PYTHONCFLAGS) fi PYCFLAGS=$PYTHONCFLAGS AC_MSG_CHECKING(for Python ldflags) PYTHONLDFLAGS="`$PYTHONCONFIG --ldflags 2>/dev/null`" if test -z "$PYTHONLDFLAGS"; then AC_MSG_RESULT(not found) else AC_MSG_RESULT($PYTHONLDFLAGS) fi PYLDFLAGS=$PYTHONLDFLAGS AC_MSG_CHECKING(for Python libs) PYTHONLIBS="`$PYTHONCONFIG --libs 2>/dev/null`" if test -z "$PYTHONLIBS"; then AC_MSG_RESULT(not found) else AC_MSG_RESULT($PYTHONLIBS) fi PYLIB="$PYTHONLIBS" # Need to do this hack since autoconf replaces __file__ with the name of the configure file filehack="file__" PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")` AC_MSG_RESULT($PYVERSION) AC_MSG_CHECKING(for Python exec-prefix) PYTHONEPREFIX="`$PYTHONCONFIG --exec-prefix 2>/dev/null`" if test -z "$PYTHONEPREFIX"; then AC_MSG_RESULT(not found) else AC_MSG_RESULT($PYTHONEPREFIX) fi PYEPREFIX="$PYTHONEPREFIX" AC_MSG_CHECKING(for Python site-dir) #This seem to be the site-packages dir where files are installed. PYSITEDIR=`($PYTHON -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=1)") 2>/dev/null` if test -z "$PYSITEDIR"; then # I'm not really sure if it should be installed at /usr/lib64... if test -d "$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/site-packages"; then PYSITEDIR="$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/site-packages" else if test -d "$PYEPREFIX/lib/$PYVERSION/site-packages"; then PYSITEDIR="$PYEPREFIX/lib/$PYVERSION/site-packages" fi fi fi AC_MSG_RESULT($PYSITEDIR) else # python-config not available. if test -n "$PYTHON"; then AC_MSG_CHECKING(for Python prefix) PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null` AC_MSG_RESULT($PYPREFIX) AC_MSG_CHECKING(for Python exec-prefix) PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null` AC_MSG_RESULT($PYEPREFIX) # Note: I could not think of a standard way to get the version string from different versions. # This trick pulls it out of the file location for a standard library file. AC_MSG_CHECKING(for Python version) # Need to do this hack since autoconf replaces __file__ with the name of the configure file filehack="file__" PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")` AC_MSG_RESULT($PYVERSION) # Find the directory for libraries this is necessary to deal with # platforms that can have apps built for multiple archs: e.g. x86_64 AC_MSG_CHECKING(for Python lib dir) PYLIBDIR=`($PYTHON -c "import sys; print sys.lib") 2>/dev/null` if test -z "$PYLIBDIR"; then # older versions don't have sys.lib so the best we can do is assume lib #PYLIBDIR="lib$LIBPOSTFIX" if test -r $PYPREFIX/include/$PYVERSION/Python.h; then if test -d "$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/config"; then PYLIBDIR="lib$LIBPOSTFIX" else if test -d "$PYEPREFIX/lib/$PYVERSION/config"; then # for some reason a 64bit system could have libs installed at lib PYLIBDIR="lib" else # I doubt this will work PYLIBDIR="lib$LIBPOSTFIX" fi fi else # probably very old installation... PYLIBDIR="lib" fi fi AC_MSG_RESULT($PYLIBDIR) AC_MSG_CHECKING(for Python site-dir) PYSITEDIR=`($PYTHON -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=1)") 2>/dev/null` if test -z "$PYSITEDIR"; then # I'm not really sure if it should be installed at /usr/lib64... if test -d "$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/site-packages"; then PYSITEDIR="$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/site-packages" else if test -d "$PYEPREFIX/lib/$PYVERSION/site-packages"; then PYSITEDIR="$PYEPREFIX/lib/$PYVERSION/site-packages" fi fi fi AC_MSG_RESULT($PYSITEDIR) # Set the include directory AC_MSG_CHECKING(for Python header files) if test -r $PYPREFIX/include/$PYVERSION/Python.h; then PYCFLAGS="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config" fi if test -z "$PYCFLAGS"; then if test -r $PYPREFIX/include/Py/Python.h; then PYCFLAGS="-I$PYPREFIX/include/Py -I$PYEPREFIX/$PYLIBDIR/python/lib" fi fi AC_MSG_RESULT($PYCFLAGS) # Set the library directory blindly. This probably won't work with older versions AC_MSG_CHECKING(for Python library) dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR" for i in $dirs; do if test -d $PYEPREFIX/$PYLIBDIR/$i; then PYLIB="$PYEPREFIX/$PYLIBDIR/$i" break fi done if test -z "$PYLIB"; then AC_MSG_RESULT(Not found) else AC_MSG_RESULT($PYLIB) fi AC_MSG_CHECKING(for Python LDFLAGS) # Check for really old versions if test -r $PYLIB/libPython.a; then PYLINK="-lModules -lPython -lObjects -lParser" else if test ! -r $PYLIB/lib$PYVERSION.so -a -r $PYLIB/lib$PYVERSION.a ; then # python2.2 on FC1 need this PYLINK="$PYLIB/lib$PYVERSION.a" else PYLINK="-l$PYVERSION" fi fi PYLDFLAGS="$PYLINK" AC_MSG_RESULT($PYLDFLAGS) fi fi # Cygwin (Windows) needs the library for dynamic linking case $host in *-*-cygwin* | *-*-mingw*) PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK" DEFS="-DUSE_DL_IMPORT $DEFS" PYCFLAGS="$PYCFLAGS" ;; *)PYTHONDYNAMICLINKING="";; esac fi ]) owfs-3.1p5/module/swig/python/examples/0000755000175000001440000000000013022537105015170 500000000000000owfs-3.1p5/module/swig/python/examples/check_ow.py0000755000175000001440000000563712654730021017264 00000000000000#! /usr/bin/env python """ Nagios plugin to check the value of a 1-wire sensor. Nagios is a host, service and network monitoring program available at http://nagios.org. Copyright (c) 2008 Peter Kropf. All rights reserved. Examples: This example doesn't really do all that much, must verifies that the specified sensor exists on the USB adapter. ./check_ow.py u /10.54BA4D000800 Check the temperature of the sensor on the USB adapter. Give a warning if the temperature is greater than 29 degrees celsius and make it critical if above 35. ./check_ow.py -c 35 -w 29 u /10.54BA4D000800/temperature """ import ow import sys from optparse import OptionParser class nagios: ok = (0, 'OK') warning = (1, 'WARNING') critical = (2, 'CRITICAL') unknown = (3, 'UNKNOWN') def exit(status, message): print 'ow ' + status[1] + ' - ' + message sys.exit(status[0]) # FIXME: need to add more help text in the init_string and sensor_path parameters parser = OptionParser(usage='usage: %prog [options] init_string sensor_path', version='%prog ' + ow.__version__) parser.add_option('-v', dest='verbose', action='count', help='multiple -v increases the level of debugging output.') parser.add_option('-w', dest='warning', type='float', help='warning level.') parser.add_option('-c', dest='critical', type='float', help='critical level.') parser.add_option('-t', dest='temperature', choices=['C', 'F', 'R', 'K'], help='set the temperature scale: C - celsius, F - fahrenheit, R - rankine or K - kelvin.') options, args = parser.parse_args() if len(args) != 2: exit(nagios.unknown, 'missing command line arguments') init = args[0] sensor_path = args[1] if options.temperature: ow.opt(options.temperature) try: ow.error_print(ow.error_print.suppressed) # needed to exclude debug output which confuses nagios ow.init(init) except ow.exUnknownSensor, ex: exit(nagios.unknown[0], 'unable to initialize sensor adapter ' + str(ex)) pieces = [x for x in sensor_path.split('/') if x] if len(pieces): sensor = '/' + pieces[0] else: sensor = '/' try: s = ow.Sensor(sensor) except ow.exUnknownSensor, ex: exit(nagios.unknown, 'unknown sensor ' + str(ex)) if options.verbose == 1: print s elif options.verbose > 1: print s print 'entryList:', s.entryList() print 'sensorList:', s.sensorList() if len(pieces) > 1: field = pieces[1] try: v = float(getattr(s, field)) except AttributeError: exit(nagios.unknown, 'unknown field - ' + repr(s) + '.' + field) if options.critical: if v > options.critical: exit(nagios.critical, repr(s) + '.' + field + ' %f' % v) if options.warning: if v > options.warning: exit(nagios.warning, repr(s) + '.' + field + ' %f' % v) exit(nagios.ok, repr(s) + '.' + field + ' %f' % v) else: # len(pieces) > 1 exit(nagios.ok, repr(s)) owfs-3.1p5/module/swig/python/examples/errormessages.py0000755000175000001440000000363712654730021020361 00000000000000#! /usr/bin/env python """ ::BOH $Id$ Copyright (c) 2005 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Turn on connection level error messages and print the address and type of all sensors on a 1-wire network. """ import sys import ow def tree( sensor ): print '%7s - %s' % ( sensor._type, sensor._path ) for next in sensor.sensors( ): if next._type in [ 'DS2409', ]: tree( next ) else: print '%7s - %s' % ( next._type, next._path ) if __name__ == "__main__": if len( sys.argv ) == 1: print 'usage: errormessages.py u|serial_port_path' sys.exit( 1 ) else: # Turn on the level of message to display #ow.error_level(ow.error_level.fatal) #ow.error_level(ow.error_level.default) #ow.error_level(ow.error_level.connect) ow.error_level(ow.error_level.call) #ow.error_level(ow.error_level.data) #ow.error_level(ow.error_level.debug) # Set where the messages are to be displayed #ow.error_print(ow.error_print.mixed) #ow.error_print(ow.error_print.syslog) ow.error_print(ow.error_print.stderr) #ow.error_print(ow.error_print.suppressed) ow.init( sys.argv[ 1 ] ) tree( ow.Sensor( '/' ) ) owfs-3.1p5/module/swig/python/examples/raw_access.py0000755000175000001440000000261212654730021017602 00000000000000#! /usr/bin/env python """ ::BOH $Id$ Copyright (c) 2004 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Example showing direct access to the underlying owfs libraries. """ import sys from ow import _OW def tree( path, indent = 0 ): raw = _OW.get( path ) if raw: entries = raw.split( ',' ) for entry in entries: print ' ' * indent, entry if entry[ -1 ] == '/': tree( entry, indent + 4 ) if __name__ == "__main__": if len( sys.argv ) == 1: print 'usage: tree.py u|serial_port_path|localhost:4304' sys.exit( 1 ) else: if not _OW.init( sys.argv[ 1 ] ): print 'problem initializing the 1-wire controller' sys.exit( 1 ) tree( '/' ) owfs-3.1p5/module/swig/python/examples/temperature.py0000755000175000001440000000233612654730021020030 00000000000000#! /usr/bin/env python """ ::BOH $Id$ Copyright (c) 2004 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Find all temperature sensors (DS18S20) and print out their current temperature reading. """ import sys import ow def temperature( ): root = ow.Sensor( '/' ) for sensor in root.find( type = 'DS18S20' ): print sensor._path, sensor.temperature if __name__ == "__main__": if len( sys.argv ) == 1: print 'usage: temperature.py u|serial_port_path' sys.exit( 1 ) else: ow.init( sys.argv[ 1 ] ) temperature( ) owfs-3.1p5/module/swig/python/examples/tree.py0000755000175000001440000000247512654730021016436 00000000000000#! /usr/bin/env python """ ::BOH $Id$ Copyright (c) 2004 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Print the address and type of all sensors on a 1-wire network. """ import sys import ow def tree( sensor ): print '%7s - %s' % ( sensor._type, sensor._path ) for next in sensor.sensors( ): if next._type in [ 'DS2409', ]: tree( next ) else: print '%7s - %s' % ( next._type, next._path ) if __name__ == "__main__": if len( sys.argv ) == 1: print 'usage: tree.py u|serial_port_path|localhost:4304' sys.exit( 1 ) else: ow.init( sys.argv[ 1 ] ) tree( ow.Sensor( '/' ) ) owfs-3.1p5/module/swig/python/examples/xmlrpc_client.py0000755000175000001440000000245112654730021020334 00000000000000#! /usr/bin/env python """ ::BOH $Id$ Copyright (c) 2005 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Create an XML-RPC client for a 1-wire network. """ import xmlrpclib import code ow_sensor = xmlrpclib.ServerProxy( 'http://localhost:8765/' ) print 'Entries at the root:', ow_sensor.entries( '/' ) print 'List of sensors:' sensors = ow_sensor.sensors( '/' ) for sensor in sensors: sensor_type = ow_sensor.attr( sensor, 'type' ) if sensor_type == 'DS18S20': print ' ', sensor, '-', sensor_type, '- temperature:', ow_sensor.attr( sensor, 'temperature' ).strip( ) else: print ' ', sensor, '-', sensor_type owfs-3.1p5/module/swig/python/examples/xmlrpc_server.py0000755000175000001440000000453212654730021020366 00000000000000#! /usr/bin/env python """ ::BOH $Id$ Copyright (c) 2005 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Create an XML-RPC server for a 1-wire network. Run xmlrpc_client.py to see the server in action. Or point a browser at http://localhost:8765 to see some documentation. """ import sys import ow from DocXMLRPCServer import DocXMLRPCServer, DocXMLRPCRequestHandler from SocketServer import ThreadingMixIn class owr: """ A wrapper class is needed around the ow.Sensor class since the XML-RPC protocol doesn't know anything about generators, Python objects and such. XML-RPC is a pretty simple protocol that deals pretty well with basic types. So that's what it'll get. """ def entries( self, path ): """List a sensor's attributes.""" return [entry for entry in ow.Sensor( path ).entries( )] def sensors( self, path ): """List all the sensors that exist in a particular path.""" return [sensor._path for sensor in ow.Sensor( path ).sensors( )] def attr( self, path, attr ): """Lookup a specific sensor attribute.""" sensor = ow.Sensor( path ) exec 'val = sensor.' + attr return val class ThreadingServer( ThreadingMixIn, DocXMLRPCServer ): pass # Initialize ow for a USB controller or for a serial port. ow.init( 'u' ) #ow.init( '/dev/ttyS0' ) # Allow connections for the localhost on port 8765. serveraddr = ( '', 8765 ) srvr = ThreadingServer( serveraddr, DocXMLRPCRequestHandler ) srvr.set_server_title( '1-wire network' ) srvr.set_server_documentation( 'Welcome to the world of 1-wire networks.' ) srvr.register_instance( owr( ) ) srvr.register_introspection_functions( ) srvr.serve_forever( ) owfs-3.1p5/module/swig/python/unittest/0000755000175000001440000000000013022537105015231 500000000000000owfs-3.1p5/module/swig/python/unittest/Readme.txt0000644000175000001440000000510512654730021017112 00000000000000$Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/unittest/Readme.txt $ Unittests Status As of 2/7/2005, the OWSensor.testCacheUncached and OWSensor.testSensorList unittest will fail. This seems to be caused by a reading from the cached and then uncached trees. Under the right circumstances, it looks like the uncached tree doesn't show sensors connected to a ds2409 microlan controller. The problem has been reproduced with the Perl interface so it appears that it's not directly related to the Python module. But more work is needed to verify and resolve the issue. Environment The unittests expect that ow has been installed into the Python installation such that "import ow" works. This can be accomplished via the "python setup.py install" command or by adding the directory that contains the ow module to the PYTHONPATH environment variable. For example, to setup the unittest environment on a linux system after OWFS has been built but before is has been installed: export PYTHONPATH=$(PATH_TO_OWFS)/module/swig/python/build/lib.linux-i686-2.3/ Configuration The unittests require a configuration file that defines the layout of the 1-wire network to be used in testing. The configuration file should be named owtest.ini and should exist in the unittest directory. See owtest_sample.ini for a description of the configuration file. Running Unittests The owtest.py program is the main driver to run all unittests. It will look for all python modules in the current directory, include the test suites that it defines if the module's load variable is true. For example: root@think:/home/peter/src/owfs/module/swig/python/unittest> ./owtest.py testAttributes (ds1420.DS1420) ... ok testBaseAttributes (owsensors.OWSensors) ... ok testEntries (owsensors.OWSensors) ... ok testFindAll (owsensors.OWSensors) ... ok testFindAllNone (owsensors.OWSensors) ... ok testFindAnyNoValue (owsensors.OWSensors) ... ok testFindAnyNone (owsensors.OWSensors) ... ok testFindAnyValue (owsensors.OWSensors) ... ok testSensors (owsensors.OWSensors) ... ok ---------------------------------------------------------------------- Ran 9 tests in 0.688s OK The individual test cases can also be run. For example: $ ./ds1420.py testAttributes (__main__.DS1420) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.117s OK owfs-3.1p5/module/swig/python/unittest/ds1420.py0000755000175000001440000000447712654730021016461 00000000000000#! /usr/bin/env python """ ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/unittest/ds1420.py $ Copyright (c) 2004 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Test suite for basic reality checks on a 1-wire nerwork. address/ crc8/ family/ id/ present/ type/ """ import unittest import sys import os import ConfigParser import ow __version__ = '0.0' if not os.path.exists( 'owtest.ini' ): raise IOError, 'owtest.ini' config = ConfigParser.ConfigParser( ) config.read( 'owtest.ini' ) sensors = [ name for name in config.get( 'Root', 'sensors' ).split( ' ' ) ] sensors = [ '/' + name for name in sensors if config.get( name, 'type' ) == 'DS1420' ] if len( sensors ): load = True else: load = False class DS1420( unittest.TestCase ): def setUp( self ): ow.init( config.get( 'General', 'interface' ) ) def testAttributes( self ): self.failIfEqual( len( sensors ), 0 ) for name in sensors: sensor = ow.Sensor( name ) family, id = name[ 1: ].split( '.' ) self.failUnlessEqual( family + id, sensor.address[ :-2 ] ) #self.failUnlessEqual( config.get( name, 'crc8' ), sensor.crc8 ) self.failUnlessEqual( family, sensor.family ) self.failUnlessEqual( id, sensor.id ) self.failUnlessEqual( config.get( name[ 1: ], 'type' ), sensor.type ) def Suite( ): return unittest.makeSuite( DS1420, 'test' ) if __name__ == "__main__": if len( sys.argv ) > 1: unittest.main( ) else: unittest.TextTestRunner( verbosity=2 ).run( Suite( ) ) owfs-3.1p5/module/swig/python/unittest/ds2408.py0000755000175000001440000001755012654730021016464 00000000000000#! /usr/bin/env python """ ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/unittest/ds2408.py $ Copyright (c) 2004 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Test suite for basic reality checks on a 1-wire network. PIO.0/ PIO.1/ PIO.2/ PIO.3/ PIO.4/ PIO.5/ PIO.6/ PIO.7/ PIO.ALL/ PIO.BYTE/ address/ crc8/ family/ id/ latch.0/ latch.1/ latch.2/ latch.3/ latch.4/ latch.5/ latch.6/ latch.7/ latch.ALL/ latch.BYTE/ power/ present/ reset/ sensed.0/ sensed.1/ sensed.2/ sensed.3/ sensed.4/ sensed.5/ sensed.6/ sensed.7/ sensed.ALL/ sensed.BYTE/ set_alarm/ strobe/ type/ """ import unittest import sys import os import ConfigParser import ow import util __version__ = '0.0' if not os.path.exists( 'owtest.ini' ): raise IOError, 'owtest.ini' config = ConfigParser.ConfigParser( ) config.read( 'owtest.ini' ) sensors = util.find_config( config, 'DS2408' ) if len( sensors ): load = True else: load = False class DS2408( unittest.TestCase ): def setUp( self ): ow.init( config.get( 'General', 'interface' ) ) def testAttributes( self ): self.failIfEqual( len( sensors ), 0 ) for name in sensors: sensor = ow.Sensor( name ) family, id = name.split( '/' )[ -1 ].split( '.' ) self.failUnlessEqual( family + id, sensor.address[ :-2 ] ) #self.failUnlessEqual( config.get( name, 'crc8' ), sensor.crc8 ) self.failUnlessEqual( family, sensor.family ) self.failUnlessEqual( id, sensor.id ) self.failUnlessEqual( '1', sensor.present ) self.failUnlessEqual( config.get( name.split( '/' )[ -1 ], 'type' ), sensor.type ) self.failUnlessEqual( hasattr( sensor, 'PIO_0' ), True ) self.failUnlessEqual( hasattr( sensor, 'PIO_1' ), True ) self.failUnlessEqual( hasattr( sensor, 'PIO_2' ), True ) self.failUnlessEqual( hasattr( sensor, 'PIO_3' ), True ) self.failUnlessEqual( hasattr( sensor, 'PIO_4' ), True ) self.failUnlessEqual( hasattr( sensor, 'PIO_5' ), True ) self.failUnlessEqual( hasattr( sensor, 'PIO_6' ), True ) self.failUnlessEqual( hasattr( sensor, 'PIO_7' ), True ) self.failUnlessEqual( hasattr( sensor, 'PIO_ALL' ), True ) self.failUnlessEqual( hasattr( sensor, 'PIO_BYTE' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_0' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_1' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_2' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_3' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_4' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_5' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_6' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_7' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_ALL' ), True ) self.failUnlessEqual( hasattr( sensor, 'latch_BYTE' ), True ) self.failUnlessEqual( hasattr( sensor, 'power' ), True ) self.failUnlessEqual( hasattr( sensor, 'reset' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_0' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_1' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_2' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_3' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_4' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_5' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_6' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_7' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_ALL' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_BYTE' ), True ) self.failUnlessEqual( hasattr( sensor, 'set_alarm' ), True ) self.failUnlessEqual( hasattr( sensor, 'strobe' ), True ) def testSet( self ): self.failIfEqual( len( sensors ), 0 ) for name in sensors: sensor = ow.Sensor( name ) sensor.PIO_0 = '0' #print sensor._path + '/PIO.0' self.failUnlessEqual( ow._OW.get( sensor._path + '/PIO.0' ), '0' ) self.failUnlessEqual( sensor.PIO_0, '0' ) self.failUnlessEqual( 'PIO_0' in dir( sensor ), False ) sensor.PIO_0 = '1' self.failUnlessEqual( sensor.PIO_0, '1' ) self.failUnlessEqual( 'PIO_0' in dir( sensor ), False ) sensor.PIO_1 = '0' self.failUnlessEqual( sensor.PIO_1, '0' ) self.failUnlessEqual( 'PIO_1' in dir( sensor ), False ) sensor.PIO_1 = '1' self.failUnlessEqual( sensor.PIO_1, '1' ) self.failUnlessEqual( 'PIO_1' in dir( sensor ), False ) sensor.PIO_2 = '0' self.failUnlessEqual( sensor.PIO_2, '0' ) self.failUnlessEqual( 'PIO_2' in dir( sensor ), False ) sensor.PIO_2 = '1' self.failUnlessEqual( sensor.PIO_2, '1' ) self.failUnlessEqual( 'PIO_2' in dir( sensor ), False ) sensor.PIO_3 = '0' self.failUnlessEqual( sensor.PIO_3, '0' ) self.failUnlessEqual( 'PIO_3' in dir( sensor ), False ) sensor.PIO_3 = '1' self.failUnlessEqual( sensor.PIO_3, '1' ) self.failUnlessEqual( 'PIO_3' in dir( sensor ), False ) sensor.PIO_4 = '0' self.failUnlessEqual( sensor.PIO_4, '0' ) self.failUnlessEqual( 'PIO_4' in dir( sensor ), False ) sensor.PIO_4 = '1' self.failUnlessEqual( sensor.PIO_4, '1' ) self.failUnlessEqual( 'PIO_4' in dir( sensor ), False ) sensor.PIO_5 = '0' self.failUnlessEqual( sensor.PIO_5, '0' ) self.failUnlessEqual( 'PIO_5' in dir( sensor ), False ) sensor.PIO_5 = '1' self.failUnlessEqual( sensor.PIO_5, '1' ) self.failUnlessEqual( 'PIO_5' in dir( sensor ), False ) sensor.PIO_6 = '0' self.failUnlessEqual( sensor.PIO_6, '0' ) self.failUnlessEqual( 'PIO_6' in dir( sensor ), False ) sensor.PIO_6 = '1' self.failUnlessEqual( sensor.PIO_6, '1' ) self.failUnlessEqual( 'PIO_6' in dir( sensor ), False ) sensor.PIO_7 = '0' self.failUnlessEqual( sensor.PIO_7, '0' ) self.failUnlessEqual( 'PIO_7' in dir( sensor ), False ) sensor.PIO_7 = '1' self.failUnlessEqual( sensor.PIO_7, '1' ) self.failUnlessEqual( 'PIO_7' in dir( sensor ), False ) def Suite( ): return unittest.makeSuite( DS2408, 'test' ) if __name__ == "__main__": if len( sys.argv ) > 1: unittest.main( ) else: unittest.TextTestRunner( verbosity=2 ).run( Suite( ) ) owfs-3.1p5/module/swig/python/unittest/ds2409.py0000755000175000001440000001002012654730021016446 00000000000000#! /usr/bin/env python """ ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/unittest/ds2409.py $ Copyright (c) 2004 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Test suite for basic reality checks on a 1-wire nerwork. address/ branch.0/ branch.ALL/ control/ discharge/ event.1/ event.BYTE/ id/ present/ sensed.1/ sensed.BYTE/ aux/ branch.1/ branch.BYTE/ crc8/ event.0/ event.ALL/ family/ main/ sensed.0/ sensed.ALL/ type/ """ import unittest import sys import os import ConfigParser import ow __version__ = '0.0' if not os.path.exists( 'owtest.ini' ): raise IOError, 'owtest.ini' config = ConfigParser.ConfigParser( ) config.read( 'owtest.ini' ) sensors = [ name for name in config.get( 'Root', 'sensors' ).split( ' ' ) ] sensors = [ '/' + name for name in sensors if config.get( name, 'type' ) == 'DS2409' ] if len( sensors ): load = True else: load = False # There seems to be an odd interaction when ds2409 is run from # owtest.py. Once the aux or main attributes are checked, calls to the # controller no longer return the sensors that are there. This is seen # when owsensors.py tests are run. At this point, I'm not sure why # this is so ds2409 is forced not to run from owtest.py. Running it by # itself works just fine. But more testing is needed to understand # what's going on. load = False class DS2409( unittest.TestCase ): def setUp( self ): ow.init( config.get( 'General', 'interface' ) ) def testAttributes( self ): for name in sensors: sensor = ow.Sensor( name ) family, id = name[ 1: ].split( '.' ) self.failUnlessEqual( family + id, sensor.address[ :-2 ] ) #self.failUnlessEqual( config.get( name, 'crc8' ), sensor.crc8 ) self.failUnlessEqual( family, sensor.family ) self.failUnlessEqual( id, sensor.id ) self.failUnlessEqual( '1', sensor.present ) self.failUnlessEqual( config.get( name[ 1: ], 'type' ), sensor.type ) self.failUnlessEqual( hasattr( sensor, 'branch_0' ), True ) self.failUnlessEqual( hasattr( sensor, 'branch_1' ), True ) self.failUnlessEqual( hasattr( sensor, 'branch_ALL' ), True ) self.failUnlessEqual( hasattr( sensor, 'branch_BYTE' ), True ) self.failUnlessEqual( hasattr( sensor, 'control' ), True ) #self.failUnlessEqual( hasattr( sensor, 'discharge' ), True ) self.failUnlessEqual( hasattr( sensor, 'event_0' ), True ) self.failUnlessEqual( hasattr( sensor, 'event_1' ), True ) self.failUnlessEqual( hasattr( sensor, 'event_ALL' ), True ) self.failUnlessEqual( hasattr( sensor, 'event_BYTE' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_0' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_1' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_ALL' ), True ) self.failUnlessEqual( hasattr( sensor, 'sensed_BYTE' ), True ) def Suite( ): return unittest.makeSuite( DS2409, 'test' ) if __name__ == "__main__": if len( sys.argv ) > 1: unittest.main( ) else: unittest.TextTestRunner( verbosity=2 ).run( Suite( ) ) owfs-3.1p5/module/swig/python/unittest/owload.py0000755000175000001440000000322012654730021017012 00000000000000#! /usr/bin/env python """ ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/unittest/owsensors.py $ Copyright (c) 2004 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Simple test to ensure that the ow module can be loaded and an instance of ow.Sensor created. """ import unittest import sys import os import ConfigParser __version__ = '0.0' load = True class OWLoad( unittest.TestCase ): def setUp( self ): if not os.path.exists( 'owtest.ini' ): raise IOError, 'owtest.ini' self.config = ConfigParser.ConfigParser( ) self.config.read( 'owtest.ini' ) def testImport( self ): #print 'OWLoad.testImport' import ow ow.init( self.config.get( 'General', 'interface' ) ) s = ow.Sensor( '/' ) def Suite( ): return unittest.makeSuite( OWLoad, 'test' ) if __name__ == "__main__": if len( sys.argv ) > 1: unittest.main( ) else: unittest.TextTestRunner( verbosity=2 ).run( Suite( ) ) owfs-3.1p5/module/swig/python/unittest/owsensors.py0000755000175000001440000002015512654730021017575 00000000000000#! /usr/bin/env python """ ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/unittest/owsensors.py $ Copyright (c) 2004 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Test suite for basic reality checks on a 1-wire nerwork. """ import unittest import sys import os import ConfigParser import ow __version__ = '0.0' load = True class OWSensors( unittest.TestCase ): def setUp( self ): #print 'OWSensors.setup' if not os.path.exists( 'owtest.ini' ): raise IOError, 'owtest.ini' self.config = ConfigParser.ConfigParser( ) self.config.read( 'owtest.ini' ) ow.init( self.config.get( 'General', 'interface' ) ) self.entries = self.config.get( 'Root', 'entries' ).split( ' ' ) self.entries.sort( ) self.sensors = [ '/' + name for name in self.config.get( 'Root', 'sensors' ).split( ' ' ) ] self.sensors.sort( ) def testRootNameType( self ): #print 'OWSensors.testRootNameType' path, name = str( ow.Sensor( '/' ) ).split( ' - ' ) self.failUnlessEqual( path, '/' ) self.failUnlessEqual( name, self.config.get( 'Root', 'type' ) ) def testRootEntries( self ): #print 'OWSensors.testRootEntries' entries = list( ow.Sensor( '/' ).entries( ) ) entries.sort( ) self.failUnlessEqual( entries, self.entries ) def testSensors( self ): #print 'OWSensors.testSensors' sensors = [ str( sensor ).split( ' - ' )[ 0 ] for sensor in ow.Sensor( '/' ).sensors( ) ] sensors.sort( ) self.failUnlessEqual( sensors, self.sensors ) def testBaseAttributes( self ): #print 'OWSensors.testBaseAttributes' for sensor in ow.Sensor( '/' ).sensors( ): name = str( sensor ).split( ' - ' )[ 0 ][ 1: ] family, id = name.split( '.' ) self.failUnlessEqual( family + id, sensor.address[ :-2 ] ) #self.failUnlessEqual( self.config.get( name, 'crc8' ), sensor.crc8 ) self.failUnlessEqual( family, sensor.family ) self.failUnlessEqual( id, sensor.id ) self.failUnlessEqual( self.config.get( name, 'type' ), sensor.type ) def testFindAnyValue( self ): #print 'OWSensors.testFindAnyValue' type_list = { } for id in self.config.get( 'Root', 'sensors' ).split( ' ' ): id_type = self.config.get( id, 'type' ) try: type_list[ id_type ] += 1 except KeyError: type_list[ id_type ] = 1 for id_type in type_list: sensor_list = [ sensor for sensor in ow.Sensor( '/' ).find( type = id_type ) ] self.failUnlessEqual( len( sensor_list ), type_list[ id_type ] ) def testFindAnyNoValue( self ): #print 'OWSensors.testFindAnyNoValue' type_count = len( self.config.get( 'Root', 'sensors' ).split( ' ' ) ) sensor_list = [ sensor for sensor in ow.Sensor( '/' ).find( type = None ) ] self.failUnlessEqual( len( sensor_list ), type_count ) def testFindAnyNone( self ): #print 'OWSensors.testFindNone' sensor_list = [ sensor for sensor in ow.Sensor( '/' ).find( xyzzy = None ) ] self.failUnlessEqual( len( sensor_list ), 0 ) def testFindAll( self ): #print 'OWSensors.testFindAll' list = { } for id in self.config.get( 'Root', 'sensors' ).split( ' ' ): family = id.split( '.' )[ 0 ] id_type = self.config.get( id, 'type' ) try: list[ ( family, id_type ) ] += 1 except KeyError: list[ ( family, id_type ) ] = 1 for pair in list: sensor_list = [ sensor for sensor in ow.Sensor( '/' ).find( all = True, family = pair[ 0 ], type = pair[ 1 ] ) ] self.failUnlessEqual( len( sensor_list ), list[ pair ] ) def testFindAllNone( self ): #print 'OWSensors.testFindAllNone' list = { } for id in self.config.get( 'Root', 'sensors' ).split( ' ' ): family = id.split( '.' )[ 0 ] id_type = self.config.get( id, 'type' ) try: list[ ( family, id_type ) ] += 1 except KeyError: list[ ( family, id_type ) ] = 1 for pair in list: sensor_list = [ sensor for sensor in ow.Sensor( '/' ).find( all = True, xyzzy = True, family = pair[ 0 ], type = pair[ 1 ] ) ] self.failUnlessEqual( len( sensor_list ), 0 ) def testCacheUncached( self ): for id in self.config.get( 'Root', 'sensors' ).split( ' ' ): c = ow.Sensor( '/' + id ) u = ow.Sensor( '/uncached/' + id ) self.failUnlessEqual( c._path, u._path ) ce = [ entry for entry in c.entries( ) ] ue = [ entry for entry in u.entries( ) ] self.failUnlessEqual( ce, ue ) cs = [ sensor for sensor in c.sensors( ) ] us = [ sensor for sensor in u.sensors( ) ] self.failUnlessEqual( cs, us ) def testCacheSwitch( self ): for id in self.config.get( 'Root', 'sensors' ).split( ' ' ): s = ow.Sensor( '/' + id ) ce = s.entryList( ) cs = s.sensorList( ) s.useCache( False ) ue = s.entryList( ) us = s.sensorList( ) self.failUnlessEqual( ce, ue ) self.failUnlessEqual( cs, us ) def testRootCache( self ): r = ow.Sensor( '/' ) ce = r.entryList( ) cs = r.sensorList( ) r.useCache( False ) ue = r.entryList( ) us = r.sensorList( ) self.failUnlessEqual( cs, us ) self.failUnlessEqual( ue, [ 'alarm', 'simultaneous' ] ) def testEntryList( self ): for id in self.config.get( 'Root', 'sensors' ).split( ' ' ): c = ow.Sensor( '/' + id ) u = ow.Sensor( '/uncached/' + id ) ce = [ entry for entry in c.entries( ) ] self.failUnlessEqual( ce, c.entryList( ) ) ue = [ entry for entry in u.entries( ) ] self.failUnlessEqual( ue, u.entryList( ) ) self.failUnlessEqual( ce, ue ) def testSensorList( self ): for id in self.config.get( 'Root', 'sensors' ).split( ' ' ): c = ow.Sensor( '/' + id ) u = ow.Sensor( '/uncached/' + id ) cs = [ sensor for sensor in c.sensors( ) ] self.failUnlessEqual( cs, c.sensorList( ) ) us = [ sensor for sensor in u.sensors( ) ] self.failUnlessEqual( us, u.sensorList( ) ) self.failUnlessEqual( cs, us ) def testEqual( self ): s1 = ow.Sensor( '/' ) s2 = ow.Sensor( '/' ) s3 = ow.Sensor( self.config.get( 'Root', 'sensors' ).split( ' ' )[ 0 ] ) self.failUnlessEqual( s1, s2 ) self.failIfEqual( s1, s3 ) self.failIfEqual( s2, s3 ) def Suite( ): return unittest.makeSuite( OWSensors, 'test' ) if __name__ == "__main__": if len( sys.argv ) > 1: unittest.main( ) else: unittest.TextTestRunner( verbosity=2 ).run( Suite( ) ) owfs-3.1p5/module/swig/python/unittest/owtest.py0000755000175000001440000000366212654730021017064 00000000000000#! /usr/bin/env python """ ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/unittest/owtest.py $ Copyright (c) 2004 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Run all the tests from the modules in the current directory. """ import sys import os import glob import unittest __version__ = '0.0' def Suite( ): """ Function used by unittest.TextTestRunner to create the suite of test cases that are found in the current directory. All modules except the current one are considered test cases and will be added to the list of test suites to be run. """ this_module_name = os.path.basename( __file__ ) test_suites = unittest.TestSuite( ) for name in glob.glob( '*.py' ): if name == this_module_name: continue name = name[:-3] try: exec 'import ' + name exec 'load = ' + name + '.load' if load: exec 'suite = ' + name + '.Suite( )' test_suites = unittest.TestSuite( ( test_suites, suite ) ) except AttributeError: print 'skipping ' + name + ' no Suite function found.' pass return test_suites suite = Suite( ) if __name__ == "__main__": unittest.TextTestRunner( verbosity=2 ).run( Suite( ) ) owfs-3.1p5/module/swig/python/unittest/owtest_sample.ini0000644000175000001440000000442312654730021020545 00000000000000#::BOH # $Id$ # $HeadURL: http://subversion/stuff/svn/owfs/trunk/unittest/owtest.ini $ # # Copyright (c) 2004 Peter Kropf. All rights reserved. # # 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #::EOH # # 1-wire unittest sample configuration file # The general section defines how the ow libraries are to be # initialized. # # interface - u | s | tty_path # Defines how the OW libraries are to communicate with the 1-wire # network. # # u - Use the USB controller # host:3001 - Talk with the OW server on host using port 3001 # tty_path - full path to the serial port [General] interface = u #interface = host:3001 #interface = /dev/ttyS0 # The root section defines the attributes and sensors that are # attached to the root branch of the 1-wire network. # # entries - names of all the attributes that are to be found in the # root. # # sensors - names of all the sensors that are attached to the root. [Root] entries = alarm settings simultaneous statistics structure system uncached sensors = 10.B7B64D000800 type = DS9490 # Each sensor that's attached to the 1-wire network should have a # section named after it. # # type - the type of the sensor # # parent - path to the controller or microlan this sensor is connected # to. # # branch - if the sensor is on a microlan, which branch is it on (main # or aux) # # main_sensors - names of all the sensors that are attached to the # main branch. This is valid for DS2409 type sensors only. # # aux_sensors - names of all the sensors that are attached to the aux # branch. This is valid for DS2409 type sensors only. [10.B7B64D000800] type = DS18S20 parent = / #branch = owfs-3.1p5/module/swig/python/unittest/owtest_think.ini0000644000175000001440000000314312654730021020377 00000000000000#::BOH # $Id$ # $HeadURL: http://subversion/stuff/svn/owfs/trunk/unittest/owtest.ini $ # # Copyright (c) 2004 Peter Kropf. All rights reserved. # # 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #::EOH # # 1-wire unittest configuration file for the host called think [General] #interface = u interface = localhost:3003 [Root] entries = alarm settings simultaneous statistics structure system uncached sensors = 10.B7B64D000800 1F.440701000000 1F.5D0B01000000 1F.7F0901000000 81.A44C23000000 type = DS9490 [10.B7B64D000800] type = DS18S20 parent = / #branch = [1F.440701000000] type = DS2409 main_sensors = 29.400900000000 aux_sensors = parent = / #branch = [1F.5D0B01000000] type = DS2409 #main_sensors = #aux_sensors = parent = / #branch = [1F.7F0901000000] type = DS2409 #main_sensors = #aux_sensors = parent = / #branch = [81.A44C23000000] type = DS1420 parent = / #branch = [29.400900000000] type = DS2408 parent = /1F.440701000000 branch = main owfs-3.1p5/module/swig/python/unittest/util.py0000644000175000001440000000300612654730021016501 00000000000000#! /usr/bin/env python """ ::BOH $Id$ Copyright (c) 2005 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH Utility functions for unittests. """ __version__ = '0.0' load = False def find_config( config, type ): """ Returns a list of sensor path names for all the sensors found in the various sections of a ConfigParser .ini file. [ '/29.400001001234', '/1F.440701000000/main/29.400900000000' ] """ sensors = [ ] for section in config.sections( ): if config.has_option( section, 'type' ): if config.get( section, 'type' ) == type: parent = config.get( section, 'parent' ) if parent == '/': sensors.append( '/' + section ) else: sensors.append( parent + '/' + config.get( section, 'branch' ) + '/' + section ) return sensors owfs-3.1p5/module/swig/python/Makefile.am0000644000175000001440000000214512665167763015355 00000000000000SUBDIRS = ow EXTRA_DIST = python.m4 \ examples/check_ow.py examples/errormessages.py examples/raw_access.py examples/temperature.py examples/tree.py examples/xmlrpc_client.py examples/xmlrpc_server.py \ unittest/Readme.txt unittest/ds1420.py unittest/ds2408.py unittest/ds2409.py unittest/owload.py unittest/owsensors.py unittest/owtest.py unittest/owtest_sample.ini unittest/owtest_think.ini unittest/util.py noinst_DATA = OW.py LIBOW = ../../owlib/src/c/libow.la ow_wrap.c: ../ow.i ${LIBOW} $(SWIG) -python -o $@ ../ow.i OW.py: ow_wrap.c setup.py $(LIBOW) CFLAGS="@LIBUSB_CFLAGS@" $(PYTHON) setup.py build install-data-local: # OpenSUSE is buggy and install libraries at /usr/local. # Need to add call "install_lib --install-dir" or call "install --install-lib" # $(PYTHON) setup.py install_lib --install-dir="/$(DESTDIR)$(PYSITEDIR)" $(PYTHON) setup.py install --install-lib="$(DESTDIR)$(PYSITEDIR)" # Other options are (but not needed): --install-data="/$(DESTDIR)$(PYSITEDIR)" --install-script="/$(DESTDIR)$(PYSITEDIR)" --install-header= clean-local: @RM@ -f configuration.log @RM@ -rf build OW.py ow_wrap.c owfs-3.1p5/module/swig/python/Makefile.in0000644000175000001440000005754413022537053015360 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/swig/python ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = setup.py 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 DATA = $(noinst_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 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 $(srcdir)/setup.py.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = ow EXTRA_DIST = python.m4 \ examples/check_ow.py examples/errormessages.py examples/raw_access.py examples/temperature.py examples/tree.py examples/xmlrpc_client.py examples/xmlrpc_server.py \ unittest/Readme.txt unittest/ds1420.py unittest/ds2408.py unittest/ds2409.py unittest/owload.py unittest/owsensors.py unittest/owtest.py unittest/owtest_sample.ini unittest/owtest_think.ini unittest/util.py noinst_DATA = OW.py LIBOW = ../../owlib/src/c/libow.la 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) --foreign module/swig/python/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/swig/python/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): setup.py: $(top_builddir)/config.status $(srcdir)/setup.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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: 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 clean-libtool clean-local 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-data-local 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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile ow_wrap.c: ../ow.i ${LIBOW} $(SWIG) -python -o $@ ../ow.i OW.py: ow_wrap.c setup.py $(LIBOW) CFLAGS="@LIBUSB_CFLAGS@" $(PYTHON) setup.py build install-data-local: # OpenSUSE is buggy and install libraries at /usr/local. # Need to add call "install_lib --install-dir" or call "install --install-lib" # $(PYTHON) setup.py install_lib --install-dir="/$(DESTDIR)$(PYSITEDIR)" $(PYTHON) setup.py install --install-lib="$(DESTDIR)$(PYSITEDIR)" # Other options are (but not needed): --install-data="/$(DESTDIR)$(PYSITEDIR)" --install-script="/$(DESTDIR)$(PYSITEDIR)" --install-header= clean-local: @RM@ -f configuration.log @RM@ -rf build OW.py ow_wrap.c # 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: owfs-3.1p5/module/swig/python/setup.py.in0000644000175000001440000001343612665167763015445 00000000000000""" ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/setup.py $ Copyright (c) 2004, 2005 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH distutils setup file for use in creating a Python module from the owfs project. """ import os # platform doesn't exist for python 2.2 #import platform from distutils.core import setup, Extension from distutils import sysconfig import string #python_version = platform.python_version()[0:3] python_version = sysconfig.get_config_vars()["VERSION"] classifiers = """ Development Status :: 4 - Beta Environment :: Console Intended Audience :: Developers Intended Audience :: System Administrators Operating System :: POSIX :: Linux Programming Language :: C Programming Language :: Python Topic :: System :: Hardware Topic :: Utilities """ my_libraries = [] my_library_dirs = [] my_include_dirs = [] my_extra_link_args = [] my_extra_compile_args = [] my_runtime_library_dirs = [] my_extra_objects = [] my_define_macros = [] my_undef_macros = [] def write_configuration(define_macros, include_dirs, libraries, library_dirs, extra_link_args, extra_compile_args, runtime_library_dirs,extra_objects): #Write the compilation configuration into a file out=open('configuration.log','w') print >> out, "Current configuration" print >> out, "libraries", libraries print >> out, "library_dirs", library_dirs print >> out, "include_dirs", include_dirs print >> out, "define_macros", define_macros print >> out, "extra_link_args", extra_link_args print >> out, "extra_compile_args", extra_compile_args print >> out, "runtime_library_dirs", runtime_library_dirs print >> out, "extra_objects", extra_objects out.close() have_darwin = '@HAVE_DARWIN@' have_freebsd = '@HAVE_FREEBSD@' bsd_fixes = have_darwin == 'true' or have_freebsd == 'true' # have to split up the _CFLAGS, _LIBS variables since there are problem # when they contain spaces. The append() function doesn't work very good. # extra_l_args.append ( '@LIBUSB_CFLAGS@' ) # Should perhaps add ${LD_EXTRALIBS} ${OSLIBS} to extra_l_args too if # supporting MacOSX. my_extra_compile_args = [ '-D_FILE_OFFSET_BITS=64' ] my_extra_link_args = [ ] if bsd_fixes: my_extra_link_args = my_extra_link_args + string.split('../../owlib/src/c/.libs/libow.so', ' ') my_libraries = [ 'ow' ] #if ARCH == "x64": # my_extra_objects = [ '../../owlib/src/c/.libs/libow.a' ] # my_libraries = [ ] # #my_extra_link_args = my_extra_link_args + string.split('-Wl,--export-dynamic', ' ') #elif ARCH != "x64": # my_extra_objects = "" # my_libraries = [ 'ow' ] if bsd_fixes: my_libraries = [ ] removals = ['-Wstrict-prototypes'] if python_version == '2.5': cv_opt = sysconfig.get_config_vars()["CFLAGS"] for removal in removals: cv_opt = cv_opt.replace(removal, " ") sysconfig.get_config_vars()["CFLAGS"] = ' '.join(cv_opt.split()) cv_opt = ' '.join(my_extra_compile_args) for removal in removals: cv_opt = cv_opt.replace(removal, " ") my_extra_compile_args = ' '.join(cv_opt.split()) else: cv_opt = sysconfig.get_config_vars()["OPT"] for removal in removals: cv_opt = cv_opt.replace(removal, " ") sysconfig.get_config_vars()["OPT"] = ' '.join(cv_opt.split()) # cv_opt = ' '.join(my_extra_compile_args) # my_extra_compile_args = ' '.join(cv_opt.split()) #print "my_extra_compile_args=", my_extra_compile_args my_extra_compile_args = [ arg for arg in my_extra_compile_args if len(arg) > 1 ] #print "my_extra_compile_args=", my_extra_compile_args my_extra_link_args = [ arg for arg in my_extra_link_args if len(arg) > 1 ] my_include_dirs = [ '../../owlib/src/include', '../../../src/include' ] my_library_dirs = [ '../../owlib/src/c/.libs' ] my_runtime_library_dirs = [ ] sources = [ 'ow_wrap.c' ] write_configuration(my_define_macros, my_include_dirs, my_libraries, my_library_dirs, my_extra_link_args, my_extra_compile_args, my_runtime_library_dirs,my_extra_objects) setup( name = 'ow', description = '1-wire hardware interface.', version = '@VERSION@', author = 'Peter Kropf', author_email = 'pkropf@gmail.com', url = 'http://www.owfs.org/', license = 'GPL', platforms = 'Linux', long_description = 'Interface with 1-wire controllers and sensors from Python.', classifiers = filter( None, classifiers.split( '\n' ) ), packages = ['ow'], ext_package = 'ow', ext_modules = [ Extension( '_OW', sources, include_dirs = my_include_dirs, library_dirs = my_library_dirs, libraries = my_libraries, extra_compile_args = my_extra_compile_args, extra_link_args = my_extra_link_args, runtime_library_dirs = my_runtime_library_dirs, extra_objects=my_extra_objects) ], ) owfs-3.1p5/module/swig/python/ow/0000755000175000001440000000000013022537106014000 500000000000000owfs-3.1p5/module/swig/python/ow/Makefile.am0000644000175000001440000000003312654730021015751 00000000000000 EXTRA_DIST = __init__.py owfs-3.1p5/module/swig/python/ow/Makefile.in0000644000175000001440000004047213022537053015775 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/swig/python/ow ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = __init__.py 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) --foreign module/swig/python/ow/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/swig/python/ow/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am 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 clean-libtool 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 mostlyclean-libtool 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 clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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 mostlyclean-libtool 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: owfs-3.1p5/module/swig/python/ow/__init__.py0000644000175000001440000003741212654730021016041 00000000000000""" ::BOH $Id$ $HeadURL: http://subversion/stuff/svn/owfs/trunk/ow/__init__.py $ Copyright (c) 2004, 2005 Peter Kropf. All rights reserved. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ::EOH 1-wire sensor network interface. OWFS is an open source project developed by Paul Alfille and hosted at http://www.owfs.org. """ # avoid error with python2.2 from __future__ import generators import os from ow import _OW __author__ = 'Peter Kropf' __email__ = 'pkropf@gmail.com' __version__ = _OW.version( ) # # Exceptions used and thrown by the ow classes # class exError( Exception ): """Base exception for all one wire raised exceptions.""" class exErrorValue( exError ): """Base exception for all one wire raised exceptions with a value.""" def __init__( self, value ): self.value = value def __str__( self ): return repr( self.value ) class exNoController( exError ): """Exception raised when a controller cannot be initialized.""" class exNotInitialized( exError ): """Exception raised when a controller has not been initialized.""" class exUnknownSensor(exErrorValue): """Exception raised when a specified sensor is not found.""" # # Module variable used to insure that the _OW library has been # initialized before any calls into it are made. # initialized = False # # Access to the internal owlib error level and print variables # def error_level(level=None): """ Manipulate the internal owlib error logging calls. If no parameter is specified, the current owlib error level is returned. Otherwise, the current owlib error level is set to the value specified. Valid level values are: error_level.fatal error_level.default error_level.connect error_level.call error_level.data error_level.debug """ if level: _OW.set_error_level(level) return _OW.get_error_level() error_level.fatal = 0 error_level.default = 1 error_level.connect = 2 error_level.call = 3 error_level.data = 4 error_level.debug = 5 def error_print(level=None): """ Manipulate where the internal owlib error logging facility sends the error messages. If no parameter is specified, the current owlib error print value is returned. Otherwise, the current owlib error print value is set to the parameter. Valid print values are: error_print.mixed error_print.syslog error_print.stderr error_print.suppressed """ if level: _OW.set_error_print(level) return _OW.get_error_print() error_print.mixed = 0 error_print.syslog = 1 error_print.stderr = 2 error_print.suppressed = 3 def opt(option, arg = ''): """ Pass options to the ow opt function. Used for things like setting the temperature scale: ow.opt('F') # use the fahrenheit temperature scale ow.opt('C') # use the celsius temperature scale Useful only when directly connected to a sensor adapter. When using a remote owserver process, the owserver process must be started with the correct command line arguments. """ return _OW.opt(option, arg) # # Module varialbe used to turn on _OW function call logging # use_logging = False #use_logging = True def _get(path): """ Get the sensor data. In the case where a sensor is disconnected from the bus or something else goes wrong, raise exUnknownSensor. """ sensor = _OW.get(path) if sensor == None: raise exUnknownSensor(path) return sensor def _put(path, value): """ Write the _OW.put call details out to the log file. """ return _OW.put(path, value) def log_get( path ): """ Write the _OW.get call details out to the log file. """ logfile.write( "_OW.get( '%s' )%s" % ( path, os.linesep ) ) return _OW.get(path) def log_put( path, value ): """ Write the _OW.put call details out to the log file. """ logfile.write( "_OW.put( '%s', '%s' )%s" % ( path, value, os.linesep ) ) return _OW.put( path, value ) if use_logging: logfile = open( 'OW.log', 'w' ) owfs_get = log_get owfs_put = log_put else: owfs_get = _get owfs_put = _put # # Initialize and cleanup the _OW library. # def init( iface ): """ Initialize the OWFS library by specifying the interface mechanism to be used for communications to the 1-wire network. Examples: ow.init( 'u' ) Will initialize the 1-wire interface to use the USB controller. ow.init( '/dev/ttyS0' ) Will initialize the 1-wire interface to use the /dev/ttyS0 serial port. ow.init( 'remote_system:3003' ) Will initialize the 1-wire interface to use the owserver running on remote_system on port 3003. """ #print 'ow.__init__' global initialized if not initialized: if not _OW.init( iface ): raise exNoController initialized = True def finish( ): """ Cleanup the OWFS library, freeing any used resources. """ #print 'Controller.__del__' global initialized if initialized: _OW.finish( ) initialized = False # # 1-wire sensors # class Sensor( object ): """ A Sensor is the basic component of a 1-wire network. It represents a individual 1-wire element as it exists on the network. """ def __init__( self, path ): """ Create a new Sensor as it exists at the specified path. """ #print 'Sensor.__init__: <%s>' % path if not initialized: raise exNotInitialized self._attrs = { } if path == '/': self._path = path self._useCache = True elif path == '/uncached': self._path = '/' self._useCache = False else: if path[ :len( '/uncached' ) ] == '/uncached': self._path = path[ len( '/uncached' ): ] self._useCache = False else: self._path = path self._useCache = True self.useCache( self._useCache ) def __str__( self ): """ Print a string representation of the Sensor in the form of: path - type Example: >>> print Sensor( '/' ) / - DS9490 """ #print 'Sensor.__str__' return "%s - %s" % ( self._usePath, self._type ) def __repr__( self ): """ Print a representation of the Sensor in the form of: Sensor( path ) Example: >>> Sensor( '/' ) Sensor("/") """ #print 'Sensor.__repr__' return 'Sensor("%s")' % self._usePath def __eq__( self, other ): """ Two sensors are considered equal if their paths are equal. This is done by comparing their _path attributes so that cached and uncached Sensors compare equal. Examples: >>> Sensor( '/' ) == Sensor( '/1F.440701000000' ) False >>> Sensor( '/' ) == Sensor( '/uncached' ) True """ return self._path == other._path def __hash__(self): """ Return a hash for the Sensor object's name. This allows Sensors to be used better in sets.Set. """ return hash(self._path) def __getattr__( self, name ): """ Retreive an attribute from the sensor. __getattr__ is called only if the named item doesn't exist in the Sensor's namespace. If it's not in the namespace, look for the attribute on the physical sensor. Usage: s = ow.Sensor( '/1F.5D0B01000000' ) print s.family, s.PIO_0 will result in the family and PIO.0 values being read from the sensor and printed. In this example, the family would be 1F and thr PIO.0 might be 1. """ #print 'Sensor.__getattr__', name try: return owfs_get(object.__getattribute__(self, '_attrs')[name]) except KeyError: raise AttributeError, name def __setattr__( self, name, value ): """ Set the value of a sensor attribute. This is accomplished by first determining if the physical sensor has the named attribute. If it does, then the value is written to the name. Otherwise, the Sensor's dictionary is updated with the name and value. Usage: s = ow.Sensor( '/1F.5D0B01000000' ) s.PIO_1 = '1' will set the value of PIO.1 to 1. """ #print 'Sensor.__setattr__', name, value # Life can get tricky when using __setattr__. Self doesn't # have an _attrs atribute when it's initially created. _attrs # is only there after it's been set in __init__. So we can # only reference it if it's already been added. if hasattr( self, '_attrs' ): if name in self._attrs: #print 'owfs_put', self._attrs[ name ], value owfs_put( self._attrs[ name ], value ) else: self.__dict__[ name ] = value else: self.__dict__[ name ] = value def useCache( self, use_cache ): """ Set the sensor to use the underlying owfs cache (or not) depending on the use_cache parameter. Usage: s = ow.Sensor( '/1F.5D0B01000000' ) s.useCache( False ) will set the internal sensor path to /uncached/1F.5D0B01000000. Also: s = ow.Sensor( '/uncached/1F.5D0B01000000' ) s.useCache( True ) will set the internal sensor path to /1F.5D0B01000000. """ self._useCache = use_cache if self._useCache: self._usePath = self._path else: if self._path == '/': self._usePath = '/uncached' else: self._usePath = '/uncached' + self._path if self._path == '/': self._type = owfs_get('bus.0/interface/settings/name') else: self._type = owfs_get( '%s/type' % self._usePath ) self._attrs = dict( [ (n.replace( '.', '_' ), self._usePath + '/' + n ) for n in owfs_get( self._usePath ).split( ',' ) ] ) def entries( self ): """ Generator which yields the attributes of a sensor. """ #print 'Sensor.entries' list = owfs_get( self._usePath ) if list: for entry in list.split( ',' ): try: owfs_get(entry + 'type') except exUnknownSensor, ex: yield entry.split( '/' )[ 0 ] def entryList( self ): """ List of the sensor's attributes. Example: >>> Sensor("/10.B7B64D000800").entryList( ) ['address', 'crc8', 'die', 'family', 'id', 'power', 'present', 'temperature', 'temphigh', 'templow', 'trim', 'trimblanket', 'trimvalid', 'type'] """ #print 'Sensor.entryList' return [ e for e in self.entries( ) ] def sensors( self, names = [ 'main', 'aux' ] ): """ Generator which yields all the sensors that are associated with the current sensor. In the event that the current sensor is the adapter (such as a DS9490 USB adapter) the list of sensors directly attached to the 1-wire network will be yielded. In the event that the current sensor is a microlan controller (such as a DS2409) the list of directories found in the names list parameter will be searched and any sensors found will be yielded. The names parameter defaults to [ 'main', 'aux' ]. """ #print 'Sensor.sensors' if self._type == 'DS2409': for branch in names: path = self._usePath + '/' + branch try: list = owfs_get( path ) except exUnknownSensor, ex: continue if list: for branch_entry in list.split( ',' ): branch_path = self._usePath + '/' + branch + '/' + branch_entry.split( '/' )[ 0 ] try: owfs_get( branch_path + '/type' ) except exUnknownSensor, ex: continue yield Sensor( branch_path ) else: list = owfs_get( self._usePath ) if list: for branch_entry in list.split( ',' ): try: owfs_get( branch_entry + 'type' ) except exUnknownSensor, ex: continue path = self._usePath + '/' + branch_entry.split( '/' )[ 0 ] if path[ :2 ] == '//': path = path[ 1: ] yield Sensor( path ) def sensorList( self, names = [ 'main', 'aux' ] ): """ List of all the sensors that are associated with the current sensor. In the event that the current sensor is the adapter (such as a DS9490 USB adapter) the list of sensors directly attached to the 1-wire network will be yielded. In the event that the current sensor is a microlan controller (such as a DS2409) the list of directories found in the names list parameter will be searched and any sensors found will be yielded. The names parameter defaults to [ 'main', 'aux' ]. Example: >>> Sensor("/1F.440701000000").sensorList( ) [Sensor("/1F.440701000000/main/29.400900000000")] """ #print 'Sensor.sensorList' return [ s for s in self.sensors( ) ] def find( self, **keywords ): """ Generator which yields all the sensors whose attributes match those past in. By default, any matched attribute will yield a sensor. If the parameter all is passed to the find call, then all the supplied attributes must match to yield a sensor. Usage: for s in Sensor( '/' ).find( type = 'DS2408' ): print s will print all the sensors whose type is DS2408. root = Sensor( '/' ) print len( [ s for s in root.find( all = True, family = '1F', type = 'DS2409' ) ] ) will print the count of sensors whose family is 1F and whose type is DS2409. """ #print 'Sensor.find', keywords #recursion = keywords.pop( 'recursion', False ) all = keywords.pop( 'all', False ) for sensor in self.sensors( ): match = 0 for attribute in keywords: if hasattr( sensor, attribute ): if keywords[ attribute ]: if getattr( sensor, attribute ) == keywords[ attribute ]: match = match + 1 else: if hasattr( sensor, attribute ): match = match + 1 if not all and match: yield sensor elif all and match == len( keywords ): yield sensor owfs-3.1p5/module/swig/Makefile.am0000644000175000001440000000046012654730021014007 00000000000000 EXTRA_DIST = ow.i if ENABLE_OWPERL if ENABLE_PERL SWIG_SUBDIRPERL = perl5 endif endif if ENABLE_OWPYTHON if ENABLE_PYTHON SWIG_SUBDIRPYTHON = python endif endif if ENABLE_OWPHP if ENABLE_PHP SWIG_SUBDIRPHP = php endif endif SUBDIRS = $(SWIG_SUBDIRPERL) $(SWIG_SUBDIRPYTHON) $(SWIG_SUBDIRPHP) owfs-3.1p5/module/swig/Makefile.in0000644000175000001440000005541013022537053014025 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/swig ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 = perl5 python php am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = ow.i @ENABLE_OWPERL_TRUE@@ENABLE_PERL_TRUE@SWIG_SUBDIRPERL = perl5 @ENABLE_OWPYTHON_TRUE@@ENABLE_PYTHON_TRUE@SWIG_SUBDIRPYTHON = python @ENABLE_OWPHP_TRUE@@ENABLE_PHP_TRUE@SWIG_SUBDIRPHP = php SUBDIRS = $(SWIG_SUBDIRPERL) $(SWIG_SUBDIRPYTHON) $(SWIG_SUBDIRPHP) 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) --foreign module/swig/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/swig/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/swig/ow.i0000644000175000001440000000371712654730021012562 00000000000000/* File: ow.i */ %module OW %include "typemaps.i" %init %{ API_setup(program_type_swig) ; %} %{ #include "config.h" #include "owfs_config.h" #include "ow.h" // define this to add debug-output from newer swig-versions. //#define SWIGRUNTIME_DEBUG 1 // Opposite of internal code #define SWIG_BAD 0 #define SWIG_GOOD 1 char *version( ) { return OWFS_VERSION; } int init( const char * dev ) { if ( BAD(API_init(dev, restart_if_repeat)) ) { return SWIG_BAD ; // error } return SWIG_GOOD ; } int put( const char * path, const char * value ) { int ret = SWIG_BAD ; /* bad result */ if ( API_access_start() == 0 ) { if ( value!=NULL) { if ( FS_write( path, value, strlen(value), 0 ) >= 0 ) { ret = SWIG_GOOD ; // success } } API_access_end() ; } return ret ; } /* Get a directory, returning a copy of the contents in *buffer (which must be free-ed elsewhere) *buffer will be returned as NULL on error Also functions as a read */ char * get( const char * path ) { char * return_buffer = NULL ; if ( API_access_start() == 0 ) { FS_get( path, &return_buffer, NULL ) ; API_access_end() ; } return return_buffer ; } void finish( void ) { API_finish() ; } void set_error_print(int val) { Globals.error_print = val; } int get_error_print(void) { return Globals.error_print; } void set_error_level(int val) { Globals.error_level = val; } int get_error_level(void) { return Globals.error_level; } int opt(const char option_char, const char *arg) { return GOOD( owopt(option_char, arg) ) ? 0 : 1 ; } %} %typemap(newfree) char * { if ($1) free($1) ; } %newobject get ; extern char *version( ); extern int init( const char * dev ) ; extern char * get( const char * path ) ; extern int put( const char * path, const char * value ) ; extern void finish( void ) ; extern void set_error_print(int); extern int get_error_print(void); extern void set_error_level(int); extern int get_error_level(void); extern int opt(const char, const char *); owfs-3.1p5/module/Makefile.am0000644000175000001440000000177612654730021013051 00000000000000if ENABLE_OWSHELL MODULE_SUBDIR_OWSHELL = owshell endif if ENABLE_OWLIB MODULE_SUBDIR_OWLIB = owlib endif if ENABLE_OWHTTPD MODULE_SUBDIR_OWHTTPD = owhttpd endif if ENABLE_OWSERVER MODULE_SUBDIR_OWSERVER = owserver endif if ENABLE_OWEXTERNAL MODULE_SUBDIR_OWSERVER = owserver endif if ENABLE_OWFS MODULE_SUBDIR_OWFS = owfs endif if ENABLE_OWFTPD MODULE_SUBDIR_OWFTPD = owftpd endif if ENABLE_OWCAPI MODULE_SUBDIR_OWCAPI = owcapi endif if ENABLE_OWNET MODULE_SUBDIR_OWNET = ownet endif if ENABLE_OWTAP MODULE_SUBDIR_OWTAP = owtap endif if ENABLE_OWMON MODULE_SUBDIR_OWMON = owmon endif if ENABLE_SWIG MODULE_SUBDIR_SWIG = swig endif if ENABLE_OWTCL MODULE_SUBDIR_OWTCL = owtcl endif SUBDIRS = $(MODULE_SUBDIR_OWSHELL) $(MODULE_SUBDIR_OWNET) $(MODULE_SUBDIR_OWLIB) $(MODULE_SUBDIR_OWHTTPD) $(MODULE_SUBDIR_OWSERVER) $(MODULE_SUBDIR_OWFS) $(MODULE_SUBDIR_OWFTPD) $(MODULE_SUBDIR_OWCAPI) $(MODULE_SUBDIR_OWTAP) $(MODULE_SUBDIR_OWMON) $(MODULE_SUBDIR_SWIG) $(MODULE_SUBDIR_OWTCL) owfs-3.1p5/module/Makefile.in0000644000175000001440000005672013022537051013057 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 = owshell ownet owlib owhttpd owserver owfs owftpd owcapi \ owtap owmon swig owtcl am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @ENABLE_OWSHELL_TRUE@MODULE_SUBDIR_OWSHELL = owshell @ENABLE_OWLIB_TRUE@MODULE_SUBDIR_OWLIB = owlib @ENABLE_OWHTTPD_TRUE@MODULE_SUBDIR_OWHTTPD = owhttpd @ENABLE_OWEXTERNAL_TRUE@MODULE_SUBDIR_OWSERVER = owserver @ENABLE_OWSERVER_TRUE@MODULE_SUBDIR_OWSERVER = owserver @ENABLE_OWFS_TRUE@MODULE_SUBDIR_OWFS = owfs @ENABLE_OWFTPD_TRUE@MODULE_SUBDIR_OWFTPD = owftpd @ENABLE_OWCAPI_TRUE@MODULE_SUBDIR_OWCAPI = owcapi @ENABLE_OWNET_TRUE@MODULE_SUBDIR_OWNET = ownet @ENABLE_OWTAP_TRUE@MODULE_SUBDIR_OWTAP = owtap @ENABLE_OWMON_TRUE@MODULE_SUBDIR_OWMON = owmon @ENABLE_SWIG_TRUE@MODULE_SUBDIR_SWIG = swig @ENABLE_OWTCL_TRUE@MODULE_SUBDIR_OWTCL = owtcl SUBDIRS = $(MODULE_SUBDIR_OWSHELL) $(MODULE_SUBDIR_OWNET) $(MODULE_SUBDIR_OWLIB) $(MODULE_SUBDIR_OWHTTPD) $(MODULE_SUBDIR_OWSERVER) $(MODULE_SUBDIR_OWFS) $(MODULE_SUBDIR_OWFTPD) $(MODULE_SUBDIR_OWCAPI) $(MODULE_SUBDIR_OWTAP) $(MODULE_SUBDIR_OWMON) $(MODULE_SUBDIR_SWIG) $(MODULE_SUBDIR_OWTCL) 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) --foreign module/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owshell/0000755000175000001440000000000013022537101012531 500000000000000owfs-3.1p5/module/owshell/Makefile.am0000644000175000001440000000001712654730021014511 00000000000000SUBDIRS = src owfs-3.1p5/module/owshell/Makefile.in0000644000175000001440000005500713022537053014533 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owshell ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src 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) --foreign module/owshell/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owshell/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owshell/src/0000755000175000001440000000000013022537101013320 500000000000000owfs-3.1p5/module/owshell/src/Makefile.am0000644000175000001440000000002512654730021015277 00000000000000SUBDIRS = c include owfs-3.1p5/module/owshell/src/Makefile.in0000644000175000001440000005503113022537053015317 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owshell/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = c include 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) --foreign module/owshell/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owshell/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owshell/src/c/0000755000175000001440000000000013022537101013542 500000000000000owfs-3.1p5/module/owshell/src/c/Makefile.am0000644000175000001440000000236012672234566015542 00000000000000COMMON_OWSHELL_SOURCE = ow_opt.c \ ow_help.c \ ow_server.c \ ow_net.c \ ow_browse.c \ ow_dl.c \ ow_dnssd.c \ ow_tcp_read.c\ getaddrinfo.c\ getopt.c \ globals.c bin_PROGRAMS = owget owdir owread owwrite owpresent owexist owusbprobe owget_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owget.c owdir_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owdir.c owread_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owread.c owwrite_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owwrite.c owpresent_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owpresent.c owexist_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owexist.c owusbprobe_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owusbprobe.c owusbprobe_LDFLAGS = ${LIBUSB_LIBS} AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${LIBUSB_CFLAGS} \ ${PTHREAD_CFLAGS} \ ${PIC_FLAGS} \ ${EXTRACFLAGS} LDADD = ${DL_LIBS} ${LD_EXTRALIBS} ${OSLIBS} owfs-3.1p5/module/owshell/src/c/Makefile.in0000644000175000001440000007173113022537053015546 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = owget$(EXEEXT) owdir$(EXEEXT) owread$(EXEEXT) \ owwrite$(EXEEXT) owpresent$(EXEEXT) owexist$(EXEEXT) \ owusbprobe$(EXEEXT) subdir = module/owshell/src/c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__objects_1 = ow_opt.$(OBJEXT) ow_help.$(OBJEXT) ow_server.$(OBJEXT) \ ow_net.$(OBJEXT) ow_browse.$(OBJEXT) ow_dl.$(OBJEXT) \ ow_dnssd.$(OBJEXT) ow_tcp_read.$(OBJEXT) getaddrinfo.$(OBJEXT) \ getopt.$(OBJEXT) globals.$(OBJEXT) am_owdir_OBJECTS = $(am__objects_1) owdir.$(OBJEXT) owdir_OBJECTS = $(am_owdir_OBJECTS) owdir_LDADD = $(LDADD) am__DEPENDENCIES_1 = owdir_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) 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 = am_owexist_OBJECTS = $(am__objects_1) owexist.$(OBJEXT) owexist_OBJECTS = $(am_owexist_OBJECTS) owexist_LDADD = $(LDADD) owexist_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_owget_OBJECTS = $(am__objects_1) owget.$(OBJEXT) owget_OBJECTS = $(am_owget_OBJECTS) owget_LDADD = $(LDADD) owget_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_owpresent_OBJECTS = $(am__objects_1) owpresent.$(OBJEXT) owpresent_OBJECTS = $(am_owpresent_OBJECTS) owpresent_LDADD = $(LDADD) owpresent_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_owread_OBJECTS = $(am__objects_1) owread.$(OBJEXT) owread_OBJECTS = $(am_owread_OBJECTS) owread_LDADD = $(LDADD) owread_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_owusbprobe_OBJECTS = $(am__objects_1) owusbprobe.$(OBJEXT) owusbprobe_OBJECTS = $(am_owusbprobe_OBJECTS) owusbprobe_LDADD = $(LDADD) owusbprobe_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) owusbprobe_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(owusbprobe_LDFLAGS) $(LDFLAGS) -o $@ am_owwrite_OBJECTS = $(am__objects_1) owwrite.$(OBJEXT) owwrite_OBJECTS = $(am_owwrite_OBJECTS) owwrite_LDADD = $(LDADD) owwrite_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) 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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(owdir_SOURCES) $(owexist_SOURCES) $(owget_SOURCES) \ $(owpresent_SOURCES) $(owread_SOURCES) $(owusbprobe_SOURCES) \ $(owwrite_SOURCES) DIST_SOURCES = $(owdir_SOURCES) $(owexist_SOURCES) $(owget_SOURCES) \ $(owpresent_SOURCES) $(owread_SOURCES) $(owusbprobe_SOURCES) \ $(owwrite_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)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ COMMON_OWSHELL_SOURCE = ow_opt.c \ ow_help.c \ ow_server.c \ ow_net.c \ ow_browse.c \ ow_dl.c \ ow_dnssd.c \ ow_tcp_read.c\ getaddrinfo.c\ getopt.c \ globals.c owget_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owget.c owdir_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owdir.c owread_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owread.c owwrite_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owwrite.c owpresent_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owpresent.c owexist_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owexist.c owusbprobe_SOURCES = ${COMMON_OWSHELL_SOURCE} \ owusbprobe.c owusbprobe_LDFLAGS = ${LIBUSB_LIBS} AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${LIBUSB_CFLAGS} \ ${PTHREAD_CFLAGS} \ ${PIC_FLAGS} \ ${EXTRACFLAGS} LDADD = ${DL_LIBS} ${LD_EXTRALIBS} ${OSLIBS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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) --foreign module/owshell/src/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owshell/src/c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list owdir$(EXEEXT): $(owdir_OBJECTS) $(owdir_DEPENDENCIES) $(EXTRA_owdir_DEPENDENCIES) @rm -f owdir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owdir_OBJECTS) $(owdir_LDADD) $(LIBS) owexist$(EXEEXT): $(owexist_OBJECTS) $(owexist_DEPENDENCIES) $(EXTRA_owexist_DEPENDENCIES) @rm -f owexist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owexist_OBJECTS) $(owexist_LDADD) $(LIBS) owget$(EXEEXT): $(owget_OBJECTS) $(owget_DEPENDENCIES) $(EXTRA_owget_DEPENDENCIES) @rm -f owget$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owget_OBJECTS) $(owget_LDADD) $(LIBS) owpresent$(EXEEXT): $(owpresent_OBJECTS) $(owpresent_DEPENDENCIES) $(EXTRA_owpresent_DEPENDENCIES) @rm -f owpresent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owpresent_OBJECTS) $(owpresent_LDADD) $(LIBS) owread$(EXEEXT): $(owread_OBJECTS) $(owread_DEPENDENCIES) $(EXTRA_owread_DEPENDENCIES) @rm -f owread$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owread_OBJECTS) $(owread_LDADD) $(LIBS) owusbprobe$(EXEEXT): $(owusbprobe_OBJECTS) $(owusbprobe_DEPENDENCIES) $(EXTRA_owusbprobe_DEPENDENCIES) @rm -f owusbprobe$(EXEEXT) $(AM_V_CCLD)$(owusbprobe_LINK) $(owusbprobe_OBJECTS) $(owusbprobe_LDADD) $(LIBS) owwrite$(EXEEXT): $(owwrite_OBJECTS) $(owwrite_DEPENDENCIES) $(EXTRA_owwrite_DEPENDENCIES) @rm -f owwrite$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owwrite_OBJECTS) $(owwrite_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getaddrinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_browse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_dl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_dnssd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_net.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_opt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_tcp_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owexist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owpresent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owusbprobe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owwrite.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .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: owfs-3.1p5/module/owshell/src/c/ow_opt.c0000644000175000001440000001061612654730021015147 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_opt -- owlib specific command line options processing */ #include "owshell.h" // globals int hexflag = 0 ; int slashflag = 0 ; int size_of_data = -1 ; int offset_into_data = 0 ; int uncached = 0 ; int unaliased = 0 ; int trim = 0 ; enum temp_type temperature_scale = temp_celsius ; enum pressure_type pressure_scale = pressure_mbar ; enum deviceformat device_format = fdi ; static void OW_parsevalue(int *var, const ASCII * str); const struct option owopts_long[] = { {"help", no_argument, NULL, 'h'}, {"debug",no_argument,&Globals.quiet,1}, {"quiet", no_argument, NULL, 'q'}, {"server", required_argument, NULL, 's'}, {"Celsius", no_argument, NULL, 'C'}, {"Fahrenheit", no_argument, NULL, 'F'}, {"Kelvin", no_argument, NULL, 'K'}, {"Rankine", no_argument, NULL, 'R'}, {"version", no_argument, NULL, 'V'}, {"format", required_argument, NULL, 'f'}, {"hex", no_argument, &hexflag, 1 }, {"HEX", no_argument, &hexflag, 1 }, {"hexidecimal", no_argument, &hexflag, 1 }, {"HEXIDECIMAL", no_argument, &hexflag, 1 }, {"dir", no_argument, &slashflag, 1 }, {"slash", no_argument, &slashflag, 1 }, {"SLASH", no_argument, &slashflag, 1 }, {"size", required_argument, NULL, 300 }, {"SIZE", required_argument, NULL, 300 }, {"BYTES", required_argument, NULL, 300 }, {"bytes", required_argument, NULL, 300 }, {"offset", required_argument, NULL, 301 }, {"OFFSET", required_argument, NULL, 301 }, {"start", required_argument, NULL, 301 }, {"START", required_argument, NULL, 301 }, {"timeout_network", required_argument, NULL, 307,}, // timeout -- tcp wait {"autoserver", no_argument, NULL, 275}, {"unaliased", no_argument, &unaliased, 1 }, {"aliased", no_argument, &unaliased, 0 }, {"trim", no_argument, &trim, 1 }, {"TRIM", no_argument, &trim, 1 }, {"uncached", no_argument, &uncached, 1 }, {"cached", no_argument, &uncached, 0 }, {0, 0, 0, 0}, }; /* Parses one argument */ void owopt(const int c, const char *arg) { //printf("Option %c (%d) Argument=%s\n",c,c,SAFESTRING(arg)) ; switch (c) { case 'h': ow_help(); Exit(0); case 'q': Globals.quiet = 1 ; // squash error messages break ; case 'C': temperature_scale = temp_celsius ; break; case 'F': temperature_scale = temp_fahrenheit ; break; case 'R': temperature_scale = temp_rankine ; break; case 'K': temperature_scale = temp_kelvin ; break; case 'V': printf("owshell version:\n\t" VERSION "\n"); Exit(0); case 's': ARG_Net(arg); break; case 'f': if (!strcasecmp(arg, "f.i")) device_format = fdi ; else if (!strcasecmp(arg, "fi")) device_format = fi ; else if (!strcasecmp(arg, "f.i.c")) device_format = fdidc ; else if (!strcasecmp(arg, "f.ic")) device_format = fdic ; else if (!strcasecmp(arg, "fi.c")) device_format = fidc ; else if (!strcasecmp(arg, "fic")) device_format = fic ; else { PRINT_ERROR("Unrecognized 1-wire slave format: %s\n", arg); Exit(1); } break; case 275: // autoserver #if OW_ZERO if (libdnssd == NULL) { PRINT_ERROR("Zeroconf/Bonjour is disabled since dnssd library isn't found.\n"); Exit(1); } else { OW_Browse(); } #else PRINT_ERROR("Zeroconf/Bonjour is disabled since it's compiled without support.\n"); Exit(1); #endif break; case 300: OW_parsevalue(&size_of_data, arg); if ( size_of_data < 0 || size_of_data > 64000 ) { PRINT_ERROR("Bad data size value. (%d).\n", size_of_data) ; Exit(1); } break ; case 301: OW_parsevalue(&offset_into_data, arg); if ( offset_into_data < 0 || offset_into_data > 64000 ) { PRINT_ERROR("Bad data offset value. (%d).\n", offset_into_data) ; Exit(1); } break ; case 307: OW_parsevalue(&Globals.timeout_network, arg); case 0: break; default: Exit(1); } } void ARG_Net(const char *arg) { ++count_inbound_connections; if (count_inbound_connections > 1) { PRINT_ERROR("Cannot link to more than one owserver. (%s and %s).\n", owserver_connection->name, arg); Exit(1); } owserver_connection->name = strdup(arg); } static void OW_parsevalue(int *var, const ASCII * str) { int I; errno = 0; I = strtol(str, NULL, 10); if (errno) { PRINT_ERROR("Bad configuration value %s\n", str); Exit(1); } var[0] = I; } owfs-3.1p5/module/owshell/src/c/ow_help.c0000644000175000001440000000413112654730021015270 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_opt -- owlib specific command line options processing */ #include "owshell.h" void ow_help(void) { printf("\n1-wire access programs\n" "By Paul H Alfille and others. See http://www.owfs.org\n" "\n" "Command line access to owserver process\n" "\n" "Syntax: owdir [Options] -s Server DirPath\n" "Syntax: owread [Options] -s Server ReadPath\n" "Syntax: owwrite [Options] -s Server WritePath WriteVal\n" "Syntax: owpresent [Options] -s Server Path\n" "\n" "Server is an owserver net address (port number or ipaddress:port)\n" "\n" "Path is in OWFS format e.g. 10.2301A3008000/temperature\n" " more than one path (or path/value pair for owwrite) can be given\n" " each is processed in turn\n" "\n" "Options include:\n" " --autoserver |Use Bonjour (zeroconf) to find owserver\n" " -C --Celsius |Celsius(default) temperature scale\n" " -F --Fahrenheit |Fahrenheit temperature scale\n" " -K --Kelvin |Kelvin temperature scale\n" " -R --Rankine |Rankine temperature scale\n" " -f --format |format for 1-wire unique serial IDs display\n" " | f[.]i[[.]c] f-amily i-d c-rc (all in hex)\n" " --hex |data in hexidecimal format\n" " --size |size of data in bytes\n" " --offset |start of read/write in field\n" " --dir |add a trailing '/' for directories\n" " -V --version |Program version\n" " -q --quiet |suppress error messages\n" " -h --help |Basic help page\n" ); } owfs-3.1p5/module/owshell/src/c/ow_server.c0000644000175000001440000002337212654730021015656 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include "owshell.h" static int FromServer(int file_descriptor, struct client_msg *cm, char *msg, size_t size); static void *FromServerAlloc(int file_descriptor, struct client_msg *cm); static int ToServer(int file_descriptor, struct server_msg *sm, struct serverpackage *sp); static uint32_t SetupSemi(void); static void Write( char * buffer, int length ) ; void Server_detect(void) { if (count_inbound_connections == 0) { PRINT_ERROR("No owserver_connection defined\n"); errno = ENOENT ; Exit(2); } if (owserver_connection->name == NULL || ClientAddr(owserver_connection->name)) { PRINT_ERROR("Could not connect with owserver %s\n", owserver_connection->name); errno = ENOENT ; Exit(2); } } int ServerRead(ASCII * path) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { path, NULL, 0, NULL, 0, }; int connectfd = ClientConnect(); int size = 65536; char buf[size + 1]; int ret = 0; if (connectfd < 0) { return -EIO; } //printf("Read <%s>\n",path); memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_read; sm.size = size; sm.offset = offset_into_data; if ( size_of_data >=0 && size_of_data <= 65536 ) { sm.size = size_of_data ; } if (ToServer(connectfd, &sm, &sp)) { PRINT_ERROR("ServerRead: Error sending request for %s\n", path); ret = -EIO; } else if (FromServer(connectfd, &cm, buf, size) < 0) { PRINT_ERROR("ServerRead: Error receiving data on %s\n", path); ret = -EIO; } else { ret = cm.ret; if (ret < 0 || ret > size ) { PRINT_ERROR("ServerRead: Data error on %s\n", path); } else { Write( buf, ret ) ; } } close(connectfd); return ret; } int ServerWrite(ASCII * path, ASCII * data, int size) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { path, (BYTE *) data, size, NULL, 0, }; int connectfd = ClientConnect(); int ret = 0; if (connectfd < 0) { return -EIO; } //printf("Write <%s> <%s>\n",path,data); memset(&sm, 0, sizeof(struct server_msg)); sm.type = msg_write; sm.size = size; sm.offset = offset_into_data; if (ToServer(connectfd, &sm, &sp)) { ret = -EIO; } else if (FromServer(connectfd, &cm, NULL, 0) < 0) { ret = -EIO; } else { ret = cm.ret; } close(connectfd); return ret; } int ServerDirall(ASCII * path) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { path, NULL, 0, NULL, 0, }; char *path2; int connectfd = ClientConnect(); if (connectfd < 0) { return -EIO; } //printf("DirALL <%s>\n",path ) ; memset(&sm, 0, sizeof(struct server_msg)); sm.type = slashflag ? msg_dirallslash : msg_dirall; if (ToServer(connectfd, &sm, &sp)) { cm.ret = -EIO; } else if ((path2 = FromServerAlloc(connectfd, &cm))) { char *p; path2[cm.payload - 1] = '\0'; /* Ensure trailing null */ for (p = path2; *p; ++p) if (*p == ',') *p = '\n'; printf("%s\n", path2); free(path2); } close(connectfd); return cm.ret; } int ServerDir(ASCII * path) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { path, NULL, 0, NULL, 0, }; int connectfd = ClientConnect(); if (connectfd < 0) { return -EIO; } //printf("Dir <%s>\n", path ) ; memset(&sm, 0, sizeof(struct server_msg)); sm.type = msg_dir; if (ToServer(connectfd, &sm, &sp)) { cm.ret = -EIO; } else { char *path2; while ((path2 = FromServerAlloc(connectfd, &cm))) { path2[cm.payload - 1] = '\0'; /* Ensure trailing null */ printf("%s\n", path2); free(path2); } } close(connectfd); return cm.ret; } int ServerPresence(ASCII * path) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { path, NULL, 0, NULL, 0, }; int connectfd = ClientConnect(); int ret = 0; if (connectfd < 0) { return -EIO; } //printf("Presence <%s>\n",path); memset(&sm, 0, sizeof(struct server_msg)); sm.type = msg_presence; if (ToServer(connectfd, &sm, &sp)) { ret = -EIO; } else if (FromServer(connectfd, &cm, NULL, 0) < 0) { ret = -EIO; } else { ret = cm.ret; } close(connectfd); printf((ret >= 0) ? "1" : "0"); return ret; } /* read from server, free return pointer if not Null */ static void *FromServerAlloc(int file_descriptor, struct client_msg *cm) { char *msg; int ret; struct timeval tv = { Globals.timeout_network + 1, 0, }; do { /* loop until non delay message (payload>=0) */ //printf("OW_SERVER loop1\n"); ret = tcp_read(file_descriptor, cm, sizeof(struct client_msg), &tv); if (ret != sizeof(struct client_msg)) { memset(cm, 0, sizeof(struct client_msg)); cm->ret = -EIO; return NULL; } cm->payload = ntohl(cm->payload); cm->size = ntohl(cm->size); cm->ret = ntohl(cm->ret); cm->sg = ntohl(cm->sg); cm->offset = ntohl(cm->offset); } while (cm->payload < 0); //printf("FromServerAlloc payload=%d size=%d ret=%d sg=%X offset=%d\n",cm->payload,cm->size,cm->ret,cm->sg,cm->offset); //printf(">%.4d|%.4d\n",cm->ret,cm->payload); if (cm->payload == 0) return NULL; if (cm->ret < 0) return NULL; if (cm->payload > MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE) { //printf("FromServerAlloc payload too large\n"); return NULL; } if ((msg = (char *) malloc((size_t) cm->payload))) { ret = tcp_read(file_descriptor, msg, (size_t) (cm->payload), &tv); if (ret != cm->payload) { //printf("FromServer couldn't read payload\n"); cm->payload = 0; cm->offset = 0; cm->ret = -EIO; free(msg); msg = NULL; } //printf("FromServer payload read ok\n"); } return msg; } /* Read from server -- return negative on error, return 0 or positive giving size of data element */ static int FromServer(int file_descriptor, struct client_msg *cm, char *msg, size_t size) { size_t rtry; size_t ret; struct timeval tv = { Globals.timeout_network + 1, 0, }; do { // read regular header, or delay (delay when payload<0) //printf("OW_SERVER loop2\n"); ret = tcp_read(file_descriptor, cm, sizeof(struct client_msg), &tv); if (ret != sizeof(struct client_msg)) { //printf("OW_SERVER loop2 bad\n"); cm->size = 0; cm->ret = -EIO; return -EIO; } cm->payload = ntohl(cm->payload); cm->size = ntohl(cm->size); cm->ret = ntohl(cm->ret); cm->sg = ntohl(cm->sg); cm->offset = ntohl(cm->offset); } while (cm->payload < 0); // flag to show a delay message //printf("OW_SERVER loop2 done\n"); //printf("FromServer payload=%d size=%d ret=%d sg=%d offset=%d\n",cm->payload,cm->size,cm->ret,cm->sg,cm->offset); //printf(">%.4d|%.4d\n",cm->ret,cm->payload); if (cm->payload == 0) return 0; // No payload, done. rtry = cm->payload < (ssize_t) size ? (size_t) cm->payload : size; ret = tcp_read(file_descriptor, msg, rtry, &tv); // read expected payload now. if (ret != rtry) { cm->ret = -EIO; return -EIO; } if (cm->payload > (ssize_t) size) { // Uh oh. payload bigger than expected. read it in and discard size_t d = cm->payload - size; char extra[d]; ret = tcp_read(file_descriptor, extra, d, &tv); if (ret != d) { cm->ret = -EIO; return -EIO; } return size; } return cm->payload; } // should be const char * data but iovec has problems with const arguments static int ToServer(int file_descriptor, struct server_msg *sm, struct serverpackage *sp) { int payload = 0; int nio = 0; struct iovec io[5] = { {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, }; // Set up flags sm->sg = SetupSemi() ; // First block to send, the header io[nio].iov_base = sm; io[nio].iov_len = sizeof(struct server_msg); nio++; // Next block, the path if ((io[nio].iov_base = sp->path)) { // send path (if not null) io[nio].iov_len = payload = strlen(sp->path) + 1; nio++; //printf("ToServer path=%s\n", sp->path); } // next block, data (only for writes) if ((sp->datasize>0) && (io[nio].iov_base = sp->data)) { // send data only for writes (if datasize not zero) payload += (io[nio].iov_len = sp->datasize); nio++; //LEVEL_DEBUG("ToServer data=%s\n", sp->data); } sp->tokens = 0; sm->version = 0; // shouldn't this be MakeServerprotocol(OWSERVER_PROTOCOL_VERSION); //printf("ToServer payload=%d size=%d type=%d tempscale=%X offset=%d\n",payload,sm->size,sm->type,sm->sg,sm->offset); //printf("<%.4d|%.4d\n",sm->type,payload); // encode in network order (just the header) sm->version = htonl(sm->version); sm->payload = htonl(payload); sm->size = htonl(sm->size); sm->type = htonl(sm->type); sm->sg = htonl(sm->sg); sm->offset = htonl(sm->offset); //Debug_Writev(io, nio); return writev(file_descriptor, io, nio) != (ssize_t) (payload + sizeof(struct server_msg) + sp->tokens * sizeof(struct antiloop)); } /* flag the sg for "virtual root" -- the remote bus was specifically requested */ /* Also ALIAS_REQUEST means that aliases will be applied */ static uint32_t SetupSemi(void) { uint32_t sg = SHOULD_RETURN_BUS_LIST ; // Device format sg |= (device_format) << DEVFORMAT_BIT ; // Pressure scale sg |= (pressure_scale) << PRESSURESCALE_BIT ; // Temperature scale sg |= (temperature_scale) << TEMPSCALE_BIT ; // Uncached sg |= uncached ? UNCACHED : 0 ; // Unaliased sg |= unaliased ? 0 : ALIAS_REQUEST ; // Trim sg |= trim ? TRIM : 0 ; // OWNet flag or Presence check sg |= OWNET ; return sg; } static void Write( char * buffer, int length) { int i ; char *fmt; /* * Write binary (raw) or hex-formatted ASCII depending on * the value of "hexflag" (set through the CLI argument * --hex). */ fmt = hexflag ? "%.2X" : "%c"; for ( i=0 ; ihost = NULL; owserver_connection->service = strdup(OWSERVER_DEFAULT_PORT); } else if ((p = strrchr(sname, ':')) == NULL) { /* : NOT exist */ if (strchr(sname, '.') || isalpha( (int) sname[0] )) { //probably an address owserver_connection->host = strdup(sname); owserver_connection->service = strdup(OWSERVER_DEFAULT_PORT); } else { // assume a port owserver_connection->host = NULL; owserver_connection->service = strdup(sname); } } else { p[0] = '\0'; /* Separate tokens in the string */ owserver_connection->host = strdup(sname); p[0] = ':'; /* restore name string */ owserver_connection->service = strdup(&p[1]); } memset(&hint, 0, sizeof(struct addrinfo)); hint.ai_socktype = SOCK_STREAM; #if OW_CYGWIN hint.ai_family = AF_INET; if(owserver_connection->host == NULL) { /* getaddrinfo doesn't work with host=NULL for cygwin */ owserver_connection->host = strdup("127.0.0.1"); } #else hint.ai_family = AF_UNSPEC; #endif //printf("ClientAddr: [%s] [%s]\n", owserver_connection->host, owserver_connection->service); if ((ret = getaddrinfo(owserver_connection->host, owserver_connection->service, &hint, &owserver_connection->ai))) { //LEVEL_CONNECT("GetAddrInfo error %s\n",gai_strerror(ret)); return -1; } return 0; } /* Usually called with BUS locked, to protect ai settings */ int ClientConnect(void) { int file_descriptor; struct addrinfo *ai; if (owserver_connection->ai == NULL) { //LEVEL_DEBUG("Client address not yet parsed\n"); return -1; } /* Can't change ai_ok without locking the in-device. * First try the last working address info, if it fails lock * the in-device and loop through the list until it works. * Not a perfect solution, but it should work at least. */ ai = owserver_connection->ai_ok; if (ai) { file_descriptor = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if (file_descriptor >= 0) { if (connect(file_descriptor, ai->ai_addr, ai->ai_addrlen) == 0) { return file_descriptor; } close(file_descriptor); } } ai = owserver_connection->ai; // loop from first address info since it failed. do { file_descriptor = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if (file_descriptor >= 0) { if (connect(file_descriptor, ai->ai_addr, ai->ai_addrlen) == 0) { owserver_connection->ai_ok = ai; return file_descriptor; } close(file_descriptor); } } while ((ai = ai->ai_next)); owserver_connection->ai_ok = NULL; //ERROR_CONNECT("ClientConnect: Socket problem\n") ; return -1; } owfs-3.1p5/module/owshell/src/c/ow_browse.c0000644000175000001440000000773212654730021015653 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include "owshell.h" #if OW_ZERO static void ResolveBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *n, const char *host, uint16_t port, uint16_t tl, const unsigned char *t, void *c); static void BrowseBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *name, const char *type, const char *domain, void *context); static void HandleCall(DNSServiceRef sref); static void HandleCall(DNSServiceRef sref) { int file_descriptor; DNSServiceErrorType err = kDNSServiceErr_Unknown; //file_descriptor = DNSServiceRefSockFD(NULL) ; //PRINT_ERROR("HandleCall: file_descriptor=%d (just a test of function-call, should result -1)\n", file_descriptor); file_descriptor = DNSServiceRefSockFD(sref); //PRINT_ERROR("HandleCall: file_descriptor=%d\n", file_descriptor); if (file_descriptor >= 0) { while (1) { fd_set readfd; int rc; struct timeval tv = { 10, 0 }; FD_ZERO(&readfd); FD_SET(file_descriptor, &readfd); rc = select(file_descriptor + 1, &readfd, NULL, NULL, &tv); if (rc == -1) { if (errno == EINTR) { continue; } PERROR("Service Discovery select returned error\n"); } else if (rc > 0) { if (FD_ISSET(file_descriptor, &readfd)) { err = DNSServiceProcessResult(sref); } } else { PERROR("Service Discovery timed out\n"); } break; } } else { PRINT_ERROR("No Service Discovery socket\n"); } DNSServiceRefDeallocate(sref); if (err != kDNSServiceErr_NoError) { PRINT_ERROR("Service Discovery Process result error 0x%X\n", (int) err); Exit(1); } } static void ResolveBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *n, const char *host, uint16_t port, uint16_t tl, const unsigned char *t, void *c) { ASCII name[121]; (void) tl; (void) t; (void) c; (void) n; (void) s; (void) f; (void) i; (void) e; //PRINT_ERROR("ResolveBack ref=%ld flags=%ld index=%ld, error=%d name=%s host=%s port=%d\n",(long int)s,(long int)f,(long int)i,(int)e,SAFESTRING(name),SAFESTRING(host),ntohs(port)) ; if (snprintf(name, 120, "%s:%d", SAFESTRING(host), ntohs(port)) < 0) { PERROR("Trouble with zeroconf resolve return\n"); } else if (count_inbound_connections < 1) { ++count_inbound_connections; owserver_connection->name = strdup(name); return; } Exit(1); } /* Sent back from Bounjour -- arbitrarily use it to set the Ref for Deallocation */ static void BrowseBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *name, const char *type, const char *domain, void *context) { (void) context; (void) i ; (void) s ; //PRINT_ERROR("BrowseBack ref=%ld flags=%ld index=%ld, error=%d name=%s type=%s domain=%s\n",(long int)s,(long int)f,(long int)i,(int)e,SAFESTRING(name),SAFESTRING(type),SAFESTRING(domain)) ; if (e == kDNSServiceErr_NoError) { if (f & kDNSServiceFlagsAdd) { // Add DNSServiceRef sr; if (DNSServiceResolve(&sr, 0, 0, name, type, domain, ResolveBack, NULL) == kDNSServiceErr_NoError) { HandleCall(sr); return; } else { PRINT_ERROR("Service Resolve error on %s\n", SAFESTRING(name)); } } else { PRINT_ERROR("OWSERVER %s is leaving\n", name); } } else { PRINT_ERROR("Browse callback error = %d\n", (int) e); } Exit(1); } void OW_Browse(void) { DNSServiceErrorType dnserr; DNSServiceRef sref; dnserr = DNSServiceBrowse(&sref, 0, 0, "_owserver._tcp", NULL, BrowseBack, NULL); if (dnserr == kDNSServiceErr_NoError) { HandleCall(sref); } else { PRINT_ERROR("DNSServiceBrowse error = %d\n", (int) dnserr); Exit(1); } } #else /* OW_ZERO */ void OW_Browse(void) { PRINT_ERROR("OWFS is compiled without Zeroconf/Bonjour support.\n"); } #endif /* OW_ZERO */ owfs-3.1p5/module/owshell/src/c/ow_dl.c0000644000175000001440000000173712654730021014750 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_dl.h" #if OW_ZERO DLHANDLE DL_open(const char *pathname) { #if OW_CYGWIN return LoadLibrary(pathname); #elif defined(HAVE_DLOPEN) return dlopen(pathname, RTLD_LAZY|RTLD_GLOBAL); #endif } void *DL_sym(DLHANDLE handle, const char *name) { #if OW_CYGWIN return (void *) GetProcAddress(handle, name); #elif defined(HAVE_DLOPEN) return dlsym(handle, name); #endif } int DL_close(DLHANDLE handle) { #if OW_CYGWIN if (FreeLibrary(handle)) return 0; return -1; #elif defined(HAVE_DLOPEN) return dlclose(handle); #endif } char *DL_error(void) { #if OW_CYGWIN return "Error in WIN32 DL"; #elif defined(HAVE_DLOPEN) return dlerror(); #endif } #endif owfs-3.1p5/module/owshell/src/c/ow_dnssd.c0000644000175000001440000000725112654730021015461 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2006 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #if OW_ZERO #include "ow.h" #include "ow_dl.h" #include "ow_dnssd.h" DLHANDLE libdnssd = NULL; #if OW_CYGWIN #ifdef HAVE_DLFCN_H #include #endif #endif _DNSServiceRefSockFD DNSServiceRefSockFD; _DNSServiceProcessResult DNSServiceProcessResult; _DNSServiceRefDeallocate DNSServiceRefDeallocate; _DNSServiceResolve DNSServiceResolve; _DNSServiceBrowse DNSServiceBrowse; _DNSServiceRegister DNSServiceRegister; _DNSServiceReconfirmRecord DNSServiceReconfirmRecord; _DNSServiceCreateConnection DNSServiceCreateConnection; _DNSServiceEnumerateDomains DNSServiceEnumerateDomains; int OW_Load_dnssd_library(void) { int i = 0; #if OW_CYGWIN char libdirs[3][80] = { //{ "/opt/owfs/lib/libdns_sd.dll" }, {"libdns_sd.dll"}, {""} }; while (*libdirs[i]) { /* Cygwin has dlopen and it seems to be ok to use it actually. */ if (!(libdnssd = DL_open(libdirs[i]))) { /* Couldn't open that lib, but continue anyway */ #if 0 char *derr; derr = DL_error(); PRINT_ERROR("dlopen [%s] failed [%s]\n", libdirs[i], derr); #endif i++; continue; } else { //PRINT_ERROR("DL_open [%s] success\n", libdirs[i]); break; } } #if 0 /* This file compiled with Microsoft Visual C doesn't work actually... */ if (!libdnssd) { char file[255]; strcpy(file, "dnssd.dll"); if (!(libdnssd = DL_open(file))) { /* Couldn't open that lib, but continue anyway */ } } #endif #elif OW_DARWIN // MacOSX have dnssd functions in libSystem char libdirs[2][80] = { {"libSystem.dylib"}, {""} }; while (*libdirs[i]) { if (!(libdnssd = DL_open(libdirs[i]))) { /* Couldn't open that lib, but continue anyway */ #if 0 char *derr; derr = DL_error(); PRINT_ERROR("DL_open [%s] failed [%s]\n", libdirs[i], derr); #endif i++; continue; } else { //PRINT_ERROR("DL_open [%s] success\n", libdirs[i]); break; } } #elif defined(HAVE_DLOPEN) char libdirs[3][80] = { {"/opt/owfs/lib/libdns_sd.so"}, {"libdns_sd.so"}, {""} }; while (*libdirs[i]) { if (!(libdnssd = DL_open(libdirs[i]))) { /* Couldn't open that lib, but continue anyway */ #if 0 char *derr; derr = DL_error(); PRINT_ERROR("DL_open [%s] failed [%s]\n", libdirs[i], derr); #endif i++; continue; } else { //PRINT_ERROR("DL_open [%s] success\n", libdirs[i]); break; } } #endif if (libdnssd == NULL) { //PRINT_ERROR("Zeroconf/Bonjour is disabled since dnssd library isn't found\n"); return -1; } DNSServiceRefSockFD = (_DNSServiceRefSockFD) DL_sym(libdnssd, "DNSServiceRefSockFD"); DNSServiceProcessResult = (_DNSServiceProcessResult) DL_sym(libdnssd, "DNSServiceProcessResult"); DNSServiceRefDeallocate = (_DNSServiceRefDeallocate) DL_sym(libdnssd, "DNSServiceRefDeallocate"); DNSServiceResolve = (_DNSServiceResolve) DL_sym(libdnssd, "DNSServiceResolve"); DNSServiceBrowse = (_DNSServiceBrowse) DL_sym(libdnssd, "DNSServiceBrowse"); DNSServiceRegister = (_DNSServiceRegister) DL_sym(libdnssd, "DNSServiceRegister"); DNSServiceReconfirmRecord = (_DNSServiceReconfirmRecord) DL_sym(libdnssd, "DNSServiceReconfirmRecord"); DNSServiceCreateConnection = (_DNSServiceCreateConnection) DL_sym(libdnssd, "DNSServiceCreateConnection"); DNSServiceEnumerateDomains = (_DNSServiceEnumerateDomains) DL_sym(libdnssd, "DNSServiceEnumerateDomains"); return 0; } void OW_Free_dnssd_library(void) { if (libdnssd) { DL_close(libdnssd); libdnssd = NULL; } } #endif /* OW_ZERO */ owfs-3.1p5/module/owshell/src/c/ow_tcp_read.c0000644000175000001440000000412212654730021016121 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_net holds the network utility routines. Many stolen unashamedly from Steven's Book */ /* Much modification by Christian Magnusson especially for Valgrind and embedded */ /* non-threaded fixes by Jerry Scharf */ #include "owshell.h" /* Read "n" bytes from a descriptor. */ /* Stolen from Unix Network Programming by Stevens, Fenner, Rudoff p89 */ ssize_t tcp_read(int file_descriptor, void *vptr, size_t n, const struct timeval *ptv) { size_t nleft; ssize_t nread; char *ptr; //printf("NetRead attempt %d bytes Time:(%ld,%ld)\n",n,ptv->tv_sec,ptv->tv_usec ) ; ptr = vptr; nleft = n; while (nleft > 0) { int rc; fd_set readset; struct timeval tv = { ptv->tv_sec, ptv->tv_usec, }; /* Initialize readset */ FD_ZERO(&readset); FD_SET(file_descriptor, &readset); /* Read if it doesn't timeout first */ rc = select(file_descriptor + 1, &readset, NULL, NULL, &tv); if (rc > 0) { /* Is there something to read? */ if (FD_ISSET(file_descriptor, &readset) == 0) { return -EIO; /* error */ } //update_max_delay(pn); if ((nread = read(file_descriptor, ptr, nleft)) < 0) { if (errno == EINTR) { errno = 0; // clear errno. We never use it anyway. nread = 0; /* and call read() again */ } else { //ERROR_DATA("Network data read error\n"); return (-1); } } else if (nread == 0) { break; /* EOF */ } //{ int i ; for ( i=0 ; i= 0 */ } owfs-3.1p5/module/owshell/src/c/getaddrinfo.c0000644000175000001440000007161412654730021016133 00000000000000/* $USAGI: getaddrinfo.c,v 1.16 2001/10/04 09:52:03 sekiya Exp $ */ /* The Inner Net License, Version 2.00 The author(s) grant permission for redistribution and use in source and binary forms, with or without modification, of the software and documentation provided that the following conditions are met: 0. If you receive a version of the software that is specifically labelled as not being for redistribution (check the version message and/or README), you are not permitted to redistribute that version of the software in any way or form. 1. All terms of the all other applicable copyrights and licenses must be followed. 2. Redistributions of source code must retain the authors' copyright notice(s), this list of conditions, and the following disclaimer. 3. Redistributions in binary form must reproduce the authors' copyright notice(s), this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 4. All advertising materials mentioning features or use of this software must display the following acknowledgement with the name(s) of the authors as specified in the copyright notice(s) substituted where indicated: This product includes software developed by , The Inner Net, and other contributors. 5. Neither the name(s) of the author(s) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY ITS AUTHORS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. If these license terms cause you a real problem, contact the author. */ /* This software is Copyright 1996 by Craig Metz, All Rights Reserved. */ #include #include "owfs_config.h" #ifdef HAVE_PTHREAD #include #endif #ifndef HAVE_GETADDRINFO #define _GNU_SOURCE 1 #define __FORCE_GLIBC #ifdef HAVE_FEATURES_H #include #endif #include #include #include #include "compat_netdb.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_RESOLV_H #include #endif #include "ow_debug.h" /* The following declarations and definitions have been removed from * the public header since we don't want people to use them. */ #define AI_V4MAPPED 0x0008 /* IPv4-mapped addresses are acceptable. */ #define AI_ALL 0x0010 /* Return both IPv4 and IPv6 addresses. */ #define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type. */ #define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG) #define GAIH_OKIFUNSPEC 0x0100 #define GAIH_EAI ~(GAIH_OKIFUNSPEC) struct gaih_service { const char *name; int num; }; struct gaih_servtuple { struct gaih_servtuple *next; int socktype; int protocol; int port; }; static const struct gaih_servtuple nullserv; struct gaih_addrtuple { struct gaih_addrtuple *next; int family; char addr[16]; uint32_t scopeid; }; struct gaih_typeproto { int socktype; int protocol; char name[4]; int protoflag; }; /* Values for `protoflag'. */ #define GAI_PROTO_NOSERVICE 1 #define GAI_PROTO_PROTOANY 2 static const struct gaih_typeproto gaih_inet_typeproto[] = { {0, 0, "", 0}, {SOCK_STREAM, IPPROTO_TCP, "tcp", 0}, {SOCK_DGRAM, IPPROTO_UDP, "udp", 0}, {SOCK_RAW, 0, "raw", GAI_PROTO_PROTOANY | GAI_PROTO_NOSERVICE}, {0, 0, "", 0} }; struct gaih { int family; int (*gaih) (const char *name, const struct gaih_service * service, const struct addrinfo * req, struct addrinfo ** pai); }; #if PF_UNSPEC == 0 static const struct addrinfo default_hints; #else static const struct addrinfo default_hints = { 0, PF_UNSPEC, 0, 0, 0, NULL, NULL, NULL }; #endif static int addrconfig(sa_family_t af) { int s; int ret; int saved_errno = errno; s = socket(af, SOCK_DGRAM, 0); if (s < 0) ret = (errno == EMFILE) ? 1 : 0; else { close(s); ret = 1; } __set_errno(saved_errno); return ret; } #if 0 #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX 108 #endif /* Using Unix sockets this way is a security risk. */ static int gaih_local(const char *name, const struct gaih_service *service, const struct addrinfo *req, struct addrinfo **pai) { struct utsname utsname; if ((name != NULL) && (req->ai_flags & AI_NUMERICHOST)) return GAIH_OKIFUNSPEC | -EAI_NONAME; if ((name != NULL) || (req->ai_flags & AI_CANONNAME)) if (uname(&utsname) < 0) return -EAI_SYSTEM; if (name != NULL) { if (strcmp(name, "localhost") && strcmp(name, "local") && strcmp(name, "unix") && strcmp(name, utsname.nodename)) return GAIH_OKIFUNSPEC | -EAI_NONAME; } if (req->ai_protocol || req->ai_socktype) { const struct gaih_typeproto *tp = gaih_inet_typeproto + 1; while (tp->name[0] && ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0 || (req->ai_socktype != 0 && req->ai_socktype != tp->socktype) || (req->ai_protocol != 0 && !(tp->protoflag & GAI_PROTO_PROTOANY) && req->ai_protocol != tp->protocol))) ++tp; if (!tp->name[0]) { if (req->ai_socktype) return (GAIH_OKIFUNSPEC | -EAI_SOCKTYPE); else return (GAIH_OKIFUNSPEC | -EAI_SERVICE); } } *pai = malloc(sizeof(struct addrinfo) + sizeof(struct sockaddr_un) + ((req->ai_flags & AI_CANONNAME) ? (strlen(utsname.nodename) + 1) : 0)); if (*pai == NULL) return -EAI_MEMORY; (*pai)->ai_next = NULL; (*pai)->ai_flags = req->ai_flags; (*pai)->ai_family = AF_LOCAL; (*pai)->ai_socktype = req->ai_socktype ? req->ai_socktype : SOCK_STREAM; (*pai)->ai_protocol = req->ai_protocol; (*pai)->ai_addrlen = sizeof(struct sockaddr_un); (*pai)->ai_addr = (void *) (*pai) + sizeof(struct addrinfo); #ifdef HAVE_SA_LEN ((struct sockaddr_un *) (*pai)->ai_addr)->sun_len = sizeof(struct sockaddr_un); #endif /* HAVE_SA_LEN */ ((struct sockaddr_un *) (*pai)->ai_addr)->sun_family = AF_LOCAL; memset(((struct sockaddr_un *) (*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX); if (service) { struct sockaddr_un *sunp = (struct sockaddr_un *) (*pai)->ai_addr; if (strchr(service->name, '/') != NULL) { if (strlen(service->name) >= sizeof(sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; strcpy(sunp->sun_path, service->name); } else { if (strlen(P_tmpdir "/") + 1 + strlen(service->name) >= sizeof(sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; __stpcpy(__stpcpy(sunp->sun_path, P_tmpdir "/"), service->name); } } else { /* This is a dangerous use of the interface since there is a time window between the test for the file and the actual creation (done by the caller) in which a file with the same name could be created. */ char *buf = ((struct sockaddr_un *) (*pai)->ai_addr)->sun_path; if (__builtin_expect(__path_search(buf, L_tmpnam, NULL, NULL, 0), 0) != 0 || __builtin_expect(__gen_tempname(buf, __GT_NOCREATE), 0) != 0) return -EAI_SYSTEM; } if (req->ai_flags & AI_CANONNAME) (*pai)->ai_canonname = strcpy((char *) *pai + sizeof(struct addrinfo) + sizeof(struct sockaddr_un), utsname.nodename); else (*pai)->ai_canonname = NULL; return 0; } #endif /* 0 */ #ifndef HAVE_GETHOSTBYNAME_R struct hostent *gethostbyname_r(const char *name, struct hostent *result, char *buf, size_t buflen, int *h_errnop) { #ifdef HAVE_PTHREAD static pthread_mutex_t gethostbyname_lock = PTHREAD_MUTEX_INITIALIZER; #endif struct hostent *res; (void) buf; // not used (void) buflen; // not used #ifdef HAVE_PTHREAD pthread_mutex_lock(&gethostbyname_lock); #endif res = gethostbyname(name); if (res) { memcpy(result, res, sizeof(struct hostent)); } else { *h_errnop = errno; } #ifdef HAVE_PTHREAD pthread_mutex_unlock(&gethostbyname_lock); #endif return res; } #endif #ifndef HAVE_GETSERVBYNAME_R struct servent *getservbyname_r(const char *name, const char *proto, struct servent *result, char *buf, size_t buflen) { #ifdef HAVE_PTHREAD static pthread_mutex_t getservbyname_lock = PTHREAD_MUTEX_INITIALIZER; #endif struct servent *res; (void) buf; // not used (void) buflen; // not used #ifdef HAVE_PTHREAD pthread_mutex_lock(&getservbyname_lock); #endif res = getservbyname(name, proto); if (res) memcpy(result, res, sizeof(struct servent)); #ifdef HAVE_PTHREAD pthread_mutex_unlock(&getservbyname_lock); #endif return res; } #endif static int gaih_inet_serv(const char *servicename, const struct gaih_typeproto *tp, const struct addrinfo *req, struct gaih_servtuple *st) { struct servent *s; size_t tmpbuflen = 1024; struct servent ts; char *tmpbuf; int r; do { tmpbuf = alloca(tmpbuflen); #if 0 r = getservbyname_r(servicename, tp->name, &ts, tmpbuf, tmpbuflen, &s); if (!s) r = errno; if (r != 0 || s == NULL) { if (r == ERANGE) tmpbuflen *= 2; else return GAIH_OKIFUNSPEC | -EAI_SERVICE; } #else s = getservbyname_r(servicename, tp->name, &ts, tmpbuf, tmpbuflen); if (s == NULL) { r = errno; if (r == ERANGE) tmpbuflen *= 2; else return GAIH_OKIFUNSPEC | -EAI_SERVICE; } else { r = 0; } #endif } while (r); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) ? req->ai_protocol : tp->protocol); st->port = s->s_port; return 0; } #define gethosts(_family, _type) \ { \ int i, herrno; \ size_t tmpbuflen; \ struct hostent th; \ char *tmpbuf; \ tmpbuflen = 512; \ no_data = 0; \ do { \ tmpbuflen *= 2; \ tmpbuf = alloca (tmpbuflen); \ rc = 0; \ h = gethostbyname_r (name, &th, tmpbuf, \ tmpbuflen, &herrno); \ if(!h) rc = errno; \ } while (rc == ERANGE && herrno == NETDB_INTERNAL); \ if (rc != 0) \ { \ if (herrno == NETDB_INTERNAL) \ { \ __set_h_errno (herrno); \ return -EAI_SYSTEM; \ } \ if (herrno == TRY_AGAIN) \ no_data = EAI_AGAIN; \ else \ no_data = herrno == NO_DATA; \ } \ else if (h != NULL) \ { \ for (i = 0; h->h_addr_list[i]; i++) \ { \ if (*pat == NULL) { \ *pat = alloca (sizeof(struct gaih_addrtuple)); \ (*pat)->scopeid = 0; \ } \ (*pat)->next = NULL; \ (*pat)->family = _family; \ memcpy ((*pat)->addr, h->h_addr_list[i], \ sizeof(_type)); \ pat = &((*pat)->next); \ } \ } \ } #ifndef HAVE_GETHOSTBYNAME2_R struct hostenv *gethostbyname2_r(const char *name, int af, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop) { /* Don't support this if it doesn't exists... (eg. IPV6 will fail on cygwin for example) */ (void) name; (void) af; (void) ret; (void) buf; (void) buflen; (void) result; (void) h_errnop; return NULL; } #endif #if __HAS_IPV6__ #define gethosts2(_family, _type) \ { \ int i, herrno; \ size_t tmpbuflen; \ struct hostent th; \ char *tmpbuf; \ tmpbuflen = 512; \ no_data = 0; \ do { \ tmpbuflen *= 2; \ tmpbuf = alloca (tmpbuflen); \ rc = gethostbyname2_r (name, _family, &th, tmpbuf, \ tmpbuflen, &h, &herrno); \ } while (rc == ERANGE && herrno == NETDB_INTERNAL); \ if (rc != 0) \ { \ if (herrno == NETDB_INTERNAL) \ { \ __set_h_errno (herrno); \ return -EAI_SYSTEM; \ } \ if (herrno == TRY_AGAIN) \ no_data = EAI_AGAIN; \ else \ no_data = herrno == NO_DATA; \ } \ else if (h != NULL) \ { \ for (i = 0; h->h_addr_list[i]; i++) \ { \ if (*pat == NULL) { \ *pat = alloca (sizeof(struct gaih_addrtuple)); \ (*pat)->scopeid = 0; \ } \ (*pat)->next = NULL; \ (*pat)->family = _family; \ memcpy ((*pat)->addr, h->h_addr_list[i], \ sizeof(_type)); \ pat = &((*pat)->next); \ } \ } \ } #endif #ifndef HAVE_GETHOSTBYADDR_R struct hostent *gethostbyaddr_r(const char *name, int len, int type, struct hostent *result, char *buf, size_t buflen, int *h_errnop) { #ifdef HAVE_PTHREAD static pthread_mutex_t gethostbyaddr_lock = PTHREAD_MUTEX_INITIALIZER; #endif struct hostent *res; (void) buf; // not used (void) buflen; // not used #ifdef HAVE_PTHREAD pthread_mutex_lock(&gethostbyaddr_lock); #endif res = gethostbyaddr(name, len, type); if (res) { memcpy(result, res, sizeof(struct hostent)); } else { *h_errnop = errno; } #ifdef HAVE_PTHREAD pthread_mutex_unlock(&gethostbyaddr_lock); #endif return res; } #endif static int gaih_inet(const char *name, const struct gaih_service *service, const struct addrinfo *req, struct addrinfo **pai) { const struct gaih_typeproto *tp = gaih_inet_typeproto; struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv; struct gaih_addrtuple *at = NULL; int rc; int v4mapped = (req->ai_family == PF_UNSPEC #if __HAS_IPV6__ || req->ai_family == PF_INET6 #endif ) && (req->ai_flags & AI_V4MAPPED); if (req->ai_protocol || req->ai_socktype) { ++tp; while (tp->name[0] && ((req->ai_socktype != 0 && req->ai_socktype != tp->socktype) || (req->ai_protocol != 0 && !(tp->protoflag & GAI_PROTO_PROTOANY) && req->ai_protocol != tp->protocol))) ++tp; if (!tp->name[0]) { if (req->ai_socktype) return (GAIH_OKIFUNSPEC | -EAI_SOCKTYPE); else return (GAIH_OKIFUNSPEC | -EAI_SERVICE); } } if (service != NULL) { if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0) return (GAIH_OKIFUNSPEC | -EAI_SERVICE); if (service->num < 0) { if (tp->name[0]) { st = (struct gaih_servtuple *) alloca(sizeof(struct gaih_servtuple)); if ((rc = gaih_inet_serv(service->name, tp, req, st))) return rc; } else { struct gaih_servtuple **pst = &st; for (tp++; tp->name[0]; tp++) { struct gaih_servtuple *newp; if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0) continue; if (req->ai_socktype != 0 && req->ai_socktype != tp->socktype) continue; if (req->ai_protocol != 0 && !(tp->protoflag & GAI_PROTO_PROTOANY) && req->ai_protocol != tp->protocol) continue; newp = (struct gaih_servtuple *) alloca(sizeof(struct gaih_servtuple)); if ((rc = gaih_inet_serv(service->name, tp, req, newp))) { if (rc & GAIH_OKIFUNSPEC) continue; return rc; } *pst = newp; pst = &(newp->next); } if (st == (struct gaih_servtuple *) &nullserv) return (GAIH_OKIFUNSPEC | -EAI_SERVICE); } } else { st = alloca(sizeof(struct gaih_servtuple)); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) ? req->ai_protocol : tp->protocol); st->port = htons(service->num); } } else if (req->ai_socktype || req->ai_protocol) { st = alloca(sizeof(struct gaih_servtuple)); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) ? req->ai_protocol : tp->protocol); st->port = 0; } else { /* * Neither socket type nor protocol is set. Return all socket types * we know about. */ struct gaih_servtuple **lastp = &st; for (++tp; tp->name[0]; ++tp) { struct gaih_servtuple *newp; newp = alloca(sizeof(struct gaih_servtuple)); newp->next = NULL; newp->socktype = tp->socktype; newp->protocol = tp->protocol; newp->port = 0; *lastp = newp; lastp = &newp->next; } } if (name != NULL) { at = alloca(sizeof(struct gaih_addrtuple)); at->family = AF_UNSPEC; at->scopeid = 0; at->next = NULL; if (inet_pton(AF_INET, name, at->addr) > 0) { if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET || v4mapped) at->family = AF_INET; else return -EAI_FAMILY; } #if __HAS_IPV6__ if (at->family == AF_UNSPEC) { char *namebuf = strdupa(name); char *scope_delim; scope_delim = strchr(namebuf, SCOPE_DELIMITER); if (scope_delim != NULL) *scope_delim = '\0'; if (inet_pton(AF_INET6, namebuf, at->addr) > 0) { if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6) at->family = AF_INET6; else return -EAI_FAMILY; if (scope_delim != NULL) { int try_numericscope = 0; if (IN6_IS_ADDR_LINKLOCAL(at->addr) || IN6_IS_ADDR_MC_LINKLOCAL(at->addr)) { at->scopeid = if_nametoindex(scope_delim + 1); if (at->scopeid == 0) try_numericscope = 1; } else try_numericscope = 1; if (try_numericscope != 0) { char *end; assert(sizeof(uint32_t) <= sizeof(unsigned long)); at->scopeid = (uint32_t) strtoul(scope_delim + 1, &end, 10); if (*end != '\0') return GAIH_OKIFUNSPEC | -EAI_NONAME; } } } } #endif if (at->family == AF_UNSPEC && (req->ai_flags & AI_NUMERICHOST) == 0) { struct hostent *h; struct gaih_addrtuple **pat = &at; int no_data = 0; int no_inet6_data; /* * If we are looking for both IPv4 and IPv6 address we don't want * the lookup functions to automatically promote IPv4 addresses to * IPv6 addresses. */ #if __HAS_IPV6__ if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6) gethosts(AF_INET6, struct in6_addr); #endif no_inet6_data = no_data; if (req->ai_family == AF_INET || (!v4mapped && req->ai_family == AF_UNSPEC) || (v4mapped && (no_inet6_data != 0 || (req->ai_flags & AI_ALL)))) #if __HAS_IPV6__ gethosts2(AF_INET, struct in_addr); #else gethosts(AF_INET, struct in_addr); #endif if (no_data != 0 && no_inet6_data != 0) { /* If both requests timed out report this. */ if (no_data == EAI_AGAIN && no_inet6_data == EAI_AGAIN) return -EAI_AGAIN; /* * We made requests but they turned out no data. * The name is known, though. */ return (GAIH_OKIFUNSPEC | -EAI_AGAIN); } } if (at->family == AF_UNSPEC) return (GAIH_OKIFUNSPEC | -EAI_NONAME); } else { struct gaih_addrtuple *atr; atr = at = alloca(sizeof(struct gaih_addrtuple)); memset(at, '\0', sizeof(struct gaih_addrtuple)); if (req->ai_family == 0) { at->next = alloca(sizeof(struct gaih_addrtuple)); memset(at->next, '\0', sizeof(struct gaih_addrtuple)); } #if __HAS_IPV6__ if (req->ai_family == 0 || req->ai_family == AF_INET6) { extern const struct in6_addr __in6addr_loopback; at->family = AF_INET6; if ((req->ai_flags & AI_PASSIVE) == 0) memcpy(at->addr, &__in6addr_loopback, sizeof(struct in6_addr)); atr = at->next; } #endif if (req->ai_family == 0 || req->ai_family == AF_INET) { atr->family = AF_INET; if ((req->ai_flags & AI_PASSIVE) == 0) *(uint32_t *) atr->addr = htonl(INADDR_LOOPBACK); } } if (pai == NULL) return 0; { const char *c = NULL; struct gaih_servtuple *st2; struct gaih_addrtuple *at2 = at; size_t socklen, namelen; sa_family_t family; /* * buffer is the size of an unformatted IPv6 address in * printable format. */ char buffer[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"]; while (at2 != NULL) { if (req->ai_flags & AI_CANONNAME) { struct hostent *h = NULL; int herrno; struct hostent th; size_t tmpbuflen = 512; char *tmpbuf; do { tmpbuflen *= 2; tmpbuf = alloca(tmpbuflen); if (tmpbuf == NULL) return -EAI_MEMORY; rc = 0; h = gethostbyaddr_r(at2->addr, #if __HAS_IPV6__ ((at2->family == AF_INET6) ? sizeof(struct in6_addr) : sizeof(struct in_addr)), #else sizeof(struct in_addr), #endif at2->family, &th, tmpbuf, tmpbuflen, &herrno); if (!h) rc = errno; } while (rc == errno && herrno == NETDB_INTERNAL); if (rc != 0 && herrno == NETDB_INTERNAL) { __set_h_errno(herrno); return -EAI_SYSTEM; } if (h == NULL) c = inet_ntop(at2->family, at2->addr, buffer, sizeof(buffer)); else c = h->h_name; if (c == NULL) return GAIH_OKIFUNSPEC | -EAI_NONAME; namelen = strlen(c) + 1; } else namelen = 0; #if __HAS_IPV6__ if (at2->family == AF_INET6 || v4mapped) { family = AF_INET6; socklen = sizeof(struct sockaddr_in6); } else #endif { family = AF_INET; socklen = sizeof(struct sockaddr_in); } for (st2 = st; st2 != NULL; st2 = st2->next) { *pai = malloc(sizeof(struct addrinfo) + socklen + namelen); if (*pai == NULL) return -EAI_MEMORY; (*pai)->ai_flags = req->ai_flags; (*pai)->ai_family = family; (*pai)->ai_socktype = st2->socktype; (*pai)->ai_protocol = st2->protocol; (*pai)->ai_addrlen = socklen; (*pai)->ai_addr = (void *) (*pai) + sizeof(struct addrinfo); #ifdef HAVE_SA_LEN (*pai)->ai_addr->sa_len = socklen; #endif /* HAVE_SA_LEN */ (*pai)->ai_addr->sa_family = family; #if __HAS_IPV6__ if (family == AF_INET6) { struct sockaddr_in6 *sin6p = (struct sockaddr_in6 *) (*pai)->ai_addr; sin6p->sin6_flowinfo = 0; if (at2->family == AF_INET6) { memcpy(&sin6p->sin6_addr, at2->addr, sizeof(struct in6_addr)); } else { sin6p->sin6_addr.s6_addr32[0] = 0; sin6p->sin6_addr.s6_addr32[1] = 0; sin6p->sin6_addr.s6_addr32[2] = htonl(0x0000ffff); memcpy(&sin6p->sin6_addr.s6_addr32[3], at2->addr, sizeof(sin6p->sin6_addr.s6_addr32[3])); } sin6p->sin6_port = st2->port; sin6p->sin6_scope_id = at2->scopeid; } else #endif { struct sockaddr_in *sinp = (struct sockaddr_in *) (*pai)->ai_addr; memcpy(&sinp->sin_addr, at2->addr, sizeof(struct in_addr)); sinp->sin_port = st2->port; memset(sinp->sin_zero, '\0', sizeof(sinp->sin_zero)); } if (c) { (*pai)->ai_canonname = ((void *) (*pai) + sizeof(struct addrinfo) + socklen); strcpy((*pai)->ai_canonname, c); } else (*pai)->ai_canonname = NULL; (*pai)->ai_next = NULL; pai = &((*pai)->ai_next); } at2 = at2->next; } } return 0; } static struct gaih gaih[] = { #if __HAS_IPV6__ {PF_INET6, gaih_inet}, #endif {PF_INET, gaih_inet}, #if 0 {PF_LOCAL, gaih_local}, #endif {PF_UNSPEC, NULL} }; int getaddrinfo(const char *name, const char *service, const struct addrinfo *hints, struct addrinfo **pai) { int i = 0, j = 0, last_i = 0; struct addrinfo *p = NULL, **end; struct gaih *g = gaih, *pg = NULL; struct gaih_service gaih_service, *pservice; if (name != NULL && name[0] == '*' && name[1] == 0) name = NULL; if (service != NULL && service[0] == '*' && service[1] == 0) service = NULL; if (name == NULL && service == NULL) return EAI_NONAME; if (hints == NULL) hints = &default_hints; if (hints->ai_flags & ~(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_ADDRCONFIG | AI_V4MAPPED | AI_ALL)) return EAI_BADFLAGS; if ((hints->ai_flags & AI_CANONNAME) && name == NULL) return EAI_BADFLAGS; if (service && service[0]) { char *c; gaih_service.name = service; gaih_service.num = strtoul(gaih_service.name, &c, 10); if (*c) gaih_service.num = -1; else /* * Can't specify a numerical socket unless a protocol * family was given. */ if (hints->ai_socktype == 0 && hints->ai_protocol == 0) return EAI_SERVICE; pservice = &gaih_service; } else pservice = NULL; if (pai) end = &p; else end = NULL; while (g->gaih) { if (hints->ai_family == g->family || hints->ai_family == AF_UNSPEC) { if ((hints->ai_flags & AI_ADDRCONFIG) && !addrconfig(g->family)) continue; j++; if (pg == NULL || pg->gaih != g->gaih) { pg = g; i = g->gaih(name, pservice, hints, end); if (i != 0) { last_i = i; if (hints->ai_family == AF_UNSPEC && (i & GAIH_OKIFUNSPEC)) continue; if (p) freeaddrinfo(p); return -(i & GAIH_EAI); } if (end) while (*end) end = &((*end)->ai_next); } } ++g; } if (j == 0) return EAI_FAMILY; if (p) { *pai = p; return 0; } if (pai == NULL && last_i == 0) return 0; if (p) freeaddrinfo(p); return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME; } void freeaddrinfo(struct addrinfo *ai) { struct addrinfo *p; while (ai != NULL) { p = ai; ai = ai->ai_next; free(p); } } #define N_(x) x static struct { int code; const char *msg; } values[] = { { EAI_ADDRFAMILY, N_("Address family for hostname not supported")}, { EAI_AGAIN, N_("Temporary failure in name resolution")}, { EAI_BADFLAGS, N_("Bad value for ai_flags")}, { EAI_FAIL, N_("Non-recoverable failure in name resolution")}, { EAI_FAMILY, N_("ai_family not supported")}, { EAI_MEMORY, N_("Memory allocation failure")}, { EAI_NODATA, N_("No address associated with hostname")}, { EAI_NONAME, N_("Name or service not known")}, { EAI_SERVICE, N_("Servname not supported for ai_socktype")}, { EAI_SOCKTYPE, N_("ai_socktype not supported")}, { EAI_SYSTEM, N_("System error")}, { EAI_INPROGRESS, N_("Processing request in progress")}, { EAI_CANCELED, N_("Request canceled")}, { EAI_NOTCANCELED, N_("Request not canceled")}, { EAI_ALLDONE, N_("All requests done")}, { EAI_INTR, N_("Interrupted by a signal")} }; const char *gai_strerror(int code) { size_t i; for (i = 0; i < sizeof(values) / sizeof(values[0]); ++i) if (values[i].code == code) return (values[i].msg); return ("Unknown error"); } #endif /* HAVE_GETADDRINFO */ #ifndef HAVE_INET_NTOP /* char * * inet_ntop4(src, dst, size) * format an IPv4 address * return: * `dst' (as a const) * notes: * (1) uses no statics * (2) takes a u_char* not an in_addr as input * author: * Paul Vixie, 1996. */ static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size) { char tmp[sizeof("255.255.255.255") + 1] = "\0"; int octet; int i; i = 0; for (octet = 0; octet <= 3; octet++) { if (src[octet] > 255) { __set_errno(ENOSPC); return (NULL); } tmp[i++] = '0' + src[octet] / 100; if (tmp[i - 1] == '0') { tmp[i - 1] = '0' + (src[octet] / 10 % 10); if (tmp[i - 1] == '0') i--; } else { tmp[i++] = '0' + (src[octet] / 10 % 10); } tmp[i++] = '0' + src[octet] % 10; tmp[i++] = '.'; } tmp[i - 1] = '\0'; if (strlen(tmp) > size) { __set_errno(ENOSPC); return (NULL); } return strcpy(dst, tmp); } /* char * * inet_ntop(af, src, dst, size) * convert a network format address to presentation format. * return: * pointer to presentation format address (`dst'), or NULL (see errno). * author: * Paul Vixie, 1996. */ const char *inet_ntop(af, src, dst, size) int af; const void *src; char *dst; socklen_t size; { switch (af) { case AF_INET: return (inet_ntop4(src, dst, size)); #if __HAS_IPV6__ case AF_INET6: return (inet_ntop6(src, dst, size)); #endif default: __set_errno(EAFNOSUPPORT); return (NULL); } /* NOTREACHED */ } #endif /* HAVE_INET_NTOP */ #ifndef HAVE_INET_PTON /* int * inet_pton4(src, dst) * like inet_aton() but without all the hexadecimal and shorthand. * return: * 1 if `src' is a valid dotted quad, else 0. * notice: * does not touch `dst' unless it's returning 1. * author: * Paul Vixie, 1996. */ static int inet_pton4(const char *src, unsigned char *dst) { int saw_digit, octets, ch; unsigned char tmp[4], *tp; saw_digit = 0; octets = 0; *(tp = tmp) = 0; while ((ch = *src++) != '\0') { if (ch >= '0' && ch <= '9') { unsigned int new = *tp * 10 + (ch - '0'); if (new > 255) return (0); *tp = new; if (!saw_digit) { if (++octets > 4) return (0); saw_digit = 1; } } else if (ch == '.' && saw_digit) { if (octets == 4) return (0); *++tp = 0; saw_digit = 0; } else return (0); } if (octets < 4) return (0); memcpy(dst, tmp, 4); return (1); } /* int * inet_pton(af, src, dst) * convert from presentation format (which usually means ASCII printable) * to network format (which is usually some kind of binary format). * return: * 1 if the address was valid for the specified address family * 0 if the address wasn't valid (`dst' is untouched in this case) * -1 if some other error occurred (`dst' is untouched in this case, too) * author: * Paul Vixie, 1996. */ int inet_pton(af, src, dst) int af; const char *src; void *dst; { switch (af) { case AF_INET: return (inet_pton4(src, dst)); #if __HAS_IPV6__ case AF_INET6: return (inet_pton6(src, dst)); #endif default: __set_errno(EAFNOSUPPORT); return (-1); } /* NOTREACHED */ } #endif /* HAVE_INET_PTON */ owfs-3.1p5/module/owshell/src/c/getopt.c0000644000175000001440000005434612654730021015152 00000000000000/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * Modified for uClibc by Manuel Novoa III on 1/5/01. * Modified once again for uClibc by Erik Andersen 8/7/02 */ #include #include "owfs_config.h" #include "compat_getopt.h" #include "ow.h" // only for UINT #ifndef HAVE_GETOPT_LONG #include #include #include #include /* Treat '-W foo' the same as the long option '--foo', * disabled for the moment since it costs about 2k... */ #undef SPECIAL_TREATMENT_FOR_W /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ extern int _getopt_internal(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only); /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ static int __getopt_initialized; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; # include # define my_index strchr /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange(char **argv) { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ static const char *_getopt_initialize(int argc, char *const *argv, const char *optstring) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (getenv("POSIXLY_CORRECT") != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) { if (argc < 1) return -1; optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize(argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp(argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index(optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((UINT) (nameend - nextchar) == (UINT) strlen(p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { PRINT_ERROR( "%s: option `%s' is ambiguous\n", argv[0], argv[optind]); nextchar += strlen(nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (argv[optind - 1][1] == '-') { /* --option */ PRINT_ERROR( "%s: option `--%s' doesn't allow an argument\n", argv[0], pfound->name); } else { /* +option or -option */ PRINT_ERROR("%s: option `%c%s' doesn't allow an argument\n", argv[0], argv[optind - 1][0], pfound->name); } nextchar += strlen(nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { PRINT_ERROR("%s: option `%s' requires an argument\n", argv[0], argv[optind - 1]); nextchar += strlen(nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen(nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index(optstring, *nextchar) == NULL) { if (argv[optind][1] == '-') { /* --option */ PRINT_ERROR("%s: unrecognized option `--%s'\n", argv[0], nextchar); } else { /* +option or -option */ PRINT_ERROR("%s: unrecognized option `%c%s'\n", argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index(optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { /* 1003.2 specifies the format of this message. */ PRINT_ERROR("%s: illegal option -- %c\n", argv[0], c); optopt = c; return '?'; } #ifdef SPECIAL_TREATMENT_FOR_W /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { /* 1003.2 specifies the format of this message. */ PRINT_ERROR("%s: option requires an argument -- %c\n", argv[0], c); optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((UINT) (nameend - nextchar) == strlen(p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { PRINT_ERROR("%s: option `-W %s' is ambiguous\n", argv[0], argv[optind]); nextchar += strlen(nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { PRINT_ERROR("%s: option `-W %s' doesn't allow an argument\n", argv[0], pfound->name); nextchar += strlen(nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { PRINT_ERROR("%s: option `%s' requires an argument\n", argv[0], argv[optind - 1]); nextchar += strlen(nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen(nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } #endif if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { /* 1003.2 specifies the format of this message. */ PRINT_ERROR("%s: option requires an argument -- %c\n", argv[0], c); optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt_long(int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal(argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only(int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal(argc, argv, options, long_options, opt_index, 1); } #endif /* HAVE_GETOPT_LONG */ #ifndef HAVE_GETOPT int getopt(int argc, char *const *argv, const char *optstring) { return _getopt_internal(argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* HAVE_GETOPT */ owfs-3.1p5/module/owshell/src/c/globals.c0000644000175000001440000000211212654730021015253 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include "owshell.h" /* Globals for port and bus communication */ /* connections globals stored in ow_connect.c */ /* i.e. connection_in * owserver_connection ... */ struct global Globals; /* Globals */ int count_inbound_connections = 0; struct connection_in s_owserver_connection; struct connection_in *owserver_connection = &s_owserver_connection; /* All ow library setup */ void Setup(void) { #if OW_ZERO OW_Load_dnssd_library(); #endif memset(owserver_connection, 0, sizeof(s_owserver_connection)); // global structure of configuration parameters memset(&Globals, 0, sizeof(struct global)); Globals.timeout_network = 1; errno = 0; /* set error level none */ } static void Cleanup(void) { #if OW_ZERO OW_Free_dnssd_library(); #endif } void Exit(int exit_code) { Cleanup(); exit(exit_code); } owfs-3.1p5/module/owshell/src/c/owdir.c0000644000175000001440000000246712654730021014771 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097 serial connector Written 2003 Paul H Alfille */ #include "owshell.h" /* ---------------------------------------------- */ /* Command line parsing and result generation */ /* ---------------------------------------------- */ int main(int argc, char *argv[]) { int c; int paths_found = 0; int rc = -1; int dirall = 1; Setup(); /* process command line arguments */ while (1) { c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL); if (c == -1) { break; } owopt(c, optarg); } DefaultOwserver(); Server_detect(); /* non-option arguments */ while (optind < argc) { ++paths_found; if (dirall) { rc = ServerDirall(argv[optind]); if (rc < 0) { dirall = 0; rc = ServerDir(argv[optind]); } } else { rc = ServerDir(argv[optind]); } ++optind; } // Was anything requested? if (paths_found == 0) { rc = ServerDirall("/"); if (rc < 0) rc = ServerDir("/"); } if ( rc >= 0 ) { errno = 0 ; Exit(0) ; } else { errno = -rc ; Exit(1) ; } return 0; // never reached } owfs-3.1p5/module/owshell/src/c/owexist.c0000644000175000001440000000170112654730021015335 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097 serial connector Written 2003 Paul H Alfille */ #include "owshell.h" /* ---------------------------------------------- */ /* Command line parsing and result generation */ /* ---------------------------------------------- */ int main(int argc, char *argv[]) { int fd ; Setup(); /* process command line arguments */ while (1) { int c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL); if (c == -1) { break; } owopt(c, optarg); } DefaultOwserver(); Server_detect(); // Exit(1) if problem. fd = ClientConnect() ; if ( fd == -1 ) { PRINT_ERROR("Cannot connect\n"); Exit(1); } // Success! close(fd); Exit(0) ; return 0 ; } owfs-3.1p5/module/owshell/src/c/owget.c0000644000175000001440000000270512654730021014765 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097 serial connector Written 2003 Paul H Alfille */ #include "owshell.h" /* ---------------------------------------------- */ /* Command line parsing and result generation */ /* ---------------------------------------------- */ int main(int argc, char *argv[]) { int c; int paths_found = 0; int rc = -1; int dirall = 1; Setup(); /* process command line arguments */ while (1) { c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL); if (c == -1) { break; } owopt(c, optarg); } DefaultOwserver(); Server_detect(); /* non-option arguments */ while (optind < argc) { ++paths_found; if (dirall) { rc = ServerDirall(argv[optind]); if ( rc == -ENOTDIR ) { rc = ServerRead(argv[optind]); } else if (rc < 0) { dirall = 0; rc = ServerDir(argv[optind]); } } else { rc = ServerDir(argv[optind]); if ( rc == -ENOTDIR ) { rc = ServerRead(argv[optind]); } } ++optind; } // Was anything requested? if (paths_found == 0) { rc = ServerDirall("/"); if (rc < 0) { rc = ServerDir("/"); } } if ( rc >= 0 ) { errno = 0 ; Exit(0) ; } else { errno = -rc ; Exit(1) ; } return 0; // never reached } owfs-3.1p5/module/owshell/src/c/owpresent.c0000644000175000001440000000170412654730021015664 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097 serial connector Written 2003 Paul H Alfille */ #include "owshell.h" /* ---------------------------------------------- */ /* Command line parsing and result generation */ /* ---------------------------------------------- */ int main(int argc, char *argv[]) { int c; int rc = -1; Setup(); /* process command line arguments */ while (1) { c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL); if (c == -1) { break; } owopt(c, optarg); } DefaultOwserver(); Server_detect(); /* non-option arguments */ while (optind < argc) { rc = ServerPresence(argv[optind]); ++optind; } Exit((rc >= 0 ? 0 : 1)); return 0; // never reached } owfs-3.1p5/module/owshell/src/c/owread.c0000644000175000001440000000177312654730021015125 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097 serial connector Written 2003 Paul H Alfille */ #include "owshell.h" /* ---------------------------------------------- */ /* Command line parsing and result generation */ /* ---------------------------------------------- */ int main(int argc, char *argv[]) { int c; int rc = -1; Setup(); /* process command line arguments */ while (1) { c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL); if (c == -1) { break; } owopt(c, optarg); } DefaultOwserver(); Server_detect(); /* non-option arguments */ while (optind < argc) { rc = ServerRead(argv[optind]); ++optind; } if ( rc >= 0 ) { errno = 0 ; Exit(0) ; } else { errno = -rc ; Exit(1) ; } return 0; // never reached } owfs-3.1p5/module/owshell/src/c/owusbprobe.c0000644000175000001440000003046212672234566016045 00000000000000/* OW -- One-Wire filesystem USB probe helper program Probes USB bus for potential 1-wire adapters and helps user to configure them Written 2016 by Johan Ström */ #include #include #include #include #include #include #include "config.h" #include "owfs_config.h" #include "../../../owlib/src/include/libusb.h" #define error_return(code, msg, args...) do { \ fprintf(stderr, msg"\n", ##args); \ return (code);\ }while(0) #define error_return_libusb(code, usb_ret, msg, args...) do { \ fprintf(stderr, msg": %s\n", ##args, libusb_strerror(usb_ret)); \ return (code);\ }while(0) #define log(msg, args...) fprintf(stdout, msg"\n", ##args) #if OW_USB #if defined(__FreeBSD__) #define TTY_EXAMPLE "/dev/cuaUx" #define ACM_EXAMPLE "/dev/cuaUx" #elif defined(__APPLE__) #define TTY_EXAMPLE "/dev/cu.xxx" #define ACM_EXAMPLE "/dev/cu.xxx" #else #define TTY_EXAMPLE "/dev/ttyUSBx" #define ACM_EXAMPLE "/dev/ttyACMx" #endif #include /* Struct which we gather and store device info into. * This can house either USB or TTY names. */ typedef struct dev_info_s { // USB only int idVendor, idProduct; int devAddr, busNo, usbNr; unsigned char manufacturer[255], description[255]; // Either USB serial, or TTY name. union { unsigned char serial[255]; unsigned char tty_name[255]; }; struct dev_info_s *next; } dev_info; static dev_info* dev_info_create(dev_info **head, dev_info **tail) { dev_info *di; // Create new result node if(!(di = malloc(sizeof(dev_info)))) error_return(NULL, "malloc() failed"); memset(di, 0, sizeof(dev_info)); if(!(*tail)) { // First; populate head *head = di; *tail = di; } else { // Not first; add to tail (*tail)->next = di; *tail = di; } return di; } static void dev_info_free_all(dev_info **head) { dev_info *next = *head; while(next) { dev_info *curr = next; next = curr->next; free(curr); } *head = NULL; } // Check if two device nodes are describing the same device static int dev_match(const dev_info *list_head, const dev_info *dev) { const dev_info *curr = list_head; while(curr) { // For tty devices, idVendor & idProduct are 0. serial is also union with tty_name if(curr->idVendor == dev->idVendor && curr->idProduct == dev->idProduct && !strcmp((const char*)curr->serial, (const char*)dev->serial)) { return 1; } curr = curr->next; } return 0; } static int list_usb_devices_iter(libusb_device **devs, dev_info **out_list_head) { int i=0; int r; int usb_nr = 0; libusb_device *dev; dev_info *tail=NULL, *curr; *out_list_head = NULL; while((dev = devs[i++]) != NULL) { libusb_device_handle *dev_handle; struct libusb_device_descriptor desc; if ((r = libusb_get_device_descriptor(dev, &desc)) < 0) error_return_libusb(-1, r, "libusb_get_device_descriptor() failed"); if((r = libusb_open(dev, &dev_handle)) < 0) error_return_libusb(-1, r, "libusb_open() failed"); // Create new result node if(!(curr = dev_info_create(out_list_head, &tail))) { libusb_close(dev_handle); return -1; } curr->idVendor = desc.idVendor; curr->idProduct = desc.idProduct; curr->usbNr = ++usb_nr; r = libusb_get_string_descriptor_ascii(dev_handle, desc.iManufacturer, curr->manufacturer, sizeof(curr->manufacturer)); if(r < 0) { snprintf((char*)curr->manufacturer, sizeof(curr->manufacturer), "(failed to read: %s)", libusb_strerror(r)); } r = libusb_get_string_descriptor_ascii(dev_handle, desc.iProduct, curr->description, sizeof(curr->description)); if(r < 0) { snprintf((char*)curr->description, sizeof(curr->description), "(failed to read: %s)", libusb_strerror(r)); } r = libusb_get_string_descriptor_ascii(dev_handle, desc.iSerialNumber, curr->serial, sizeof(curr->serial)); if(r < 0) { snprintf((char*)curr->serial, sizeof(curr->serial), "(failed to read: %s)", libusb_strerror(r)); } curr->devAddr = libusb_get_device_address(dev); curr->busNo = libusb_get_bus_number(dev); libusb_close(dev_handle); } return i; } static int list_usb_devices(dev_info **out_list_head) { int r; libusb_device **devs; libusb_context *usb_ctx = NULL; r = libusb_init(&usb_ctx) != 0; if(r != 0) error_return(1, "libusb_init() failed: %d", r); log(" Scanning USB devices..."); if((r = libusb_get_device_list(usb_ctx, &devs)) < 0) { libusb_exit(usb_ctx); error_return_libusb(-1, r, "libusb_get_device_list() failed: %d", r); } log(" Found %d devices", r); r = list_usb_devices_iter(devs, out_list_head); libusb_free_device_list(devs, 1); libusb_exit(usb_ctx); return r; } /* Iterate all files in /dev/ and match OS-specific TTY names. */ static int list_tty_devices(dev_info **out_list_head) { DIR* d; struct dirent* e; int i=0; dev_info *tail=NULL, *curr; if(!(d = opendir("/dev"))) error_return(-1, "opendir(/dev) failed: %d", errno); while((e = readdir(d)) != NULL) { #if defined(__FreeBSD__) if(!strncmp(e->d_name, "cua", 3) && !strstr(e->d_name, ".init") && !strstr(e->d_name, ".lock")) #elif defined(__APPLE__) if(!strncmp(e->d_name, "cu.", 3)) #else if(!strncmp(e->d_name, "ttyUSB", 6) || strncmp(e->d_name, "ttyACM", 6)) #endif { if(!(curr = dev_info_create(out_list_head, &tail))) return -1; snprintf((char*)curr->tty_name, sizeof(curr->tty_name), "/dev/%s", e->d_name); i++; } } closedir(d); return i; } // For each TTY in updated, but not in baseline, add tty_name to // a comma separated string which is returned static char *create_ttys_string(dev_info *baseline, dev_info *updated, int cnt_baseline, int cnt_updated) { int sz = (cnt_baseline > cnt_updated ? cnt_baseline : cnt_updated) * 255; int of=0; const dev_info *curr = updated; char *result = malloc(sz); memset(result, 0, sz); while(curr) { if(!dev_match(baseline, curr)){ of+= snprintf(result+of, sz-of-1, "%s%s", (of > 0 ? ", ":""), curr->tty_name); } curr = curr->next; } return result; } static void describe_usb_device(const dev_info *dev, const char *ttys_found) { int vid = dev->idVendor, pid = dev->idProduct; log("> Vendor ID : 0x%04x Product ID : 0x%04x", vid, pid); log(" Manufacturer : %-20s Description : %-30s", dev->manufacturer, dev->description); log(" Serial : %-20s Bus: %d, Addr: %d, US" "B nr: %d\n", dev->serial, dev->busNo, dev->devAddr, dev->usbNr); // Compare vid/pid with known device list if(vid == 0x0403 && (pid == 0x6001 || pid == 0x6010 || pid == 0x6011 || pid == 0x6014 || pid == 0x6015)) { char addr[255]; snprintf(addr, sizeof(addr), "ftdi:s:0x%04x:0x%04x:%s", vid, pid, dev->serial); log("This device is identified as a generic FTDI adapter. To address it, use the following adressing:\n"); log(" %s\n", addr); if(pid == 0x6001) { log("This MAY be a LinkUSB device. If so, you may put the following in your owfs.conf:\n"); log(" link = %s\n", addr); log("Or, if running from command line:\n"); log(" --link %s\n", addr); printf("If NOT a LinkUSB, you "); } else { printf("You "); } log("have to check the documentation on how to target your particular device type."); log("For any serial type device, you should be able to use the above addressing."); log("For example, if it is DS2480B-compatible, you may put the following in your owfs.conf:\n"); log(" device = %s\n", addr); log("Or, if running from command line:\n"); log(" --device %s", addr); }else if(vid == 0x04FA && pid == 0x2490) { log("This device is identified as a DS2490 / DS9490 USB adapter.\n"); log("You may put either of the following in your owfs.conf:\n"); log(" usb = %d:%d\n", dev->busNo, dev->devAddr); log(" usb = %d\n", dev->usbNr); log("Or, if running from command line:\n"); log(" --usb %d:%d", dev->busNo, dev->devAddr); log(" --usb %d\n", dev->usbNr); log("Please be aware that these adressing schemes are non-stable, and numbers may\n" "change between reboots or reconnects. Please read owserver manual page for more info."); }else if((vid == 0x067B && pid == 0x2303) || (vid == 0x0B6A && pid == 0x5A03)) { // DS2480b-emulating devices if(vid == 0x067B && pid == 0x2303) { log("This device is identified as a generic Prolific USB adapter.\n" "It MAY be a DS9481 adapter. If it is, you need to use the DS2480B device, \n" "and point it to the appropriate %s device.\n", TTY_EXAMPLE); }else if(vid == 0x0B6A && pid == 0x5A03){ log("This device is identified as a DS9481P-300 USB adapter."); log("To use this, you need to use the DS2480B device, and point it to\n" "the appropriate %s device\n", ACM_EXAMPLE); } if(ttys_found) { log("The following devices where found: %s", ttys_found); } log("You may put the following in your owfs.conf:\n"); log(" device = %s\n", TTY_EXAMPLE); log("Or, if running from command line:\n"); log(" --device %s", TTY_EXAMPLE); log("Please be aware that /dev device names may be non-stable, and may\n" "thus change between reboots or reconnects. Please read owserver manual page for more info."); }else{ log("This device is not a known compatible device."); } log("------------------------------------------------------------------"); } static int usage(char *progname) { log("OWFS USB probe utility"); log("usage: %s [-a|--all]\n", progname); log("By default, this will run an interactive guide to identify your USB based 1-wire adapters."); log("If you run with -a/--all, we will print all found devices and exit"); return 1; } #define DEV_INFO_CLEANUP() do {\ dev_info_free_all(&usb_baseline);\ dev_info_free_all(&usb_updated);\ dev_info_free_all(&tty_baseline);\ dev_info_free_all(&tty_updated);\ if(tty_result){ free(tty_result); tty_result = NULL;} \ }while(0) int main(int argc, char *argv[]) { int cnt_usb_baseline = 0, cnt_usb_updated = 0; int cnt_tty_baseline = 0, cnt_tty_updated = 0; int i; int interactive = 1; char *tty_result = NULL; dev_info *usb_baseline = NULL, *usb_updated = NULL; dev_info *tty_baseline = NULL, *tty_updated = NULL; if(argc > 2) { usage(argv[0]); return 1; }else if(argc == 2) { if(!strcmp(argv[1], "-a") || !strcmp(argv[1], "--all")) interactive = 0; else usage(argv[0]); } if(geteuid() != 0) { log("NOTE: You are running as a non-root user. Unless permissions are already configured\n" "you will probably not find any devices.\n"); } if(interactive) { log("Please disconnect any USB devices you which to identify.\n" "A bus scan will then be made to create a base-line of ignored devices.\n\n" "Press Enter when you are ready to proceed"); getc(stdin); if((cnt_usb_baseline = list_usb_devices(&usb_baseline)) < 0) { DEV_INFO_CLEANUP(); return 1; } if((cnt_tty_baseline = list_tty_devices(&tty_baseline)) < 0) { DEV_INFO_CLEANUP(); return 1; } log("Please reconnect one of the device you which to identify.\n\n" "When you are ready to proceed, wait a few seconds.\n" "Then press Enter"); getc(stdin); } for(i=0; i < 5; i++){ if((cnt_usb_updated = list_usb_devices(&usb_updated)) < 0) { DEV_INFO_CLEANUP(); return 1; } if(interactive && cnt_usb_updated <= cnt_usb_baseline) { // No change; sleep a bit and try agian log("No new devices detect.. Re-scanning in 2s..."); sleep(2); }else break; } if(interactive) { if((cnt_tty_updated = list_tty_devices(&tty_updated)) < 0) { DEV_INFO_CLEANUP(); return 1; } // Find any new in tty_updated tty_result = create_ttys_string(tty_baseline, tty_updated, cnt_tty_baseline, cnt_tty_updated); } if(interactive && cnt_usb_baseline == cnt_usb_updated) { log("Sorry, no new USB devices was found."); if(geteuid() != 0) log("This is likely due to running as non-root. "); DEV_INFO_CLEANUP(); return 0; } if(usb_updated) { const dev_info *curr = usb_updated; // Iterate all newly found and compare with baseline while(curr) { if(!interactive || !dev_match(usb_baseline, curr)) describe_usb_device(curr, tty_result); curr = curr->next; } if(geteuid() == 0) { log("\nNOTE: You are running as root. You may have to configure your OS to allow\n" "your user to access the device. Please see owfs documentation for details."); } } DEV_INFO_CLEANUP(); return 0; } #else int main(int arc, char *argv[]) { error_return(1, "Sorry, OWFS was not built with USB support." "Please rebuild with USB support to use this tool."); } #endif owfs-3.1p5/module/owshell/src/c/owwrite.c0000644000175000001440000000641712711737666015364 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097 serial connector Written 2003 Paul H Alfille */ #include "owshell.h" static int HexVal( char c ) ; static char * HexConvert( char * input_string, int *out_size ) ; /* ---------------------------------------------- */ /* Command line parsing and result generation */ /* ---------------------------------------------- */ int main(int argc, char *argv[]) { int c; int rc = -EINVAL; Setup(); /* process command line arguments */ while (1) { c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL); if (c == -1) { break; } owopt(c, optarg); } DefaultOwserver(); Server_detect(); if ( hexflag ) { char * hex_convert ; /* non-option arguments */ while (optind < argc - 1) { int size = 0; hex_convert = HexConvert(argv[optind + 1], &size) ; // never null (will exit if null) rc = ServerWrite(argv[optind], hex_convert, size); optind += 2; free(hex_convert ) ; } } else { /* non-option arguments */ while (optind < argc - 1) { rc = ServerWrite(argv[optind], argv[optind + 1], strlen(argv[optind + 1])); optind += 2; } } if (optind < argc) { PRINT_ERROR("Unpaired entry: %s\n", argv[optind]); rc = -EINVAL; } if ( rc >= 0 ) { errno = 0 ; Exit(0) ; } else { errno = -rc ; Exit(1) ; } return 0; // never reached } static int HexVal( char c ) { switch ( c ) { case '0': return 0 ; case '1': return 1 ; case '2': return 2 ; case '3': return 3 ; case '4': return 4 ; case '5': return 5 ; case '6': return 6 ; case '7': return 7 ; case '8': return 8 ; case '9': return 9 ; case 'A': case 'a': return 10 ; case 'B': case 'b': return 11 ; case 'C': case 'c': return 12 ; case 'D': case 'd': return 13 ; case 'E': case 'e': return 14 ; case 'F': case 'f': return 15 ; default: PRINT_ERROR("Unrecognized hex character %c\n",c) ; Exit(1) ; } return -1 ; // never gets here } // allocates a string -- must be freed by caller static char * HexConvert( char * input_string, int *out_size ) { int length = strlen( input_string ) ; int pad_first = ( (length/2)*2 != length ) ; // odd char * return_string = malloc( length+1 ) ; // make same size (intentionally large) int hex_pointer = 0 ; // pointer into input_string int char_pointer = 0 ; // pointer into return_string if ( return_string == NULL ) { PRINT_ERROR("Out of memory.\n") ; errno = ENOMEM ; Exit(1) ; return 0; // Silence static analyzer } memset( return_string, 0, length+1 ) ; if ( pad_first ) { // odd number of chars return_string[0] = HexVal(input_string[0]) ; ++char_pointer ; ++hex_pointer ; } *out_size = 0; while ( hex_pointer < length ) { return_string[char_pointer] = HexVal(input_string[hex_pointer]) * 16 + HexVal(input_string[hex_pointer+1]) ; hex_pointer += 2 ; ++char_pointer ; (*out_size)++; } return_string[ char_pointer] = '\0' ; // trailing null return return_string ; //freed in calling function } owfs-3.1p5/module/owshell/src/include/0000755000175000001440000000000013022537101014743 500000000000000owfs-3.1p5/module/owshell/src/include/Makefile.am0000644000175000001440000000003512654730021016723 00000000000000 noinst_HEADERS = owshell.h owfs-3.1p5/module/owshell/src/include/owshell.h0000644000175000001440000002064312665167763016547 00000000000000/* $Id$ Written 2006 Paul H Alfille MIT license */ #ifndef OWSHELL_H /* tedious wrapper */ #define OWSHELL_H #include "config.h" #include "owfs_config.h" // Define this to avoid some VALGRIND warnings... (just for testing) // Warning: This will partially remove the multithreaded support since ow_net.c // will wait for a thread to complete before executing a new one. //#define VALGRIND 1 #ifdef __CYGWIN__ #define __BSD_VISIBLE 1 /* for strep and u_int */ #include /* for anything select on newer cygwin */ #endif /* __CYGWIN__ */ #define _FILE_OFFSET_BITS 64 #ifdef HAVE_FEATURES_H #include #endif #ifdef HAVE_FEATURE_TESTS_H #include #endif #ifdef HAVE_SYS_STAT_H #include /* for stat */ #endif #ifdef HAVE_SYS_TYPES_H #include /* for stat */ #endif #include /* for times */ #include #include #include #include #include #include #include #ifdef HAVE_STDINT_H #include /* for bit twiddling */ #if OW_CYGWIN #define _MSL_STDINT_H #endif #endif #include #ifdef HAVE_GETOPT_H #ifdef __GNU_LIBRARY__ #include #else /* __GNU_LIBRARY__ */ #define __GNU_LIBRARY__ #include #undef __GNU_LIBRARY__ #endif /* __GNU_LIBRARY__ */ #endif /* HAVE_GETOPT_H */ #include #ifndef __USE_XOPEN #define __USE_XOPEN /* for strptime fuction */ #include #undef __USE_XOPEN /* for strptime fuction */ #else #include #endif #include #include #include #include #include /* for gettimeofday */ #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #include /* addrinfo */ /* Can't include search.h when compiling owperl on Fedora Core 1. */ #ifndef SKIP_SEARCH_H #ifndef __USE_GNU #define __USE_GNU #include #undef __USE_GNU #else /* __USE_GNU */ #include #endif /* __USE_GNU */ #endif /* SKIP_SEARCH_H */ #if OW_ZERO /* Zeroconf / Bonjour */ #include "ow_dl.h" #include "ow_dnssd.h" #endif /* Include some compatibility functions */ #include "compat.h" /* Debugging and error messages separated out for readability */ #include "ow_debug.h" /* Floating point */ /* I hate to do this, making everything a double */ /* The compiler complains mercilessly, however */ /* 1-wire really is low precision -- float is more than enough */ typedef double _FLOAT; typedef time_t _DATE; typedef unsigned char BYTE; typedef char ASCII; typedef unsigned int UINT; typedef int INT; /* OW -- One Wire Globals variables -- each invokation will have it's own data */ /* command line options */ /* These are the owlib-specific options */ #define OWLIB_OPT "m:c:f:p:s:hqu::d:t:CFRKVP:" extern const struct option owopts_long[]; void owopt(const int c, const char *arg); /* Several different structures: device -- one for each type of 1-wire device filetype -- one for each type of file parsedname -- translates a path into usable form */ /* --------------------------------------------------------- */ /* Filetypes -- directory entries for each 1-wire chip found */ /* Filetype is the most elaborate of the internal structures, though simple in concept. Actually a little misnamed. Each filetype corresponds to a device property, and to a file in the file system (though there are Filetype entries for some directory elements too) Filetypes belong to a particular device. (i.e. each device has it's list of filetypes) and have a name and pointers to processing functions. Filetypes also have a data format (integer, ascii,...) and a data length, and an indication of whether the property is static, changes only on command, or is volatile. Some properties occur are arrays (pages of memory, logs of temperature values). The "aggregate" structure holds to allowable size, and the method of access. -- Aggregate properties are either accessed all at once, then split, or accessed individually. The choice depends on the device hardware. There is even a further wrinkle: mixed. In cases where the handling can be either, mixed causes separate handling of individual items are querried, and combined if ALL are requested. This is useful for the DS2450 quad A/D where volt and PIO functions step on each other, but the conversion time for individual is rather costly. */ /* predeclare connection_in/out */ struct connection_in; /* Exposed connection info */ extern int count_inbound_connections; // Default owserver port (assigned by the IANA) #define OWSERVER_DEFAULT_PORT "4304" /* Maximum length of a file or directory name, and extension */ #define OW_NAME_MAX (32) #define OW_EXT_MAX (6) #define OW_FULLNAME_MAX (OW_NAME_MAX+OW_EXT_MAX) #define OW_DEFAULT_LENGTH (128) /* Unique token for owserver loop checks */ struct antiloop { BYTE uuid[16]; }; /* Globals information (for local control) */ struct global { int announce_off; // use zeroconf? struct antiloop Token; int readonly; int autoserver; int quiet ; int trim ; /* Special parameter to trigger William Robison timings */ int timeout_network ; }; extern struct global Globals; /* device display format */ enum deviceformat { fdi, fi, fdidc, fdic, fidc, fic }; /* Gobal temperature scale */ enum temp_type { temp_celsius, temp_fahrenheit, temp_kelvin, temp_rankine, }; /* Global pressure scale up tp 8 */ enum pressure_type { pressure_mbar, pressure_atm, pressure_mmhg, pressure_inhg, pressure_psi, pressure_Pa, pressure_end_mark }; /* Server (Socket-based) interface */ enum msg_classification { msg_error, msg_nop, msg_read, msg_write, msg_dir, msg_size, // No longer used, leave here to compatibility msg_presence, msg_dirall, msg_get, msg_dirallslash, msg_getslash, }; /* message to owserver */ struct server_msg { int32_t version; int32_t payload; int32_t type; int32_t sg; int32_t size; int32_t offset; }; /* message to client */ struct client_msg { int32_t version; int32_t payload; int32_t ret; int32_t sg; int32_t size; int32_t offset; }; struct serverpackage { ASCII *path; BYTE *data; size_t datasize; BYTE *tokenstring; size_t tokens; }; #define Servermessage (((int32_t)1)<<16) #define isServermessage( version ) (((version)&Servermessage)!=0) #define Servertokens(version) ((version)&0xFFFF) /* large enough for arrays of 2048 elements of ~49 bytes each */ #define MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE 100050 /* -------------------------------------------- */ extern int hexflag ; // read/write in hex mode? extern int slashflag ; // directory with '/'? extern int size_of_data ; extern int offset_into_data ; extern int uncached ; extern int unaliased ; extern int trim ; extern enum temp_type temperature_scale ; extern enum pressure_type pressure_scale ; extern enum deviceformat device_format ; ssize_t tcp_read(int file_descriptor, void *vptr, size_t n, const struct timeval *ptv); int ClientAddr(char *sname); int ClientConnect(void); void DefaultOwserver(void); void ARG_Net(const char *arg); void Setup(void); void ow_help(void); void OW_Browse(void); void Server_detect(void); int ServerRead(ASCII * path); int ServerWrite(ASCII * path, ASCII * data, int size); int ServerDir(ASCII * path); int ServerDirall(ASCII * path); int ServerPresence(ASCII * path); #define SHOULD_RETURN_BUS_LIST ( (UINT) 0x00000002 ) #define ALIAS_REQUEST ( (UINT) 0x00000008 ) #define TEMPSCALE_MASK ( (UINT) 0x00FF0000 ) #define TEMPSCALE_BIT 16 #define PRESSURESCALE_BIT 18 #define DEVFORMAT_MASK ( (UINT) 0xFF000000 ) #define DEVFORMAT_BIT 24 #define UNCACHED ( (UINT) 0x00000020 ) #define TRIM ( (UINT) 0x00000040 ) #define OWNET ( (UINT) 0x00000100 ) #define PRINT_ERROR(...) while ( ! Globals.quiet ) { fprintf( stderr, __VA_ARGS__ ) ; break ; } #define PERROR(...) while ( ! Globals.quiet ) { perror( __VA_ARGS__ ) ; break ; } struct connection_in; struct device_search { int LastDiscrepancy; // for search int LastDevice; // for search BYTE sn[8]; BYTE search; }; struct connection_in { char *name; int file_descriptor; char *host; char *service; struct addrinfo *ai; struct addrinfo *ai_ok; }; extern struct connection_in s_owserver_connection; extern struct connection_in *owserver_connection; void Exit(int exit_code); #endif /* OWSHELL_H */ owfs-3.1p5/module/owshell/src/include/Makefile.in0000644000175000001440000004461513022537053016750 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owshell/src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 HEADERS = $(noinst_HEADERS) 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)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = owshell.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) --foreign module/owshell/src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owshell/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(HEADERS) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am 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-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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool 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-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags 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: owfs-3.1p5/module/owlib/0000755000175000001440000000000013022537103012172 500000000000000owfs-3.1p5/module/owlib/Makefile.am0000644000175000001440000000002512711737666014167 00000000000000SUBDIRS = src tests owfs-3.1p5/module/owlib/Makefile.in0000644000175000001440000005500713022537052014171 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owlib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src tests 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) --foreign module/owlib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owlib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owlib/src/0000755000175000001440000000000013022537103012761 500000000000000owfs-3.1p5/module/owlib/src/Makefile.am0000644000175000001440000000002512654730021014736 00000000000000SUBDIRS = c include owfs-3.1p5/module/owlib/src/Makefile.in0000644000175000001440000005502313022537052014756 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owlib/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = c include 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) --foreign module/owlib/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owlib/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owlib/src/c/0000755000175000001440000000000013022537103013203 500000000000000owfs-3.1p5/module/owlib/src/c/Makefile.am0000644000175000001440000002163012672234566015202 00000000000000OWLIB_SOURCE = ow_dl.c \ ow_dnssd.c \ ow_arg.c \ ow_baud.c \ ow_bitfield.c \ ow_byte.c \ compat.c \ getaddrinfo.c \ getline.c \ timegm.c \ getopt.c \ jsmn.c \ ow_none.c \ ow_1820.c \ ow_1821.c \ ow_1921.c \ ow_1923.c \ ow_1954.c \ ow_1963.c \ ow_1977.c \ ow_1991.c \ ow_1993.c \ ow_2401.c \ ow_2404.c \ ow_2405.c \ ow_2406.c \ ow_2408.c \ ow_2409.c \ ow_2413.c \ ow_2415.c \ ow_2423.c \ ow_2430.c \ ow_2433.c \ ow_2436.c \ ow_2438.c \ ow_2450.c \ ow_2502.c \ ow_2505.c \ ow_2760.c \ ow_2804.c \ ow_2890.c \ ow_add_inflight.c \ ow_alias.c \ ow_alloc.c \ ow_api.c \ ow_avahi_announce.c\ ow_avahi_browse.c \ ow_badadapter.c \ ow_bae.c \ ow_browse.c \ ow_browse_resolve.c\ ow_browse_monitor.c\ ow_bus.c \ ow_bus_bitdata.c \ ow_bus_config.c \ ow_bus_data.c \ ow_buslock.c \ ow_cache.c \ ow_charblob.c \ ow_com.c \ ow_com_change.c \ ow_com_close.c \ ow_com_free.c \ ow_com_open.c \ ow_com_write.c \ ow_com_read.c \ ow_connect.c \ ow_connect_out.c \ ow_cmciel.c \ ow_crc.c \ ow_daemon.c \ ow_date.c \ ow_delay.c \ ow_del_inflight.c \ ow_detail.c \ ow_devicelock.c \ ow_dir.c \ ow_dirblob.c \ ow_ds2482.c \ ow_ds9097.c \ ow_ds1410.c \ ow_ds1wm.c \ ow_ds9097U.c \ ow_ds9490.c \ ow_eds.c \ ow_eeef.c \ ow_elabnet.c \ ow_enet_discover.c \ ow_enet_monitor.c \ ow_eprom_write.c \ ow_etherweather.c \ ow_example_slave.c \ ow_exec.c \ ow_exit.c \ ow_external.c \ ow_find_external.c \ ow_fs_address.c \ ow_fs_alias.c \ ow_fs_code.c \ ow_fs_crc8.c \ ow_fs_id.c \ ow_fs_type.c \ ow_getbit.c \ ow_getbit_U.c \ ow_ha5.c \ ow_ha7.c \ ow_ha7e.c \ ow_fake.c \ ow_fakeread.c \ ow_filelength.c \ ow_fstat.c \ ow_ftdi.c \ ow_generic_read.c \ ow_get.c \ ow_help.c \ ow_inotify.c \ ow_interface.c \ ow_iterate.c \ ow_launchd.c \ ow_k1wm.c \ ow_kevent.c \ ow_lcd.c \ ow_lib_close.c \ ow_lib_setup.c \ ow_lib_stop.c \ ow_link.c \ ow_locator.c \ ow_locks.c \ ow_masterhub.c \ ow_memblob.c \ ow_memory.c \ ow_multicast.c \ ow_name.c \ ow_net_client.c \ ow_net_server.c \ ow_offset.c \ ow_opt.c \ ow_parse_address.c \ ow_parse_external.c\ ow_parseinput.c \ ow_parsename.c \ ow_parseobject.c \ ow_parseoutput.c \ ow_parseshallow.c \ ow_parse_sn.c \ ow_pid.c \ ow_powerbyte.c \ ow_powerbit.c \ ow_presence.c \ ow_pressure.c \ ow_printparse.c \ ow_programpulse.c \ ow_read.c \ ow_read_external.c \ ow_read_telnet.c \ ow_reconnect.c \ ow_regex.c \ ow_remote_alias.c \ ow_reset.c \ ow_return_code.c \ ow_rwlock.c \ ow_stats.c \ ow_search.c \ ow_serial_free.c \ ow_serial_open.c \ ow_server.c \ ow_server_message.c\ ow_server_enet.c \ ow_select.c \ ow_set_telnet.c \ ow_settings.c \ ow_sibling.c \ ow_sibling_binary.c\ ow_sibling_float.c \ ow_sibling_uint.c \ ow_sibling_yesno.c \ ow_sig_handlers.c \ ow_simultaneous.c \ ow_slurp.c \ ow_stateinfo.c \ ow_system.c \ ow_systemd.c \ ow_tcp_free.c \ ow_tcp_open.c \ ow_tcp_read.c \ ow_telnet_write.c \ ow_temp.c \ ow_testerread.c \ ow_thermocouple.c \ ow_traffic.c \ ow_transaction.c \ ow_tree.c \ ow_udp_read.c \ ow_usb_msg.c \ ow_usb_cycle.c \ ow_usb_monitor.c \ ow_util.c \ ow_verify.c \ ow_visibility.c \ ow_w1.c \ ow_w1_addremove.c \ ow_w1_bind.c \ ow_w1_browse.c \ ow_w1_dispatch.c \ ow_w1_list.c \ ow_w1_monitor.c \ ow_w1_parse.c \ ow_w1_print.c \ ow_w1_scan.c \ ow_w1_select.c \ ow_w1_send.c \ ow_write.c \ ow_write_external.c\ ow_zero.c \ owlib.c \ error.c \ sd-daemon.c \ globals.c lib_LTLIBRARIES = libow.la libow_la_SOURCES = ${OWLIB_SOURCE} if HAVE_CYGWIN libow_la_LDFLAGS = ${PTHREAD_LIBS} -shared -no-undefined ${LIBUSB_LIBS} ${LIBAVAHI_LIBS} ${LD_EXTRALIBS} ${MQ_LIBS} else libow_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) ${PTHREAD_LIBS} -shared -shrext .so ${LIBUSB_LIBS} ${LIBFTDI_LIBS} ${LIBAVAHI_LIBS} ${LD_EXTRALIBS} ${M_LIBS} ${DL_LIBS} ${MQ_LIBS} endif # Maybe need this for MacOS X #if HAVE_DARWIN #LDADDS = -framework IOKit -framework CoreFoundation #endif #libow_la_LDFLAGS = -shared -shrext .so \ # -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ # -release $(LT_RELEASE) \ # -export-dynamic \ # $(LDADDS) AM_CFLAGS = -I../include \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ -D__EXTENSIONS__ \ ${EXTRACFLAGS} \ ${PTHREAD_CFLAGS} \ ${LIBUSB_CFLAGS} \ ${LIBFTDI_CFLAGS} \ ${PIC_FLAGS} #if HAVE_CYGWIN #NOWINE=1 #else #DOS_OWFSROOT:=$(OWFSROOT) #LINT_DIR:=$(DOS_OWFSROOT)/src/tools/lint #LINT_CC:=wine $(LINT_DIR)/lint-nt.exe #endif #SRC:=$(OWLIB_SOURCE) #include $(abs_top_srcdir)/src/tools/lint/lint.mk # #clean-generic: # @RM@ -f *~ .*~ *.lint *.lint.txt .#* *.bak owfs-3.1p5/module/owlib/src/c/Makefile.in0000644000175000001440000015020113022537052015172 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owlib/src/c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libow_la_LIBADD = am__objects_1 = ow_dl.lo ow_dnssd.lo ow_arg.lo ow_baud.lo \ ow_bitfield.lo ow_byte.lo compat.lo getaddrinfo.lo getline.lo \ timegm.lo getopt.lo jsmn.lo ow_none.lo ow_1820.lo ow_1821.lo \ ow_1921.lo ow_1923.lo ow_1954.lo ow_1963.lo ow_1977.lo \ ow_1991.lo ow_1993.lo ow_2401.lo ow_2404.lo ow_2405.lo \ ow_2406.lo ow_2408.lo ow_2409.lo ow_2413.lo ow_2415.lo \ ow_2423.lo ow_2430.lo ow_2433.lo ow_2436.lo ow_2438.lo \ ow_2450.lo ow_2502.lo ow_2505.lo ow_2760.lo ow_2804.lo \ ow_2890.lo ow_add_inflight.lo ow_alias.lo ow_alloc.lo \ ow_api.lo ow_avahi_announce.lo ow_avahi_browse.lo \ ow_badadapter.lo ow_bae.lo ow_browse.lo ow_browse_resolve.lo \ ow_browse_monitor.lo ow_bus.lo ow_bus_bitdata.lo \ ow_bus_config.lo ow_bus_data.lo ow_buslock.lo ow_cache.lo \ ow_charblob.lo ow_com.lo ow_com_change.lo ow_com_close.lo \ ow_com_free.lo ow_com_open.lo ow_com_write.lo ow_com_read.lo \ ow_connect.lo ow_connect_out.lo ow_cmciel.lo ow_crc.lo \ ow_daemon.lo ow_date.lo ow_delay.lo ow_del_inflight.lo \ ow_detail.lo ow_devicelock.lo ow_dir.lo ow_dirblob.lo \ ow_ds2482.lo ow_ds9097.lo ow_ds1410.lo ow_ds1wm.lo \ ow_ds9097U.lo ow_ds9490.lo ow_eds.lo ow_eeef.lo ow_elabnet.lo \ ow_enet_discover.lo ow_enet_monitor.lo ow_eprom_write.lo \ ow_etherweather.lo ow_example_slave.lo ow_exec.lo ow_exit.lo \ ow_external.lo ow_find_external.lo ow_fs_address.lo \ ow_fs_alias.lo ow_fs_code.lo ow_fs_crc8.lo ow_fs_id.lo \ ow_fs_type.lo ow_getbit.lo ow_getbit_U.lo ow_ha5.lo ow_ha7.lo \ ow_ha7e.lo ow_fake.lo ow_fakeread.lo ow_filelength.lo \ ow_fstat.lo ow_ftdi.lo ow_generic_read.lo ow_get.lo ow_help.lo \ ow_inotify.lo ow_interface.lo ow_iterate.lo ow_launchd.lo \ ow_k1wm.lo ow_kevent.lo ow_lcd.lo ow_lib_close.lo \ ow_lib_setup.lo ow_lib_stop.lo ow_link.lo ow_locator.lo \ ow_locks.lo ow_masterhub.lo ow_memblob.lo ow_memory.lo \ ow_multicast.lo ow_name.lo ow_net_client.lo ow_net_server.lo \ ow_offset.lo ow_opt.lo ow_parse_address.lo \ ow_parse_external.lo ow_parseinput.lo ow_parsename.lo \ ow_parseobject.lo ow_parseoutput.lo ow_parseshallow.lo \ ow_parse_sn.lo ow_pid.lo ow_powerbyte.lo ow_powerbit.lo \ ow_presence.lo ow_pressure.lo ow_printparse.lo \ ow_programpulse.lo ow_read.lo ow_read_external.lo \ ow_read_telnet.lo ow_reconnect.lo ow_regex.lo \ ow_remote_alias.lo ow_reset.lo ow_return_code.lo ow_rwlock.lo \ ow_stats.lo ow_search.lo ow_serial_free.lo ow_serial_open.lo \ ow_server.lo ow_server_message.lo ow_server_enet.lo \ ow_select.lo ow_set_telnet.lo ow_settings.lo ow_sibling.lo \ ow_sibling_binary.lo ow_sibling_float.lo ow_sibling_uint.lo \ ow_sibling_yesno.lo ow_sig_handlers.lo ow_simultaneous.lo \ ow_slurp.lo ow_stateinfo.lo ow_system.lo ow_systemd.lo \ ow_tcp_free.lo ow_tcp_open.lo ow_tcp_read.lo \ ow_telnet_write.lo ow_temp.lo ow_testerread.lo \ ow_thermocouple.lo ow_traffic.lo ow_transaction.lo ow_tree.lo \ ow_udp_read.lo ow_usb_msg.lo ow_usb_cycle.lo ow_usb_monitor.lo \ ow_util.lo ow_verify.lo ow_visibility.lo ow_w1.lo \ ow_w1_addremove.lo ow_w1_bind.lo ow_w1_browse.lo \ ow_w1_dispatch.lo ow_w1_list.lo ow_w1_monitor.lo \ ow_w1_parse.lo ow_w1_print.lo ow_w1_scan.lo ow_w1_select.lo \ ow_w1_send.lo ow_write.lo ow_write_external.lo ow_zero.lo \ owlib.lo error.lo sd-daemon.lo globals.lo am_libow_la_OBJECTS = $(am__objects_1) libow_la_OBJECTS = $(am_libow_la_OBJECTS) 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 = libow_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libow_la_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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libow_la_SOURCES) DIST_SOURCES = $(libow_la_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)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ OWLIB_SOURCE = ow_dl.c \ ow_dnssd.c \ ow_arg.c \ ow_baud.c \ ow_bitfield.c \ ow_byte.c \ compat.c \ getaddrinfo.c \ getline.c \ timegm.c \ getopt.c \ jsmn.c \ ow_none.c \ ow_1820.c \ ow_1821.c \ ow_1921.c \ ow_1923.c \ ow_1954.c \ ow_1963.c \ ow_1977.c \ ow_1991.c \ ow_1993.c \ ow_2401.c \ ow_2404.c \ ow_2405.c \ ow_2406.c \ ow_2408.c \ ow_2409.c \ ow_2413.c \ ow_2415.c \ ow_2423.c \ ow_2430.c \ ow_2433.c \ ow_2436.c \ ow_2438.c \ ow_2450.c \ ow_2502.c \ ow_2505.c \ ow_2760.c \ ow_2804.c \ ow_2890.c \ ow_add_inflight.c \ ow_alias.c \ ow_alloc.c \ ow_api.c \ ow_avahi_announce.c\ ow_avahi_browse.c \ ow_badadapter.c \ ow_bae.c \ ow_browse.c \ ow_browse_resolve.c\ ow_browse_monitor.c\ ow_bus.c \ ow_bus_bitdata.c \ ow_bus_config.c \ ow_bus_data.c \ ow_buslock.c \ ow_cache.c \ ow_charblob.c \ ow_com.c \ ow_com_change.c \ ow_com_close.c \ ow_com_free.c \ ow_com_open.c \ ow_com_write.c \ ow_com_read.c \ ow_connect.c \ ow_connect_out.c \ ow_cmciel.c \ ow_crc.c \ ow_daemon.c \ ow_date.c \ ow_delay.c \ ow_del_inflight.c \ ow_detail.c \ ow_devicelock.c \ ow_dir.c \ ow_dirblob.c \ ow_ds2482.c \ ow_ds9097.c \ ow_ds1410.c \ ow_ds1wm.c \ ow_ds9097U.c \ ow_ds9490.c \ ow_eds.c \ ow_eeef.c \ ow_elabnet.c \ ow_enet_discover.c \ ow_enet_monitor.c \ ow_eprom_write.c \ ow_etherweather.c \ ow_example_slave.c \ ow_exec.c \ ow_exit.c \ ow_external.c \ ow_find_external.c \ ow_fs_address.c \ ow_fs_alias.c \ ow_fs_code.c \ ow_fs_crc8.c \ ow_fs_id.c \ ow_fs_type.c \ ow_getbit.c \ ow_getbit_U.c \ ow_ha5.c \ ow_ha7.c \ ow_ha7e.c \ ow_fake.c \ ow_fakeread.c \ ow_filelength.c \ ow_fstat.c \ ow_ftdi.c \ ow_generic_read.c \ ow_get.c \ ow_help.c \ ow_inotify.c \ ow_interface.c \ ow_iterate.c \ ow_launchd.c \ ow_k1wm.c \ ow_kevent.c \ ow_lcd.c \ ow_lib_close.c \ ow_lib_setup.c \ ow_lib_stop.c \ ow_link.c \ ow_locator.c \ ow_locks.c \ ow_masterhub.c \ ow_memblob.c \ ow_memory.c \ ow_multicast.c \ ow_name.c \ ow_net_client.c \ ow_net_server.c \ ow_offset.c \ ow_opt.c \ ow_parse_address.c \ ow_parse_external.c\ ow_parseinput.c \ ow_parsename.c \ ow_parseobject.c \ ow_parseoutput.c \ ow_parseshallow.c \ ow_parse_sn.c \ ow_pid.c \ ow_powerbyte.c \ ow_powerbit.c \ ow_presence.c \ ow_pressure.c \ ow_printparse.c \ ow_programpulse.c \ ow_read.c \ ow_read_external.c \ ow_read_telnet.c \ ow_reconnect.c \ ow_regex.c \ ow_remote_alias.c \ ow_reset.c \ ow_return_code.c \ ow_rwlock.c \ ow_stats.c \ ow_search.c \ ow_serial_free.c \ ow_serial_open.c \ ow_server.c \ ow_server_message.c\ ow_server_enet.c \ ow_select.c \ ow_set_telnet.c \ ow_settings.c \ ow_sibling.c \ ow_sibling_binary.c\ ow_sibling_float.c \ ow_sibling_uint.c \ ow_sibling_yesno.c \ ow_sig_handlers.c \ ow_simultaneous.c \ ow_slurp.c \ ow_stateinfo.c \ ow_system.c \ ow_systemd.c \ ow_tcp_free.c \ ow_tcp_open.c \ ow_tcp_read.c \ ow_telnet_write.c \ ow_temp.c \ ow_testerread.c \ ow_thermocouple.c \ ow_traffic.c \ ow_transaction.c \ ow_tree.c \ ow_udp_read.c \ ow_usb_msg.c \ ow_usb_cycle.c \ ow_usb_monitor.c \ ow_util.c \ ow_verify.c \ ow_visibility.c \ ow_w1.c \ ow_w1_addremove.c \ ow_w1_bind.c \ ow_w1_browse.c \ ow_w1_dispatch.c \ ow_w1_list.c \ ow_w1_monitor.c \ ow_w1_parse.c \ ow_w1_print.c \ ow_w1_scan.c \ ow_w1_select.c \ ow_w1_send.c \ ow_write.c \ ow_write_external.c\ ow_zero.c \ owlib.c \ error.c \ sd-daemon.c \ globals.c lib_LTLIBRARIES = libow.la libow_la_SOURCES = ${OWLIB_SOURCE} @HAVE_CYGWIN_FALSE@libow_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) ${PTHREAD_LIBS} -shared -shrext .so ${LIBUSB_LIBS} ${LIBFTDI_LIBS} ${LIBAVAHI_LIBS} ${LD_EXTRALIBS} ${M_LIBS} ${DL_LIBS} ${MQ_LIBS} @HAVE_CYGWIN_TRUE@libow_la_LDFLAGS = ${PTHREAD_LIBS} -shared -no-undefined ${LIBUSB_LIBS} ${LIBAVAHI_LIBS} ${LD_EXTRALIBS} ${MQ_LIBS} # Maybe need this for MacOS X #if HAVE_DARWIN #LDADDS = -framework IOKit -framework CoreFoundation #endif #libow_la_LDFLAGS = -shared -shrext .so \ # -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ # -release $(LT_RELEASE) \ # -export-dynamic \ # $(LDADDS) AM_CFLAGS = -I../include \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ -D__EXTENSIONS__ \ ${EXTRACFLAGS} \ ${PTHREAD_CFLAGS} \ ${LIBUSB_CFLAGS} \ ${LIBFTDI_CFLAGS} \ ${PIC_FLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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) --foreign module/owlib/src/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owlib/src/c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libow.la: $(libow_la_OBJECTS) $(libow_la_DEPENDENCIES) $(EXTRA_libow_la_DEPENDENCIES) $(AM_V_CCLD)$(libow_la_LINK) -rpath $(libdir) $(libow_la_OBJECTS) $(libow_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getaddrinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsmn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_1820.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_1821.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_1921.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_1923.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_1954.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_1963.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_1977.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_1991.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_1993.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2401.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2404.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2405.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2406.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2408.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2409.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2413.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2415.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2423.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2430.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2433.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2436.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2438.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2450.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2502.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2505.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2760.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2804.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_2890.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_add_inflight.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_alias.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_arg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_avahi_announce.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_avahi_browse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_badadapter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_bae.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_baud.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_bitfield.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_browse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_browse_monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_browse_resolve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_bus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_bus_bitdata.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_bus_config.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_bus_data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_buslock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_byte.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_cache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_charblob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_cmciel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_com.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_com_change.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_com_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_com_free.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_com_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_com_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_com_write.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_connect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_connect_out.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_crc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_daemon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_date.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_del_inflight.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_delay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_detail.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_devicelock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_dir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_dirblob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_dl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_dnssd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ds1410.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ds1wm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ds2482.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ds9097.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ds9097U.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ds9490.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_eds.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_eeef.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_elabnet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_enet_discover.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_enet_monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_eprom_write.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_etherweather.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_example_slave.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_exec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_exit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_external.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_fake.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_fakeread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_filelength.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_find_external.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_fs_address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_fs_alias.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_fs_code.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_fs_crc8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_fs_id.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_fs_type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_fstat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ftdi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_generic_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_get.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_getbit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_getbit_U.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ha5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ha7.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_ha7e.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_help.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_inotify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_iterate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_k1wm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_kevent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_launchd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_lcd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_lib_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_lib_setup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_lib_stop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_link.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_locator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_locks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_masterhub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_memblob.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_memory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_multicast.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_name.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_net_client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_net_server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_none.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_offset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_opt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_parse_address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_parse_external.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_parse_sn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_parseinput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_parsename.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_parseobject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_parseoutput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_parseshallow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_pid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_powerbit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_powerbyte.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_presence.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_pressure.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_printparse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_programpulse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_read_external.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_read_telnet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_reconnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_regex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_remote_alias.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_reset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_return_code.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_rwlock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_search.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_select.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_serial_free.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_serial_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_server_enet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_server_message.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_set_telnet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_settings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_sibling.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_sibling_binary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_sibling_float.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_sibling_uint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_sibling_yesno.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_sig_handlers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_simultaneous.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_slurp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_stateinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_stats.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_system.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_systemd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_tcp_free.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_tcp_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_tcp_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_telnet_write.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_temp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_testerread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_thermocouple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_traffic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_transaction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_udp_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_usb_cycle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_usb_monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_usb_msg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_verify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_visibility.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_addremove.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_bind.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_browse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_dispatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_print.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_scan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_select.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_w1_send.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_write.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_write_external.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ow_zero.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owlib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sd-daemon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timegm.Plo@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool 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-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile #if HAVE_CYGWIN #NOWINE=1 #else #DOS_OWFSROOT:=$(OWFSROOT) #LINT_DIR:=$(DOS_OWFSROOT)/src/tools/lint #LINT_CC:=wine $(LINT_DIR)/lint-nt.exe #endif #SRC:=$(OWLIB_SOURCE) #include $(abs_top_srcdir)/src/tools/lint/lint.mk # #clean-generic: # @RM@ -f *~ .*~ *.lint *.lint.txt .#* *.bak # 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: owfs-3.1p5/module/owlib/src/c/ow_dl.c0000644000175000001440000000174712654730021014410 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_dl.h" #if OW_ZERO DLHANDLE DL_open(const char *pathname) { #if OW_CYGWIN return LoadLibrary(pathname); #elif defined(HAVE_DLOPEN) return dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL ); #endif } void *DL_sym(DLHANDLE handle, const char *name) { #if OW_CYGWIN return (void *) GetProcAddress(handle, name); #elif defined(HAVE_DLOPEN) return dlsym(handle, name); #endif } int DL_close(DLHANDLE handle) { #if OW_CYGWIN if (FreeLibrary(handle)) { return 0; } return -1; #elif defined(HAVE_DLOPEN) return dlclose(handle); #endif } char *DL_error(void) { #if OW_CYGWIN return "Error in WIN32 DL"; #elif defined(HAVE_DLOPEN) return dlerror(); #endif } #endif owfs-3.1p5/module/owlib/src/c/ow_dnssd.c0000644000175000001440000000457012654730021015121 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2006 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #if OW_ZERO #include "ow.h" #include "ow_dl.h" #include "ow_dnssd.h" DLHANDLE libdnssd = NULL; #if OW_CYGWIN #ifdef HAVE_DLFCN_H #include #endif /* HAVE_DLFCN_H */ #endif /* OW_CYGWIN */ _DNSServiceRefSockFD DNSServiceRefSockFD; _DNSServiceProcessResult DNSServiceProcessResult; _DNSServiceRefDeallocate DNSServiceRefDeallocate; _DNSServiceResolve DNSServiceResolve; _DNSServiceBrowse DNSServiceBrowse; _DNSServiceRegister DNSServiceRegister; _DNSServiceReconfirmRecord DNSServiceReconfirmRecord; _DNSServiceCreateConnection DNSServiceCreateConnection; _DNSServiceEnumerateDomains DNSServiceEnumerateDomains; #define DNSfunction_link( name ) name = (_##name) DL_sym( libdnssd, #name );\ if ( name == NULL ) {\ LEVEL_CONNECT("Zeroconf/Bonjour is disabled since "#name" isn't found");\ return -1;\ } else { \ LEVEL_DEBUG("Linked in Bonjour function "#name) ;\ } int OW_Load_dnssd_library(void) { int i ; libdnssd = NULL ; // marker for successful opening of library char libdirs[3][80] = { #if OW_CYGWIN //{ "/opt/owfs/lib/libdns_sd.dll" }, {"libdns_sd.dll"}, #elif OW_DARWIN // MacOSX have dnssd functions in libSystem {"libSystem.dylib"}, #elif defined(HAVE_DLOPEN) {"/opt/owfs/lib/libdns_sd.so"}, {"libdns_sd.so"}, #endif {""} // needed at end }; for ( i=0 ; *libdirs[i] ; ++i ) { libdnssd = DL_open( libdirs[i] ) ; if ( libdnssd != NULL ) { LEVEL_CONNECT( "DL_open [%s] success", libdirs[i] ); break ; } } if (libdnssd == NULL) { LEVEL_CONNECT("Zeroconf/Bonjour is disabled since dnssd library isn't found"); return -1; } DNSfunction_link(DNSServiceRefSockFD); DNSfunction_link(DNSServiceProcessResult); DNSfunction_link(DNSServiceRefDeallocate); DNSfunction_link(DNSServiceResolve); DNSfunction_link(DNSServiceBrowse); DNSfunction_link(DNSServiceRegister); DNSfunction_link(DNSServiceReconfirmRecord); DNSfunction_link(DNSServiceCreateConnection); DNSfunction_link(DNSServiceEnumerateDomains); return 0; } void OW_Free_dnssd_library(void) { if (libdnssd) { DL_close(libdnssd); libdnssd = NULL; } } #endif /* OW_ZERO */ owfs-3.1p5/module/owlib/src/c/ow_arg.c0000644000175000001440000003020312672234566014564 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ // regex /* ow_opt -- owlib specific command line options processing */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_usb_msg.h" // for DS9490_port_setup enum arg_address { arg_addr_device, arg_addr_null, arg_addr_ip, arg_addr_colon, arg_addr_number, arg_addr_ftdi, arg_addr_other, arg_addr_error, } ; static enum arg_address ArgType( const char * arg ) { static regex_t rx_dev ; static regex_t rx_num ; static regex_t rx_ip ; static regex_t rx_ftdi ; static regex_t rx_col ; // compile regex expressions ow_regcomp( &rx_dev, "/", REG_NOSUB ) ; ow_regcomp( &rx_num, "^[:digit:]+$", REG_NOSUB ) ; ow_regcomp( &rx_ip, "[:digit:]{1,3}\\.[:digit:]{1,3}\\.[:digit:]{1,3}\\.[:digit:]{1,3}", REG_NOSUB ) ; ow_regcomp( &rx_ftdi, "^ftdi:", REG_NOSUB ) ; ow_regcomp( &rx_col, ":", REG_NOSUB ) ; if ( arg == NULL ) { return arg_addr_null ; } else if ( ow_regexec( &rx_ip, arg, NULL ) == 0 ) { return arg_addr_ip ; } else if ( ow_regexec( &rx_ftdi, arg, NULL ) == 0 ) { return arg_addr_ftdi; } else if ( ow_regexec( &rx_col, arg, NULL ) == 0 ) { return arg_addr_colon ; } else if ( ow_regexec( &rx_dev, arg, NULL ) == 0 ) { return arg_addr_device ; } else if ( ow_regexec( &rx_num, arg, NULL ) == 0 ) { return arg_addr_number ; } return arg_addr_other ; } // Put initial port configuration in init_data and connection_in devicename static void arg_data( const char * arg, struct port_in * pin ) { if ( arg == NULL ) { DEVICENAME(pin->first) = NULL ; pin->init_data = NULL ; } else { DEVICENAME(pin->first) = owstrdup(arg) ; pin->init_data = owstrdup(arg) ; } } // Test whether address is a serial port, or a serial over telnet (ser2net) static GOOD_OR_BAD Serial_or_telnet( const char * arg, struct connection_in * in ) { switch( ArgType(arg) ) { case arg_addr_null: case arg_addr_error: LEVEL_DEFAULT("Error with device. Specify a serial port, or a serial-over-telnet network address"); return gbBAD ; case arg_addr_device: in->pown->type = ct_serial ; // serial port break ; case arg_addr_ftdi: #if OW_FTDI in->pown->type = ct_ftdi; break; #else LEVEL_DEFAULT("FTDI support not included in compilation. Use generic serial device."); return gbBAD; #endif case arg_addr_number: // port case arg_addr_colon: case arg_addr_ip: case arg_addr_other: in->pown->type = ct_telnet ; // network break ; } return gbGOOD; } GOOD_OR_BAD ARG_Device(const char *arg) { struct stat sbuf; if (stat(arg, &sbuf)) { switch( ArgType(arg) ) { case arg_addr_number: // port case arg_addr_colon: case arg_addr_ip: case arg_addr_ftdi: case arg_addr_other: return ARG_Serial(arg) ; default: LEVEL_DEFAULT("Cannot access device %s", arg); return gbBAD; } } if (!S_ISCHR(sbuf.st_mode)) { LEVEL_DEFAULT("Not a \"character\" device %s (st_mode=%x)", arg, sbuf.st_mode); return gbBAD; } if (major(sbuf.st_rdev) == 99) { return ARG_Parallel(arg); } if (major(sbuf.st_rdev) == 89) { return ARG_I2C(arg); } return ARG_Serial(arg); } GOOD_OR_BAD ARG_PBM(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_pbm ; // elabnet return Serial_or_telnet( arg, in ) ; } GOOD_OR_BAD ARG_EtherWeather(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data( arg, pin ) ; pin->busmode = bus_etherweather; return gbGOOD; } GOOD_OR_BAD ARG_External(const char *arg) { (void) arg ; if ( Inbound_Control.external == NULL ) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data("external",pin) ; pin->busmode = bus_external; Inbound_Control.external = in ; } return gbGOOD; } GOOD_OR_BAD ARG_Fake(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_fake; return gbGOOD; } GOOD_OR_BAD ARG_Generic(const char *arg) { if (arg && arg[0]) { switch (arg[0]) { case '/': return ARG_Device(arg); case 'u': case 'U': return ARG_USB(&arg[1]); default: return ARG_Net(arg); } } return gbBAD; } GOOD_OR_BAD ARG_HA5( const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } if ( arg == NULL ) { return gbBAD ; } arg_data(arg,pin) ; pin->busmode = bus_ha5; return Serial_or_telnet( arg, in ) ; } GOOD_OR_BAD ARG_HA7(const char *arg) { if (arg != NULL) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_ha7net; return gbGOOD; } else { // Try multicast discovery //printf("Find HA7\n"); return FS_FindHA7(); } } GOOD_OR_BAD ARG_HA7E(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_ha7e ; return Serial_or_telnet( arg, in ) ; } GOOD_OR_BAD ARG_DS1WM(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_ds1wm ; return gbGOOD ; } GOOD_OR_BAD ARG_K1WM(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_k1wm ; return gbGOOD ; } GOOD_OR_BAD ARG_ENET(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_enet ; return gbGOOD; } GOOD_OR_BAD ARG_I2C(const char *arg) { #if OW_I2C struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data( (arg!=NULL) ? arg : ":" , pin ) ; pin->busmode = bus_i2c; return gbGOOD; #else /* OW_I2C */ LEVEL_DEFAULT("I2C (smbus DS2482-X00) support (intentionally) not included in compilation. Reconfigure and recompile."); return gbBAD; #endif /* OW_I2C */ } GOOD_OR_BAD ARG_Link(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_link ; // link return Serial_or_telnet( arg, in ) ; } GOOD_OR_BAD ARG_MasterHub(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_masterhub ; // link return Serial_or_telnet( arg, in ) ; } GOOD_OR_BAD ARG_Mock(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_mock; return gbGOOD; } GOOD_OR_BAD ARG_W1_monitor(void) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data("W1 bus monitor",pin) ; pin->busmode = bus_w1_monitor; return gbGOOD; } GOOD_OR_BAD ARG_Browse(void) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data("ZeroConf monitor",pin) ; pin->busmode = bus_browse; return gbGOOD; } // This is to connect to owserver as a (remote) bus GOOD_OR_BAD ARG_Net(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_server; return gbGOOD; } GOOD_OR_BAD ARG_Parallel(const char *arg) { (void) arg ; #if OW_PARPORT struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_parallel; return gbGOOD; #else /* OW_PARPORT */ LEVEL_DEFAULT("Parallel port support (intentionally) not included in compilation. For DS1410E. That's ok, it doesn't work anyways."); return gbBAD; #endif /* OW_PARPORT */ } GOOD_OR_BAD ARG_Passive(char *adapter_type_name, const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; // special set name of adapter here in->adapter_name = adapter_type_name; pin->busmode = bus_passive ; // DS9097 return Serial_or_telnet( arg, in ) ; } GOOD_OR_BAD ARG_Serial(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_serial ; // DS2480B return Serial_or_telnet( arg, in ) ; } // This is owserver's listening port // and owfs's mountpoint GOOD_OR_BAD ARG_Server(const char *arg) { switch (Globals.daemon_status) { case e_daemon_sd: case e_daemon_sd_done: LEVEL_DEBUG("Systemd mode: Ignore %s",arg); break ; default: { struct connection_out *out = NewOut(); if (out == NULL) { return gbBAD; } out->name = (arg!=NULL) ? owstrdup(arg) : NULL; } break ; } return gbGOOD; } GOOD_OR_BAD ARG_Tester(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_tester; return gbGOOD; } // USB is a little more involved -- have to handle the "all" case and the specific number case GOOD_OR_BAD ARG_USB(const char *arg) { #if OW_USB if ( Globals.luc != NULL ) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } pin->busmode = bus_usb; DS9490_port_setup( NULL, pin ) ; // flag as not yet set up arg_data(arg,pin) ; return gbGOOD; } else { LEVEL_DEFAULT( "USB library initialization had problems -- can't proceed") ; return gbBAD ; } #else /* OW_USB */ (void) arg ; LEVEL_DEFAULT("USB support (intentionally) not included in compilation. Check LIBUSB, then reconfigure and recompile."); return gbBAD; #endif /* OW_USB */ } // Xport or telnet -- DS2480B over a remote serial server using telnet protocol. GOOD_OR_BAD ARG_Xport(const char *arg) { struct port_in * pin = NewPort( NULL ) ; struct connection_in * in ; if ( pin == NULL ) { return gbBAD; } in = pin->first ; if (in == NO_CONNECTION) { return gbBAD; } arg_data(arg,pin) ; pin->busmode = bus_xport; pin->type = ct_telnet ; // network return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_baud.c0000644000175000001440000000431112654730021014712 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_baud -- baud rate interpret and print */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" speed_t COM_MakeBaud( int raw_baud ) { switch ( raw_baud ) { case 12: case 1200: return B1200 ; case 24: case 2400: return B2400 ; case 48: case 4800: return B4800 ; case 96: case 9600: return B9600 ; case 19: case 19000: case 19200: return B19200 ; case 38: case 38000: case 38400: return B38400 ; case 56: case 57: case 56000: case 57000: case 57600: return B57600 ; case 115: case 115000: case 115200: return B115200 ; case 230: case 230000: case 230400: return B230400 ; default: return B9600 ; } } int COM_BaudRate( speed_t B_baud ) { switch ( B_baud ) { case B1200: return 1200 ; case B2400: return 2400 ; case B4800: return 4800 ; case B9600: return 9600 ; case B19200: return 19200 ; case B38400: return 38400 ; case B57600: return 57600 ; case B115200: return 115200 ; case B230400: return 230400 ; default: return 9600 ; } } // Find the best choice for baud rate among allowable choices. // Must end list with a 0 void COM_BaudRestrict( speed_t * B_baud, ... ) { va_list baud_list ; speed_t B_original = B_baud[0] ; int original_baudrate = COM_BaudRate( B_original ) ; speed_t B_best = B9600 ; int best_baudrate = COM_BaudRate( B_best ) ; speed_t B_current ; va_start( baud_list, B_baud ) ; while ( (B_current=va_arg( baud_list, speed_t)) ) { int current_baudrate = COM_BaudRate( B_current ) ; if ( current_baudrate == original_baudrate ) { // perfect match B_best = B_current ; break ; } else if ( current_baudrate > original_baudrate ) { // too fast continue ; } else if ( current_baudrate > best_baudrate ) { // better choice B_best = B_current ; best_baudrate = current_baudrate ; } } va_end( baud_list ) ; B_baud[0] = B_best ; } owfs-3.1p5/module/owlib/src/c/ow_bitfield.c0000644000175000001440000000502312654730021015562 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" // struct bitfield { "alias_link", number_of_bits, shift_left, } /* Bitfield * Change individual bits in a variable * the variable is the alias_link * the bitfield size is number_of_bits * and the position from the lowest is shift_left * */ ZERO_OR_ERROR FS_r_bitfield(struct one_wire_query *owq) { struct bitfield * bf = PN(owq)->selected_filetype->data.v ; UINT mask = ( 0x01 << bf->size ) - 1 ; UINT val ; RETURN_ERROR_IF_BAD( FS_r_sibling_U( &val, bf->link, owq ) ) ; OWQ_U(owq) = (val >> bf->shift ) & mask ; return 0 ; } ZERO_OR_ERROR FS_w_bitfield(struct one_wire_query *owq) { struct bitfield * bf = PN(owq)->selected_filetype->data.v ; UINT mask = ( 0x01 << bf->size ) - 1 ; UINT val ; // read it in RETURN_ERROR_IF_BAD( FS_r_sibling_U( &val, bf->link, owq ) ) ; // clear the bits val &= ~(mask << bf->shift) ; // Add in the new value val |= (OWQ_U(owq) & mask) << bf->shift ; // write it out return FS_w_sibling_U( val, bf->link, owq ) ; } /* Bit Array * single bits interspersed * alias_link is the base value * number_of_bits is the number of arrays * shift_left is the starting bit * */ ZERO_OR_ERROR FS_r_bit_array(struct one_wire_query *owq) { struct filetype * ft = PN(owq)->selected_filetype ; struct bitfield * bf = ft->data.v ; int elements = ft->ag->elements ; UINT val ; UINT array = 0 ; int i ; BYTE data[4] ; RETURN_ERROR_IF_BAD( FS_r_sibling_U( &val, bf->link, owq ) ) ; // get value UT_uint32_to_bytes( val, data ) ; // convert to bytes for ( i = 0 ; i < elements ; ++i ) { // extract bits UT_setbit( (void *) &array, i, UT_getbit( data, i*bf->size + bf->shift ) ) ; } OWQ_U(owq) = array ; return 0 ; } ZERO_OR_ERROR FS_w_bit_array(struct one_wire_query *owq) { struct filetype * ft = PN(owq)->selected_filetype ; struct bitfield * bf = ft->data.v ; int elements = ft->ag->elements ; UINT val ; UINT array = OWQ_U(owq) ; int i ; BYTE data[4] ; // read it in RETURN_ERROR_IF_BAD( FS_r_sibling_U( &val, bf->link, owq ) ) ; UT_uint32_to_bytes( val, data ) ; for ( i = 0 ; i < elements ; ++i ) { UT_setbit( data, i*bf->size + bf->shift, UT_getbit( (void *) &array, i) ) ; } // write it out return FS_w_sibling_U( UT_uint32(data), bf->link, owq ) ; } owfs-3.1p5/module/owlib/src/c/ow_byte.c0000644000175000001440000000240712654730021014746 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" struct one_wire_query * ALLtoBYTE(struct one_wire_query *owq_all) { struct one_wire_query * owq_byte = OWQ_create_separate( EXTENSION_BYTE, owq_all ); size_t elements = PN(owq_all)->selected_filetype->ag->elements ; size_t extension ; if ( owq_byte == NO_ONE_WIRE_QUERY ) { return NO_ONE_WIRE_QUERY ; } for ( extension = 0 ; extension < elements ; ++extension ) { UT_setbit_U( &OWQ_U(owq_byte), extension, OWQ_array_Y(owq_all,extension) ) ; } return owq_byte ; } struct one_wire_query * BYTEtoALL(struct one_wire_query *owq_byte) { struct one_wire_query * owq_all = OWQ_create_aggregate( owq_byte ); size_t elements ; size_t extension ; if ( owq_all == NO_ONE_WIRE_QUERY ) { return NO_ONE_WIRE_QUERY ; } elements = PN(owq_all)->selected_filetype->ag->elements ; for ( extension = 0 ; extension < elements ; ++extension ) { OWQ_array_Y(owq_all,extension) = UT_getbit_U( OWQ_U(owq_byte), extension ) ; } return owq_all ; } owfs-3.1p5/module/owlib/src/c/compat.c0000644000175000001440000002002312654730021014553 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #ifndef HAVE_STRSEP /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Get next token from string *stringp, where tokens are possibly-empty * strings separated by characters from delim. * * Writes NULs into the string at *stringp to end tokens. * delim need not remain constant from call to call. * On return, *stringp points past the last NUL written (if there might * be further tokens), or is NULL (if there are definitely no more tokens). * * If *stringp is NULL, strsep returns NULL. */ char *strsep(char **stringp, const char *delim) { char *s; const char *spanp; int c, sc; char *tok; if ((s = *stringp) == NULL) { return (NULL); } for (tok = s;;) { c = *s++; spanp = delim; do { if ((sc = *spanp++) == c) { if (c == 0) { s = NULL; } else { s[-1] = 0; } *stringp = s; return (tok); } } while (sc != 0); } /* NOTREACHED */ } #endif /* !defined(HAVE_STRSEP) */ #ifndef HAVE_TDESTROY /* uClibc older than 0.9.19 is missing tdestroy() (don't know exactly when it was added) I added a replacement to this, just to be able to compile owfs for WRT54G without any patched uClibc. */ #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif static void tdestroy_recurse_(node * root, void (*freefct) (void *)) { if (root->left != NULL) { tdestroy_recurse_(root->left, freefct); } if (root->right != NULL) { tdestroy_recurse_(root->right, freefct); } if (root->key) { (*freefct) ((void *) root->key); //free(root->key); root->key = NULL; } /* Free the node itself. */ owfree(root); } void tdestroy(void *vroot, void (*freefct) (void *)) { node *root = (node *) vroot; if (root != NULL) { tdestroy_recurse_(root, freefct); } } #endif /* HAVE_TDESTROY */ #ifndef HAVE_TSEARCH #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif /* find or insert datum into search tree. char *key; key to be located register node **rootp; address of tree root int (*compar)(); ordering function */ void *tsearch(__const void *key, void **vrootp, __compar_fn_t compar) { register node *q; register node **rootp = (node **) vrootp; if (rootp == (struct node_t **) 0) { return ((struct node_t *) 0); } while (*rootp != (struct node_t *) 0) { /* Knuth's T1: */ int r; if ((r = (*compar) (key, (*rootp)->key)) == 0) { /* T2: */ return (*rootp); /* we found it! */ } rootp = (r < 0) ? &(*rootp)->left : /* T3: follow left tree branch */ &(*rootp)->right; /* T4: follow right tree branch */ } q = (node *) owmalloc(sizeof(node)); /* T5: key not found */ if (q != (struct node_t *) 0) { /* make new node */ *rootp = q; /* link new node to old */ q->key = (void *) key; /* initialize new node */ q->left = q->right = (struct node_t *) 0; } return (q); } #endif #ifndef HAVE_TFIND #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif void *tfind(__const void *key, void *__const * vrootp, __compar_fn_t compar) { register node **rootp = (node **) vrootp; if (rootp == (struct node_t **) 0) { return ((struct node_t *) 0); } while (*rootp != (struct node_t *) 0) { /* Knuth's T1: */ int r; if ((r = (*compar) (key, (*rootp)->key)) == 0) { /* T2: */ return (*rootp); /* we found it! */ } rootp = (r < 0) ? &(*rootp)->left : /* T3: follow left tree branch */ &(*rootp)->right; /* T4: follow right tree branch */ } return NULL; } #endif #ifndef HAVE_TFIND #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif /* delete node with given key char *key; key to be deleted register node **rootp; address of the root of tree int (*compar)(); comparison function */ void *tdelete(__const void *key, void **vrootp, __compar_fn_t compar) { node *p; register node *q; register node *r; int cmp; register node **rootp = (node **) vrootp; if (rootp == (struct node_t **) 0 || (p = *rootp) == (struct node_t *) 0) { return ((struct node_t *) 0); } while ((cmp = (*compar) (key, (*rootp)->key)) != 0) { p = *rootp; rootp = (cmp < 0) ? &(*rootp)->left : /* follow left tree branch */ &(*rootp)->right; /* follow right tree branch */ if (*rootp == (struct node_t *) 0) { return ((struct node_t *) 0); /* key not found */ } } r = (*rootp)->right; /* D1: */ if ((q = (*rootp)->left) == (struct node_t *) 0) { /* Left (struct node_t *)0? */ q = r; } else if (r != (struct node_t *) 0) { /* Right link is null? */ if (r->left == (struct node_t *) 0) { /* D2: Find successor */ r->left = q; q = r; } else { /* D3: Find (struct node_t *)0 link */ for (q = r->left; q->left != (struct node_t *) 0; q = r->left) r = q; r->left = q->right; q->left = (*rootp)->left; q->right = (*rootp)->right; } } owfree((struct node_t *) *rootp); /* D4: Free node */ *rootp = q; /* link parent to new node */ return (p); } #endif #ifndef HAVE_TWALK #ifndef NODE_T_DEFINED #define NODE_T_DEFINED typedef struct node_t { void *key; struct node_t *left, *right; } node; #endif /* Walk the nodes of a tree register node *root; Root of the tree to be walked register void (*action)(); Function to be called at each node register int level; */ static void trecurse(__const void *vroot, __action_fn_t action, int level) { register node *root = (node *) vroot; if (root->left == (struct node_t *) 0 && root->right == (struct node_t *) 0) { (*action) (root, leaf, level); } else { (*action) (root, preorder, level); if (root->left != (struct node_t *) 0) { trecurse(root->left, action, level + 1); } (*action) (root, postorder, level); if (root->right != (struct node_t *) 0) { trecurse(root->right, action, level + 1); } (*action) (root, endorder, level); } } /* void twalk(root, action) Walk the nodes of a tree node *root; Root of the tree to be walked void (*action)(); Function to be called at each node PTR */ void twalk(__const void *vroot, __action_fn_t action) { register __const node *root = (node *) vroot; if (root != (node *) 0 && action != (__action_fn_t) 0) { trecurse(root, action, 0); } } #endif owfs-3.1p5/module/owlib/src/c/getaddrinfo.c0000644000175000001440000007156512654730021015577 00000000000000/* $USAGI: getaddrinfo.c,v 1.16 2001/10/04 09:52:03 sekiya Exp $ */ /* The Inner Net License, Version 2.00 The author(s) grant permission for redistribution and use in source and binary forms, with or without modification, of the software and documentation provided that the following conditions are met: 0. If you receive a version of the software that is specifically labelled as not being for redistribution (check the version message and/or README), you are not permitted to redistribute that version of the software in any way or form. 1. All terms of the all other applicable copyrights and licenses must be followed. 2. Redistributions of source code must retain the authors' copyright notice(s), this list of conditions, and the following disclaimer. 3. Redistributions in binary form must reproduce the authors' copyright notice(s), this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 4. All advertising materials mentioning features or use of this software must display the following acknowledgement with the name(s) of the authors as specified in the copyright notice(s) substituted where indicated: This product includes software developed by , The Inner Net, and other contributors. 5. Neither the name(s) of the author(s) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY ITS AUTHORS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. If these license terms cause you a real problem, contact the author. */ /* This software is Copyright 1996 by Craig Metz, All Rights Reserved. */ #include #include "owfs_config.h" #ifdef HAVE_PTHREAD #include #endif #ifndef HAVE_GETADDRINFO #define _GNU_SOURCE 1 #define __FORCE_GLIBC #ifdef HAVE_FEATURES_H #include #endif #include #include #include #include "compat_netdb.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_RESOLV_H #include #endif #include "ow_debug.h" #include "ow_alloc.h" /* The following declarations and definitions have been removed from * the public header since we don't want people to use them. */ #define AI_V4MAPPED 0x0008 /* IPv4-mapped addresses are acceptable. */ #define AI_ALL 0x0010 /* Return both IPv4 and IPv6 addresses. */ #define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type. */ #define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG) #define GAIH_OKIFUNSPEC 0x0100 #define GAIH_EAI ~(GAIH_OKIFUNSPEC) struct gaih_service { const char *name; int num; }; struct gaih_servtuple { struct gaih_servtuple *next; int socktype; int protocol; int port; }; static const struct gaih_servtuple nullserv; struct gaih_addrtuple { struct gaih_addrtuple *next; int family; char addr[16]; uint32_t scopeid; }; struct gaih_typeproto { int socktype; int protocol; char name[4]; int protoflag; }; /* Values for `protoflag'. */ #define GAI_PROTO_NOSERVICE 1 #define GAI_PROTO_PROTOANY 2 static const struct gaih_typeproto gaih_inet_typeproto[] = { {0, 0, "", 0}, {SOCK_STREAM, IPPROTO_TCP, "tcp", 0}, {SOCK_DGRAM, IPPROTO_UDP, "udp", 0}, {SOCK_RAW, 0, "raw", GAI_PROTO_PROTOANY | GAI_PROTO_NOSERVICE}, {0, 0, "", 0} }; struct gaih { int family; int (*gaih) (const char *name, const struct gaih_service * service, const struct addrinfo * req, struct addrinfo ** pai); }; #if PF_UNSPEC == 0 static const struct addrinfo default_hints; #else static const struct addrinfo default_hints = { 0, PF_UNSPEC, 0, 0, 0, NULL, NULL, NULL }; #endif static int addrconfig(sa_family_t af) { int s; int ret; int saved_errno = errno; s = socket(af, SOCK_DGRAM, 0); if (s < 0) ret = (errno == EMFILE) ? 1 : 0; else { close(s); ret = 1; } __set_errno(saved_errno); return ret; } #if 0 #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX 108 #endif /* Using Unix sockets this way is a security risk. */ static int gaih_local(const char *name, const struct gaih_service *service, const struct addrinfo *req, struct addrinfo **pai) { struct utsname utsname; if ((name != NULL) && (req->ai_flags & AI_NUMERICHOST)) return GAIH_OKIFUNSPEC | -EAI_NONAME; if ((name != NULL) || (req->ai_flags & AI_CANONNAME)) if (uname(&utsname) < 0) return -EAI_SYSTEM; if (name != NULL) { if (strcmp(name, "localhost") && strcmp(name, "local") && strcmp(name, "unix") && strcmp(name, utsname.nodename)) return GAIH_OKIFUNSPEC | -EAI_NONAME; } if (req->ai_protocol || req->ai_socktype) { const struct gaih_typeproto *tp = gaih_inet_typeproto + 1; while (tp->name[0] && ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0 || (req->ai_socktype != 0 && req->ai_socktype != tp->socktype) || (req->ai_protocol != 0 && !(tp->protoflag & GAI_PROTO_PROTOANY) && req->ai_protocol != tp->protocol))) ++tp; if (!tp->name[0]) { if (req->ai_socktype) return (GAIH_OKIFUNSPEC | -EAI_SOCKTYPE); else return (GAIH_OKIFUNSPEC | -EAI_SERVICE); } } *pai = owmalloc(sizeof(struct addrinfo) + sizeof(struct sockaddr_un) + ((req->ai_flags & AI_CANONNAME) ? (strlen(utsname.nodename) + 1) : 0)); if (*pai == NULL) return -EAI_MEMORY; (*pai)->ai_next = NULL; (*pai)->ai_flags = req->ai_flags; (*pai)->ai_family = AF_LOCAL; (*pai)->ai_socktype = req->ai_socktype ? req->ai_socktype : SOCK_STREAM; (*pai)->ai_protocol = req->ai_protocol; (*pai)->ai_addrlen = sizeof(struct sockaddr_un); (*pai)->ai_addr = (void *) (*pai) + sizeof(struct addrinfo); #ifdef HAVE_SA_LEN ((struct sockaddr_un *) (*pai)->ai_addr)->sun_len = sizeof(struct sockaddr_un); #endif /* HAVE_SA_LEN */ ((struct sockaddr_un *) (*pai)->ai_addr)->sun_family = AF_LOCAL; memset(((struct sockaddr_un *) (*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX); if (service) { struct sockaddr_un *sunp = (struct sockaddr_un *) (*pai)->ai_addr; if (strchr(service->name, '/') != NULL) { if (strlen(service->name) >= sizeof(sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; strcpy(sunp->sun_path, service->name); } else { if (strlen(P_tmpdir "/") + 1 + strlen(service->name) >= sizeof(sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; __stpcpy(__stpcpy(sunp->sun_path, P_tmpdir "/"), service->name); } } else { /* This is a dangerous use of the interface since there is a time window between the test for the file and the actual creation (done by the caller) in which a file with the same name could be created. */ char *buf = ((struct sockaddr_un *) (*pai)->ai_addr)->sun_path; if (__builtin_expect(__path_search(buf, L_tmpnam, NULL, NULL, 0), 0) != 0 || __builtin_expect(__gen_tempname(buf, __GT_NOCREATE), 0) != 0) return -EAI_SYSTEM; } if (req->ai_flags & AI_CANONNAME) (*pai)->ai_canonname = strcpy((char *) *pai + sizeof(struct addrinfo) + sizeof(struct sockaddr_un), utsname.nodename); else (*pai)->ai_canonname = NULL; return 0; } #endif /* 0 */ #ifndef HAVE_GETHOSTBYNAME_R struct hostent *gethostbyname_r(const char *name, struct hostent *result, char *buf, size_t buflen, int *h_errnop) { #ifdef HAVE_PTHREAD static pthread_mutex_t gethostbyname_lock = PTHREAD_MUTEX_INITIALIZER; #endif struct hostent *res; (void) buf; // not used (void) buflen; // not used #ifdef HAVE_PTHREAD _MUTEX_LOCK(gethostbyname_lock); #endif res = gethostbyname(name); if (res) { memcpy(result, res, sizeof(struct hostent)); } else { *h_errnop = errno; } #ifdef HAVE_PTHREAD _MUTEX_UNLOCK(gethostbyname_lock); #endif return res; } #endif #ifndef HAVE_GETSERVBYNAME_R struct servent *getservbyname_r(const char *name, const char *proto, struct servent *result, char *buf, size_t buflen) { #ifdef HAVE_PTHREAD static pthread_mutex_t getservbyname_lock = PTHREAD_MUTEX_INITIALIZER; #endif struct servent *res; (void) buf; // not used (void) buflen; // not used #ifdef HAVE_PTHREAD _MUTEX_LOCK(getservbyname_lock); #endif res = getservbyname(name, proto); if (res) memcpy(result, res, sizeof(struct servent)); #ifdef HAVE_PTHREAD _MUTEX_UNLOCK(getservbyname_lock); #endif return res; } #endif static int gaih_inet_serv(const char *servicename, const struct gaih_typeproto *tp, const struct addrinfo *req, struct gaih_servtuple *st) { struct servent *s; size_t tmpbuflen = 1024; struct servent ts; char *tmpbuf; int r; do { tmpbuf = alloca(tmpbuflen); #if 0 r = getservbyname_r(servicename, tp->name, &ts, tmpbuf, tmpbuflen, &s); if (!s) r = errno; if (r != 0 || s == NULL) { if (r == ERANGE) tmpbuflen *= 2; else return GAIH_OKIFUNSPEC | -EAI_SERVICE; } #else s = getservbyname_r(servicename, tp->name, &ts, tmpbuf, tmpbuflen); if (s == NULL) { r = errno; if (r == ERANGE) tmpbuflen *= 2; else return GAIH_OKIFUNSPEC | -EAI_SERVICE; } else { r = 0; } #endif } while (r); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) ? req->ai_protocol : tp->protocol); st->port = s->s_port; return 0; } #define gethosts(_family, _type) \ { \ int i, herrno; \ size_t tmpbuflen; \ struct hostent th; \ char *tmpbuf; \ tmpbuflen = 512; \ no_data = 0; \ do { \ tmpbuflen *= 2; \ tmpbuf = alloca (tmpbuflen); \ rc = 0; \ h = gethostbyname_r (name, &th, tmpbuf, \ tmpbuflen, &herrno); \ if(!h) rc = errno; \ } while (rc == ERANGE && herrno == NETDB_INTERNAL); \ if (rc != 0) \ { \ if (herrno == NETDB_INTERNAL) \ { \ __set_h_errno (herrno); \ return -EAI_SYSTEM; \ } \ if (herrno == TRY_AGAIN) \ no_data = EAI_AGAIN; \ else \ no_data = herrno == NO_DATA; \ } \ else if (h != NULL) \ { \ for (i = 0; h->h_addr_list[i]; i++) \ { \ if (*pat == NULL) { \ *pat = alloca (sizeof(struct gaih_addrtuple)); \ (*pat)->scopeid = 0; \ } \ (*pat)->next = NULL; \ (*pat)->family = _family; \ memcpy ((*pat)->addr, h->h_addr_list[i], \ sizeof(_type)); \ pat = &((*pat)->next); \ } \ } \ } #ifndef HAVE_GETHOSTBYNAME2_R struct hostenv *gethostbyname2_r(const char *name, int af, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop) { /* Don't support this if it doesn't exists... (eg. IPV6 will fail on cygwin for example) */ (void) name; (void) af; (void) ret; (void) buf; (void) buflen; (void) result; (void) h_errnop; return NULL; } #endif #if __HAS_IPV6__ #define gethosts2(_family, _type) \ { \ int i, herrno; \ size_t tmpbuflen; \ struct hostent th; \ char *tmpbuf; \ tmpbuflen = 512; \ no_data = 0; \ do { \ tmpbuflen *= 2; \ tmpbuf = alloca (tmpbuflen); \ rc = gethostbyname2_r (name, _family, &th, tmpbuf, \ tmpbuflen, &h, &herrno); \ } while (rc == ERANGE && herrno == NETDB_INTERNAL); \ if (rc != 0) \ { \ if (herrno == NETDB_INTERNAL) \ { \ __set_h_errno (herrno); \ return -EAI_SYSTEM; \ } \ if (herrno == TRY_AGAIN) \ no_data = EAI_AGAIN; \ else \ no_data = herrno == NO_DATA; \ } \ else if (h != NULL) \ { \ for (i = 0; h->h_addr_list[i]; i++) \ { \ if (*pat == NULL) { \ *pat = alloca (sizeof(struct gaih_addrtuple)); \ (*pat)->scopeid = 0; \ } \ (*pat)->next = NULL; \ (*pat)->family = _family; \ memcpy ((*pat)->addr, h->h_addr_list[i], \ sizeof(_type)); \ pat = &((*pat)->next); \ } \ } \ } #endif #ifndef HAVE_GETHOSTBYADDR_R struct hostent *gethostbyaddr_r(const char *name, int len, int type, struct hostent *result, char *buf, size_t buflen, int *h_errnop) { #ifdef HAVE_PTHREAD static pthread_mutex_t gethostbyaddr_lock = PTHREAD_MUTEX_INITIALIZER; #endif struct hostent *res; (void) buf; // not used (void) buflen; // not used #ifdef HAVE_PTHREAD _MUTEX_LOCK(gethostbyaddr_lock); #endif res = gethostbyaddr(name, len, type); if (res) { memcpy(result, res, sizeof(struct hostent)); } else { *h_errnop = errno; } #ifdef HAVE_PTHREAD _MUTEX_UNLOCK(gethostbyaddr_lock); #endif return res; } #endif static int gaih_inet(const char *name, const struct gaih_service *service, const struct addrinfo *req, struct addrinfo **pai) { const struct gaih_typeproto *tp = gaih_inet_typeproto; struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv; struct gaih_addrtuple *at = NULL; int rc; int v4mapped = (req->ai_family == PF_UNSPEC #if __HAS_IPV6__ || req->ai_family == PF_INET6 #endif ) && (req->ai_flags & AI_V4MAPPED); if (req->ai_protocol || req->ai_socktype) { ++tp; while (tp->name[0] && ((req->ai_socktype != 0 && req->ai_socktype != tp->socktype) || (req->ai_protocol != 0 && !(tp->protoflag & GAI_PROTO_PROTOANY) && req->ai_protocol != tp->protocol))) ++tp; if (!tp->name[0]) { if (req->ai_socktype) return (GAIH_OKIFUNSPEC | -EAI_SOCKTYPE); else return (GAIH_OKIFUNSPEC | -EAI_SERVICE); } } if (service != NULL) { if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0) return (GAIH_OKIFUNSPEC | -EAI_SERVICE); if (service->num < 0) { if (tp->name[0]) { st = (struct gaih_servtuple *) alloca(sizeof(struct gaih_servtuple)); if ((rc = gaih_inet_serv(service->name, tp, req, st))) return rc; } else { struct gaih_servtuple **pst = &st; for (tp++; tp->name[0]; tp++) { struct gaih_servtuple *newp; if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0) continue; if (req->ai_socktype != 0 && req->ai_socktype != tp->socktype) continue; if (req->ai_protocol != 0 && !(tp->protoflag & GAI_PROTO_PROTOANY) && req->ai_protocol != tp->protocol) continue; newp = (struct gaih_servtuple *) alloca(sizeof(struct gaih_servtuple)); if ((rc = gaih_inet_serv(service->name, tp, req, newp))) { if (rc & GAIH_OKIFUNSPEC) continue; return rc; } *pst = newp; pst = &(newp->next); } if (st == (struct gaih_servtuple *) &nullserv) return (GAIH_OKIFUNSPEC | -EAI_SERVICE); } } else { st = alloca(sizeof(struct gaih_servtuple)); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) ? req->ai_protocol : tp->protocol); st->port = htons(service->num); } } else if (req->ai_socktype || req->ai_protocol) { st = alloca(sizeof(struct gaih_servtuple)); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) ? req->ai_protocol : tp->protocol); st->port = 0; } else { /* * Neither socket type nor protocol is set. Return all socket types * we know about. */ struct gaih_servtuple **lastp = &st; for (++tp; tp->name[0]; ++tp) { struct gaih_servtuple *newp; newp = alloca(sizeof(struct gaih_servtuple)); newp->next = NULL; newp->socktype = tp->socktype; newp->protocol = tp->protocol; newp->port = 0; *lastp = newp; lastp = &newp->next; } } if (name != NULL) { at = alloca(sizeof(struct gaih_addrtuple)); at->family = AF_UNSPEC; at->scopeid = 0; at->next = NULL; if (inet_pton(AF_INET, name, at->addr) > 0) { if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET || v4mapped) at->family = AF_INET; else return -EAI_FAMILY; } #if __HAS_IPV6__ if (at->family == AF_UNSPEC) { char *namebuf = strdupa(name); char *scope_delim; scope_delim = strchr(namebuf, SCOPE_DELIMITER); if (scope_delim != NULL) *scope_delim = '\0'; if (inet_pton(AF_INET6, namebuf, at->addr) > 0) { if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6) at->family = AF_INET6; else return -EAI_FAMILY; if (scope_delim != NULL) { int try_numericscope = 0; if (IN6_IS_ADDR_LINKLOCAL(at->addr) || IN6_IS_ADDR_MC_LINKLOCAL(at->addr)) { at->scopeid = if_nametoindex(scope_delim + 1); if (at->scopeid == 0) try_numericscope = 1; } else try_numericscope = 1; if (try_numericscope != 0) { char *end; assert(sizeof(uint32_t) <= sizeof(unsigned long)); at->scopeid = (uint32_t) strtoul(scope_delim + 1, &end, 10); if (*end != '\0') return GAIH_OKIFUNSPEC | -EAI_NONAME; } } } } #endif if (at->family == AF_UNSPEC && (req->ai_flags & AI_NUMERICHOST) == 0) { struct hostent *h; struct gaih_addrtuple **pat = &at; int no_data = 0; int no_inet6_data; /* * If we are looking for both IPv4 and IPv6 address we don't want * the lookup functions to automatically promote IPv4 addresses to * IPv6 addresses. */ #if __HAS_IPV6__ if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6) gethosts(AF_INET6, struct in6_addr); #endif no_inet6_data = no_data; if (req->ai_family == AF_INET || (!v4mapped && req->ai_family == AF_UNSPEC) || (v4mapped && (no_inet6_data != 0 || (req->ai_flags & AI_ALL)))) #if __HAS_IPV6__ gethosts2(AF_INET, struct in_addr); #else gethosts(AF_INET, struct in_addr); #endif if (no_data != 0 && no_inet6_data != 0) { /* If both requests timed out report this. */ if (no_data == EAI_AGAIN && no_inet6_data == EAI_AGAIN) return -EAI_AGAIN; /* * We made requests but they turned out no data. * The name is known, though. */ return (GAIH_OKIFUNSPEC | -EAI_AGAIN); } } if (at->family == AF_UNSPEC) return (GAIH_OKIFUNSPEC | -EAI_NONAME); } else { struct gaih_addrtuple *atr; atr = at = alloca(sizeof(struct gaih_addrtuple)); memset(at, '\0', sizeof(struct gaih_addrtuple)); if (req->ai_family == 0) { at->next = alloca(sizeof(struct gaih_addrtuple)); memset(at->next, '\0', sizeof(struct gaih_addrtuple)); } #if __HAS_IPV6__ if (req->ai_family == 0 || req->ai_family == AF_INET6) { extern const struct in6_addr __in6addr_loopback; at->family = AF_INET6; if ((req->ai_flags & AI_PASSIVE) == 0) memcpy(at->addr, &__in6addr_loopback, sizeof(struct in6_addr)); atr = at->next; } #endif if (req->ai_family == 0 || req->ai_family == AF_INET) { atr->family = AF_INET; if ((req->ai_flags & AI_PASSIVE) == 0) *(uint32_t *) atr->addr = htonl(INADDR_LOOPBACK); } } if (pai == NULL) return 0; { const char *c = NULL; struct gaih_servtuple *st2; struct gaih_addrtuple *at2 = at; size_t socklen, namelen; sa_family_t family; /* * buffer is the size of an unformatted IPv6 address in * printable format. */ char buffer[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"]; while (at2 != NULL) { if (req->ai_flags & AI_CANONNAME) { struct hostent *h = NULL; int herrno; struct hostent th; size_t tmpbuflen = 512; char *tmpbuf; do { tmpbuflen *= 2; tmpbuf = alloca(tmpbuflen); if (tmpbuf == NULL) return -EAI_MEMORY; rc = 0; h = gethostbyaddr_r(at2->addr, #if __HAS_IPV6__ ((at2->family == AF_INET6) ? sizeof(struct in6_addr) : sizeof(struct in_addr)), #else sizeof(struct in_addr), #endif at2->family, &th, tmpbuf, tmpbuflen, &herrno); if (!h) rc = errno; } while (rc == errno && herrno == NETDB_INTERNAL); if (rc != 0 && herrno == NETDB_INTERNAL) { __set_h_errno(herrno); return -EAI_SYSTEM; } if (h == NULL) c = inet_ntop(at2->family, at2->addr, buffer, sizeof(buffer)); else c = h->h_name; if (c == NULL) return GAIH_OKIFUNSPEC | -EAI_NONAME; namelen = strlen(c) + 1; } else namelen = 0; #if __HAS_IPV6__ if (at2->family == AF_INET6 || v4mapped) { family = AF_INET6; socklen = sizeof(struct sockaddr_in6); } else #endif { family = AF_INET; socklen = sizeof(struct sockaddr_in); } for (st2 = st; st2 != NULL; st2 = st2->next) { *pai = owmalloc(sizeof(struct addrinfo) + socklen + namelen); if (*pai == NULL) return -EAI_MEMORY; (*pai)->ai_flags = req->ai_flags; (*pai)->ai_family = family; (*pai)->ai_socktype = st2->socktype; (*pai)->ai_protocol = st2->protocol; (*pai)->ai_addrlen = socklen; (*pai)->ai_addr = (void *) (*pai) + sizeof(struct addrinfo); #ifdef HAVE_SA_LEN (*pai)->ai_addr->sa_len = socklen; #endif /* HAVE_SA_LEN */ (*pai)->ai_addr->sa_family = family; #if __HAS_IPV6__ if (family == AF_INET6) { struct sockaddr_in6 *sin6p = (struct sockaddr_in6 *) (*pai)->ai_addr; sin6p->sin6_flowinfo = 0; if (at2->family == AF_INET6) { memcpy(&sin6p->sin6_addr, at2->addr, sizeof(struct in6_addr)); } else { sin6p->sin6_addr.s6_addr32[0] = 0; sin6p->sin6_addr.s6_addr32[1] = 0; sin6p->sin6_addr.s6_addr32[2] = htonl(0x0000ffff); memcpy(&sin6p->sin6_addr.s6_addr32[3], at2->addr, sizeof(sin6p->sin6_addr.s6_addr32[3])); } sin6p->sin6_port = st2->port; sin6p->sin6_scope_id = at2->scopeid; } else #endif { struct sockaddr_in *sinp = (struct sockaddr_in *) (*pai)->ai_addr; memcpy(&sinp->sin_addr, at2->addr, sizeof(struct in_addr)); sinp->sin_port = st2->port; memset(sinp->sin_zero, '\0', sizeof(sinp->sin_zero)); } if (c) { (*pai)->ai_canonname = ((void *) (*pai) + sizeof(struct addrinfo) + socklen); strcpy((*pai)->ai_canonname, c); } else (*pai)->ai_canonname = NULL; (*pai)->ai_next = NULL; pai = &((*pai)->ai_next); } at2 = at2->next; } } return 0; } static struct gaih gaih[] = { #if __HAS_IPV6__ {PF_INET6, gaih_inet}, #endif {PF_INET, gaih_inet}, #if 0 {PF_LOCAL, gaih_local}, #endif {PF_UNSPEC, NULL} }; int getaddrinfo(const char *name, const char *service, const struct addrinfo *hints, struct addrinfo **pai) { int i = 0, j = 0, last_i = 0; struct addrinfo *p = NULL, **end; struct gaih *g = gaih, *pg = NULL; struct gaih_service gaih_service, *pservice; if (name != NULL && name[0] == '*' && name[1] == 0) name = NULL; if (service != NULL && service[0] == '*' && service[1] == 0) service = NULL; if (name == NULL && service == NULL) return EAI_NONAME; if (hints == NULL) hints = &default_hints; if (hints->ai_flags & ~(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_ADDRCONFIG | AI_V4MAPPED | AI_ALL)) return EAI_BADFLAGS; if ((hints->ai_flags & AI_CANONNAME) && name == NULL) return EAI_BADFLAGS; if (service && service[0]) { char *c; gaih_service.name = service; gaih_service.num = strtoul(gaih_service.name, &c, 10); if (*c) gaih_service.num = -1; else /* * Can't specify a numerical socket unless a protocol * family was given. */ if (hints->ai_socktype == 0 && hints->ai_protocol == 0) return EAI_SERVICE; pservice = &gaih_service; } else pservice = NULL; if (pai) end = &p; else end = NULL; while (g->gaih) { if (hints->ai_family == g->family || hints->ai_family == AF_UNSPEC) { if ((hints->ai_flags & AI_ADDRCONFIG) && !addrconfig(g->family)) continue; j++; if (pg == NULL || pg->gaih != g->gaih) { pg = g; i = g->gaih(name, pservice, hints, end); if (i != 0) { last_i = i; if (hints->ai_family == AF_UNSPEC && (i & GAIH_OKIFUNSPEC)) continue; if (p) freeaddrinfo(p); return -(i & GAIH_EAI); } if (end) while (*end) end = &((*end)->ai_next); } } ++g; } if (j == 0) return EAI_FAMILY; if (p) { *pai = p; return 0; } if (pai == NULL && last_i == 0) return 0; if (p) freeaddrinfo(p); return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME; } void freeaddrinfo(struct addrinfo *ai) { struct addrinfo *p; while (ai != NULL) { p = ai; ai = ai->ai_next; owfree(p); } } #define N_(x) x static struct { int code; const char *msg; } values[] = { { EAI_ADDRFAMILY, N_("Address family for hostname not supported")}, { EAI_AGAIN, N_("Temporary failure in name resolution")}, { EAI_BADFLAGS, N_("Bad value for ai_flags")}, { EAI_FAIL, N_("Non-recoverable failure in name resolution")}, { EAI_FAMILY, N_("ai_family not supported")}, { EAI_MEMORY, N_("Memory allocation failure")}, { EAI_NODATA, N_("No address associated with hostname")}, { EAI_NONAME, N_("Name or service not known")}, { EAI_SERVICE, N_("Servname not supported for ai_socktype")}, { EAI_SOCKTYPE, N_("ai_socktype not supported")}, { EAI_SYSTEM, N_("System error")}, { EAI_INPROGRESS, N_("Processing request in progress")}, { EAI_CANCELED, N_("Request canceled")}, { EAI_NOTCANCELED, N_("Request not canceled")}, { EAI_ALLDONE, N_("All requests done")}, { EAI_INTR, N_("Interrupted by a signal")} }; const char *gai_strerror(int code) { size_t i; for (i = 0; i < sizeof(values) / sizeof(values[0]); ++i) if (values[i].code == code) return (values[i].msg); return ("Unknown error"); } #endif /* HAVE_GETADDRINFO */ #ifndef HAVE_INET_NTOP /* char * * inet_ntop4(src, dst, size) * format an IPv4 address * return: * `dst' (as a const) * notes: * (1) uses no statics * (2) takes a u_char* not an in_addr as input * author: * Paul Vixie, 1996. */ static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size) { char tmp[sizeof("255.255.255.255") + 1] = "\0"; int octet; int i; i = 0; for (octet = 0; octet <= 3; octet++) { if (src[octet] > 255) { __set_errno(ENOSPC); return (NULL); } tmp[i++] = '0' + src[octet] / 100; if (tmp[i - 1] == '0') { tmp[i - 1] = '0' + (src[octet] / 10 % 10); if (tmp[i - 1] == '0') i--; } else { tmp[i++] = '0' + (src[octet] / 10 % 10); } tmp[i++] = '0' + src[octet] % 10; tmp[i++] = '.'; } tmp[i - 1] = '\0'; if (strlen(tmp) > size) { __set_errno(ENOSPC); return (NULL); } return strcpy(dst, tmp); } /* char * * inet_ntop(af, src, dst, size) * convert a network format address to presentation format. * return: * pointer to presentation format address (`dst'), or NULL (see errno). * author: * Paul Vixie, 1996. */ const char *inet_ntop(af, src, dst, size) int af; const void *src; char *dst; socklen_t size; { switch (af) { case AF_INET: return (inet_ntop4(src, dst, size)); #if __HAS_IPV6__ case AF_INET6: return (inet_ntop6(src, dst, size)); #endif default: __set_errno(EAFNOSUPPORT); return (NULL); } /* NOTREACHED */ } #endif /* HAVE_INET_NTOP */ #ifndef HAVE_INET_PTON /* int * inet_pton4(src, dst) * like inet_aton() but without all the hexadecimal and shorthand. * return: * 1 if `src' is a valid dotted quad, else 0. * notice: * does not touch `dst' unless it's returning 1. * author: * Paul Vixie, 1996. */ static int inet_pton4(const char *src, unsigned char *dst) { int saw_digit, octets, ch; unsigned char tmp[4], *tp; saw_digit = 0; octets = 0; *(tp = tmp) = 0; while ((ch = *src++) != '\0') { if (ch >= '0' && ch <= '9') { unsigned int new = *tp * 10 + (ch - '0'); if (new > 255) return (0); *tp = new; if (!saw_digit) { if (++octets > 4) return (0); saw_digit = 1; } } else if (ch == '.' && saw_digit) { if (octets == 4) return (0); *++tp = 0; saw_digit = 0; } else return (0); } if (octets < 4) return (0); memcpy(dst, tmp, 4); return (1); } /* int * inet_pton(af, src, dst) * convert from presentation format (which usually means ASCII printable) * to network format (which is usually some kind of binary format). * return: * 1 if the address was valid for the specified address family * 0 if the address wasn't valid (`dst' is untouched in this case) * -1 if some other error occurred (`dst' is untouched in this case, too) * author: * Paul Vixie, 1996. */ int inet_pton(af, src, dst) int af; const char *src; void *dst; { switch (af) { case AF_INET: return (inet_pton4(src, dst)); #if __HAS_IPV6__ case AF_INET6: return (inet_pton6(src, dst)); #endif default: __set_errno(EAFNOSUPPORT); return (-1); } /* NOTREACHED */ } #endif /* HAVE_INET_PTON */ owfs-3.1p5/module/owlib/src/c/getline.c0000644000175000001440000000607112654730021014726 00000000000000/* getline.c -- Replacement for GNU C library function getline Copyright (C) 1993 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 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */ /* modified very slightly for OWFS proect by Paul Alfille * */ #include #include "owfs_config.h" #include "ow.h" #ifndef HAVE_GETLINE #include /* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR + OFFSET (and null-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'd as necessary. Return the number of characters read (not including the null terminator), or -1 on error or EOF. */ int getstr (char ** lineptr, size_t *n, FILE * stream, char terminator, int offset) { int nchars_avail; /* Allocated but unused chars in *LINEPTR. */ char *read_pos; /* Where we're reading into *LINEPTR. */ int ret; if (!lineptr || !n || !stream) return -1; if (!*lineptr) { *n = 64; *lineptr = (char *) malloc (*n); if (!*lineptr) return -1; } nchars_avail = *n - offset; read_pos = *lineptr + offset; for (;;) { register int c = getc (stream); /* We always want at least one char left in the buffer, since we always (unless we get an error while reading the first char) NUL-terminate the line buffer. */ assert(*n - nchars_avail == read_pos - *lineptr); if (nchars_avail < 1) { if (*n > 64) *n *= 2; else *n += 64; nchars_avail = *n + *lineptr - read_pos; *lineptr = (char *) realloc (*lineptr, *n); if (!*lineptr) return -1; read_pos = *n - nchars_avail + *lineptr; assert(*n - nchars_avail == read_pos - *lineptr); } if (c == EOF || ferror (stream)) { /* Return partial line, if any. */ if (read_pos == *lineptr) return -1; else break; } *read_pos++ = c; nchars_avail--; if (c == terminator) /* Return the line. */ break; } /* Done - NUL terminate and return the number of chars read. */ *read_pos = '\0'; ret = read_pos - (*lineptr + offset); return ret; } ssize_t getline(char **lineptr, size_t *n, FILE *stream) { return getstr (lineptr, n, stream, '\n', 0); } #endif /* HAVE_GETLINE */ owfs-3.1p5/module/owlib/src/c/timegm.c0000644000175000001440000000323612654730021014561 00000000000000/* $Id: */ /* * From Clemmens Egger : * * Working with the DS1921 Thermochron iButton I noticed that, when writing a time value to * clock/udate and reading it immediately afterwards, the returned value differs notably to * the written value. This is dependent on the local time zone and whether it's daylight saving * time or not. My environment variable TZ usually reads "Europe/Berlin". * * In the following example there's a difference of 3600 seconds i.e. 1 hour between the two values. * $ ./owwrite -s 3000 21.D5542E000000/clock/udate 1352387000; ./owread -s 3000 21.D5542E000000/clock/udate 1352383400 * * Looking at the source code, I discovered that the function mktime is used to convert a struct * tm to time_t. However mktime uses the local time zone which explains the time shift. * * The following workaround makes the time shift disappear: just set the TZ environment variable * to UTC when invoking the server. * TZ=UTC ./owserver -u -p 3000 * * There's a function timegm which is basically the opposite part to gmtime. The latter is * already used in the code when writing a udate value to the iButton. In my opinion timegm * would be more suitable than mktime. * * Code obtained 2012-10-17 from timegm(3) * */ #include #include "owfs_config.h" #include "ow.h" #if (!defined _BSD_SOURCE && !defined _SVID_SOURCE) #include time_t timegm(struct tm *tm) { time_t ret; char *tz; TIMEGMLOCK ; tz = getenv("TZ"); setenv("TZ", "", 1); tzset(); ret = mktime(tm); if (tz) setenv("TZ", tz, 1); else unsetenv("TZ"); tzset(); TIMEGMUNLOCK ; return ret; } #endif owfs-3.1p5/module/owlib/src/c/getopt.c0000644000175000001440000005563012654730021014606 00000000000000/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * Modified for uClibc by Manuel Novoa III on 1/5/01. * Modified once again for uClibc by Erik Andersen 8/7/02 */ #include #include "owfs_config.h" #include "compat_getopt.h" #include "ow.h" // only for UINT #ifndef HAVE_GETOPT_LONG #include #include #include #undef _ #define _(X) X /* Treat '-W foo' the same as the long option '--foo', * disabled for the moment since it costs about 2k... */ #undef SPECIAL_TREATMENT_FOR_W /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ extern int _getopt_internal(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only); /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ static int __getopt_initialized; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; # include # define my_index strchr /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange(char **argv) { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ static const char *_getopt_initialize(int argc, char *const *argv, const char *optstring) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (getenv("POSIXLY_CORRECT") != NULL) { ordering = REQUIRE_ORDER; } else { ordering = PERMUTE; } return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) { int print_errors = opterr; if (optstring[0] == ':') { print_errors = 0; } if (argc < 1) { return -1; } optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) { optind = 1; /* Don't scan ARGV[0], the program name. */ } optstring = _getopt_initialize(argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) { last_nonopt = optind; } if (first_nonopt > optind) { first_nonopt = optind; } if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) { exchange((char **) argv); } else if (last_nonopt != optind) { first_nonopt = optind; } /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) { optind++; } last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp(argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) { exchange((char **) argv); } else if (first_nonopt == last_nonopt) { first_nonopt = optind; } last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) { optind = first_nonopt; } return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) { return -1; } optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index(optstring, argv[optind] [1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((UINT) (nameend - nextchar) == (UINT) strlen(p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { fprintf(stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); } nextchar += strlen(nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) { optarg = nameend + 1; } else { if (print_errors) { if (argv[optind - 1][1] == '-') { /* --option */ fprintf(stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); } else { /* +option or -option */ fprintf(stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } } nextchar += strlen(nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) { optarg = argv[optind++]; } else { if (print_errors) { fprintf(stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); } nextchar += strlen(nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen(nextchar); if (longind != NULL) { *longind = option_index; } if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index(optstring, *nextchar) == NULL) { if (print_errors) { if (argv[optind][1] == '-') { /* --option */ fprintf(stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); } else { /* +option or -option */ fprintf(stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index(optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') { ++optind; } if (temp == NULL || c == ':') { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf(stderr, _("%s: illegal option -- %c\n"), argv[0], c); } optopt = c; return '?'; } #ifdef SPECIAL_TREATMENT_FOR_W /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf(stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') { c = ':'; } else { c = '?'; } return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((UINT) (nameend - nextchar) == strlen(p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { fprintf(stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); } nextchar += strlen(nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) { optarg = nameend + 1; } else { if (print_errors) { fprintf(stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); } nextchar += strlen(nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) { optarg = argv[optind++]; } else { if (print_errors) { fprintf(stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); } nextchar += strlen(nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen(nextchar); if (longind != NULL) { *longind = option_index; } if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } #endif if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf(stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') { c = ':'; } else { c = '?'; } } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt_long(int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal(argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only(int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal(argc, argv, options, long_options, opt_index, 1); } #endif /* HAVE_GETOPT_LONG */ #ifndef HAVE_GETOPT int getopt(int argc, char *const *argv, const char *optstring) { return _getopt_internal(argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* HAVE_GETOPT */ owfs-3.1p5/module/owlib/src/c/jsmn.c0000644000175000001440000001147712654730021014254 00000000000000/* $Id$ * jsmn -- a JSON parser * Obtained from http://zserge.bitbucket.org/jsmn.html * MIT licence * written by Serge Zaitsev * Some simplification -- no parents */ #include #include "jsmn.h" /** * Allocates a fresh unused token from the token pull. */ static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser, jsmntok_t *tokens, int num_tokens) { jsmntok_t *tok; if (parser->toknext >= num_tokens) { return NULL; } tok = &tokens[parser->toknext++]; tok->start = tok->end = -1; tok->size = 0; return tok; } /** * Fills token type and boundaries. */ static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type, int start, int end) { token->type = type; token->start = start; token->end = end; token->size = 0; } /** * Fills next available token with JSON primitive. */ static jsmnerr_t jsmn_parse_primitive(jsmn_parser *parser, const char *js, jsmntok_t *tokens, int num_tokens) { jsmntok_t *token; int start; start = parser->pos; for (; js[parser->pos] != '\0'; parser->pos++) { switch (js[parser->pos]) { /* In strict mode primitive must be followed by "," or "}" or "]" */ case ':': case '\t' : case '\r' : case '\n' : case ' ' : case ',' : case ']' : case '}' : goto found; } if (js[parser->pos] < 32 || js[parser->pos] >= 127) { parser->pos = start; return JSMN_ERROR_INVAL; } } found: token = jsmn_alloc_token(parser, tokens, num_tokens); if (token == NULL) { parser->pos = start; return JSMN_ERROR_NOMEM; } jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos); parser->pos--; return JSMN_SUCCESS; } /** * Fills next token with JSON string. */ static jsmnerr_t jsmn_parse_string(jsmn_parser *parser, const char *js, jsmntok_t *tokens, int num_tokens) { jsmntok_t *token; int start = parser->pos; parser->pos++; /* Skip starting quote */ for (; js[parser->pos] != '\0'; parser->pos++) { char c = js[parser->pos]; /* Quote: end of string */ if (c == '\"') { token = jsmn_alloc_token(parser, tokens, num_tokens); if (token == NULL) { parser->pos = start; return JSMN_ERROR_NOMEM; } jsmn_fill_token(token, JSMN_STRING, start+1, parser->pos); return JSMN_SUCCESS; } /* Backslash: Quoted symbol expected */ if (c == '\\') { parser->pos++; switch (js[parser->pos]) { /* Allowed escaped symbols */ case '\"': case '/' : case '\\' : case 'b' : case 'f' : case 'r' : case 'n' : case 't' : break; /* Allows escaped symbol \uXXXX */ case 'u': /* TODO */ break; /* Unexpected symbol */ default: parser->pos = start; return JSMN_ERROR_INVAL; } } } parser->pos = start; return JSMN_ERROR_PART; } /** * Parse JSON string and fill tokens. */ jsmnerr_t jsmn_parse(jsmn_parser *parser, const char *js, jsmntok_t *tokens, int num_tokens) { jsmnerr_t r; int i; jsmntok_t *token; for (; js[parser->pos] != '\0'; parser->pos++) { char c; jsmntype_t type; c = js[parser->pos]; switch (c) { case '{': case '[': token = jsmn_alloc_token(parser, tokens, num_tokens); if (token == NULL) return JSMN_ERROR_NOMEM; if (parser->toksuper != -1) { tokens[parser->toksuper].size++; } token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY); token->start = parser->pos; parser->toksuper = parser->toknext - 1; break; case '}': case ']': type = (c == '}' ? JSMN_OBJECT : JSMN_ARRAY); for (i = parser->toknext - 1; i >= 0; i--) { token = &tokens[i]; if (token->start != -1 && token->end == -1) { if (token->type != type) { return JSMN_ERROR_INVAL; } parser->toksuper = -1; token->end = parser->pos + 1; break; } } /* Error if unmatched closing bracket */ if (i == -1) return JSMN_ERROR_INVAL; for (; i >= 0; i--) { token = &tokens[i]; if (token->start != -1 && token->end == -1) { parser->toksuper = i; break; } } break; case '\"': r = jsmn_parse_string(parser, js, tokens, num_tokens); if (r < 0) return r; if (parser->toksuper != -1) tokens[parser->toksuper].size++; break; case '\t' : case '\r' : case '\n' : case ':' : case ',': case ' ': break; /* In non-strict mode every unquoted value is a primitive */ default: r = jsmn_parse_primitive(parser, js, tokens, num_tokens); if (r < 0) return r; if (parser->toksuper != -1) tokens[parser->toksuper].size++; break; } } for (i = parser->toknext - 1; i >= 0; i--) { /* Unmatched opened object or array */ if (tokens[i].start != -1 && tokens[i].end == -1) { return JSMN_ERROR_PART; } } return JSMN_SUCCESS; } /** * Creates a new parser based over a given buffer with an array of tokens * available. */ void jsmn_init(jsmn_parser *parser) { parser->pos = 0; parser->toknext = 0; parser->toksuper = -1; } owfs-3.1p5/module/owlib/src/c/ow_none.c0000644000175000001440000000616412654730021014746 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server version 0.9 8/21/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Poliqcy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #include #include "owfs_config.h" #include "ow_none.h" /* ------- Structures ----------- */ struct filetype NoDev[] = { F_address, F_code, F_crc8, F_id, F_present, F_r_address, F_r_id, }; struct device UnknownDevice = { "XX", "generic", ePN_real, COUNT_OF_FILETYPES(NoDev), NoDev, NO_GENERIC_READ, NO_GENERIC_WRITE }; struct device RemoteDevice = { "YY", "remote_alias", ePN_real, COUNT_OF_FILETYPES(NoDev), NoDev, NO_GENERIC_READ, NO_GENERIC_WRITE }; /* ------- Functions ------------ */ owfs-3.1p5/module/owlib/src/c/ow_1820.c0000644000175000001440000014156113021631744014403 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_1820.h" /* ------- Prototypes ----------- */ /* DS18S20&2 Temperature */ // READ_FUNCTION( FS_tempdata ) ; READ_FUNCTION(FS_10temp); READ_FUNCTION(FS_10latesttemp); READ_FUNCTION(FS_10temp_link); READ_FUNCTION(FS_22temp); READ_FUNCTION(FS_22latesttemp); READ_FUNCTION(FS_thermocouple); READ_FUNCTION(FS_fasttemp); READ_FUNCTION(FS_slowtemp); READ_FUNCTION(FS_power); READ_FUNCTION(FS_r_templimit); WRITE_FUNCTION(FS_w_templimit); READ_FUNCTION(FS_r_tempres); WRITE_FUNCTION(FS_w_tempres); READ_FUNCTION(FS_r_die); READ_FUNCTION(FS_r_trim); WRITE_FUNCTION(FS_w_trim); READ_FUNCTION(FS_r_trimvalid); READ_FUNCTION(FS_r_blanket); WRITE_FUNCTION(FS_w_blanket); READ_FUNCTION(FS_r_ad); READ_FUNCTION(FS_r_piostate); READ_FUNCTION(FS_r_pio); READ_FUNCTION(FS_r_latch); WRITE_FUNCTION(FS_w_pio); READ_FUNCTION(FS_sense); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_scratchpad); READ_FUNCTION(FS_r_flagfield) ; static enum e_visibility VISIBLE_DS1825( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_MAX31826( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_MAX31850( const struct parsedname * pn ) ; enum threeB { Unknown_3B, DS1825_3B, MAX31826_3B, MAX31850_3B, } ; #define SCRATCHPAD_LENGTH 9 // struct bitfield { "alias_link", number_of_bits, shift_left, } static struct bitfield max31850_fault = { "flagfield", 1, 0, } ; static struct bitfield max31850_open = { "flagfield", 1, 16, } ; static struct bitfield max31850_short_g = { "flagfield", 1, 17, } ; static struct bitfield max31850_short_v = { "flagfield", 1, 18, } ; /* -------- Structures ---------- */ static struct filetype DS18S20[] = { F_STANDARD, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_10temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"temperature9", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_10temp_link, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"temperature10", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_10temp_link, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"temperature11", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_10temp_link, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"temperature12", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_10temp_link, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"fasttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_10temp_link, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"latesttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_10latesttemp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"templow", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE, {.i=1}, }, {"temphigh", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE, {.i=0}, }, {"power", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_power, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"scratchpad", SCRATCHPAD_LENGTH, NON_AGGREGATE, ft_binary, fc_volatile, FS_r_scratchpad, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"errata", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"errata/trim", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_trim, FS_w_trim, VISIBLE, NO_FILETYPE_DATA, }, {"errata/die", 2, NON_AGGREGATE, ft_ascii, fc_static, FS_r_die, NO_WRITE_FUNCTION, VISIBLE, {.i=1}, }, {"errata/trimvalid", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_trimvalid, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"errata/trimblanket", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_blanket, FS_w_blanket, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(10, DS18S20, DEV_temp | DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS18B20[] = { F_STANDARD, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_slowtemp, NO_WRITE_FUNCTION, VISIBLE, {.i=12}, }, {"temperature9", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=9}, }, {"temperature10", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=10}, }, {"temperature11", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=11}, }, {"temperature12", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=12}, }, {"fasttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_fasttemp, NO_WRITE_FUNCTION, VISIBLE, {.i=9}, }, {"latesttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_22latesttemp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"templow", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE, {.i=1}, }, {"temphigh", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE, {.i=0}, }, {"tempres", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_tempres, FS_w_tempres, VISIBLE, NO_FILETYPE_DATA, }, {"power", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_power, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"scratchpad", SCRATCHPAD_LENGTH, NON_AGGREGATE, ft_binary, fc_volatile, FS_r_scratchpad, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"errata", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"errata/trim", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_trim, FS_w_trim, VISIBLE, NO_FILETYPE_DATA, }, {"errata/die", 2, NON_AGGREGATE, ft_ascii, fc_static, FS_r_die, NO_WRITE_FUNCTION, VISIBLE, {.i=2}, }, {"errata/trimvalid", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_trimvalid, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"errata/trimblanket", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_blanket, FS_w_blanket, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(28, DS18B20, DEV_temp | DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS1822[] = { F_STANDARD, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_slowtemp, NO_WRITE_FUNCTION, VISIBLE, {.i=12}, }, {"temperature9", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=9}, }, {"temperature10", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=10}, }, {"temperature11", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=11}, }, {"temperature12", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=12}, }, {"fasttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_fasttemp, NO_WRITE_FUNCTION, VISIBLE, {.i=9}, }, {"latesttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_22latesttemp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"templow", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE, {.i=1}, }, {"temphigh", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE, {.i=0}, }, {"tempres", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_tempres, FS_w_tempres, VISIBLE, NO_FILETYPE_DATA, }, {"power", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_power, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"scratchpad", SCRATCHPAD_LENGTH, NON_AGGREGATE, ft_binary, fc_volatile, FS_r_scratchpad, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"errata", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"errata/trim", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_trim, FS_w_trim, VISIBLE, NO_FILETYPE_DATA, }, {"errata/die", 2, NON_AGGREGATE, ft_ascii, fc_static, FS_r_die, NO_WRITE_FUNCTION, VISIBLE, {.i=0}, }, {"errata/trimvalid", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_trimvalid, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"errata/trimblanket", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_blanket, FS_w_blanket, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(22, DS1822, DEV_temp | DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); /* The DS1825 also includes the MAX31826 MAX31850 and MAX31851 */ static struct aggregate AMAX = { 16, ag_numbers, ag_separate, }; static struct filetype DS1825[] = { F_STANDARD, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_slowtemp, NO_WRITE_FUNCTION, VISIBLE, {.i=12}, }, {"temperature9", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE_DS1825, {.i=9}, }, {"temperature10", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE_DS1825, {.i=10}, }, {"temperature11", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE_DS1825, {.i=11}, }, {"temperature12", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=12}, }, {"fasttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_fasttemp, NO_WRITE_FUNCTION, VISIBLE_DS1825, {.i=9}, }, {"latesttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_22latesttemp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"templow", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE_DS1825, {.i=1}, }, {"temphigh", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE_DS1825, {.i=0}, }, {"tempres", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_tempres, FS_w_tempres, VISIBLE, NO_FILETYPE_DATA, }, {"thermocouple", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_thermocouple, NO_WRITE_FUNCTION, VISIBLE_MAX31850, {.i=12}, }, {"flagfield", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_flagfield, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"fault" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_MAX31850, {.v= &max31850_fault,}, }, {"open_circuit" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_MAX31850, {.v= &max31850_open,}, }, {"ground_short" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_MAX31850, {.v= &max31850_short_g,}, }, {"vdd_short" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_MAX31850, {.v= &max31850_short_v,}, }, {"power", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_power, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"prog_addr", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_ad, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"memory", 128, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE_MAX31826, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_MAX31826, NO_FILETYPE_DATA, }, {"pages/page", 8, &AMAX, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE_MAX31826, NO_FILETYPE_DATA, }, {"scratchpad", SCRATCHPAD_LENGTH, NON_AGGREGATE, ft_binary, fc_volatile, FS_r_scratchpad, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(3B, DS1825, DEV_temp | DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate A28EA00 = { 2, ag_letters, ag_aggregate, }; static struct filetype DS28EA00[] = { F_STANDARD, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_slowtemp, NO_WRITE_FUNCTION, VISIBLE, {.i=12}, }, {"temperature9", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=9}, }, {"temperature10", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=10}, }, {"temperature11", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=11}, }, {"temperature12", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_22temp, NO_WRITE_FUNCTION, VISIBLE, {.i=12}, }, {"fasttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_fasttemp, NO_WRITE_FUNCTION, VISIBLE, {.i=9}, }, {"latesttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_22latesttemp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"templow", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE_DS1825, {.i=1}, }, {"temphigh", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE_DS1825, {.i=0}, }, {"tempres", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_tempres, FS_w_tempres, VISIBLE, NO_FILETYPE_DATA, }, {"power", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_power, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"piostate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_piostate, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"PIO", PROPERTY_LENGTH_BITFIELD, &A28EA00, ft_bitfield, fc_link, FS_r_pio, FS_w_pio, VISIBLE, NO_FILETYPE_DATA, }, {"latch", PROPERTY_LENGTH_BITFIELD, &A28EA00, ft_bitfield, fc_link, FS_r_latch, FS_w_pio, VISIBLE, NO_FILETYPE_DATA, }, {"sensed", PROPERTY_LENGTH_BITFIELD, &A28EA00, ft_bitfield, fc_link, FS_sense, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(42, DS28EA00, DEV_temp | DEV_alarm | DEV_chain, NO_GENERIC_READ, NO_GENERIC_WRITE); /* Internal properties */ Make_SlaveSpecificTag(RES, fc_stable); // resolution Make_SlaveSpecificTag(POW, fc_stable); // power status struct tempresolution { int bits; // resolution in bits BYTE config; // how to set resolution bits UINT delay; // for conversion BYTE mask; // of LSB byte _FLOAT scale ; // integer -> temperature }; struct tempresolution Resolution9 = { 9, 0x1F, 110, 0xF8, 16.} ; /* 9 bit */ struct tempresolution Resolution10 = {10, 0x3F, 200, 0xFC, 16.} ; /* 10 bit */ struct tempresolution Resolution11 = {11, 0x5F, 400, 0xFE, 16.} ; /* 11 bit */ struct tempresolution Resolution12 = {12, 0x7F,1000, 0xFF, 16.}; /* 12 bit */ struct tempresolution ResolutionS = { 9, 0x00,1000, 0xFE, 2.}; /* DS18S20 -- different scaling */ struct tempresolution ResolutionMAX= {12, 0x00, 150, 0xFF, 16.}; /* MAX31826 cold junction*/ struct tempresolution ResolutionCLD= {12, 0x00, 100, 0xF0, 256.}; /* MAX31850 cold junction*/ struct tempresolution ResolutionTCP= {12, 0x00, 100, 0xFC, 16.}; /* MAX31850 thermocouple*/ struct die_limits { BYTE B7[6]; BYTE C2[6]; }; enum eDie { eB6, eB7, eC2, eC3, }; // ID ranges for the different chip dies struct die_limits DIE[] = { { // DS1822 Family code 22 {0x00, 0x00, 0x00, 0x08, 0x97, 0x8A}, {0x00, 0x00, 0x00, 0x0C, 0xB8, 0x1A}, }, { // DS18S20 Family code 10 {0x00, 0x08, 0x00, 0x59, 0x1D, 0x20}, {0x00, 0x08, 0x00, 0x80, 0x88, 0x60}, }, { // DS18B20 Family code 28 {0x00, 0x00, 0x00, 0x54, 0x50, 0x10}, {0x00, 0x00, 0x00, 0x66, 0x2B, 0x50}, }, }; /* Intermediate cached values -- start with unlikely asterisk */ /* RES -- resolution POW -- power */ #define _1W_WRITE_SCRATCHPAD 0x4E #define _1W_READ_SCRATCHPAD 0xBE #define _1W_COPY_SCRATCHPAD 0x48 #define _1W_CONVERT_T 0x44 #define _1W_READ_POWERMODE 0xB4 #define _1W_RECALL_EEPROM 0xB8 #define _1W_PIO_ACCESS_READ 0xF5 #define _1W_PIO_ACCESS_WRITE 0xA5 #define _1W_CHAIN_COMMAND 0x99 #define _1W_CHAIN_SUBCOMMAND_OFF 0x3C #define _1W_CHAIN_SUBCOMMAND_ON 0x5A #define _1W_CHAIN_SUBCOMMAND_DONE 0x96 #define _1W_READ_TRIM_1 0x93 #define _1W_READ_TRIM_2 0x68 #define _1W_WRITE_TRIM_1 0x95 #define _1W_WRITE_TRIM_2 0x63 #define _1W_ACTIVATE_TRIM_1 0x94 #define _1W_ACTIVATE_TRIM_2 0x64 #define _DEFAULT_BLANKET_TRIM_1 0x9D #define _DEFAULT_BLANKET_TRIM_2 0xBB #define _1W_WRITE_SCRATCHPAD2 0x0F #define _1W_READ_SCRATCHPAD2 0xAA #define _1W_COPY_SCRATCHPAD2 0x55 #define _1W_COPY_SCRATCHPAD2_DO 0xA5 #define _1W_READ_MEMORY 0xF0 enum temperature_problem_flag { allow_85C, deny_85C, } ; /* ------- Functions ------------ */ /* DS1820*/ static GOOD_OR_BAD OW_10latesttemp(_FLOAT * temp, enum temperature_problem_flag accept_85C, const struct parsedname *pn); static GOOD_OR_BAD OW_10temp(_FLOAT * temp, enum temperature_problem_flag accept_85C, int simul_good, const struct parsedname *pn); static GOOD_OR_BAD OW_thermocouple(_FLOAT * temp, enum temperature_problem_flag accept_85C, int simul_good, const struct parsedname *pn); static GOOD_OR_BAD OW_22latesttemp(_FLOAT * temp, enum temperature_problem_flag accept_85C, const struct parsedname *pn); static GOOD_OR_BAD OW_22temp(_FLOAT * temp, enum temperature_problem_flag accept_85C, int simul_good, const struct parsedname *pn); static GOOD_OR_BAD OW_power(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_templimit(_FLOAT * T, const int Tindex, const struct parsedname *pn); static GOOD_OR_BAD OW_w_templimit(const _FLOAT T, const int Tindex, const struct parsedname *pn); static GOOD_OR_BAD OW_r_tempres(UINT * resolution, const struct parsedname *pn); static GOOD_OR_BAD OW_w_tempres(UINT resolution, const struct parsedname *pn); static GOOD_OR_BAD OW_r_scratchpad(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_w_scratchpad(const BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_w_store_scratchpad(const BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_trim(BYTE * trim, const struct parsedname *pn); static GOOD_OR_BAD OW_w_trim(const BYTE * trim, const struct parsedname *pn); static enum eDie OW_die(const struct parsedname *pn); static GOOD_OR_BAD OW_w_pio(BYTE pio, const struct parsedname *pn); static GOOD_OR_BAD OW_set_resolution( struct tempresolution ** Resolution, const struct parsedname *pn) ; static GOOD_OR_BAD OW_test_resolution( int * resolution_changed, struct tempresolution * Resolution, const struct parsedname *pn) ; static GOOD_OR_BAD OW_temperature_ready( enum temperature_problem_flag accept_85C, int simul_good, struct tempresolution * Resolution, const struct parsedname *pn) ; static GOOD_OR_BAD OW_read_piostate(UINT * piostate, const struct parsedname *pn) ; static _FLOAT OW_masked_temperature( BYTE * data, struct tempresolution * Resolution ) ; static GOOD_OR_BAD OW_poll_convert(const struct parsedname *pn) ; static GOOD_OR_BAD OW_r_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) ; static GOOD_OR_BAD OW_w_mem( BYTE * data, size_t size, off_t offset, struct parsedname * pn ) ; static GOOD_OR_BAD OW_w_page( BYTE * data, size_t size, off_t offset, struct parsedname * pn ) ; /* finds the visibility value (0x0071 ...) either cached, or computed via the device_id (then cached) */ static enum threeB VISIBLE_3B( const struct parsedname * pn ) { enum threeB e3B = Unknown_3B ; LEVEL_DEBUG("Checking visibility of %s",SAFESTRING(pn->path)) ; if ( BAD( GetVisibilityCache( (int *) &e3B, pn ) ) ) { struct one_wire_query * owq = OWQ_create_from_path(pn->path) ; // for read if ( owq != NULL) { size_t scr_leng = SCRATCHPAD_LENGTH ; BYTE data[scr_leng] ; if ( FS_r_sibling_binary( data, &scr_leng, "scratchpad", owq ) == 0 ) { if ( (data[4] & 0x80) == 0 ) { e3B = DS1825_3B ; } else if ( (data[2]==0xFF) && (data[3]==0xFF) ) { e3B = MAX31826_3B ; } else { e3B = MAX31850_3B ; } SetVisibilityCache( e3B, pn ) ; } OWQ_destroy(owq) ; } } return e3B ; } #define VISIBLE_FN( id ) static enum e_visibility VISIBLE_##id(const struct parsedname * pn ) {\ return ( VISIBLE_3B(pn)==id##_3B ) ? visible_now : visible_not_now ; } VISIBLE_FN( DS1825 ) ; VISIBLE_FN( MAX31826 ) ; VISIBLE_FN( MAX31850 ) ; static ZERO_OR_ERROR FS_10temp(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; // triple try temperatures // first pass include simultaneous if ( GOOD( OW_10temp(&OWQ_F(owq), deny_85C, OWQ_SIMUL_TEST(owq), pn)) ) { return 0 ; } // second pass no simultaneous if ( GOOD( OW_10temp(&OWQ_F(owq), deny_85C, 0, pn)) ) { return 0 ; } // third pass, accept 85C return GB_to_Z_OR_E(OW_10temp(&OWQ_F(owq), allow_85C, 0, pn)); } static ZERO_OR_ERROR FS_10latesttemp(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_10latesttemp(&OWQ_F(owq), allow_85C, PN(owq))); } static ZERO_OR_ERROR FS_10temp_link(struct one_wire_query *owq) { return FS_r_sibling_F(&OWQ_F(owq),"temperature",owq) ; } /* For DS1822 and DS18B20 -- resolution stuffed in ft->data */ static ZERO_OR_ERROR FS_22temp(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; // triple try temperatures // first pass include simultaneous if ( GOOD( OW_22temp(&OWQ_F(owq), deny_85C, OWQ_SIMUL_TEST(owq), pn) ) ) { return 0 ; } // second pass no simultaneous if ( GOOD( OW_22temp(&OWQ_F(owq), deny_85C, 0, pn) ) ) { return 0 ; } // third pass, accept 85C return GB_to_Z_OR_E(OW_22temp(&OWQ_F(owq), allow_85C, 0, pn)); } static ZERO_OR_ERROR FS_22latesttemp(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_22latesttemp(&OWQ_F(owq), allow_85C, PN(owq))); } // use sibling function for fasttemp to keep cache value consistent static ZERO_OR_ERROR FS_fasttemp(struct one_wire_query *owq) { _FLOAT temperature = 0.; ZERO_OR_ERROR z_or_e = FS_r_sibling_F( &temperature, "temperature9", owq ) ; OWQ_F(owq) = temperature ; return z_or_e ; } // use sibling function for temperature to keep cache value consistent static ZERO_OR_ERROR FS_slowtemp(struct one_wire_query *owq) { _FLOAT temperature = 0. ; ZERO_OR_ERROR z_or_e = FS_r_sibling_F( &temperature, "temperature12", owq ) ; OWQ_F(owq) = temperature ; return z_or_e ; } static ZERO_OR_ERROR FS_power(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_power(&data, PN(owq))) ; OWQ_Y(owq) = (data != 0x00); return 0; } /* 28EA00 switch */ static ZERO_OR_ERROR FS_w_pio(struct one_wire_query *owq) { BYTE data = BYTE_INVERSE(OWQ_U(owq) & 0x03); /* reverse bits, set unused to 1s */ //printf("Write pio raw=%X, stored=%X\n",OWQ_U(owq),data) ; FS_del_sibling( "piostate", owq ) ; return GB_to_Z_OR_E(OW_w_pio(data, PN(owq))); } static ZERO_OR_ERROR FS_sense(struct one_wire_query *owq) { UINT piostate = 0; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &piostate, "piostate", owq ) ; // bits 0->0 and 2->1 OWQ_U(owq) = ( (piostate & 0x01) | ((piostate & 0x04)>>1) ) & 0x03 ; return z_or_e; } static ZERO_OR_ERROR FS_r_pio(struct one_wire_query *owq) { UINT piostate = 0; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &piostate, "piostate", owq ) ; // bits 0->0 and 2->1 OWQ_U(owq) = BYTE_INVERSE( (piostate & 0x01) | ((piostate & 0x04)>>1) ) & 0x03 ; return z_or_e; } static ZERO_OR_ERROR FS_r_piostate(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_read_piostate(&(OWQ_U(owq)), PN(owq)) ) ; } static ZERO_OR_ERROR FS_r_latch(struct one_wire_query *owq) { UINT piostate = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &piostate, "piostate", owq ) ; // bits 1->0 and 3->1 OWQ_U(owq) = BYTE_INVERSE( ((piostate & 0x02)>>1) | ((piostate & 0x08)>>2) ) & 0x03 ; return z_or_e; } static ZERO_OR_ERROR FS_r_templimit(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_r_templimit(&OWQ_F(owq), PN(owq)->selected_filetype->data.i, PN(owq)) ); } static ZERO_OR_ERROR FS_r_tempres(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_r_tempres(&OWQ_U(owq), PN(owq)) ); } /* DS1825 hardware programmable address */ static ZERO_OR_ERROR FS_r_ad(struct one_wire_query *owq) { size_t scr_leng = SCRATCHPAD_LENGTH ; BYTE data[scr_leng]; RETURN_ERROR_IF_BAD(FS_r_sibling_binary( data, &scr_leng, "scratchpad", owq )) ; OWQ_U(owq) = data[4] & 0x0F; return 0; } /* DS1825 thermocouple flags */ static ZERO_OR_ERROR FS_r_flagfield(struct one_wire_query *owq) { size_t scr_leng = SCRATCHPAD_LENGTH ; BYTE data[scr_leng]; RETURN_ERROR_IF_BAD(FS_r_sibling_binary( data, &scr_leng, "scratchpad", owq )) ; OWQ_U(owq) = UT_uint32( data ) ; return 0; } static ZERO_OR_ERROR FS_thermocouple(struct one_wire_query * owq ) { struct parsedname * pn = PN(owq) ; // triple try temperatures // first pass include simultaneous if ( GOOD( OW_thermocouple(&OWQ_F(owq), deny_85C, OWQ_SIMUL_TEST(owq), pn) ) ) { return 0 ; } // second pass no simultaneous if ( GOOD( OW_thermocouple(&OWQ_F(owq), deny_85C, 0, pn) ) ) { return 0 ; } // third pass, accept 85C return GB_to_Z_OR_E(OW_thermocouple(&OWQ_F(owq), allow_85C, 0, pn)); } static ZERO_OR_ERROR FS_w_templimit(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_templimit(OWQ_F(owq), PN(owq)->selected_filetype->data.i, PN(owq))); } static ZERO_OR_ERROR FS_w_tempres(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_tempres(OWQ_U(owq), PN(owq))); } static ZERO_OR_ERROR FS_r_die(struct one_wire_query *owq) { char *d; switch (OW_die(PN(owq))) { case eB6: d = "B6"; break; case eB7: d = "B7"; break; case eC2: d = "C2"; break; case eC3: d = "C3"; break; default: return -EINVAL; } return OWQ_format_output_offset_and_size(d, 2, owq); } static ZERO_OR_ERROR FS_r_scratchpad(struct one_wire_query *owq) { BYTE s[SCRATCHPAD_LENGTH] ; if ( BAD(OW_r_scratchpad( s, PN(owq) ) ) ) { return -EINVAL ; } return OWQ_format_output_offset_and_size( (const ASCII *) s, 9, owq); } static ZERO_OR_ERROR FS_r_trim(struct one_wire_query *owq) { BYTE t[2]; RETURN_ERROR_IF_BAD(OW_r_trim(t, PN(owq))) ; OWQ_U(owq) = (t[1] << 8) | t[0]; return 0; } static ZERO_OR_ERROR FS_w_trim(struct one_wire_query *owq) { UINT trim = OWQ_U(owq); BYTE t[2] = { LOW_HIGH_ADDRESS(trim), }; switch (OW_die(PN(owq))) { case eB7: case eC2: return GB_to_Z_OR_E(OW_w_trim(t, PN(owq))); default: return -EINVAL; } } /* Are the trim values valid-looking? */ static ZERO_OR_ERROR FS_r_trimvalid(struct one_wire_query *owq) { BYTE trim[2]; switch (OW_die(PN(owq))) { case eB7: case eC2: RETURN_ERROR_IF_BAD(OW_r_trim(trim, PN(owq))) ; OWQ_Y(owq) = (((trim[0] & 0x07) == 0x05) || ((trim[0] & 0x07) == 0x03)) && (trim[1] == 0xBB); break; default: OWQ_Y(owq) = 1; /* Assume true */ } return 0; } /* Put in a blank trim value if non-zero */ static ZERO_OR_ERROR FS_r_blanket(struct one_wire_query *owq) { BYTE trim[2]; BYTE blanket[] = { _DEFAULT_BLANKET_TRIM_1, _DEFAULT_BLANKET_TRIM_2 }; switch (OW_die(PN(owq))) { case eB7: case eC2: RETURN_ERROR_IF_BAD(OW_r_trim(trim, PN(owq))) ; OWQ_Y(owq) = (memcmp(trim, blanket, 2) == 0); return 0; default: return -EINVAL; } } /* Put in a blank trim value if non-zero */ static ZERO_OR_ERROR FS_w_blanket(struct one_wire_query *owq) { BYTE blanket[] = { _DEFAULT_BLANKET_TRIM_1, _DEFAULT_BLANKET_TRIM_2 }; switch (OW_die(PN(owq))) { case eB7: case eC2: if (OWQ_Y(owq)) { RETURN_ERROR_IF_BAD(OW_w_trim(blanket, PN(owq)) ) ; } return 0; default: return -EINVAL; } } static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { OWQ_length(owq) = OWQ_size(owq) ; return GB_to_Z_OR_E( OW_r_mem( (BYTE *)OWQ_buffer(owq),OWQ_size(owq),OWQ_offset(owq),PN(owq)) ) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { OWQ_length(owq) = OWQ_size(owq) ; return GB_to_Z_OR_E( OW_w_mem( (BYTE *)OWQ_buffer(owq),OWQ_size(owq),OWQ_offset(owq),PN(owq)) ) ; } static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 8; struct parsedname * pn = PN(owq) ; OWQ_length(owq) = OWQ_size(owq) ; return GB_to_Z_OR_E( OW_r_mem( (BYTE *)OWQ_buffer(owq),OWQ_size(owq),OWQ_offset(owq)+pn->extension*pagesize,pn) ) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 8; struct parsedname * pn = PN(owq) ; OWQ_length(owq) = OWQ_size(owq) ; return GB_to_Z_OR_E( OW_w_mem( (BYTE *)OWQ_buffer(owq),OWQ_size(owq),OWQ_offset(owq)+pn->extension*pagesize,pn) ) ; } static GOOD_OR_BAD OW_power(BYTE * data, const struct parsedname *pn) { if (IsUncachedDir(pn) || BAD( Cache_Get_SlaveSpecific(data, sizeof(BYTE), SlaveSpecificTag(POW), pn)) ) { BYTE b4[] = { _1W_READ_POWERMODE, }; struct transaction_log tpower[] = { TRXN_START, TRXN_WRITE1(b4), TRXN_READ1(data), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(tpower, pn)) ; //LEVEL_DEBUG("TEST cannot read power"); Cache_Add_SlaveSpecific(data, sizeof(BYTE), SlaveSpecificTag(POW), pn); } return gbGOOD; } /* Knows if resolution supported -- returns valid resolution changed in all cases (if no error) */ static GOOD_OR_BAD OW_set_resolution( struct tempresolution ** Resolution, const struct parsedname *pn) { switch (pn->sn[0]) { // family code case 0x10: // DS18S20 Resolution[0] = &ResolutionS ; return gbGOOD ; case 0x28: // DS18B20 case 0x22: // DS1822 case 0x42: // DS28EA00 break ; case 0x3B: // DS1825 switch( VISIBLE_3B(pn) ) { case DS1825_3B: break ; case MAX31826_3B: Resolution[0] = &ResolutionMAX ; return gbGOOD ; case MAX31850_3B: //Resolution[0] = &ResolutionCLD ; Resolution[0] = &ResolutionTCP ; return gbGOOD ; case Unknown_3B: LEVEL_DEBUG("Cannot tell type (Family 3B)") ; return gbBAD ; } break ; default: LEVEL_DEBUG("Unknown temperature family code"); return gbBAD ; } switch (pn->selected_filetype->data.i) { // bits case 9: Resolution[0] = &Resolution9 ; break ; case 10: Resolution[0] = &Resolution10 ; break ; case 11: Resolution[0] = &Resolution11 ; break ; case 12: Resolution[0] = &Resolution12 ; break ; default: return gbBAD ; } return gbGOOD ; } /* Knows if resolution supported -- returns valid resolution changed in all cases (if no error) */ static GOOD_OR_BAD OW_test_resolution( int * resolution_changed, struct tempresolution * Resolution, const struct parsedname *pn) { BYTE data[SCRATCHPAD_LENGTH]; int stored_resolution ; * resolution_changed = 0 ; // default ok switch (pn->sn[0]) { // family code case 0x10: // DS18S20 return gbGOOD ; case 0x28: // DS18B20 case 0x22: // DS1822 case 0x42: // DS28EA00 break ; case 0x3B: // DS1825 switch( VISIBLE_3B(pn) ) { case DS1825_3B: break ; case MAX31826_3B: case MAX31850_3B: return gbGOOD ; case Unknown_3B: LEVEL_DEBUG("Cannot tell type (Family 3B)") ; return gbBAD ; } break ; default: LEVEL_DEBUG("Unknown temperature family code"); return gbBAD ; } /* Resolution */ if ( BAD( Cache_Get_SlaveSpecific(&stored_resolution, sizeof(stored_resolution), SlaveSpecificTag(RES), pn)) || stored_resolution != Resolution->bits) { BYTE resolution_register = Resolution->config; /* Get existing settings */ RETURN_BAD_IF_BAD(OW_r_scratchpad(data, pn)) ; /* Put in new settings (if different) */ if ((data[4] | 0x1F) != resolution_register) { // ignore lower 5 bits //LEVEL_DEBUG("TEST resolution changed"); * resolution_changed = 1 ; // resolution has changed data[4] = (resolution_register & 0x60) | 0x1F ; /* only store in scratchpad, not EEPROM */ RETURN_BAD_IF_BAD(OW_w_scratchpad(&data[2], pn)) ; } // Always add a succesful/correct result to cache, else we will be re-reading // every time if we use default resolution Cache_Add_SlaveSpecific(&(Resolution->bits), sizeof(stored_resolution), SlaveSpecificTag(RES), pn); } return gbGOOD; } /* returns when temperature is ready for reading * Based on cache, simultaneous, or delay */ static GOOD_OR_BAD OW_temperature_ready( enum temperature_problem_flag accept_85C, int simul_good, struct tempresolution * Resolution, const struct parsedname *pn) { BYTE convert[] = { _1W_CONVERT_T, }; BYTE pow; UINT delay = Resolution->delay; UINT longdelay = delay * 1.5 ; // failsafe int must_convert = 0 ; struct transaction_log tunpowered[] = { TRXN_START, TRXN_POWER(convert, delay), TRXN_END, }; struct transaction_log tpowered[] = { TRXN_START, TRXN_WRITE1(convert), TRXN_END, }; // failsafe struct transaction_log tunpowered_long[] = { TRXN_START, TRXN_POWER(convert, longdelay), TRXN_END, }; RETURN_BAD_IF_BAD( OW_test_resolution( &must_convert, Resolution, pn ) ) ; /* Conversion */ // first time /* powered? */ if (OW_power(&pow, pn)) { //LEVEL_DEBUG("TEST unpowered"); pow = 0x00; /* assume unpowered if cannot tell */ } if ( accept_85C == allow_85C ) { // must be desperate LEVEL_DEBUG("Unpowered temperature conversion -- %d msec", longdelay); // If not powered, no Simultaneous for this chip RETURN_BAD_IF_BAD(BUS_transaction(tunpowered_long, pn)) ; } else if (!pow) { // unpowered, deliver power, no communication allowed LEVEL_DEBUG("Unpowered temperature conversion -- %d msec", delay); // If not powered, no Simultaneous for this chip RETURN_BAD_IF_BAD(BUS_transaction(tunpowered, pn)) ; } else if ( must_convert || !simul_good ) { // No Simultaneous active, so need to "convert" if ( pn->selected_connection->iroutines.flags & ADAP_FLAG_unlock_during_delay ) { // better to put in delay on this channel and allow other channels to work LEVEL_DEBUG("Powered temperature conversion just one channel -- %d msec", delay); // If not powered, no Simultaneous for this chip RETURN_BAD_IF_BAD(BUS_transaction(tunpowered, pn)) ; } else { // powered, so poll bus for faster conversion GOOD_OR_BAD ret; LEVEL_DEBUG("Powered temperature conversion -- poll for completion"); BUSLOCK(pn); ret = BUS_transaction_nolock(tpowered, pn) || OW_poll_convert(pn); BUSUNLOCK(pn); RETURN_BAD_IF_BAD(ret) } } else { // valid simultaneous, just delay if needed RETURN_BAD_IF_BAD( FS_Test_Simultaneous( SlaveSpecificTag(S_T), delay, pn)) ; } return gbGOOD ; } /* DS18S20 */ /* get the temp from the scratchpad buffer */ static GOOD_OR_BAD OW_10latesttemp(_FLOAT * temp, enum temperature_problem_flag accept_85C, const struct parsedname *pn) { BYTE data[SCRATCHPAD_LENGTH]; struct tempresolution * Resolution = &ResolutionS ; RETURN_BAD_IF_BAD(OW_r_scratchpad(data, pn)) ; // Correction thanks to Nathan D. Holmes //temp[0] = (_FLOAT) ((int16_t)(data[1]<<8|data[0])) * .5 ; // Main conversion // Further correction, using "truncation" thanks to Wim Heirman temp[0] = OW_masked_temperature( data, Resolution ) ; if (data[7]) { // only if COUNT_PER_C non-zero (supposed to be!) // temp[0] += (_FLOAT)(data[7]-data[6]) / (_FLOAT)data[7] - .25 ; // additional precision temp[0] += .75 - (_FLOAT) data[6] / (_FLOAT) data[7]; // additional precision } if ( accept_85C==allow_85C || data[0] != 0x50 || data[1] != 0x05 ) { return gbGOOD; } return gbBAD ; } /* get the temp from the scratchpad buffer after starting a conversion and waiting */ static GOOD_OR_BAD OW_10temp(_FLOAT * temp, enum temperature_problem_flag accept_85C, int simul_good, const struct parsedname *pn) { struct tempresolution * Resolution = &ResolutionS ; RETURN_BAD_IF_BAD( OW_temperature_ready( accept_85C, simul_good, Resolution, pn ) ) ; return OW_10latesttemp(temp, accept_85C, pn); } static GOOD_OR_BAD OW_22latesttemp(_FLOAT * temp, enum temperature_problem_flag accept_85C, const struct parsedname *pn) { BYTE data[SCRATCHPAD_LENGTH]; struct tempresolution *Resolution ; RETURN_BAD_IF_BAD( OW_r_scratchpad(data, pn) ) ; switch (data[4] & 0x60) { case 0x00: Resolution = &Resolution9 ; break ; case 0x20: Resolution = &Resolution10 ; break ; case 0x40: Resolution = &Resolution11 ; break ; case 0x60: default: Resolution = &Resolution12 ; break ; } if ((pn->sn[0] == 0x3B) && (data[4] & 0x80)) { /* MAX31850 shows internal temperature at data[2] as "temperatureXXX"! */ temp[0] = ((_FLOAT) ((int16_t) ((data[3] << 8) | (data[2] & 0xf0)))) / 256.0; } else { temp[0] = OW_masked_temperature( data, Resolution ) ; } if ( accept_85C==allow_85C || data[0] != 0x50 || data[1] != 0x05 ) { return gbGOOD; } return gbBAD ; } static GOOD_OR_BAD OW_22temp(_FLOAT * temp, enum temperature_problem_flag accept_85C, int simul_good, const struct parsedname *pn) { struct tempresolution *Resolution ; RETURN_BAD_IF_BAD( OW_set_resolution( &Resolution, pn ) ) ; RETURN_BAD_IF_BAD( OW_temperature_ready( accept_85C, simul_good, Resolution, pn ) ) ; return OW_22latesttemp(temp, accept_85C, pn); } /* MAX31850 Thermocouple */ /* get the temp from the scratchpad buffer after starting a conversion and waiting */ static GOOD_OR_BAD OW_thermocouple(_FLOAT * temp, enum temperature_problem_flag accept_85C, int simul_good, const struct parsedname *pn) { BYTE data[SCRATCHPAD_LENGTH]; //struct tempresolution * Resolution = &ResolutionTCP ; struct tempresolution * Resolution = &ResolutionCLD ; RETURN_BAD_IF_BAD( OW_temperature_ready( accept_85C, simul_good, Resolution, pn ) ) ; RETURN_BAD_IF_BAD(OW_r_scratchpad(data, pn)) ; if ( (data[0] & 0x01) || (data[2] & 0x07)) { // Fault flag LEVEL_DEBUG("Error flag on thermocouple read of %s",pn->path) ; return gbBAD ; } temp[0] = OW_masked_temperature( &data[0], Resolution ) ; return gbGOOD ; } /* Limits Tindex=0 high 1=low */ static GOOD_OR_BAD OW_r_templimit(_FLOAT * T, const int Tindex, const struct parsedname *pn) { BYTE data[SCRATCHPAD_LENGTH]; BYTE recall[] = { _1W_RECALL_EEPROM, }; struct transaction_log trecall[] = { TRXN_START, TRXN_WRITE1(recall), TRXN_DELAY(10), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(trecall, pn)) ; RETURN_BAD_IF_BAD(OW_r_scratchpad(data, pn)) ; T[0] = (_FLOAT) ((int8_t) data[2 + Tindex]); return gbGOOD; } /* Limits Tindex=0 high 1=low */ static GOOD_OR_BAD OW_w_templimit(const _FLOAT T, const int Tindex, const struct parsedname *pn) { BYTE data[SCRATCHPAD_LENGTH]; if (OW_r_scratchpad(data, pn)) { return gbBAD; } data[2 + Tindex] = (int8_t) T; return OW_w_store_scratchpad(&data[2], pn); } /* Get default resolution */ static GOOD_OR_BAD OW_r_tempres(UINT * resolution, const struct parsedname *pn) { BYTE data[SCRATCHPAD_LENGTH]; BYTE recall[] = { _1W_RECALL_EEPROM, }; struct transaction_log trecall[] = { TRXN_START, TRXN_WRITE1(recall), TRXN_DELAY(10), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(trecall, pn)) ; RETURN_BAD_IF_BAD(OW_r_scratchpad(data, pn)) ; switch (data[4] & 0x60) { case 0x00: resolution[0] = 9; break ; case 0x20: resolution[0] = 10; break ; case 0x40: resolution[0] = 11; break ; case 0x60: resolution[0] = 12; break ; } return gbGOOD; } /* Set default resolution */ static GOOD_OR_BAD OW_w_tempres(UINT resolution, const struct parsedname *pn) { BYTE data[SCRATCHPAD_LENGTH]; if (OW_r_scratchpad(data, pn)) { return gbBAD; } data[4] &= 0x9f; switch (resolution) { case 9: break; case 10: data[4] |= 0x20; break; case 11: data[4] |= 0x40; break; case 12: data[4] |= 0x60; break; default: return gbBAD; } return OW_w_store_scratchpad(&data[2], pn); } /* read 9 bytes, includes CRC8 which is checked */ static GOOD_OR_BAD OW_r_scratchpad(BYTE * data, const struct parsedname *pn) { /* data is 9 bytes long */ BYTE be[] = { _1W_READ_SCRATCHPAD, }; struct transaction_log tread[] = { TRXN_START, TRXN_WRITE1(be), TRXN_READ(data, SCRATCHPAD_LENGTH), TRXN_CRC8(data, SCRATCHPAD_LENGTH), TRXN_END, }; return BUS_transaction(tread, pn); } /* write 3 bytes (byte2,3,4 of register) */ /* Write the scratchpad but not back to static */ static GOOD_OR_BAD OW_w_scratchpad(const BYTE * data, const struct parsedname *pn) { /* data is 3 bytes long */ BYTE d[4] = { _1W_WRITE_SCRATCHPAD, data[0], data[1], data[2], }; /* different processing for DS18S20 and others */ int scratch_length = (pn->sn[0] == 0x10) ? 2 : 3 ; struct transaction_log twrite[] = { TRXN_START, TRXN_WRITE(d, scratch_length+1), TRXN_END, }; return BUS_transaction(twrite, pn); } /* write 3 bytes (byte2,3,4 of register) */ /* write to scratchpad and store in static */ static GOOD_OR_BAD OW_w_store_scratchpad(const BYTE * data, const struct parsedname *pn) { /* data is 3 bytes long */ BYTE d[4] = { _1W_WRITE_SCRATCHPAD, data[0], data[1], data[2], }; BYTE pow[] = { _1W_COPY_SCRATCHPAD, }; /* different processing for DS18S20 and others */ int scratch_length = (pn->sn[0] == 0x10) ? 2 : 3 ; struct transaction_log twrite[] = { TRXN_START, TRXN_WRITE(d, scratch_length+1), TRXN_START, TRXN_POWER(pow, 10), TRXN_END, }; return BUS_transaction(twrite, pn); } /* Trim values -- undocumented except in AN247.pdf */ static GOOD_OR_BAD OW_r_trim(BYTE * trim, const struct parsedname *pn) { BYTE cmd0[] = { _1W_READ_TRIM_1, }; BYTE cmd1[] = { _1W_READ_TRIM_2, }; struct transaction_log t0[] = { TRXN_START, TRXN_WRITE1(cmd0), TRXN_READ1(&trim[0]), TRXN_END, }; struct transaction_log t1[] = { TRXN_START, TRXN_WRITE1(cmd1), TRXN_READ1(&trim[1]), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t0, pn)) ; return BUS_transaction(t1, pn); } static GOOD_OR_BAD OW_w_trim(const BYTE * trim, const struct parsedname *pn) { BYTE cmd0[] = { _1W_WRITE_TRIM_1, trim[0], }; BYTE cmd1[] = { _1W_WRITE_TRIM_2, trim[1], }; BYTE cmd2[] = { _1W_ACTIVATE_TRIM_1, }; BYTE cmd3[] = { _1W_ACTIVATE_TRIM_2, }; struct transaction_log t0[] = { TRXN_START, TRXN_WRITE2(cmd0), TRXN_END, }; struct transaction_log t1[] = { TRXN_START, TRXN_WRITE2(cmd1), TRXN_END, }; struct transaction_log t2[] = { TRXN_START, TRXN_WRITE1(cmd2), TRXN_END, }; struct transaction_log t3[] = { TRXN_START, TRXN_WRITE1(cmd3), TRXN_END, }; RETURN_BAD_IF_BAD( BUS_transaction(t0, pn) ); RETURN_BAD_IF_BAD( BUS_transaction(t1, pn) ); RETURN_BAD_IF_BAD( BUS_transaction(t2, pn) ); RETURN_BAD_IF_BAD( BUS_transaction(t3, pn) ); return gbGOOD; } /* This is the CMOS die for the circuit, not program death */ static enum eDie OW_die(const struct parsedname *pn) { BYTE die[6] = { pn->sn[6], pn->sn[5], pn->sn[4], pn->sn[3], pn->sn[2], pn->sn[1], }; // data gives index into die matrix if (memcmp(die, DIE[pn->selected_filetype->data.i].C2, 6) > 0) { return eC2; } if (memcmp(die, DIE[pn->selected_filetype->data.i].B7, 6) > 0) { return eB7; } return eB6; } /* Powered temperature measurements -- need to poll line since it is held low during measurement */ /* We check every 10 msec (arbitrary) up to 1.25 seconds */ static GOOD_OR_BAD OW_poll_convert(const struct parsedname *pn) { int i; BYTE p[1]; struct transaction_log t[] = { {NULL, NULL, 10, trxn_delay,}, TRXN_READ1(p), TRXN_END, }; // the first test is faster for just DS2438 (10 msec) // subsequent polling is slower since the DS18x20 is a slower converter for (i = 0; i < 22; ++i) { //LEVEL_DEBUG("TEST polling %d",i); if ( BAD( BUS_transaction_nolock(t, pn) )) { LEVEL_DEBUG("BUS_transaction failed"); break; } if (p[0] != 0) { LEVEL_DEBUG("BUS_transaction done after %dms", (i + 1) * 10); return gbGOOD; } t[0].size = 50; // 50 msec for rest of delays } LEVEL_DEBUG("Temperature measurement failed"); return gbBAD; } /* read PIO pins for the DS28EA00 */ static GOOD_OR_BAD OW_read_piostate(UINT * piostate, const struct parsedname *pn) { BYTE data[1]; BYTE cmd[] = { _1W_PIO_ACCESS_READ, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(cmd), TRXN_READ1(data), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; /* compare lower and upper nibble to be complements */ // High nibble the complement of low nibble? // Fix thanks to josef_heiler if ((data[0] & 0x0F) != ((~data[0] >> 4) & 0x0F)) { return gbBAD; } piostate[0] = data[0] & 0x0F ; return gbGOOD; } /* Write to PIO -- both channels. Already inverted and other fields set to 1 */ static GOOD_OR_BAD OW_w_pio(BYTE pio, const struct parsedname *pn) { BYTE cmd[] = { _1W_PIO_ACCESS_WRITE, pio, BYTE_INVERSE(pio) }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(cmd), TRXN_END, }; return BUS_transaction(t, pn); } static _FLOAT OW_masked_temperature( BYTE * data, struct tempresolution * Resolution ) { // Torsten Godau found a problem with 9-bit resolution //printf("%s", "TEMPERATURE REGISTERS, data[1]: "); //printf("%x", data[1]); //printf("%s", ", data[0]: "); //printf("%x\n", data[0]); //printf("%s %x %s %f \n", "ResMask: ", Resolution->mask, "ResScale: ", Resolution->scale); return (_FLOAT) ((int16_t) ((data[1] << 8) | (data[0] & (Resolution->mask)))) / Resolution->scale ; } static GOOD_OR_BAD OW_r_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[] = { _1W_READ_MEMORY, offset & 0x7F, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(p), TRXN_READ(data,size), TRXN_END, }; return BUS_transaction(t, pn) ; } // write into eeprom // need to split into pages static GOOD_OR_BAD OW_w_mem( BYTE * data, size_t size, off_t offset, struct parsedname * pn ) { int pagesize = 8 ; BYTE * dataloc = data ; size_t left_to_write = size ; off_t current_off = offset ; off_t page_boundary_next = offset + pagesize - (offset % pagesize ) ; // loop through pages while ( left_to_write > 0 ) { off_t this_write = left_to_write ; // trim length of write to fit in page if ( current_off + this_write > page_boundary_next ) { this_write = page_boundary_next - current_off ; } // write this page RETURN_BAD_IF_BAD( OW_w_page( dataloc, this_write, current_off, pn ) ) ; // update pointers and counters dataloc += this_write ; left_to_write -= this_write ; current_off += this_write ; page_boundary_next += pagesize ; } return gbGOOD ; } // write into a "page" // we assume that the "size" won't cross page boundary static GOOD_OR_BAD OW_w_page( BYTE * data, size_t size, off_t offset, struct parsedname * pn ) { size_t pagesize = 8 ; off_t page_offset = offset - (offset % pagesize ) ; BYTE p_write[2+pagesize+1] ; BYTE p_read[2+pagesize+1] ; BYTE p_copy[2] ; struct transaction_log t_write[] = { TRXN_START, TRXN_WRITE( p_write, 2+pagesize ), TRXN_READ1( &p_write[2+pagesize] ), TRXN_CRC8( p_write, 2+pagesize+1 ), TRXN_END, } ; struct transaction_log t_read[] = { TRXN_START, TRXN_WRITE2( p_read ), TRXN_READ( &p_read[2], pagesize+1 ), TRXN_CRC8( p_read, 2+pagesize+1 ), TRXN_COMPARE( &p_write[2+pagesize], &p_read[2+pagesize], pagesize ) , TRXN_END, } ; struct transaction_log t_copy[] = { TRXN_START, TRXN_WRITE1( p_copy ), TRXN_POWER( &p_copy[1], 25 ), // 25 msec TRXN_END, } ; if ( size == 0 ) { return gbGOOD ; } // is this a partial page (need to read the full page first to fill the buffer) if ( size != pagesize ) { RETURN_BAD_IF_BAD( OW_r_mem( &p_write[2], pagesize, page_offset, pn ) ) ; } // Copy data into loaded buffer memcpy( &p_write[2 + (offset - page_offset)], data, size ) ; // write to scratchpad 2 p_write[0] = _1W_WRITE_SCRATCHPAD2 ; p_write[1] = page_offset ; RETURN_BAD_IF_BAD( BUS_transaction( t_write, pn ) ) ; // read from scratchpad 2 and compare p_read[0] = _1W_READ_SCRATCHPAD2 ; p_read[1] = page_offset ; RETURN_BAD_IF_BAD( BUS_transaction( t_read, pn ) ) ; // copy scratchpad 2 to eeprom p_copy[0] = _1W_COPY_SCRATCHPAD2 ; p_copy[1] = _1W_COPY_SCRATCHPAD2_DO ; return BUS_transaction( t_copy, pn ) ; } owfs-3.1p5/module/owlib/src/c/ow_1821.c0000644000175000001440000003206012654730021014374 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_1821.h" #include /* ------- Prototypes ----------- */ /* DS18S20&2 Temperature */ // READ_FUNCTION( FS_tempdata ) ; READ_FUNCTION(FS_temperature); READ_FUNCTION(FS_r_polarity); WRITE_FUNCTION(FS_w_polarity); READ_FUNCTION(FS_r_templimit); WRITE_FUNCTION(FS_w_templimit); READ_FUNCTION(FS_r_thermomode); WRITE_FUNCTION(FS_w_thermomode); READ_FUNCTION(FS_r_oneshot); WRITE_FUNCTION(FS_w_oneshot); READ_FUNCTION(FS_r_tlf); WRITE_FUNCTION(FS_w_tlf); READ_FUNCTION(FS_r_thf); WRITE_FUNCTION(FS_w_thf); /* -------- Structures ---------- */ static struct filetype DS1821[] = { F_type, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_temperature, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"polarity", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_polarity, FS_w_polarity, VISIBLE, NO_FILETYPE_DATA, }, {"templow", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE, {.i=1}, }, {"temphigh", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE, {.i=0}, }, {"templowflag", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_tlf, FS_w_tlf, VISIBLE, NO_FILETYPE_DATA, }, {"temphighflag", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_thf, FS_w_thf, VISIBLE, NO_FILETYPE_DATA, }, {"thermostatmode", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_thermomode, FS_w_thermomode, VISIBLE, NO_FILETYPE_DATA, }, {"1shot", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_oneshot, FS_w_oneshot, VISIBLE, NO_FILETYPE_DATA, } } ; DeviceEntry(thermostat, DS1821, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_READ_TEMPERATURE 0xAA #define _1W_START_CONVERT_T 0xEE #define _1W_STOP_CONVERT_T 0x22 #define _1W_WRITE_TH 0x01 #define _1W_WRITE_TL 0x02 #define _1W_READ_TH 0xA1 #define _1W_READ_TL 0xA2 #define _1W_WRITE_STATUS 0x0C #define _1W_READ_STATUS 0xAC #define _1W_READ_COUNTER 0xA0 #define _1W_LOAD_COUNTER 0x41 /* Definition of status register bits. */ /* Please see the DS1821 datasheet for further information. */ #define DS1821_STATUS_1SHOT 0 // 0: convert temp continuously; 1: one conversion only. #define DS1821_STATUS_POL 1 // 0: in thermostat mode DQ output is active low; 1: active high. #define DS1821_STATUS_TR 2 // 0: go 1-wire mode on next power-up; 1: go into thermostat mode. #define DS1821_STATUS_TLF 3 // 0: temp has not been below the TL temp; 1: temp has. #define DS1821_STATUS_THF 4 // 0: temp has not been above the TH temp; 1: temp has. #define DS1821_STATUS_NVB 5 // 0: EEPROM write not in progress; 1: EEPROM write in progress. // Bit 6 always returns 1. #define DS1821_STATUS_DONE 7 // 0: temp conversion in progress; 1: conversion finished. /* End of status register bits. */ /* ------- Functions ------------ */ /* DS1821*/ static GOOD_OR_BAD OW_temperature(_FLOAT * temp, const struct parsedname *pn); static GOOD_OR_BAD OW_current_temperature(_FLOAT * temp, const struct parsedname *pn); static GOOD_OR_BAD OW_current_temperature_lowres(_FLOAT * temp, const struct parsedname *pn); static GOOD_OR_BAD OW_r_status(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_w_status(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_templimit(_FLOAT * T, const int Tindex, const struct parsedname *pn); static GOOD_OR_BAD OW_w_templimit(const _FLOAT T, const int Tindex, const struct parsedname *pn); static ZERO_OR_ERROR FS_temperature(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_temperature(&OWQ_F(owq), PN(owq))) ; } static ZERO_OR_ERROR FS_r_thf(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; OWQ_Y(owq) = (data >> DS1821_STATUS_THF) & 0x01; // OWQ_Y(owq) = (data & 0x10) >> 4; return 0; } static ZERO_OR_ERROR FS_w_thf(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; UT_setbit(&data, DS1821_STATUS_THF, OWQ_Y(owq)); return GB_to_Z_OR_E(OW_w_status(&data, PN(owq))) ; } static ZERO_OR_ERROR FS_r_tlf(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; OWQ_Y(owq) = (data >> DS1821_STATUS_TLF) & 0x01; //OWQ_Y(owq) = (data & 0x08) >> 3; return 0; } static ZERO_OR_ERROR FS_w_tlf(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; UT_setbit(&data, DS1821_STATUS_TLF, OWQ_Y(owq)); return GB_to_Z_OR_E(OW_w_status(&data, PN(owq))) ; } static ZERO_OR_ERROR FS_r_thermomode(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; OWQ_Y(owq) = (data >> DS1821_STATUS_TR) & 0x01; // OWQ_Y(owq) = (data & 0x04) >> 2; return 0; } static ZERO_OR_ERROR FS_w_thermomode(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; UT_setbit(&data, DS1821_STATUS_TR, OWQ_Y(owq)); return GB_to_Z_OR_E(OW_w_status(&data, PN(owq))) ; } static ZERO_OR_ERROR FS_r_polarity(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; OWQ_Y(owq) = (data >> DS1821_STATUS_POL) & 0x01; return 0; } static ZERO_OR_ERROR FS_w_polarity(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; UT_setbit(&data, DS1821_STATUS_POL, OWQ_Y(owq)); return GB_to_Z_OR_E(OW_w_status(&data, PN(owq))) ; } static ZERO_OR_ERROR FS_r_oneshot(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; OWQ_Y(owq) = (data >> DS1821_STATUS_1SHOT) & 0x01; return 0; } /* Set or reset the "one shot" bit of the status register. * * One of several idiosyncrasies of this chip is it's "Continuous Conversion/1Shot" mode. * If the 1Shot bit is zero at the time a temperature conversion is finished then the chip starts another * conversion immediately without needing a Start Conversion command. It continues to do this until * it hears a Stop Conversion command. This means that the chip doesn't do anything when the 1Shot * bit is cleared - it waits until the next Start Conversion command before starting continuous conversions. * I can't see how this waiting behaviour is useful so I have issued Start Conversion and Stop Conversion * commands at the appropriate times on the assumption that the reason you are setting the continuous conversion * mode is because you want continuous conversions. */ static ZERO_OR_ERROR FS_w_oneshot(struct one_wire_query *owq) { BYTE pstop[] = { _1W_STOP_CONVERT_T, }; struct transaction_log tstop[] = { TRXN_START, TRXN_WRITE1(pstop), TRXN_END, }; BYTE pstart[] = { _1W_START_CONVERT_T, }; struct transaction_log tstart[] = { TRXN_START, TRXN_WRITE1(pstart), TRXN_END, }; BYTE data; int oneshotmode; RETURN_ERROR_IF_BAD(OW_r_status(&data, PN(owq))) ; oneshotmode = (data >> DS1821_STATUS_1SHOT) & 0x01; UT_setbit(&data, DS1821_STATUS_1SHOT, OWQ_Y(owq)); RETURN_ERROR_IF_BAD(OW_w_status(&data, PN(owq))) ; if (!oneshotmode && OWQ_Y(owq)) { /* 1Shot mode was off and we are setting it on; i.e. we are ending continuous mode. * Continuous conversions may be in progress. * Since we are turning this mode off, it's probably a reasonable assumption * that we don't want continuous conversions anymore, * so issue a STOP CONVERSION to halt the conversions. */ if ( BUS_transaction(tstop, PN(owq)) ) { return -EINVAL; } } else if (oneshotmode && !OWQ_Y(owq)) { /* 1Shot mode was on and we are turning it off; i.e. we are starting continuous mode. * Continuous conversions are probably not in progress. * Presumably, we are doing this because we want continuous conversions so * issue a START CONVERSION command to kick things off. */ GOOD_OR_BAD ret = BUS_transaction(tstart, PN(owq)); /* We have just kicked off a conversion. If we try to read the temperature * right now we will get some previous temperature, which we are not probably * expecting. So wait for the first conversion only, just in case. We will now * be in continuous conversion mode so after the first one we no longer have to * worry about it. */ UT_delay(1000); if ( BAD(ret) ) { return -EINVAL; } } // else ; /* We are setting the bit to what it already was so do nothing special. */ return 0; } static ZERO_OR_ERROR FS_r_templimit(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_r_templimit(&OWQ_F(owq), OWQ_pn(owq).selected_filetype->data.i, PN(owq))) ; } static ZERO_OR_ERROR FS_w_templimit(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_templimit(OWQ_F(owq), OWQ_pn(owq).selected_filetype->data.i, PN(owq))) ; } static GOOD_OR_BAD OW_r_status(BYTE * data, const struct parsedname *pn) { BYTE p[] = { _1W_READ_STATUS, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(p), TRXN_READ1(data), TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD OW_w_status(BYTE * data, const struct parsedname *pn) { BYTE p[] = { _1W_WRITE_STATUS, data[0] }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(p), TRXN_END, }; return BUS_transaction(t, pn); } /* Do a transaction to get the temperature, increasing the resolution if possible. * * When we are in continuous conversion mode we don't have to wait for a conversion to finish * because, apart from the first one, one has always already been completed and the temperature stored in the * temperature register. * * However, a tricky wrinkle is that you cannot use the "high resolution" temperature calculation in continuous * conversion mode because the counter is constantly in use and reading it disrupts the temperature measurement * in progress. The result is incorrect temperature readings in the temperature register even if we don't attempt * to use the counter value to increase resolution. */ static GOOD_OR_BAD OW_temperature(_FLOAT * temp, const struct parsedname *pn) { BYTE c[] = { _1W_START_CONVERT_T, }; BYTE status; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(c), TRXN_END, }; RETURN_BAD_IF_BAD(OW_r_status(&status, pn)) ; if ((status >> DS1821_STATUS_1SHOT) & 0x01) { /* 1-shot, convert and wait 1 second */ RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; UT_delay(1000); return OW_current_temperature(temp, pn); } else { /* in continuous conversion mode. No need to delay but can't get full resolution. */ return OW_current_temperature_lowres(temp, pn); } } /* Do a transaction to get the temperature, the remaining count, and the count-per-c registers. * Perform the calculation to increase the temperature resolution. */ static GOOD_OR_BAD OW_current_temperature(_FLOAT * temp, const struct parsedname *pn) { BYTE read_temp[] = { _1W_READ_TEMPERATURE, }; BYTE read_counter[] = { _1W_READ_COUNTER, }; BYTE load_counter[] = { _1W_LOAD_COUNTER, }; BYTE temp_read; BYTE count_per_c; BYTE count_remain; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(read_temp), TRXN_READ1(&temp_read), TRXN_START, TRXN_WRITE1(read_counter), TRXN_READ1(&count_remain), TRXN_START, TRXN_WRITE1(load_counter), TRXN_START, TRXN_WRITE1(read_counter), TRXN_READ1(&count_per_c), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; if (count_per_c) { /* Perform calculation to get high temperature resolution - see datasheet. */ temp[0] = (_FLOAT) ((int8_t) temp_read) + .5 - ((_FLOAT) count_remain) / ((_FLOAT) count_per_c); } else { /* Bad count_per_c -- use lower resolution */ temp[0] = (_FLOAT) ((int8_t) temp_read); } return gbGOOD; } /* Read temperature register but do not attempt to increase the resolution, * because, for instance, the chip is in continuous conversion mode. */ static GOOD_OR_BAD OW_current_temperature_lowres(_FLOAT * temp, const struct parsedname *pn) { BYTE read_temp[] = { _1W_READ_TEMPERATURE, }; BYTE temp_read; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(read_temp), TRXN_READ1(&temp_read), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; temp[0] = (_FLOAT) ((int8_t) temp_read); return gbGOOD; } /* Limits Tindex=0 high 1=low */ static GOOD_OR_BAD OW_r_templimit(_FLOAT * T, const int Tindex, const struct parsedname *pn) { BYTE p[] = { _1W_READ_TH, _1W_READ_TL, }; BYTE data; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(&p[Tindex]), TRXN_READ1(&data), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; T[0] = (_FLOAT) ((int8_t) data); return gbGOOD; } /* Limits Tindex=0 high 1=low */ static GOOD_OR_BAD OW_w_templimit(const _FLOAT T, const int Tindex, const struct parsedname *pn) { BYTE p[] = { _1W_WRITE_TH, _1W_WRITE_TL, }; #ifdef HAVE_LRINT BYTE data = BYTE_MASK(lrint(T)); // round off #else BYTE data = BYTE_MASK((int) (T + .49)); // round off #endif struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(&p[Tindex]), TRXN_WRITE1(&data), TRXN_END, }; return BUS_transaction(t, pn);; } owfs-3.1p5/module/owlib/src/c/ow_1921.c0000644000175000001440000013037312654730021014403 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_1921.h" /* ------- Prototypes ----------- */ /* DS1921 Temperature */ READ_FUNCTION(FS_r_histotemp); READ_FUNCTION(FS_r_histogap); READ_FUNCTION(FS_r_histoelem); READ_FUNCTION(FS_r_resolution); READ_FUNCTION(FS_r_version); READ_FUNCTION(FS_r_rangelow); READ_FUNCTION(FS_r_rangehigh); READ_FUNCTION(FS_r_histogram); READ_FUNCTION(FS_r_logtemp); READ_FUNCTION(FS_r_logdate); READ_FUNCTION(FS_r_logudate); READ_FUNCTION(FS_logelements); READ_FUNCTION(FS_r_temperature); READ_FUNCTION(FS_bitread); READ_FUNCTION(FS_rbitread); WRITE_FUNCTION(FS_easystart); READ_FUNCTION(FS_alarmudate); READ_FUNCTION(FS_alarmstart); READ_FUNCTION(FS_alarmend); READ_FUNCTION(FS_alarmcnt); READ_FUNCTION(FS_alarmelems); READ_FUNCTION(FS_r_alarmtemp); WRITE_FUNCTION(FS_w_alarmtemp); READ_FUNCTION(FS_mdate); READ_FUNCTION(FS_umdate); READ_FUNCTION(FS_r_date); WRITE_FUNCTION(FS_w_date); READ_FUNCTION(FS_r_counter); WRITE_FUNCTION(FS_w_counter); READ_FUNCTION(FS_r_delay); WRITE_FUNCTION(FS_w_delay); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_samplerate); WRITE_FUNCTION(FS_w_samplerate); READ_FUNCTION(FS_r_3byte); READ_FUNCTION(FS_r_atime); WRITE_FUNCTION(FS_w_atime); READ_FUNCTION(FS_r_atrig); WRITE_FUNCTION(FS_w_atrig); WRITE_FUNCTION(FS_w_mip); READ_FUNCTION(FS_r_register); WRITE_FUNCTION(FS_w_register); READ_FUNCTION(FS_r_controlbit); WRITE_FUNCTION(FS_w_controlbit); READ_FUNCTION(FS_r_controlrbit); WRITE_FUNCTION(FS_w_controlrbit); READ_FUNCTION(FS_r_statusbit); WRITE_FUNCTION(FS_w_statusbit); WRITE_FUNCTION(FS_clrmem); /* ------- Structures ----------- */ #define HISTOGRAM_DATA_ELEMENTS 63 #define LOG_DATA_ELEMENTS 2048 struct BitRead { size_t location; int bit; }; static struct BitRead BitReads[] = { {0x0214, 7,}, //temperature in progress {0x0214, 5,}, // Mission in progress {0x0214, 4,}, //sample in progress {0x020E, 3,}, // rollover {0x020E, 7,}, // clock running (reversed) }; #define _ADDRESS_DS1921_STATUS_REGISTER 0x0214 #define _MASK_DS1921_CLEARED 0x40 #define _MASK_DS1921_MIP 0x20 #define _MASK_DS1921_TEMP_LOW_STATUS 0x04 #define _MASK_DS1921_TEMP_HIGH_STATUS 0x02 #define _MASK_DS1921_TIMER_STATUS 0x01 #define _ADDRESS_DS1921_CONTROL_REGISTER 0x020E #define _MASK_DS1921_CLOCK_ENABLE 0x80 #define _MASK_DS1921_CLEAR_MEMORY 0x40 #define _MASK_DS1921_MISSION_ENABLE 0x10 #define _MASK_DS1921_ROLLOVER 0x08 #define _MASK_DS1921_TEMP_LOW_ALARM 0x04 #define _MASK_DS1921_TEMP_HIGH_ALARM 0x02 #define _MASK_DS1921_TIMER_ALARM 0x01 struct Mission { _DATE start; int rollover; int interval; int samples; }; static struct aggregate A1921p = { 16, ag_numbers, ag_separate, }; static struct aggregate A1921l = { LOG_DATA_ELEMENTS, ag_numbers, ag_mixed, }; static struct aggregate A1921h = { HISTOGRAM_DATA_ELEMENTS, ag_numbers, ag_mixed, }; static struct aggregate A1921m = { 12, ag_numbers, ag_aggregate, }; static struct filetype DS1921[] = { F_STANDARD, {"memory", 512, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A1921p, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"ControlRegister", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_register, FS_w_register, INVISIBLE, {.u=_ADDRESS_DS1921_CONTROL_REGISTER}, }, {"StatusRegister", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_register, FS_w_register, INVISIBLE, {.u=_ADDRESS_DS1921_STATUS_REGISTER}, }, {"histogram", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"histogram/counts", PROPERTY_LENGTH_UNSIGNED, &A1921h, ft_unsigned, fc_volatile, FS_r_histogram, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"histogram/elements", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_histoelem, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"histogram/gap", PROPERTY_LENGTH_TEMPGAP, NON_AGGREGATE, ft_tempgap, fc_static, FS_r_histogap, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"histogram/temperature", PROPERTY_LENGTH_TEMP, &A1921h, ft_temperature, fc_static, FS_r_histotemp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"clock", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"clock/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_second, FS_r_date, FS_w_date, VISIBLE, NO_FILETYPE_DATA, }, {"clock/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter, FS_w_counter, VISIBLE, NO_FILETYPE_DATA, }, {"clock/running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_controlrbit, FS_w_controlrbit, VISIBLE, {.u=_MASK_DS1921_CLOCK_ENABLE}, }, {"about", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"about/resolution", PROPERTY_LENGTH_TEMPGAP, NON_AGGREGATE, ft_tempgap, fc_static, FS_r_resolution, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"about/templow", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_static, FS_r_rangelow, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"about/temphigh", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_static, FS_r_rangehigh, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"about/version", 11, NON_AGGREGATE, ft_ascii, fc_stable, FS_r_version, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"about/samples", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_3byte, NO_WRITE_FUNCTION, VISIBLE, {.s=0x021D}, }, {"about/measuring", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_rbitread, NO_WRITE_FUNCTION, VISIBLE, {.v=&BitReads[0]}, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_temperature, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"mission", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"mission/enable", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_controlrbit, FS_w_controlrbit, VISIBLE, {.u=_MASK_DS1921_MISSION_ENABLE}, }, {"mission/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, NO_READ_FUNCTION, FS_clrmem, VISIBLE, {.u=_MASK_DS1921_CLEAR_MEMORY}, }, {"mission/running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_bitread, FS_w_mip, VISIBLE, {.v=&BitReads[1]}, }, {"mission/frequency", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_samplerate, FS_w_samplerate, VISIBLE, NO_FILETYPE_DATA, }, {"mission/samples", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_3byte, NO_WRITE_FUNCTION, VISIBLE, {.s=0x021A}, }, {"mission/delay", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_delay, FS_w_delay, VISIBLE, NO_FILETYPE_DATA, }, {"mission/rollover", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_controlbit, FS_w_controlbit, VISIBLE, {.u=_MASK_DS1921_ROLLOVER}, }, {"mission/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_volatile, FS_mdate, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"mission/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_umdate, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"mission/sampling", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_bitread, NO_WRITE_FUNCTION, VISIBLE, {.v=&BitReads[2]}, }, {"mission/easystart", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, NO_READ_FUNCTION, FS_easystart, VISIBLE, NO_FILETYPE_DATA, }, {"mission/templow", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_statusbit, FS_w_statusbit, VISIBLE, {.u=_MASK_DS1921_TEMP_LOW_STATUS}, }, {"mission/temphigh", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_statusbit, FS_w_statusbit, VISIBLE, {.u=_MASK_DS1921_TEMP_HIGH_STATUS}, }, {"mission/timer", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_statusbit, FS_w_statusbit, INVISIBLE, {.u=_MASK_DS1921_TIMER_STATUS}, }, {"overtemp", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"overtemp/date", PROPERTY_LENGTH_DATE, &A1921m, ft_date, fc_volatile, FS_alarmstart, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0250}, }, {"overtemp/udate", PROPERTY_LENGTH_UNSIGNED, &A1921m, ft_unsigned, fc_volatile, FS_alarmudate, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0250}, }, {"overtemp/end", PROPERTY_LENGTH_DATE, &A1921m, ft_date, fc_volatile, FS_alarmend, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0250}, }, {"overtemp/count", PROPERTY_LENGTH_UNSIGNED, &A1921m, ft_unsigned, fc_volatile, FS_alarmcnt, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0250}, }, {"overtemp/elements", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_alarmelems, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0250}, }, {"overtemp/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_alarmtemp, FS_w_alarmtemp, VISIBLE, {.s=0x020C}, }, {"undertemp", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"undertemp/date", PROPERTY_LENGTH_DATE, &A1921m, ft_date, fc_volatile, FS_alarmstart, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0220}, }, {"undertemp/udate", PROPERTY_LENGTH_UNSIGNED, &A1921m, ft_unsigned, fc_volatile, FS_alarmudate, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0220}, }, {"undertemp/end", PROPERTY_LENGTH_DATE, &A1921m, ft_date, fc_volatile, FS_alarmend, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0220}, }, {"undertemp/count", PROPERTY_LENGTH_UNSIGNED, &A1921m, ft_unsigned, fc_volatile, FS_alarmcnt, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0220}, }, {"undertemp/elements", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_alarmelems, NO_WRITE_FUNCTION, VISIBLE, {.s=0x0220}, }, {"undertemp/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_alarmtemp, FS_w_alarmtemp, VISIBLE, {.s=0x020B}, }, {"log", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"log/temperature", PROPERTY_LENGTH_TEMP, &A1921l, ft_temperature, fc_volatile, FS_r_logtemp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"log/date", PROPERTY_LENGTH_DATE, &A1921l, ft_date, fc_volatile, FS_r_logdate, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"log/udate", PROPERTY_LENGTH_UNSIGNED, &A1921l, ft_unsigned, fc_volatile, FS_r_logudate, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"log/elements", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_logelements, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, // no entries in these directories yet {"set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"set_alarm/trigger", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_yesno, fc_volatile, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"set_alarm/templow", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_controlbit, FS_w_controlbit, VISIBLE, {.u=_MASK_DS1921_TEMP_LOW_ALARM}, }, {"set_alarm/temphigh", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_controlbit, FS_w_controlbit, VISIBLE, {.u=_MASK_DS1921_TEMP_HIGH_ALARM}, }, {"set_alarm/date", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_controlbit, FS_w_controlbit, VISIBLE, {.u=_MASK_DS1921_TIMER_ALARM}, }, {"alarm_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_samplerate, FS_w_samplerate, VISIBLE, NO_FILETYPE_DATA, }, {"alarm_second", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_atime, FS_w_atime, VISIBLE, {.s=0x0207}, }, {"alarm_minute", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_atime, FS_w_atime, VISIBLE, {.s=0x0208}, }, {"alarm_hour", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_atime, FS_w_atime, VISIBLE, {.s=0x0209}, }, {"alarm_dow", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_atime, FS_w_atime, VISIBLE, {.s=0x020A}, }, {"alarm_trigger", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_atrig, FS_w_atrig, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(21, DS1921, DEV_alarm | DEV_temp | DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD 0x55 #define _1W_READ_MEMORY 0xF0 #define _1W_READ_MEMORY_WITH_CRC 0xA5 #define _1W_CLEAR_MEMORY 0x3C #define _1W_CONVERT_TEMPERATURE 0x44 /* Different version of the Thermocron, sorted by ID[11,12] of name. Keep in sorted order */ struct Version { UINT ID; char *name; _FLOAT histolow; _FLOAT resolution; _FLOAT rangelow; _FLOAT rangehigh; UINT delay; }; static struct Version Versions[] = { {0x000, "DS1921G-F5", -40.0, 0.500, -40., +85., 90,}, {0x064, "DS1921L-F50", -40.0, 0.500, -40., +85., 300,}, {0x15C, "DS1921L-F53", -40.0, 0.500, -30., +85., 300,}, {0x254, "DS1921L-F52", -40.0, 0.500, -20., +85., 300,}, {0x34C, "DS1921L-F51", -40.0, 0.500, -10., +85., 300,}, {0x3B2, "DS1921Z-F5", -5.5, 0.125, -5., +26., 360,}, {0x4F2, "DS1921H-F5", +14.5, 0.125, +15., +46., 360,}, }; /* AM/PM for hours field */ const int ampm[8] = { 0, 10, 20, 30, 0, 10, 12, 22 }; #define VersionElements ( sizeof(Versions) / sizeof(struct Version) ) static int VersionCmp(const void *pn, const void *version) { return (((((const struct parsedname *) pn)-> sn[5]) >> 4) | (((UINT) ((const struct parsedname *) pn)->sn[6]) << 4)) - ((const struct Version *) version)->ID; } /* ------- Functions ------------ */ /* DS1921 */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t length, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_temperature(int *T, const UINT delay, struct parsedname *pn); static GOOD_OR_BAD OW_clearmemory(struct parsedname *pn); static GOOD_OR_BAD OW_2date(_DATE * d, const BYTE * data); static GOOD_OR_BAD OW_2mdate(_DATE * d, const BYTE * data); static void OW_date(const _DATE * d, BYTE * data); static GOOD_OR_BAD OW_MIP(struct parsedname *pn); static GOOD_OR_BAD OW_FillMission(struct Mission *m, struct parsedname *pn); static GOOD_OR_BAD OW_alarmlog(int *t, int *c, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_stopmission(struct parsedname *pn); static GOOD_OR_BAD OW_startmission(UINT freq, struct parsedname *pn); static GOOD_OR_BAD OW_w_date(_DATE * D, struct parsedname *pn); static GOOD_OR_BAD OW_w_run(int state, struct parsedname *pn); static GOOD_OR_BAD OW_small_read(BYTE * buffer, size_t size, off_t location, struct parsedname *pn); static GOOD_OR_BAD OW_r_histogram_single(struct one_wire_query *owq); static GOOD_OR_BAD OW_r_histogram_all(struct one_wire_query *owq); static GOOD_OR_BAD OW_r_logtemp_single(struct Version *v, struct Mission *mission, struct one_wire_query *owq); static GOOD_OR_BAD OW_r_logtemp_all(struct Version *v, struct Mission *mission, struct one_wire_query *owq); static GOOD_OR_BAD OW_r_logdate_all(struct Mission *mission, struct one_wire_query *owq); static GOOD_OR_BAD OW_r_logdate_single(struct Mission *mission, struct one_wire_query *owq); static GOOD_OR_BAD OW_r_logudate_all(struct Mission *mission, struct one_wire_query *owq); static GOOD_OR_BAD OW_r_logudate_single(struct Mission *mission, struct one_wire_query *owq); static ZERO_OR_ERROR FS_r_register(struct one_wire_query *owq) { BYTE c ; RETURN_ERROR_IF_BAD( OW_small_read( &c, 1, PN(owq)->selected_filetype->data.u, PN(owq) ) ) ; OWQ_U(owq) = c ; return 0 ; } static ZERO_OR_ERROR FS_w_register(struct one_wire_query *owq) { BYTE c = OWQ_U(owq) & 0xFF ; return GB_to_Z_OR_E( OW_w_mem( &c, 1, PN(owq)->selected_filetype->data.u, PN(owq) ) ) ; } /* ControlRegister reversed */ static ZERO_OR_ERROR FS_r_controlrbit(struct one_wire_query *owq) { UINT U = 0 ; UINT mask = PN(owq)->selected_filetype->data.u ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &U, "ControlRegister", owq ) ; OWQ_Y(owq) = ( (U & mask) == 0 ) ; return z_or_e ; } /* ControlRegister reversed */ static ZERO_OR_ERROR FS_w_controlrbit(struct one_wire_query *owq) { UINT mask = PN(owq)->selected_filetype->data.u ; UINT Y = OWQ_Y(owq) ? 0 : mask ; return FS_w_sibling_bitwork( Y, mask, "ControlRegister", owq ) ; } static ZERO_OR_ERROR FS_r_controlbit(struct one_wire_query *owq) { UINT U = 0 ; UINT mask = PN(owq)->selected_filetype->data.u ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &U, "ControlRegister", owq ) ; OWQ_Y(owq) = ( (U & mask) != 0 ) ; return z_or_e ; } static ZERO_OR_ERROR FS_w_controlbit(struct one_wire_query *owq) { UINT mask = PN(owq)->selected_filetype->data.u ; UINT Y = OWQ_Y(owq) ? mask : 0 ; return FS_w_sibling_bitwork( Y, mask, "ControlRegister", owq ) ; } static ZERO_OR_ERROR FS_clrmem(struct one_wire_query *owq) { /* clear memory */ if OWQ_Y(owq) { return GB_to_Z_OR_E( OW_clearmemory(PN(owq)) ) ; } return 0; } static ZERO_OR_ERROR FS_r_statusbit(struct one_wire_query *owq) { UINT U = 0 ; UINT mask = PN(owq)->selected_filetype->data.u ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &U, "StatusRegister", owq ) ; OWQ_Y(owq) = ( (U & mask) != 0 ) ; return z_or_e ; } static ZERO_OR_ERROR FS_w_statusbit(struct one_wire_query *owq) { UINT mask = PN(owq)->selected_filetype->data.u ; UINT Y = OWQ_Y(owq) ? mask : 0 ; return FS_w_sibling_bitwork( Y, mask, "StatusRegister", owq ) ; } static ZERO_OR_ERROR FS_bitread(struct one_wire_query *owq) { BYTE d; struct parsedname *pn = PN(owq); struct BitRead *br; if (pn->selected_filetype->data.v == NULL) { return -EINVAL; } br = ((struct BitRead *) (pn->selected_filetype->data.v)); RETURN_ERROR_IF_BAD(OW_small_read(&d, 1, br->location, pn)) ; OWQ_Y(owq) = UT_getbit(&d, br->bit); return 0; } static ZERO_OR_ERROR FS_rbitread(struct one_wire_query *owq) { ZERO_OR_ERROR ret = FS_bitread(owq); OWQ_Y(owq) = !OWQ_Y(owq); return ret; } /* histogram counts */ static ZERO_OR_ERROR FS_r_histogram(struct one_wire_query *owq) { switch (OWQ_pn(owq).extension) { case EXTENSION_ALL: return GB_to_Z_OR_E( OW_r_histogram_all(owq) ); default: return GB_to_Z_OR_E( OW_r_histogram_single(owq) ); } } static ZERO_OR_ERROR FS_r_histotemp(struct one_wire_query *owq) { int extension = OWQ_pn(owq).extension; struct Version *v = (struct Version *) bsearch(PN(owq), Versions, VersionElements, sizeof(struct Version), VersionCmp); if (v == NULL) { return -EINVAL; } if (extension == EXTENSION_ALL) { /* ALL */ int i; for (i = 0; i < HISTOGRAM_DATA_ELEMENTS; ++i) { OWQ_array_F(owq, i) = v->histolow + 4 * i * v->resolution; } } else { /* element */ OWQ_F(owq) = v->histolow + 4 * extension * v->resolution; } return 0; } static ZERO_OR_ERROR FS_r_histogap(struct one_wire_query *owq) { struct Version *v = (struct Version *) bsearch(PN(owq), Versions, VersionElements, sizeof(struct Version), VersionCmp); if (v == NULL) { return -EINVAL; } OWQ_F(owq) = v->resolution * 4; return 0; } static ZERO_OR_ERROR FS_r_histoelem(struct one_wire_query *owq) { OWQ_U(owq) = HISTOGRAM_DATA_ELEMENTS; return 0; } static ZERO_OR_ERROR FS_r_version(struct one_wire_query *owq) { struct Version *v = (struct Version *) bsearch(PN(owq), Versions, VersionElements, sizeof(struct Version), VersionCmp); return v ? OWQ_format_output_offset_and_size_z(v->name, owq) : -ENOENT; } static ZERO_OR_ERROR FS_r_resolution(struct one_wire_query *owq) { struct Version *v = (struct Version *) bsearch(PN(owq), Versions, VersionElements, sizeof(struct Version), VersionCmp); if (v == NULL) { return -EINVAL; } OWQ_F(owq) = v->resolution; return 0; } static ZERO_OR_ERROR FS_r_rangelow(struct one_wire_query *owq) { struct Version *v = (struct Version *) bsearch(PN(owq), Versions, VersionElements, sizeof(struct Version), VersionCmp); if (v == NULL) { return -EINVAL; } OWQ_F(owq) = v->rangelow; return 0; } static ZERO_OR_ERROR FS_r_rangehigh(struct one_wire_query *owq) { struct Version *v = (struct Version *) bsearch(PN(owq), Versions, VersionElements, sizeof(struct Version), VersionCmp); if (v == NULL) { return -EINVAL; } OWQ_F(owq) = v->rangehigh; return 0; } /* Temperature -- force if not in progress */ static ZERO_OR_ERROR FS_r_temperature(struct one_wire_query *owq) { int temp; struct parsedname *pn = PN(owq); struct Version *v = (struct Version *) bsearch(pn, Versions, VersionElements, sizeof(struct Version), VersionCmp); if (v == NULL) { return -EINVAL; } if ( BAD(OW_MIP(pn)) ) { return -EBUSY; /* Mission in progress */ } RETURN_ERROR_IF_BAD(OW_temperature(&temp, v->delay, pn)) ; OWQ_F(owq) = (_FLOAT) temp *v->resolution + v->histolow; return 0; } /* read counter */ /* Save a function by shoving address in data field */ static ZERO_OR_ERROR FS_r_3byte(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); size_t addr = pn->selected_filetype->data.s; BYTE data[3]; RETURN_ERROR_IF_BAD(OW_small_read(data, 3, addr, pn)) ; OWQ_U(owq) = (((((UINT) data[2]) << 8) | data[1]) << 8) | data[0]; return 0; } /* mission start date */ static ZERO_OR_ERROR FS_mdate(struct one_wire_query *owq) { struct Mission mission; RETURN_ERROR_IF_BAD(OW_FillMission(&mission, PN(owq))) ; /* Get date from chip */ OWQ_D(owq) = mission.start; return 0; } /* mission start date */ static ZERO_OR_ERROR FS_umdate(struct one_wire_query *owq) { struct Mission mission; RETURN_ERROR_IF_BAD(OW_FillMission(&mission, PN(owq))) ; /* Get date from chip */ OWQ_U(owq) = mission.start; return 0; } static ZERO_OR_ERROR FS_alarmelems(struct one_wire_query *owq) { struct Mission mission; struct parsedname *pn = PN(owq); int t[12]; int c[12]; int i; RETURN_ERROR_IF_BAD(OW_FillMission(&mission, pn)) ; RETURN_ERROR_IF_BAD(OW_alarmlog(t, c, pn->selected_filetype->data.s, pn)) ; for (i = 0; i < 12; ++i) { if (c[i] == 0) { break; } } OWQ_U(owq) = i; return 0; } /* Temperature -- force if not in progress */ static ZERO_OR_ERROR FS_r_alarmtemp(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE data[1]; struct Version *v = (struct Version *) bsearch(pn, Versions, VersionElements, sizeof(struct Version), VersionCmp); if (v == NULL) { return -EINVAL; } RETURN_ERROR_IF_BAD(OW_small_read(data, 1, pn->selected_filetype->data.s, pn)) ; OWQ_F(owq) = (_FLOAT) data[0] * v->resolution + v->histolow; return 0; } /* Temperature -- force if not in progress */ static ZERO_OR_ERROR FS_w_alarmtemp(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE data[1]; struct Version *v = (struct Version *) bsearch(pn, Versions, VersionElements, sizeof(struct Version), VersionCmp); if (v == NULL) { return -EINVAL; } if ( BAD(OW_MIP(pn)) ) { return -EBUSY; } data[0] = (OWQ_F(owq) - v->histolow) / v->resolution; return GB_to_Z_OR_E(OW_w_mem(data, 1, pn->selected_filetype->data.s, pn)) ; } static ZERO_OR_ERROR FS_alarmudate(struct one_wire_query *owq) { struct Mission mission; struct parsedname *pn = PN(owq); int t[12]; int c[12]; int i; RETURN_ERROR_IF_BAD(OW_FillMission(&mission, pn)) ; RETURN_ERROR_IF_BAD(OW_alarmlog(t, c, pn->selected_filetype->data.s, pn)) ; for (i = 0; i < 12; ++i) { OWQ_array_U(owq, i) = mission.start + t[i] * mission.interval; } return 0; } static ZERO_OR_ERROR FS_alarmstart(struct one_wire_query *owq) { struct Mission mission; struct parsedname *pn = PN(owq); int t[12]; int c[12]; int i; RETURN_ERROR_IF_BAD(OW_FillMission(&mission, pn)) ; RETURN_ERROR_IF_BAD(OW_alarmlog(t, c, pn->selected_filetype->data.s, pn)) ; for (i = 0; i < 12; ++i) { OWQ_array_D(owq, i) = mission.start + t[i] * mission.interval; } return 0; } static ZERO_OR_ERROR FS_alarmend(struct one_wire_query *owq) { struct Mission mission; struct parsedname *pn = PN(owq); int t[12]; int c[12]; int i; RETURN_ERROR_IF_BAD(OW_FillMission(&mission, pn)) ; RETURN_ERROR_IF_BAD(OW_alarmlog(t, c, pn->selected_filetype->data.s, pn)) ; for (i = 0; i < 12; ++i) { OWQ_array_D(owq, i) = mission.start + (t[i] + c[i]) * mission.interval; } return 0; } static ZERO_OR_ERROR FS_alarmcnt(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int t[12]; int c[12]; int i; RETURN_ERROR_IF_BAD(OW_alarmlog(t, c, pn->selected_filetype->data.s, pn)) ; for (i = 0; i < 12; ++i) { OWQ_array_U(owq, i) = c[i]; } return 0; } /* read clock */ static ZERO_OR_ERROR FS_r_date(struct one_wire_query *owq) { BYTE data[7]; /* Get date from chip */ RETURN_ERROR_IF_BAD(OW_small_read(data, 7, 0x0200, PN(owq))) ; return GB_to_Z_OR_E( OW_2date(&OWQ_D(owq), data) ); } /* read clock */ static ZERO_OR_ERROR FS_r_counter(struct one_wire_query *owq) { BYTE data[7]; _DATE d; /* Get date from chip */ RETURN_ERROR_IF_BAD( OW_small_read(data, 7, 0x0200, PN(owq)) ) ; RETURN_ERROR_IF_BAD( OW_2date(&d, data) ) ; OWQ_U(owq) = (UINT) d; return 0; } /* set clock */ static ZERO_OR_ERROR FS_w_date(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_w_date(&OWQ_D(owq), PN(owq)) ); } static ZERO_OR_ERROR FS_w_counter(struct one_wire_query *owq) { BYTE data[7]; struct parsedname *pn = PN(owq); _DATE d = (_DATE) OWQ_U(owq); /* Busy if in mission */ if ( BAD(OW_MIP(pn)) ) { return -EBUSY; } OW_date(&d, data); return GB_to_Z_OR_E( OW_w_mem(data, 7, 0x0200, pn) ) ; } /* start/stop mission */ static ZERO_OR_ERROR FS_w_mip(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if (OWQ_Y(owq)) { /* start a mission! */ BYTE data; RETURN_ERROR_IF_BAD(OW_small_read(&data, 1, 0x020D, pn)) ; return GB_to_Z_OR_E( OW_startmission((UINT) data, pn) ); } else { return GB_to_Z_OR_E( OW_stopmission(pn) ); } } /* read the interval between samples during a mission */ static ZERO_OR_ERROR FS_r_samplerate(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_small_read(&data, 1, 0x020D, PN(owq))) ; OWQ_U(owq) = data; return 0; } /* write the interval between samples during a mission */ static ZERO_OR_ERROR FS_w_samplerate(struct one_wire_query *owq) { if (OWQ_U(owq) > 0) { return GB_to_Z_OR_E( OW_startmission(OWQ_U(owq), PN(owq)) ); } else { return GB_to_Z_OR_E( OW_stopmission(PN(owq)) ); } } /* read the alarm time field (not bit 7, though) */ static ZERO_OR_ERROR FS_r_atime(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD(OW_small_read(&data, 1, OWQ_pn(owq).selected_filetype->data.s, PN(owq))) ; OWQ_U(owq) = data & 0x7F; return 0; } /* write one of the alarm fields */ /* NOTE: keep first bit */ static ZERO_OR_ERROR FS_w_atime(struct one_wire_query *owq) { BYTE data; struct parsedname *pn = PN(owq); RETURN_ERROR_IF_BAD(OW_small_read(&data, 1, pn->selected_filetype->data.s, pn)) ; data = ((BYTE) OWQ_U(owq)) | (data & 0x80); /* EM on */ return GB_to_Z_OR_E(OW_w_mem(&data, 1, pn->selected_filetype->data.s, pn)) ; } /* read the alarm time field (not bit 7, though) */ static ZERO_OR_ERROR FS_r_atrig(struct one_wire_query *owq) { BYTE data[4]; RETURN_ERROR_IF_BAD(OW_small_read(data, 4, 0x0207, PN(owq))) ; if (data[3] & 0x80) { OWQ_U(owq) = 4; } else if (data[2] & 0x80) { OWQ_U(owq) = 3; } else if (data[1] & 0x80) { OWQ_U(owq) = 2; } else if (data[0] & 0x80) { OWQ_U(owq) = 1; } else { OWQ_U(owq) = 0; } return 0; } static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E(COMMON_OWQ_readwrite_paged(owq, 0, pagesize, COMMON_read_memory_crc16_A5)) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E( COMMON_readwrite_paged(owq, 0, pagesize, OW_w_mem) ) ; } static ZERO_OR_ERROR FS_w_atrig(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE data[4]; RETURN_ERROR_IF_BAD(OW_small_read(data, 4, 0x0207, pn)) ; data[0] &= 0x7F; data[1] &= 0x7F; data[2] &= 0x7F; data[3] &= 0x7F; switch (OWQ_U(owq)) { /* Intentional fall-throughs in cases */ case 1: data[0] |= 0x80; case 2: data[1] |= 0x80; case 3: data[2] |= 0x80; case 4: data[3] |= 0x80; } return GB_to_Z_OR_E( OW_w_mem(data, 4, 0x0207, pn)) ; } static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32 ; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize ) ; } /* temperature log */ static ZERO_OR_ERROR FS_logelements(struct one_wire_query *owq) { struct Mission mission; RETURN_ERROR_IF_BAD(OW_FillMission(&mission, PN(owq))) ; OWQ_U(owq) = (mission.samples > LOG_DATA_ELEMENTS) ? LOG_DATA_ELEMENTS : mission.samples; return 0; } /* temperature log */ static ZERO_OR_ERROR FS_r_logdate(struct one_wire_query *owq) { struct Mission mission; RETURN_ERROR_IF_BAD(OW_FillMission(&mission, PN(owq))) ; switch (OWQ_pn(owq).extension) { case EXTENSION_ALL: return GB_to_Z_OR_E( OW_r_logdate_all(&mission, owq) ); default: return GB_to_Z_OR_E( OW_r_logdate_single(&mission, owq) ); } } /* temperature log */ static ZERO_OR_ERROR FS_r_logudate(struct one_wire_query *owq) { struct Mission mission; RETURN_ERROR_IF_BAD(OW_FillMission(&mission, PN(owq))) ; switch (OWQ_pn(owq).extension) { case EXTENSION_ALL: return GB_to_Z_OR_E( OW_r_logudate_all(&mission, owq) ); default: return GB_to_Z_OR_E( OW_r_logudate_single(&mission, owq) ); } } /* mission delay */ static ZERO_OR_ERROR FS_r_delay(struct one_wire_query *owq) { BYTE data[2]; RETURN_ERROR_IF_BAD(OW_small_read(data, 2, (size_t) 0x0212, PN(owq))) ; OWQ_U(owq) = (((UINT) data[1]) << 8) | data[0]; return 0; } /* mission delay */ static ZERO_OR_ERROR FS_w_delay(struct one_wire_query *owq) { BYTE data[2] = { LOW_HIGH_ADDRESS(OWQ_U(owq)), }; if ( BAD(OW_MIP(PN(owq))) ) { return -EBUSY; } return GB_to_Z_OR_E(OW_w_mem(data, 2, (size_t) 0x0212, PN(owq))) ; } /* temperature log */ static ZERO_OR_ERROR FS_r_logtemp(struct one_wire_query *owq) { struct Mission mission; struct parsedname *pn = PN(owq); struct Version *v = (struct Version *) bsearch(pn, Versions, VersionElements, sizeof(struct Version), VersionCmp); if (v == NULL) { return -EINVAL; } RETURN_ERROR_IF_BAD(OW_FillMission(&mission, pn)) ; switch (pn->extension) { case EXTENSION_ALL: return GB_to_Z_OR_E( OW_r_logtemp_all(v, &mission, owq) ); default: return GB_to_Z_OR_E( OW_r_logtemp_single(v, &mission, owq) ); } } static ZERO_OR_ERROR FS_easystart(struct one_wire_query *owq) { /* write 0x020E -- 0x0214 */ BYTE data[] = { 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* clear memory */ RETURN_BAD_IF_BAD( OW_clearmemory(PN(owq))) ; /* Stop clock, no rollover, no delay, temp alarms on, alarms cleared */ if ( BAD( OW_w_mem(data, 7, 0x020E, PN(owq)) ) ) { return -EINVAL; } return GB_to_Z_OR_E( OW_startmission(OWQ_U(owq), PN(owq)) ); } static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[3 + 1 + 32 + 2] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; int rest = 32 - (offset & 0x1F); struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE(p, 3 + size), TRXN_END, }; struct transaction_log tcopy_crc[] = { TRXN_START, TRXN_WR_CRC16(p, 3 + size, 0), TRXN_END, }; struct transaction_log tread[] = { TRXN_START, TRXN_WR_CRC16(p, 3, 1 + rest), TRXN_COMPARE(&p[4], data, size), TRXN_END, }; struct transaction_log twrite[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_DELAY(1), /* 1 msec >> 2 usec per byte */ TRXN_END, }; /* Copy to scratchpad -- use CRC16 if write to end of page, but don't force it */ memcpy(&p[3], data, size); if ((offset + size) & 0x1F) { /* to end of page */ RETURN_BAD_IF_BAD(BUS_transaction(tcopy, pn)) ; } else { RETURN_BAD_IF_BAD(BUS_transaction(tcopy_crc, pn)) ; } /* Re-read scratchpad and compare */ /* Note: location of data has now shifted down a byte for E/S register */ p[0] = _1W_READ_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(tread, pn)) ; /* write Scratchpad to SRAM */ p[0] = _1W_COPY_SCRATCHPAD; return BUS_transaction(twrite, pn) ; } static GOOD_OR_BAD OW_temperature(int *T, const UINT delay, struct parsedname *pn) { BYTE convert[] = { _1W_CONVERT_TEMPERATURE, }; BYTE data; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(convert), TRXN_END, }; /* Mission not progress, force conversion */ RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; /* Thermochron is powered (internally by battery) -- no reason to hold bus */ UT_delay(delay); RETURN_BAD_IF_BAD(OW_small_read(&data, 1, 0x0211, pn)) ; *T = (int) data; return gbGOOD; } static GOOD_OR_BAD OW_clearmemory(struct parsedname *pn) { /* Clear memory command */ BYTE cr[] = { _1W_CLEAR_MEMORY, }; BYTE flag; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(cr), TRXN_DELAY(1), TRXN_END, }; /* Clear memory flag */ RETURN_BAD_IF_BAD( OW_small_read(&flag, 1, 0x020E, pn) ); flag = (flag & 0x3F) | 0x40; RETURN_BAD_IF_BAD( OW_w_mem(&flag, 1, 0x020E, pn) ); return BUS_transaction(t, pn) ; } /* translate 7 byte field to a Unix-style date (number) */ static GOOD_OR_BAD OW_2date(_DATE * d, const BYTE * data) { struct tm t; /* Prefill entries */ d[0] = NOW_TIME; if (gmtime_r(d, &t) == NULL) { return gbBAD; } /* Get date from chip */ t.tm_sec = (data[0] & 0x0F) + 10 * (data[0] >> 4); /* BCD->dec */ t.tm_min = (data[1] & 0x0F) + 10 * (data[1] >> 4); /* BCD->dec */ t.tm_hour = (data[2] & 0x0F) + ampm[data[2] >> 4]; /* BCD->dec */ t.tm_mday = (data[4] & 0x0F) + 10 * (data[4] >> 4); /* BCD->dec */ t.tm_mon = (data[5] & 0x0F) + 10 * ((data[5] & 0x10) >> 4); /* BCD->dec */ t.tm_year = (data[6] & 0x0F) + 10 * (data[6] >> 4) + 100 * (2 - (data[5] >> 7)); /* BCD->dec */ //printf("_DATE_READ data=%2X, %2X, %2X, %2X, %2X, %2X, %2X\n",data[0],data[1],data[2],data[3],data[4],data[5],data[6]); //printf("_DATE: sec=%d, min=%d, hour=%d, mday=%d, mon=%d, year=%d, wday=%d, isdst=%d\n",tm.tm_sec,tm.tm_min,tm.tm_hour,tm.tm_mday,tm.tm_mon,tm.tm_year,tm.tm_wday,tm.tm_isdst) ; /* Pass through time_t again to validate */ if ((d[0] = timegm(&t)) == (time_t) - 1) { return gbBAD; } return gbGOOD; } /* translate m byte field to a Unix-style date (number) */ static GOOD_OR_BAD OW_2mdate(_DATE * d, const BYTE * data) { struct tm t; int year; /* Prefill entries */ d[0] = NOW_TIME; if (gmtime_r(d, &t) == NULL) { return gbBAD; } year = t.tm_year; /* Get date from chip */ t.tm_sec = 0; /* BCD->dec */ t.tm_min = (data[0] & 0x0F) + 10 * (data[0] >> 4); /* BCD->dec */ t.tm_hour = (data[1] & 0x0F) + ampm[data[1] >> 4]; /* BCD->dec */ t.tm_mday = (data[2] & 0x0F) + 10 * (data[2] >> 4); /* BCD->dec */ t.tm_mon = (data[3] & 0x0F) + 10 * ((data[3] & 0x10) >> 4); /* BCD->dec */ t.tm_year = (data[4] & 0x0F) + 10 * (data[4] >> 4); /* BCD->dec */ /* Adjust the century -- should be within 50 years of current */ while (t.tm_year + 50 < year) t.tm_year += 100; /* Pass through time_t again to validate */ if ((d[0] = timegm(&t)) == (time_t) - 1) { return gbBAD; } return gbGOOD; } /* set clock */ static void OW_date(const _DATE * d, BYTE * data) { struct tm tm; int year; /* Convert time format */ gmtime_r(d, &tm); data[0] = tm.tm_sec + 6 * (tm.tm_sec / 10); /* dec->bcd */ data[1] = tm.tm_min + 6 * (tm.tm_min / 10); /* dec->bcd */ data[2] = tm.tm_hour + 6 * (tm.tm_hour / 10); /* dec->bcd */ data[3] = tm.tm_wday; /* dec->bcd */ data[4] = tm.tm_mday + 6 * (tm.tm_mday / 10); /* dec->bcd */ data[5] = tm.tm_mon + 6 * (tm.tm_mon / 10); /* dec->bcd */ year = tm.tm_year % 100; data[6] = year + 6 * (year / 10); /* dec->bcd */ if (tm.tm_year > 99 && tm.tm_year < 200) { data[5] |= 0x80; } //printf("_DATE_WRITE data=%2X, %2X, %2X, %2X, %2X, %2X, %2X\n",data[0],data[1],data[2],data[3],data[4],data[5],data[6]); //printf("_DATE: sec=%d, min=%d, hour=%d, mday=%d, mon=%d, year=%d, wday=%d, isdst=%d\n",tm.tm_sec,tm.tm_min,tm.tm_hour,tm.tm_mday,tm.tm_mon,tm.tm_year,tm.tm_wday,tm.tm_isdst) ; } /* many things are disallowed if mission in progress */ /* returns 1 if MIP, 0 if not, <0 if error */ static GOOD_OR_BAD OW_MIP(struct parsedname *pn) { BYTE data; RETURN_BAD_IF_BAD( OW_small_read(&data, 1, 0x0214, pn) ); /* read status register */ return UT_getbit(&data, 5)==0 ? gbGOOD : gbBAD ; } static GOOD_OR_BAD OW_FillMission(struct Mission *mission, struct parsedname *pn) { BYTE data[16]; /* Get date from chip */ RETURN_BAD_IF_BAD(OW_small_read(data, 16, 0x020D, pn)) ; mission->interval = 60 * (int) data[0]; mission->rollover = UT_getbit(&data[1], 3); mission->samples = (((((UINT) data[15]) << 8) | data[14]) << 8) | data[13]; return OW_2mdate(&(mission->start), &data[8]); } static GOOD_OR_BAD OW_alarmlog(int *t, int *c, off_t offset, struct parsedname *pn) { BYTE data[48]; int i, j = 0; OWQ_allocate_struct_and_pointer(owq_alog); OWQ_create_temporary(owq_alog, (char *) data, sizeof(data), offset, pn); if ( BAD( COMMON_OWQ_readwrite_paged(owq_alog, 0, 32, COMMON_read_memory_crc16_A5) ) ) { return gbBAD; } for (i = 0; i < 12; ++i) { t[i] = (((((UINT) data[j + 2]) << 8) | data[j + 1]) << 8) | data[j]; c[i] = data[j + 3]; j += 4; } return gbGOOD; } static GOOD_OR_BAD OW_stopmission(struct parsedname *pn) { /* write 0 to bit 5 of status register 0x0214 to stop the mission */ BYTE data = 0xDF; return OW_w_mem(&data, 1, 0x0214, pn); } static GOOD_OR_BAD OW_startmission(UINT freq, struct parsedname *pn) { BYTE data; /* stop the mission */ RETURN_BAD_IF_BAD(OW_stopmission(pn)) ; if (freq == 0) { return gbGOOD; /* stay stopped */ } if (freq > 255) { return gbBAD; /* Bad interval */ } RETURN_BAD_IF_BAD(OW_small_read(&data, 1, 0x020E, pn)) ; if ((data & 0x80)) { /* clock stopped */ _DATE d = NOW_TIME; /* start clock */ RETURN_BAD_IF_BAD(OW_w_date(&d, pn)) ; UT_delay(1000); /* wait for the clock to count a second */ } /* finally, set the sample interval (to start the mission) */ data = BYTE_MASK(freq); return OW_w_mem(&data, 1, 0x020D, pn); } /* set clock */ static GOOD_OR_BAD OW_w_date(_DATE * D, struct parsedname *pn) { BYTE data[7]; RETURN_BAD_IF_BAD(OW_MIP(pn)) ; OW_date(D, data); RETURN_BAD_IF_BAD( OW_w_mem(data, 7, 0x0200, pn) ); return GB_to_Z_OR_E( OW_w_run(1, pn) ); } /* stop/start clock running */ static GOOD_OR_BAD OW_w_run(int state, struct parsedname *pn) { BYTE cr; RETURN_BAD_IF_BAD(OW_small_read(&cr, 1, 0x020E, pn)) ; cr = state ? cr & 0x7F : cr | 0x80; return OW_w_mem(&cr, 1, 0x020E, pn) ; } static GOOD_OR_BAD OW_small_read(BYTE * buffer, size_t size, off_t location, struct parsedname *pn) { OWQ_allocate_struct_and_pointer(owq_small); OWQ_create_temporary(owq_small, (char *) buffer, size, location, pn); return COMMON_read_memory_crc16_A5(owq_small, 0, 32)==0 ? gbGOOD : gbBAD ; } #define HISTOGRAM_DATA_SIZE 2 static GOOD_OR_BAD OW_r_histogram_all(struct one_wire_query *owq) { size_t pagesize = 32; int i; BYTE data[HISTOGRAM_DATA_ELEMENTS * HISTOGRAM_DATA_SIZE]; OWQ_allocate_struct_and_pointer(owq_histo); OWQ_create_temporary(owq_histo, (char *) data, sizeof(data), 0x0800, PN(owq)); if ( BAD( COMMON_OWQ_readwrite_paged(owq_histo, 0, pagesize, COMMON_read_memory_crc16_A5) ) ) { return gbBAD; } for (i = 0; i < HISTOGRAM_DATA_ELEMENTS; ++i) { OWQ_array_U(owq, i) = (((UINT) data[i * HISTOGRAM_DATA_SIZE + 1]) << 8) | data[i * HISTOGRAM_DATA_SIZE]; } return gbGOOD; } static GOOD_OR_BAD OW_r_histogram_single(struct one_wire_query *owq) { BYTE data[HISTOGRAM_DATA_SIZE]; RETURN_BAD_IF_BAD(OW_small_read(data, 2, (size_t) 0x800 + OWQ_pn(owq).extension * HISTOGRAM_DATA_SIZE, PN(owq))) ; OWQ_U(owq) = (((UINT) data[1]) << 8) | data[0]; return gbGOOD; } /* temperature log */ static GOOD_OR_BAD OW_r_logtemp_single(struct Version *v, struct Mission *mission, struct one_wire_query *owq) { int pass = 0; int off = 0; BYTE data[1]; struct parsedname *pn = PN(owq); if (mission->rollover) { pass = mission->samples / LOG_DATA_ELEMENTS; // samples/2048 off = mission->samples % LOG_DATA_ELEMENTS; // samples%2048 } if (pass) { RETURN_BAD_IF_BAD(OW_small_read(data, 1, (size_t) 0x1000 + ((pn->extension + off) % LOG_DATA_ELEMENTS), pn)) ; } else { RETURN_BAD_IF_BAD(OW_small_read(data, 1, (size_t) 0x1000 + pn->extension, pn)) ; } OWQ_F(owq) = (_FLOAT) data[0] * v->resolution + v->histolow; return gbGOOD; } /* temperature log */ static GOOD_OR_BAD OW_r_logtemp_all(struct Version *v, struct Mission *mission, struct one_wire_query *owq) { int pass = 0; int off = 0; size_t pagesize = 32; int i; BYTE data[LOG_DATA_ELEMENTS]; OWQ_allocate_struct_and_pointer(owq_log); if (mission->rollover) { pass = mission->samples / LOG_DATA_ELEMENTS; // samples/2048 off = mission->samples % LOG_DATA_ELEMENTS; // samples%2048 } OWQ_create_temporary(owq_log, (char *) data, sizeof(data), 0x1000, PN(owq)); RETURN_BAD_IF_BAD(COMMON_OWQ_readwrite_paged(owq_log, 0, pagesize, COMMON_read_memory_crc16_A5) ); if (pass) { for (i = 0; i < LOG_DATA_ELEMENTS; ++i) { OWQ_array_F(owq, i) = (_FLOAT) data[(i + off) % LOG_DATA_ELEMENTS] * v->resolution + v->histolow; } } else { for (i = 0; i < LOG_DATA_ELEMENTS; ++i) { OWQ_array_F(owq, i) = (_FLOAT) data[i] * v->resolution + v->histolow; } } return gbGOOD; } static GOOD_OR_BAD OW_r_logdate_single(struct Mission *mission, struct one_wire_query *owq) { int extension = OWQ_pn(owq).extension; int pass = 0; if (mission->rollover) { pass = mission->samples / LOG_DATA_ELEMENTS; // samples/2048 } if (pass) { OWQ_D(owq) = mission->start + (mission->samples - LOG_DATA_ELEMENTS + extension) * mission->interval; } else { OWQ_D(owq) = mission->start + extension * mission->interval; } return gbGOOD; } static GOOD_OR_BAD OW_r_logdate_all(struct Mission *mission, struct one_wire_query *owq) { int pass = 0; int i; if (mission->rollover) { pass = mission->samples / LOG_DATA_ELEMENTS; // samples/2048 } if (pass) { for (i = 0; i < LOG_DATA_ELEMENTS; ++i) OWQ_array_D(owq, i) = mission->start + (mission->samples - LOG_DATA_ELEMENTS + i) * mission->interval; } else { for (i = 0; i < LOG_DATA_ELEMENTS; ++i) OWQ_array_D(owq, i) = mission->start + i * mission->interval; } return gbGOOD; } static GOOD_OR_BAD OW_r_logudate_single(struct Mission *mission, struct one_wire_query *owq) { int extension = OWQ_pn(owq).extension; int pass = 0; if (mission->rollover) { pass = mission->samples / LOG_DATA_ELEMENTS; // samples/2048 } if (pass) { OWQ_U(owq) = mission->start + (mission->samples - LOG_DATA_ELEMENTS + extension) * mission->interval; } else { OWQ_U(owq) = mission->start + extension * mission->interval; } return gbGOOD; } static GOOD_OR_BAD OW_r_logudate_all(struct Mission *mission, struct one_wire_query *owq) { int pass = 0; int i; if (mission->rollover) { pass = mission->samples / LOG_DATA_ELEMENTS; // samples/2048 } if (pass) { for (i = 0; i < LOG_DATA_ELEMENTS; ++i) { OWQ_array_U(owq, i) = mission->start + (mission->samples - LOG_DATA_ELEMENTS + i) * mission->interval; } } else { for (i = 0; i < LOG_DATA_ELEMENTS; ++i) { OWQ_array_U(owq, i) = mission->start + i * mission->interval; } } return gbGOOD; } #undef HISTOGRAM_DATA_SIZE #undef LOG_DATA_ELEMENTS #undef HISTOGRAM_DATA_ELEMENTS owfs-3.1p5/module/owlib/src/c/ow_1923.c0000644000175000001440000005417612654730021014413 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Notes on DS1923 passwords The DS1923 has (optional) password protection for data reads, and full read/write This creaqtes problems for the filesystem metaphore, that typically doesn't allow aditional information to be sent with every operation. Our solution is to have the password stored in memory in each session, and thus used transparently when read/write pcalls are done. There are therefore several password operations: 1. Setting/clearing passwords in the chip 2. Setting local (memory) knowledge of the password 3. Turning password protection on/off So we have two cases: 1. No passowrd protection Then any read/write should succeed. There are issues with the testing since password protection needs memory access to test. It should be possible to set passwords (and password protection) from this state 2. Passord protection set on chip Passords need to be set in memory to */ #include #include "owfs_config.h" #include "ow_1923.h" /* ------- Prototypes ----------- */ /* DS1923 Battery */ READ_FUNCTION(FS_r_temperature); READ_FUNCTION(FS_r_humid); READ_FUNCTION(FS_r_date); WRITE_FUNCTION(FS_w_date); READ_FUNCTION(FS_r_counter); WRITE_FUNCTION(FS_w_counter); READ_FUNCTION(FS_bitread); WRITE_FUNCTION(FS_bitwrite); READ_FUNCTION(FS_rbitread); WRITE_FUNCTION(FS_rbitwrite); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); WRITE_FUNCTION(FS_w_run); WRITE_FUNCTION(FS_w_mip); READ_FUNCTION(FS_r_delay); WRITE_FUNCTION(FS_w_delay); /* ------- Structures ----------- */ struct BitRead { size_t location; int bit; }; static struct BitRead BitReads[] = { {0x0215, 1,}, // Mission in progress {0x0213, 4,}, // rollover {0x0212, 0,}, // clock running {0x0213, 0,}, //sample temp in progress {0x0213, 1,}, //sample humidity in progress //{ 0x0214, 7, } , //temperature in progress //{ 0x0214, 4, } , //sample in progress }; /* Device configuration byte (Address 0x0226) Add detection and support for all of them... 00000000 DS2422 00100000 DS1923 01000000 DS1922L 01100000 DS1922T */ struct Mission { _DATE start; int rollover; int interval; int samples; }; static struct aggregate A1923p = { 18, ag_numbers, ag_separate, }; static struct filetype DS1923[] = { F_STANDARD, #if 0 /* Just test functions */ {"memory", 512, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, #endif {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A1923p, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_temperature, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"humidity", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_humid, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"clock", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"clock/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_second, FS_r_date, FS_w_date, VISIBLE, NO_FILETYPE_DATA, }, {"clock/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter, FS_w_counter, VISIBLE, NO_FILETYPE_DATA, }, {"clock/running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_rbitread, FS_rbitwrite, VISIBLE, {.v=&BitReads[2]}, }, #if 0 /* Just test functions */ {"running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_run, FS_w_run, VISIBLE, NO_FILETYPE_DATA, }, {"clearmem", 1, NON_AGGREGATE, ft_binary, fc_stable, FS_clearmem, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"enableosc", 1, NON_AGGREGATE, ft_binary, fc_stable, FS_enable_osc, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, #endif {"mission", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"mission/running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_bitread, FS_w_mip, VISIBLE, {.v=&BitReads[0]}, }, {"mission/rollover", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_bitread, FS_bitwrite, VISIBLE, {.v=&BitReads[1]}, }, {"mission/delay", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_delay, FS_w_delay, VISIBLE, NO_FILETYPE_DATA, }, {"mission/samplingtemp", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_bitread, NO_WRITE_FUNCTION, VISIBLE, {.v=&BitReads[3]}, }, {"mission/samplinghumidity", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_bitread, NO_WRITE_FUNCTION, VISIBLE, {.v=&BitReads[4]}, }, }; DeviceEntryExtended(41, DS1923, DEV_temp | DEV_alarm | DEV_ovdr | DEV_resume, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD_WITH_PASSWORD 0x99 #define _1W_READ_MEMORY_WITH_PASSWORD_AND_CRC 0x69 #define _1W_CLEAR_MEMORY_WITH_PASSWORD 0x96 #define _1W_FORCED_CONVERSION 0x55 #define _1W_FORCED_CONVERSION_START 0xFF #define _1W_START_MISSION_WITH_PASSWORD 0xCC #define _1W_START_MISSION_WITH_PASSWORD_START 0xFF #define _1W_STOP_MISSION_WITH_PASSWORD 0x33 #define _1W_STOP_MISSION_WITH_PASSWORD_START 0xFF #define _1W_MEM_GENERAL_PURPOSE 0x0000 #define _1W_MEM_REGISTER_P1 0x0200 #define _1W_MEM_REGISTER_P2 0x0220 #define _1W_MEM_CALIBRATION_P1 0x0240 #define _1W_MEM_CALIBRATION_P2 0x0260 #define _1W_MEM_DATALOG 0x1000 /* ------- Functions ------------ */ /* DS1923 */ static GOOD_OR_BAD OW_r_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_r_temperature(_FLOAT * T, const UINT delay, struct parsedname *pn); static GOOD_OR_BAD OW_r_humid(_FLOAT * H, const UINT delay, struct parsedname *pn); static GOOD_OR_BAD OW_startmission(unsigned long mdelay, struct parsedname *pn); static GOOD_OR_BAD OW_mission_timing(unsigned long mdelay, struct parsedname *pn) ; static GOOD_OR_BAD OW_startmission_post_setup( struct parsedname * pn ) ; static GOOD_OR_BAD OW_mission_default_setup( struct parsedname * pn ) ; static GOOD_OR_BAD OW_stopmission(struct parsedname *pn); static GOOD_OR_BAD OW_MIP(struct parsedname *pn); static GOOD_OR_BAD OW_clearmemory(struct parsedname *pn); static GOOD_OR_BAD OW_force_conversion(const UINT delay, struct parsedname *pn); static GOOD_OR_BAD OW_2date(_DATE * d, const BYTE * data); static GOOD_OR_BAD OW_oscillator(const int on, struct parsedname *pn); static void OW_date(const _DATE * d, BYTE * data); static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E( COMMON_readwrite_paged(owq, 0, pagesize, OW_r_mem)) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E( COMMON_readwrite_paged(owq, 0, pagesize, OW_w_mem)) ; } /* mission delay */ static ZERO_OR_ERROR FS_r_delay(struct one_wire_query *owq) { BYTE data[3]; RETURN_ERROR_IF_BAD( OW_r_mem(data, 3, 0x0216, PN(owq)) ); // should be 3 bytes! //u[0] = (((UINT)data[2])<<16) | (((UINT)data[1])<<8) | data[0] ; OWQ_U(owq) = (((UINT) data[1]) << 8) | data[0]; return 0; } /* mission delay */ static ZERO_OR_ERROR FS_w_delay(struct one_wire_query *owq) { UINT U = OWQ_U(owq); BYTE data[3] = { U & 0xFF, (U >> 8) & 0xFF, (U >> 16) & 0xFF }; if ( BAD(OW_MIP(PN(owq)) ) ) { return -EBUSY; } return GB_to_Z_OR_E( OW_w_mem(data, 3, 0x0216, PN(owq))) ; } /* stop/start clock running */ static ZERO_OR_ERROR FS_w_run(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE cr; BYTE check; RETURN_ERROR_IF_BAD( OW_r_mem(&cr, 1, 0x0212, pn) ); // only bit 0 and 1 should be used! if (cr & 0xFC) { return -EINVAL; } cr = OWQ_Y(owq) ? (cr | 0x01) : (cr & 0xFE); RETURN_ERROR_IF_BAD( OW_w_mem(&cr, 1, 0x0212, pn) ); /* Double check written value */ RETURN_ERROR_IF_BAD( OW_r_mem(&check, 1, 0x0212, pn) ); if (check != cr) { return -EINVAL; } return 0; } /* start/stop mission */ static ZERO_OR_ERROR FS_w_mip(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); unsigned long mdelay; BYTE data[3]; //printf("FS_w_mip:\n"); if (OWQ_Y(owq)) { /* start a mission! */ //printf("FS_w_mip: start\n"); RETURN_ERROR_IF_BAD( OW_r_mem(data, 3, 0x0216, pn) ); mdelay = data[0] | data[1] << 8 | data[2] << 16; return GB_to_Z_OR_E(OW_startmission(mdelay, pn)); } else { //printf("FS_w_mip: stop\n"); return GB_to_Z_OR_E( OW_stopmission(pn) ); } } static ZERO_OR_ERROR FS_bitread(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE d; struct BitRead *br; if (pn->selected_filetype->data.v == NULL) { return -EINVAL; } br = ((struct BitRead *) (pn->selected_filetype->data.v)); RETURN_ERROR_IF_BAD( OW_r_mem(&d, 1, br->location, pn) ); OWQ_Y(owq) = UT_getbit(&d, br->bit); return 0; } static ZERO_OR_ERROR FS_bitwrite(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE d; struct BitRead *br; if (pn->selected_filetype->data.v == NULL) { return -EINVAL; } br = ((struct BitRead *) (pn->selected_filetype->data.v)); RETURN_ERROR_IF_BAD( OW_r_mem(&d, 1, br->location, pn) ); UT_setbit(&d, br->bit, OWQ_Y(owq)); return GB_to_Z_OR_E( OW_w_mem(&d, 1, br->location, pn) ) ; } static ZERO_OR_ERROR FS_rbitread(struct one_wire_query *owq) { ZERO_OR_ERROR ret = FS_bitread(owq); OWQ_Y(owq) = !OWQ_Y(owq); return ret; } static int FS_rbitwrite(struct one_wire_query *owq) { OWQ_Y(owq) = !OWQ_Y(owq); return FS_bitwrite(owq); } /* Temperature -- force if not in progress */ static ZERO_OR_ERROR FS_r_temperature(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT delay = 666; RETURN_ERROR_IF_BAD( OW_MIP(pn)); RETURN_ERROR_IF_BAD(OW_force_conversion(delay, pn)); return GB_to_Z_OR_E(OW_r_temperature(&OWQ_F(owq), delay, pn)) ; } static ZERO_OR_ERROR FS_r_humid(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT delay = 666; RETURN_ERROR_IF_BAD( OW_MIP(pn)); RETURN_ERROR_IF_BAD(OW_force_conversion(delay, pn)); return GB_to_Z_OR_E(OW_r_humid(&OWQ_F(owq), delay, pn)) ; } /* translate 7 byte field to a Unix-style date (number) */ static GOOD_OR_BAD OW_2date(_DATE * d, const BYTE * data) { struct tm t; /* Prefill entries */ d[0] = NOW_TIME; if (gmtime_r(d, &t) == NULL) { //printf("OW_2date: error1\n"); return gbBAD; } //printf("_DATE: sec=%d, min=%d, hour=%d, mday=%d, mon=%d, year=%d, wday=%d, isdst=%d\n",t.tm_sec, t.tm_min, t.tm_hour, t.tm_mday, t.tm_mon, t.tm_year, t.tm_wday, t.tm_isdst); #define bcd2dec(x) (((x)&0x70)>>4)*10 + ((x)&0x0F) t.tm_sec = bcd2dec(data[0]); t.tm_min = bcd2dec(data[1]); if (data[2] & 0x40) { // am/pm mode t.tm_hour = ((data[2] & 0x20) ? 12 : 0) + bcd2dec(data[2] & 0x1F); } else { t.tm_hour = bcd2dec(data[2] & 0x2F); } t.tm_mday = bcd2dec(data[3] & 0x2F); t.tm_mon = bcd2dec(data[4] & 0x1F); // should be range 0-11 //The number of years since 1900. t.tm_year = (data[4] & 0x80 ? 100 : 0) + bcd2dec(data[5] & 0xFF); //printf("_DATE_READ data=%2X, %2X, %2X, %2X, %2X, %2X\n", data[0], data[1], data[2], data[3], data[4], data[5]); //printf("_DATE: sec=%d, min=%d, hour=%d, mday=%d, mon=%d, year=%d, wday=%d, isdst=%d\n",t.tm_sec, t.tm_min, t.tm_hour, t.tm_mday, t.tm_mon, t.tm_year, t.tm_wday, t.tm_isdst); /* Pass through time_t again to validate */ if ((*d = timegm(&t)) == -1) { //printf("2date: error2\n"); return gbBAD; } return gbGOOD; } static GOOD_OR_BAD OW_oscillator(const int on, struct parsedname *pn) { BYTE d; BYTE check; /* Since the DS1923 has a bug and permanently hangs if oscillator is * turned off, I make this real paranoid read/write/read of the * oscillator bit until I know the code really works. */ RETURN_BAD_IF_BAD( OW_r_mem(&d, 1, 0x0212, pn) ); /* Only bit 0 and 1 are used... All other bits should be 0 */ if (d & 0xFC) { return gbBAD; } if (on) { if (d & 0x01) { return gbGOOD; // already on } d |= 0x01; } else { if (!(d & 0x01)) { return gbGOOD; // already off } d &= 0xFE; } RETURN_ERROR_IF_BAD( OW_w_mem(&d, 1, 0x0212, pn) ); RETURN_ERROR_IF_BAD( OW_r_mem(&check, 1, 0x0212, pn) ); if (check != d) { return gbBAD; // failed to change value } UT_delay(1000); // I just want to wait a second and let clock update return gbGOOD; } /* read clock */ static ZERO_OR_ERROR FS_r_date(struct one_wire_query *owq) { BYTE data[6]; RETURN_ERROR_IF_BAD( OW_r_mem(data, 6, 0x0200, PN(owq)) ); return GB_to_Z_OR_E( OW_2date(&OWQ_D(owq), data) ); } /* read clock */ static ZERO_OR_ERROR FS_r_counter(struct one_wire_query *owq) { BYTE data[6]; _DATE d; /* Get date from chip */ RETURN_ERROR_IF_BAD( OW_r_mem(data, 6, 0x0200, PN(owq)) ); RETURN_ERROR_IF_BAD(OW_2date(&d, data)); OWQ_U(owq) = (UINT) d; return 0; } /* set clock */ static ZERO_OR_ERROR FS_w_date(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE data[6]; /* Busy if in mission */ if ( BAD( OW_MIP(pn))) { //printf("FS_w_date: mip error\n"); return -EBUSY; /* Mission in progress */ } RETURN_ERROR_IF_BAD(OW_oscillator(1, pn)) ; OW_date(&OWQ_D(owq), data); RETURN_ERROR_IF_BAD( OW_w_mem(data, 6, 0x0200, pn) ); OWQ_Y(owq) = 1; // for turning on chip return FS_w_run(owq); } static ZERO_OR_ERROR FS_w_counter(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE data[6]; _DATE d = (_DATE) OWQ_U(owq); /* Busy if in mission */ if ( BAD( OW_MIP(pn)) ) { return -EBUSY; /* Mission in progress */ } OW_date(&d, data); return GB_to_Z_OR_E( OW_w_mem(data, 6, 0x0200, pn) ) ; } static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[3 + 1 + 32 + 2] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; BYTE passwd[8]; int rest = 32 - (offset & 0x1F); struct transaction_log t_scratch[] = { TRXN_START, TRXN_WRITE(p,3+rest), TRXN_END, } ; struct transaction_log t_check[] = { TRXN_START, TRXN_WR_CRC16(p,1,3+rest), TRXN_COMPARE(&p[4],data,size), TRXN_END, }; struct transaction_log t_write[] = { TRXN_START, TRXN_WRITE(p,4), TRXN_WRITE(passwd,8), TRXN_DELAY(1) , TRXN_END, }; memset(passwd, 0xFF, 8); // dummy password memcpy(&p[3], data, size); RETURN_BAD_IF_BAD( BUS_transaction(t_scratch,pn) ) ; /* Re-read scratchpad and compare */ /* Note: location of data has now shifted down a byte for E/S register */ p[0] = _1W_READ_SCRATCHPAD; RETURN_BAD_IF_BAD( BUS_transaction(t_check,pn) ) ; /* Copy Scratchpad to SRAM */ p[0] = _1W_COPY_SCRATCHPAD_WITH_PASSWORD; RETURN_BAD_IF_BAD( BUS_transaction(t_write,pn) ) ; return gbGOOD; } static GOOD_OR_BAD OW_clearmemory(struct parsedname *pn) { BYTE p[3 + 8 + 32 + 2] = { _1W_CLEAR_MEMORY_WITH_PASSWORD, }; BYTE r; struct transaction_log t[] = { TRXN_START , TRXN_WRITE(p,10), TRXN_DELAY(1), TRXN_END , } ; memset(&p[1], 0xFF, 8); // password p[9] = 0xFF; // dummy byte RETURN_BAD_IF_BAD( BUS_transaction(t,pn) ) ; RETURN_BAD_IF_BAD( OW_r_mem(&r, 1, 0x0215, pn) ); LEVEL_DEBUG("Read 0x0215: MEMCLR=%d %02X", (r & 0x08 ? 1 : 0), r); return gbGOOD; } // At most one page static GOOD_OR_BAD OW_r_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[3 + 32 + 2] = { _1W_READ_MEMORY_WITH_PASSWORD_AND_CRC, LOW_HIGH_ADDRESS(offset), }; int rest = 32 - (offset & 0x1F); BYTE passwd[8]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(p), TRXN_WRITE(passwd,8), TRXN_READ(&p[3],rest+2), TRXN_CRC16(p,3+rest+2), TRXN_END, }; memset(passwd, 0xFF, 8); // dummy password //printf("OW_r_mem: size=%lX offset=%lX %02X %02X %02X\n", size, offset, p[0], p[1], p[2]); RETURN_BAD_IF_BAD( BUS_transaction( t, pn) ) ; memcpy(data, &p[3], size); return gbGOOD; } /* many things are disallowed if mission in progress */ /* returns 1 if MIP, 0 if not, <0 if error */ static GOOD_OR_BAD OW_MIP(struct parsedname *pn) { BYTE data; RETURN_BAD_IF_BAD( OW_r_mem(&data, 1, 0x0215, pn) ); /* read status register */ if (UT_getbit(&data, 1)) { return gbBAD; } return gbGOOD; } /* set clock */ static void OW_date(const _DATE * d, BYTE * data) { struct tm tm; int year; /* Convert time format */ gmtime_r(d, &tm); data[0] = tm.tm_sec + 6 * (tm.tm_sec / 10); /* dec->bcd */ data[1] = tm.tm_min + 6 * (tm.tm_min / 10); /* dec->bcd */ data[2] = tm.tm_hour + 6 * (tm.tm_hour / 10); /* dec->bcd */ data[3] = tm.tm_mday + 6 * (tm.tm_mday / 10); /* dec->bcd */ data[4] = tm.tm_mon + 6 * (tm.tm_mon / 10); /* dec->bcd */ year = tm.tm_year % 100; data[5] = year + 6 * (year / 10); /* dec->bcd */ if (tm.tm_year > 99 && tm.tm_year < 200) { data[4] |= 0x80; } //printf("_DATE_WRITE data=%2X, %2X, %2X, %2X, %2X, %2X\n",data[0],data[1],data[2],data[3],data[4],data[5]); //printf("_DATE: sec=%d, min=%d, hour=%d, mday=%d, mon=%d, year=%d, wday=%d, isdst=%d\n",tm.tm_sec,tm.tm_min,tm.tm_hour,tm.tm_mday,tm.tm_mon,tm.tm_year,tm.tm_wday,tm.tm_isdst) ; } static GOOD_OR_BAD OW_force_conversion(const UINT delay, struct parsedname *pn) { BYTE p[2] = { _1W_FORCED_CONVERSION, _1W_FORCED_CONVERSION_START }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(p), TRXN_DELAY(delay), TRXN_END, } ; RETURN_BAD_IF_BAD(OW_oscillator(1, pn)); /* Mission not progress, force conversion */ return BUS_transaction(t,pn) ; } static GOOD_OR_BAD OW_r_temperature(_FLOAT * T, const UINT delay, struct parsedname *pn) { BYTE data[32]; (void) delay; RETURN_BAD_IF_BAD( OW_r_mem(data, 8, 0x020C, pn) ); /* read temp register */ *T = ((_FLOAT) ((BYTE) data[1])) / 2 - 41; if (data[7] & 0x04) { *T += ((_FLOAT) ((BYTE) data[0])) / 512; } return gbGOOD; } static GOOD_OR_BAD OW_r_humid(_FLOAT * H, const UINT delay, struct parsedname *pn) { _FLOAT ADVAL, IVAL; BYTE data[32]; (void) delay; RETURN_BAD_IF_BAD( OW_r_mem(data, 6, 0x020E, pn) ); if (data[5] & 0x08) { // high resolution IVAL = (((BYTE) data[1]) * 256 + (BYTE) data[0]) / 16; ADVAL = (IVAL * 5.02) / 4096; } else { // low resolution ADVAL = ((_FLOAT) ((BYTE) data[1])) * 5.02 / 256; } *H = (ADVAL - 0.958) / 0.0307; return gbGOOD; } static GOOD_OR_BAD OW_stopmission(struct parsedname *pn) { BYTE data[10] = { _1W_STOP_MISSION_WITH_PASSWORD, }; struct transaction_log t[] = { TRXN_START , TRXN_WRITE( data, 10) , TRXN_END , } ; memset(&data[1], 0xFF, 8); // dummy password data[9] = _1W_STOP_MISSION_WITH_PASSWORD_START; return BUS_transaction(t,pn); } static GOOD_OR_BAD OW_startmission(unsigned long mdelay, struct parsedname *pn) { RETURN_BAD_IF_BAD( OW_stopmission(pn) ); RETURN_BAD_IF_BAD( OW_mission_timing(mdelay,pn) ); RETURN_BAD_IF_BAD( OW_clearmemory(pn) ); RETURN_BAD_IF_BAD( OW_mission_default_setup(pn) ) ; RETURN_BAD_IF_BAD( OW_startmission_post_setup(pn) ); return gbGOOD ; } static GOOD_OR_BAD OW_mission_timing(unsigned long mdelay, struct parsedname *pn) { BYTE cc; BYTE start_delay[3] ; if (mdelay == 0) { return gbGOOD; /* stay stopped */ } if (mdelay & 0xFF000000) { return gbBAD; /* Bad interval */ } RETURN_BAD_IF_BAD( OW_r_mem(&cc, 1, 0x0212, pn) ); if (cc & 0xFC) { return -EINVAL; } if (!(cc & 0x01)) { /* clock stopped */ OWQ_allocate_struct_and_pointer(owq_dateset); OWQ_create_temporary(owq_dateset, NULL, 0, 0, pn); OWQ_D(owq_dateset) = NOW_TIME; /* start clock */ if (FS_w_date(owq_dateset)) { return gbBAD; /* set the clock to current time */ } UT_delay(1000); /* wait for the clock to count a second */ } if (mdelay >= 15 * 60) { cc |= 0x02; // Enable high speed sample (minute) mdelay = mdelay / 60; } else { cc &= 0xFD; // Enable high speed sample (second) } RETURN_BAD_IF_BAD( OW_w_mem(&cc, 1, 0x0212, pn) ); // mission start delay start_delay[0] = (mdelay & 0xFF); start_delay[1] = (mdelay & 0xFF00) >> 8; start_delay[2] = (mdelay & 0xFF0000) >> 16; return OW_w_mem(start_delay, 3, 0x0216, pn) ; } static GOOD_OR_BAD OW_mission_default_setup( struct parsedname * pn ) { BYTE data = 0x00 ; data |= 0xA0; // Bit 6&7 always set data |= 0x01; // start Temp logging data |= 0x02; // start Humidity logging data |= 0x04; // store Temp in high resolution data |= 0x08; // store Humidity in high resolution data |= 0x10; // Rollover and overwrite //data |= 0x20 ; // start mission upon temperature alarm return OW_w_mem(&data, 1, 0x0213, pn); } static GOOD_OR_BAD OW_startmission_post_setup( struct parsedname * pn ) { BYTE p[10] = { _1W_START_MISSION_WITH_PASSWORD, } ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE(p,10), TRXN_END, } ; memset(&p[1], 0xFF, 8); // dummy password p[9] = _1W_START_MISSION_WITH_PASSWORD_START; // dummy byte return BUS_transaction(t,pn) ; } owfs-3.1p5/module/owlib/src/c/ow_1954.c0000644000175000001440000001570112654730021014406 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ // DS1954 Cryptographics iButton // DS1957 ibutton // From datasheet in the web -- hard to find info #include #include "owfs_config.h" #include "ow_1954.h" /* ------- Prototypes ----------- */ /* DS1902 ibutton memory */ READ_FUNCTION(FS_r_ipr); WRITE_FUNCTION(FS_w_ipr); READ_FUNCTION(FS_r_io); WRITE_FUNCTION(FS_w_io); READ_FUNCTION(FS_r_status); WRITE_FUNCTION(FS_w_status); WRITE_FUNCTION(FS_reset); /* ------- Structures ----------- */ static struct filetype DS1954[] = { F_STANDARD, {"ipr", 128, NON_AGGREGATE, ft_binary, fc_volatile, FS_r_ipr, FS_w_ipr, VISIBLE, NO_FILETYPE_DATA, }, {"io_buffer", 8, NON_AGGREGATE, ft_binary, fc_volatile, FS_r_io, FS_w_io, VISIBLE, NO_FILETYPE_DATA, }, {"status", 4, NON_AGGREGATE, ft_binary, fc_volatile, FS_r_status, FS_w_status, VISIBLE, NO_FILETYPE_DATA, }, {"reset", 1, NON_AGGREGATE, ft_yesno, fc_volatile, NO_READ_FUNCTION, FS_reset, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(16, DS1954, DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_IPR 0x0F #define _1W_READ_IPR 0xAA #define _1W_WRITE_IO_BUFFER 0x2D #define _1W_READ_IO_BUFFER 0x22 #define _1W_START_PROGRAM 0x77 #define _1W_CONTINUE_PROGRAM 0x87 #define _1W_RESET_MICRO 0xDD #define _1W_WRITE_STATUS 0xD2 #define _1W_READ_STATUS 0xE1 #define _1W_WRITE_RELEASE_SEQUENCE 0x9D,0xB3 #define _1W_READ_RELEASE_SEQUENCE 0x62,0x4C #define _1W_START_RELEASE_SEQUENCE 0x6D,0x43 #define _1W_CONTINUE_RELEASE_SEQUENCE 0x5D,0x73 #define _1W_RESET_RELEASE_SEQUENCE 0x92,0xBC #define _1W_STATUS_RELEASE_SEQUENCE 0x51,0x7F /* ------- Functions ------------ */ /* DS1957 */ static GOOD_OR_BAD OW_w_ipr(size_t size, BYTE * data, struct parsedname * pn); static GOOD_OR_BAD OW_r_ipr(struct one_wire_query *owq); static GOOD_OR_BAD OW_w_io(struct one_wire_query *owq); static GOOD_OR_BAD OW_r_io(struct one_wire_query *owq); static GOOD_OR_BAD OW_w_status(struct one_wire_query *owq); static GOOD_OR_BAD OW_r_status(struct one_wire_query *owq); static GOOD_OR_BAD OW_reset(struct one_wire_query *owq); /* 1954 */ static ZERO_OR_ERROR FS_w_ipr(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_w_ipr(OWQ_size(owq), (BYTE*) OWQ_buffer(owq),PN(owq)) ) ; } static ZERO_OR_ERROR FS_r_ipr(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_r_ipr(owq)) ; } static ZERO_OR_ERROR FS_w_io(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_io(owq)) ; } static ZERO_OR_ERROR FS_r_io(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_r_io(owq)) ; } static ZERO_OR_ERROR FS_w_status(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_status(owq)) ; } static ZERO_OR_ERROR FS_r_status(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_r_status(owq)) ; } static ZERO_OR_ERROR FS_reset(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_reset(owq)) ; } static GOOD_OR_BAD OW_w_ipr(size_t size, BYTE * data, struct parsedname * pn) { BYTE p[2 + 128 + 2] = { _1W_WRITE_IPR, BYTE_MASK(size), }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 2 + size, 0), TRXN_END, }; memcpy(&p[2],data,size) ; return BUS_transaction(t, pn); }; /* Read all 128 bytes, then transfer over what's needed */ static GOOD_OR_BAD OW_r_ipr(struct one_wire_query *owq) { BYTE p[2 + 128 + 2] = { _1W_READ_IPR, 128, }; int size = OWQ_size(owq); struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 2, 128), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, PN(owq))) ; if (size > 128) { size = 128; } memcpy(OWQ_buffer(owq), &p[2], size); OWQ_length(owq) = size; return gbGOOD; }; static GOOD_OR_BAD OW_w_status(struct one_wire_query *owq) { int size = OWQ_size(owq); BYTE p[1 + 1 + 2] = { _1W_WRITE_STATUS, BYTE_MASK(size), }; BYTE release[2] = { _1W_STATUS_RELEASE_SEQUENCE, }; BYTE zero[2] = { 0x00, 0x00, }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 1, 1), TRXN_MODIFY(release, release, 2), TRXN_COMPARE(release, zero, 2), TRXN_END, }; return BUS_transaction(t, PN(owq)); }; static GOOD_OR_BAD OW_r_status(struct one_wire_query *owq) { BYTE p[1 + 4 + 2] = { _1W_READ_STATUS, }; int size = OWQ_size(owq); struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 1, 4), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, PN(owq))); if (size > 4) { size = 4; } memcpy(OWQ_buffer(owq), &p[1], size); OWQ_length(owq) = size; return gbGOOD; }; static GOOD_OR_BAD OW_w_io(struct one_wire_query *owq) { int size = OWQ_size(owq); BYTE p[2 + 8 + 2] = { _1W_WRITE_IO_BUFFER, BYTE_MASK(size), }; BYTE release[2] = { _1W_WRITE_RELEASE_SEQUENCE, }; BYTE zero[2] = { 0x00, 0x00, }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 2 + size, 0), TRXN_MODIFY(release, release, 2), TRXN_COMPARE(release, zero, 2), TRXN_END, }; return BUS_transaction(t, PN(owq)); }; static GOOD_OR_BAD OW_r_io(struct one_wire_query *owq) { int size = OWQ_size(owq); BYTE p[2 + 8 + 2] = { _1W_READ_IO_BUFFER, BYTE_MASK(size), }; BYTE release[2] = { _1W_READ_RELEASE_SEQUENCE, }; BYTE zero[2] = { 0x00, 0x00, }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 2, size), TRXN_MODIFY(release, release, 2), TRXN_COMPARE(release, zero, 2), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, PN(owq))) ; memcpy(OWQ_buffer(owq), &p[2], size); OWQ_length(owq) = size; return gbGOOD; }; static GOOD_OR_BAD OW_reset(struct one_wire_query *owq) { BYTE p[] = { _1W_RESET_MICRO, }; BYTE release[2] = { _1W_RESET_RELEASE_SEQUENCE, }; BYTE zero[2] = { 0x00, 0x00, }; BYTE testbit[1]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(p), TRXN_MODIFY(release, release, 2), TRXN_COMPARE(release, zero, 2), TRXN_READ1(testbit), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, PN(owq)) ) ; if ( testbit[0] & 0x80 ) { return gbBAD; } return gbGOOD; }; owfs-3.1p5/module/owlib/src/c/ow_1963.c0000644000175000001440000001411612654730021014405 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_1963.h" /* ------- Prototypes ----------- */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); WRITE_FUNCTION(FS_w_password); READ_FUNCTION(FS_counter); /* ------- Structures ----------- */ static struct aggregate A1963S = { 16, ag_numbers, ag_separate, }; static struct filetype DS1963S[] = { F_STANDARD, {"memory", 512, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A1963S, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"pages/count", PROPERTY_LENGTH_UNSIGNED, &A1963S, ft_unsigned, fc_volatile, FS_counter, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/password", 8, NON_AGGREGATE, ft_binary, fc_stable, NO_READ_FUNCTION, FS_w_password, VISIBLE, NO_FILETYPE_DATA, }, {"password", 8, NON_AGGREGATE, ft_binary, fc_stable, NO_READ_FUNCTION, FS_w_password, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(18, DS1963S, DEV_resume | DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate A1963L = { 16, ag_numbers, ag_separate, }; static struct filetype DS1963L[] = { F_STANDARD, {"memory", 512, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A1963L, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"pages/count", PROPERTY_LENGTH_UNSIGNED, &A1963L, ft_unsigned, fc_volatile, FS_counter, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(1A, DS1963L, DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD 0x5A #define _1W_READ_MEMORY 0xF0 #define _1W_READ_MEMORY_PLUS_COUNTER 0xA5 #define _1W_COUNTER_FILL 0x55 /* ------- Functions ------------ */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_r_counter(struct one_wire_query *owq, size_t page, size_t pagesize); static ZERO_OR_ERROR FS_w_password(struct one_wire_query *owq) { (void) owq; return -EINVAL; } static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { /* read is not page-limited */ size_t pagesize = 32; return GB_to_Z_OR_E(COMMON_OWQ_readwrite_paged(owq, 0, pagesize, COMMON_read_memory_toss_counter)) ; } static ZERO_OR_ERROR FS_counter(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E(OW_r_counter(owq, OWQ_pn(owq).extension, pagesize)) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, pagesize, OW_w_mem)) ; } /* paged, and pre-screened */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[1 + 2 + 32 + 2] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE(p, 3 + size), TRXN_END, }; struct transaction_log tcopy_crc16[] = { TRXN_START, TRXN_WR_CRC16(p, 3 + size, 0), TRXN_END, }; struct transaction_log tread[] = { TRXN_START, TRXN_WRITE1(p), TRXN_READ(&p[1], 3 + size), TRXN_COMPARE(data, &p[4], size), TRXN_END, }; struct transaction_log tsram[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_END, }; /* Copy to scratchpad */ memcpy(&p[3], data, size); RETURN_BAD_IF_BAD(BUS_transaction(((offset + size) & 0x1F) != 0 ? tcopy : tcopy_crc16, pn)) ; /* Re-read scratchpad and compare */ /* Note that we tacitly shift the data one byte down for the E/S byte */ p[0] = _1W_READ_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(tread, pn)) ; /* Copy Scratchpad to SRAM */ p[0] = _1W_COPY_SCRATCHPAD; return BUS_transaction(tsram, pn) ; } /* read counter (just past memory) */ /* Nathan Holmes helped troubleshoot this one! */ static GOOD_OR_BAD OW_r_counter(struct one_wire_query *owq, size_t page, size_t pagesize) { BYTE extra[8]; if (COMMON_read_memory_plus_counter(extra, page, pagesize, PN(owq))) { return gbBAD; } if (extra[4] != _1W_COUNTER_FILL || extra[5] != _1W_COUNTER_FILL || extra[6] != _1W_COUNTER_FILL || extra[7] != _1W_COUNTER_FILL) { return gbBAD; } /* counter is held in the 4 bytes after the data */ OWQ_U(owq) = UT_uint32(extra); return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_1977.c0000644000175000001440000002403312654730021014411 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_1977.h" /* ------- Prototypes ----------- */ /* DS1977 counter */ READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_ver); READ_FUNCTION(FS_r_pwd); WRITE_FUNCTION(FS_w_pwd); WRITE_FUNCTION(FS_set); WRITE_FUNCTION(FS_use); /* ------- Structures ----------- */ enum _ds1977_passwords { _ds1977_full, _ds1977_read, _ds1977_control } ; off_t _ds1977_pwd_loc[] = { 0x7FC0, 0x7FC8, 0x7FD0, } ; static struct aggregate A1977 = { 511, ag_numbers, ag_separate, }; static struct filetype DS1977[] = { F_STANDARD, {"memory", 32704, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 64, &A1977, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"version", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_ver, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"set_password", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"set_password/read", 8, NON_AGGREGATE, ft_binary, fc_stable, NO_READ_FUNCTION, FS_set, VISIBLE, {.i=_ds1977_full}, }, {"set_password/full", 8, NON_AGGREGATE, ft_binary, fc_stable, NO_READ_FUNCTION, FS_set, VISIBLE, {.i=_ds1977_read}, }, {"set_password/enabled", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_pwd, FS_w_pwd, VISIBLE, NO_FILETYPE_DATA, }, {"use_password", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"use_password/read", 8, NON_AGGREGATE, ft_binary, fc_stable, NO_READ_FUNCTION, FS_use, VISIBLE, {.i=_ds1977_full}, }, {"use_password/full", 8, NON_AGGREGATE, ft_binary, fc_stable, NO_READ_FUNCTION, FS_use, VISIBLE, {.i=_ds1977_read}, }, }; DeviceEntryExtended(37, DS1977, DEV_resume | DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD_WITH_PASSWORD 0x99 #define _1W_READ_MEMORY_WITH_PASSWORD 0xC3 #define _1W_VERIFY_PASSWORD 0x69 #define _1W_READ_VERSION 0xCC #define _DS1977_PASSWORD_OK 0xAA /* Persistent storage */ Make_SlaveSpecificTag(REA, fc_persistent); Make_SlaveSpecificTag(FUL, fc_persistent); /* ------- Functions ------------ */ /* DS2423 */ static GOOD_OR_BAD OW_w_mem( BYTE * data, size_t size, off_t offset, struct parsedname *pn) ; static GOOD_OR_BAD OW_r_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_version(UINT * u, struct parsedname *pn); static GOOD_OR_BAD OW_verify(BYTE * pwd, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_r_mem_with_password( BYTE * pwd, BYTE * data, size_t size, off_t offset, struct parsedname *pn) ; /* 1977 password */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 64; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 64; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { size_t pagesize = 64; return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, pagesize, OW_r_mem)) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { size_t pagesize = 64; return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, pagesize, OW_w_mem)) ; } static ZERO_OR_ERROR FS_ver(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_version(&OWQ_U(owq), PN(owq)) ); } static ZERO_OR_ERROR FS_r_pwd(struct one_wire_query *owq) { BYTE p; RETURN_ERROR_IF_BAD( OW_r_mem(&p, 1, _ds1977_pwd_loc[_ds1977_control], PN(owq)) ) ; OWQ_Y(owq) = (p == _DS1977_PASSWORD_OK); return 0; } static ZERO_OR_ERROR FS_w_pwd(struct one_wire_query *owq) { BYTE p = OWQ_Y(owq) ? 0x00 : _DS1977_PASSWORD_OK; return GB_to_Z_OR_E( OW_w_mem(&p, 1, _ds1977_pwd_loc[_ds1977_control], PN(owq)) ); } static ZERO_OR_ERROR FS_set(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; if (OWQ_size(owq) < 8) { return -ERANGE; } /* Write */ RETURN_ERROR_IF_BAD( OW_w_mem((BYTE *) OWQ_buffer(owq), 8, _ds1977_pwd_loc[pn->selected_filetype->data.i],pn) ) ; /* Verify */ RETURN_ERROR_IF_BAD(OW_verify((BYTE *) OWQ_buffer(owq), _ds1977_pwd_loc[pn->selected_filetype->data.i], pn) ) ; switch ( pn->selected_filetype->data.i) { case _ds1977_full: Cache_Add_SlaveSpecific((BYTE *) OWQ_buffer(owq), 8, SlaveSpecificTag(FUL) , pn) ; break ; case _ds1977_read: default: Cache_Add_SlaveSpecific((BYTE *) OWQ_buffer(owq), 8, SlaveSpecificTag(REA) , pn) ; break ; } return FS_use(owq); } static ZERO_OR_ERROR FS_use(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; if (OWQ_size(owq) < 8) { return -ERANGE; } switch ( pn->selected_filetype->data.i) { case _ds1977_full: return Cache_Add_SlaveSpecific((BYTE *) OWQ_buffer(owq), 8, SlaveSpecificTag(FUL) , pn)==0 ? 0 : -EINVAL ; case _ds1977_read: return Cache_Add_SlaveSpecific((BYTE *) OWQ_buffer(owq), 8, SlaveSpecificTag(REA) , pn)==0 ? 0 : -EINVAL ; } return -EINVAL; } static GOOD_OR_BAD OW_r_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE pwd[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; if ( GOOD( Cache_Get_SlaveSpecific((void *) pwd, sizeof(pwd), SlaveSpecificTag(REA), pn)) ) { RETURN_GOOD_IF_GOOD( OW_r_mem_with_password( pwd, data,size,offset,pn) ) ; } if ( GOOD( Cache_Get_SlaveSpecific((void *) pwd, sizeof(pwd), SlaveSpecificTag(FUL), pn)) ) { RETURN_GOOD_IF_GOOD( OW_r_mem_with_password( pwd, data,size,offset,pn) ) ; } return OW_r_mem_with_password(pwd, data, size, offset, pn); } static GOOD_OR_BAD OW_version(UINT * u, struct parsedname *pn) { BYTE p[] = { _1W_READ_VERSION, 0x00, 0x00 }; struct transaction_log t[] = { TRXN_START, TRXN_MODIFY(p,p,3), TRXN_COMPARE(&p[1],&p[2],1), TRXN_END, } ; RETURN_BAD_IF_BAD( BUS_transaction(t,pn) ) ; u[0] = p[1]; return gbGOOD; } static GOOD_OR_BAD OW_w_mem( BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[1 + 2 + 1+ 64 + 2] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; BYTE passwd[8] ; // altered size_t rest = 64 - (offset & 0x3F); BYTE post[1] ; struct transaction_log t_nocrc[] = { TRXN_START, TRXN_WRITE(p,3+size), TRXN_END, }; struct transaction_log t_crc[] = { TRXN_START, TRXN_WR_CRC16(p,3+size,0), TRXN_END, }; struct transaction_log t_read[] = { TRXN_START, TRXN_WR_CRC16(p,1,3+rest), TRXN_COMPARE(&p[4],data,size), TRXN_END, }; struct transaction_log t_copy[] = { TRXN_START, TRXN_WRITE(p,4), TRXN_MODIFY(passwd,passwd, 8-1), TRXN_POWER(&passwd[7],10), // 10ms TRXN_READ1(post), TRXN_END, }; // set up transfer if ( size>rest ) { return gbBAD ; } memcpy(&p[3],data,size) ; // Write to scratchpad (possibly with CRC16) if ( size==rest ) { RETURN_BAD_IF_BAD( BUS_transaction( t_crc, pn ) ) ; } else { RETURN_BAD_IF_BAD( BUS_transaction( t_nocrc, pn ) ) ; } // Read back from scratch pad to prime next step and confirm data /* Note that we tacitly shift the data one byte down for the E/S byte */ p[0] = _1W_READ_SCRATCHPAD ; RETURN_BAD_IF_BAD( BUS_transaction( t_read, pn ) ) ; // Copy scratchpad to memory if ( BAD( Cache_Get_SlaveSpecific((void *) passwd, 8, SlaveSpecificTag(FUL), pn)) ) { /* Full passwd */ memset( passwd, 0xFF, 8 ) ; } p[0] = _1W_COPY_SCRATCHPAD_WITH_PASSWORD ; RETURN_BAD_IF_BAD( BUS_transaction( t_copy, pn ) ) ; return (post[0]==0xFF) ? gbBAD : gbGOOD ; } static GOOD_OR_BAD OW_r_mem_with_password( BYTE * pwd, BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[1 + 2 + 64 + 2] = { _1W_READ_MEMORY_WITH_PASSWORD, LOW_HIGH_ADDRESS(offset), }; BYTE passwd[8] ; // altered size_t rest = 64 - (offset & 0x3F); struct transaction_log t[] = { TRXN_START, TRXN_WRITE(p,3), TRXN_MODIFY(passwd,passwd, 8-1), TRXN_POWER(&passwd[7],5), // 5ms TRXN_READ(&p[3],rest+2), { p, NULL, 3+rest+2, trxn_crc16, }, TRXN_END, }; // set up transfer if ( size>rest ) { return gbBAD ; } memcpy(passwd,pwd,8) ; RETURN_BAD_IF_BAD( BUS_transaction(t,pn) ) ; memcpy(data,&p[3],size) ; return gbGOOD ; } static GOOD_OR_BAD OW_verify(BYTE * pwd, off_t offset, struct parsedname *pn) { BYTE p[1 + 2] = { _1W_READ_MEMORY_WITH_PASSWORD, LOW_HIGH_ADDRESS(offset), }; BYTE passwd[8] ; // altered BYTE post[1] ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE(p,3), TRXN_MODIFY(passwd,passwd, 8-1), TRXN_POWER(&passwd[7],5), // 5ms TRXN_READ1(post), TRXN_END, }; memcpy(passwd,pwd,8) ; RETURN_BAD_IF_BAD( BUS_transaction(t,pn) ) ; return post[0]==0xFF ? gbBAD : gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_1991.c0000644000175000001440000003712012654730021014406 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_1991.h" /* ------- Prototypes ----------- */ WRITE_FUNCTION(FS_password); WRITE_FUNCTION(FS_reset); READ_FUNCTION(FS_r_subkey); WRITE_FUNCTION(FS_w_subkey); READ_FUNCTION(FS_r_id); WRITE_FUNCTION(FS_w_id); #define _DS1991_PAGES 3 #define _DS1991_PAGE_LENGTH 0x40 #define _DS1991_ID_START 0x00 #define _DS1991_ID_LENGTH 8 #define _DS1991_PASSWORD_START (_DS1991_ID_START + _DS1991_ID_LENGTH ) #define _DS1991_PASSWORD_LENGTH 8 #define _DS1991_DATA_START ( _DS1991_PASSWORD_START + _DS1991_PASSWORD_LENGTH ) #define _DS1991_DATA_LENGTH (_DS1991_PAGE_LENGTH - _DS1991_DATA_START) BYTE subkey_byte[3] = { (0<<6), (1<<6), (2<<6), } ; /* ------- Structures ----------- */ static struct aggregate A1991_password = { 0, ag_letters, ag_sparse, }; static struct filetype DS1991[] = { F_STANDARD, {"subkey0", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"subkey0/password", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, NO_READ_FUNCTION, FS_password, VISIBLE, {.i=0,}, }, {"subkey0/reset", PROPERTY_LENGTH_YESNO, &A1991_password, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_reset, VISIBLE, {.i=0,}, }, {"subkey0/secure_data", _DS1991_DATA_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_subkey, FS_w_subkey, VISIBLE, {.i=0,}, }, {"subkey0/id", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_id, FS_w_id, VISIBLE, {.i=0,}, }, {"subkey1", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"subkey1/password", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, NO_READ_FUNCTION, FS_password, VISIBLE, {.i=1,}, }, {"subkey1/reset", PROPERTY_LENGTH_YESNO, &A1991_password, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_reset, VISIBLE, {.i=1,}, }, {"subkey1/secure_data", _DS1991_DATA_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_subkey, FS_w_subkey, VISIBLE, {.i=1,}, }, {"subkey1/id", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_id, FS_w_id, VISIBLE, {.i=1,}, }, {"subkey2", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"subkey2/password", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, NO_READ_FUNCTION, FS_password, VISIBLE, {.i=2,}, }, {"subkey2/reset", PROPERTY_LENGTH_YESNO, &A1991_password, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_reset, VISIBLE, {.i=2,}, }, {"subkey2/secure_data", _DS1991_DATA_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_subkey, FS_w_subkey, VISIBLE, {.i=2,}, }, {"subkey2/id", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_id, FS_w_id, VISIBLE, {.i=2,}, }, }; DeviceEntry(02, DS1991, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS1425[] = { F_STANDARD, {"subkey0", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"subkey0/password", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, NO_READ_FUNCTION, FS_password, VISIBLE, {.i=0,}, }, {"subkey0/reset", PROPERTY_LENGTH_YESNO, &A1991_password, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_reset, VISIBLE, {.i=0,}, }, {"subkey0/secure_data", _DS1991_DATA_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_subkey, FS_w_subkey, VISIBLE, {.i=0,}, }, {"subkey0/id", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_id, FS_w_id, VISIBLE, {.i=0,}, }, {"subkey1", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"subkey1/password", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, NO_READ_FUNCTION, FS_password, VISIBLE, {.i=1,}, }, {"subkey1/reset", PROPERTY_LENGTH_YESNO, &A1991_password, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_reset, VISIBLE, {.i=1,}, }, {"subkey1/secure_data", _DS1991_DATA_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_subkey, FS_w_subkey, VISIBLE, {.i=1,}, }, {"subkey1/id", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_id, FS_w_id, VISIBLE, {.i=1,}, }, {"subkey2", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"subkey2/password", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, NO_READ_FUNCTION, FS_password, VISIBLE, {.i=2,}, }, {"subkey2/reset", PROPERTY_LENGTH_YESNO, &A1991_password, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_reset, VISIBLE, {.i=2,}, }, {"subkey2/secure_data", _DS1991_DATA_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_subkey, FS_w_subkey, VISIBLE, {.i=2,}, }, {"subkey2/id", _DS1991_ID_LENGTH, &A1991_password, ft_binary, fc_stable, FS_r_id, FS_w_id, VISIBLE, {.i=2,}, }, }; DeviceEntry(82, DS1425, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x96 #define _1W_READ_SCRATCHPAD 0x69 #define _1W_COPY_SCRATCHPAD 0x3C #define _1W_WRITE_PASSWORD 0x5A #define _1W_WRITE_SUBKEY 0x99 #define _1W_READ_SUBKEY 0x66 /* ------- Functions ------------ */ static GOOD_OR_BAD OW_password( int subkey, const BYTE * new_id, const BYTE * new_password, const struct parsedname * pn ) ; static GOOD_OR_BAD OW_read_subkey( int subkey, BYTE * password, size_t size, off_t offset, BYTE * data, const struct parsedname * pn ) ; static GOOD_OR_BAD OW_write_subkey( int subkey, BYTE * password, size_t size, off_t offset, BYTE * data, const struct parsedname * pn ) ; static GOOD_OR_BAD OW_read_id( int subkey, BYTE * id, const struct parsedname * pn ) ; static GOOD_OR_BAD OW_write_id( int subkey, BYTE * password, BYTE * id, const struct parsedname * pn ) ; static GOOD_OR_BAD OW_write_password( int subkey, BYTE * old_password, BYTE * new_password, const struct parsedname * pn ) ; static GOOD_OR_BAD ToPassword( char * text, BYTE * psw ) ; /* array with magic bytes representing the Copy Scratch operations */ enum block { block_ALL = 0, block_IDENT, block_PASSWORD, block_DATA }; #define _DS1991_COPY_BLOCK_LENGTH 8 #define _DS1991_COPY_BLOCK_ITEMS 9 static const BYTE cp_array[_DS1991_COPY_BLOCK_ITEMS][_DS1991_COPY_BLOCK_LENGTH] = { {0x56, 0x56, 0x7F, 0x51, 0x57, 0x5D, 0x5A, 0x7F}, // 00-3F {0x9A, 0x9A, 0xB3, 0x9D, 0x64, 0x6E, 0x69, 0x4C}, // ident {0x9A, 0x9A, 0x4C, 0x62, 0x9B, 0x91, 0x69, 0x4C}, // passwd {0x9A, 0x65, 0xB3, 0x62, 0x9B, 0x6E, 0x96, 0x4C}, // 10-17 {0x6A, 0x6A, 0x43, 0x6D, 0x6B, 0x61, 0x66, 0x43}, // 18-1F {0x95, 0x95, 0xBC, 0x92, 0x94, 0x9E, 0x99, 0xBC}, // 20-27 {0x65, 0x9A, 0x4C, 0x9D, 0x64, 0x91, 0x69, 0xB3}, // 28-2F {0x65, 0x65, 0xB3, 0x9D, 0x64, 0x6E, 0x96, 0xB3}, // 30-37 {0x65, 0x65, 0x4C, 0x62, 0x9B, 0x91, 0x96, 0xB3}, // 38-3F }; #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif // reset the subkey area with a new password // clear all data // put default ID in it. static ZERO_OR_ERROR FS_reset(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int subkey = pn->selected_filetype->data.i ; BYTE new_password[_DS1991_PASSWORD_LENGTH] ; BYTE new_id[_DS1991_PASSWORD_LENGTH + 1 ] ; if ( OWQ_Y(owq) == 0 ) { // Not true request return 0 ; } if ( BAD(ToPassword( pn->sparse_name, new_password ) ) ) { return -EINVAL ; } snprintf( (char *) new_id, _DS1991_ID_LENGTH + 1, "Subkey %.1d", subkey ) ; return GB_to_Z_OR_E(OW_password(subkey, new_id, new_password, pn)) ; } // write a new password without clearing data // done with a scratchpad copy static ZERO_OR_ERROR FS_password(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int subkey = pn->selected_filetype->data.i ; BYTE new_password[_DS1991_PASSWORD_LENGTH] ; BYTE old_password[_DS1991_PASSWORD_LENGTH] ; if ( OWQ_offset(owq) != 0 ) { return -EINVAL ; } if ( OWQ_size(owq) != _DS1991_PASSWORD_LENGTH ) { return -EINVAL ; } memcpy( new_password, (BYTE *)OWQ_buffer(owq) , _DS1991_PASSWORD_LENGTH ) ; if ( BAD(ToPassword( pn->sparse_name, old_password ) ) ) { return -EINVAL ; } return GB_to_Z_OR_E(OW_write_password(subkey, old_password, new_password, pn)) ; } // write to secure data area // needs the password encoded in the extension static ZERO_OR_ERROR FS_w_subkey(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int subkey = pn->selected_filetype->data.i ; BYTE password[_DS1991_PASSWORD_LENGTH] ; if ( BAD(ToPassword( pn->sparse_name, password ) ) ) { return -EINVAL ; } if ( BAD (OW_write_subkey( subkey, password, OWQ_size(owq), OWQ_offset(owq)+_DS1991_DATA_START, (BYTE *) OWQ_buffer(owq), pn )) ) { return -EINVAL ; } return 0 ; } // read from secure data area // needs the password encoded in the extension static ZERO_OR_ERROR FS_r_subkey(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int subkey = pn->selected_filetype->data.i ; BYTE password[_DS1991_PASSWORD_LENGTH] ; if ( BAD(ToPassword( pn->sparse_name, password ) ) ) { return -EINVAL ; } if ( BAD (OW_read_subkey( subkey, password, OWQ_size(owq), OWQ_offset(owq)+_DS1991_DATA_START, (BYTE *) OWQ_buffer(owq), pn )) ) { return -EINVAL ; } OWQ_length(owq) = OWQ_size(owq) ; return 0 ; } // read id // needs a dummy password encoded in the extension static ZERO_OR_ERROR FS_r_id(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int subkey = pn->selected_filetype->data.i ; BYTE id[_DS1991_ID_LENGTH] ; if ( BAD (OW_read_id( subkey, id, pn )) ) { return -EINVAL ; } return OWQ_format_output_offset_and_size( (const char *) id, _DS1991_ID_LENGTH, owq ) ; } // write new id // needs the password encoded in the extension static ZERO_OR_ERROR FS_w_id(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int subkey = pn->selected_filetype->data.i ; BYTE password[_DS1991_PASSWORD_LENGTH] ; BYTE id[_DS1991_ID_LENGTH] ; if ( BAD(ToPassword( pn->sparse_name, password ) ) ) { return -EINVAL ; } if ( OWQ_offset(owq) != 0 && OWQ_size(owq) != _DS1991_ID_LENGTH ) { // Fill id with existing id if ( BAD (OW_read_id( subkey, id, pn )) ) { return -EINVAL ; } } memcpy( &id[OWQ_offset(owq)], OWQ_buffer(owq), OWQ_size(owq) ) ; if ( BAD (OW_write_id( subkey, password, id, pn )) ) { return -EINVAL ; } return 0 ; } static GOOD_OR_BAD OW_password( int subkey, const BYTE * new_id, const BYTE * new_password, const struct parsedname * pn ) { BYTE subkey_addr = subkey_byte[ subkey ] ; BYTE write_pwd[] = { _1W_WRITE_PASSWORD, subkey_addr, BYTE_INVERSE(subkey_addr), } ; BYTE old_id[_DS1991_ID_LENGTH] ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(write_pwd), TRXN_READ(old_id, _DS1991_ID_LENGTH), TRXN_WRITE(old_id, _DS1991_ID_LENGTH), TRXN_WRITE(new_id, _DS1991_ID_LENGTH), TRXN_WRITE(new_password, _DS1991_PASSWORD_LENGTH), TRXN_END, }; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_read_id( int subkey, BYTE * id, const struct parsedname * pn ) { BYTE subkey_addr = subkey_byte[ subkey ] + _DS1991_DATA_START ; BYTE read_sbk[] = { _1W_READ_SUBKEY, subkey_addr, BYTE_INVERSE(subkey_addr), } ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(read_sbk), TRXN_READ(id, _DS1991_ID_LENGTH), TRXN_END, }; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_read_subkey( int subkey, BYTE * password, size_t size, off_t offset, BYTE * data, const struct parsedname * pn ) { BYTE subkey_addr = subkey_byte[ subkey ] + offset ; BYTE write_sbk[] = { _1W_READ_SUBKEY, subkey_addr, BYTE_INVERSE(subkey_addr), } ; BYTE old_id[_DS1991_ID_LENGTH] ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(write_sbk), TRXN_READ(old_id, _DS1991_ID_LENGTH), TRXN_WRITE(password, _DS1991_PASSWORD_LENGTH), TRXN_READ(data, size), TRXN_END, }; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_write_subkey( int subkey, BYTE * password, size_t size, off_t offset, BYTE * data, const struct parsedname * pn ) { BYTE subkey_addr = subkey_byte[ subkey ] + offset ; BYTE write_sbk[] = { _1W_WRITE_SUBKEY, subkey_addr, BYTE_INVERSE(subkey_addr), } ; BYTE old_id[_DS1991_ID_LENGTH] ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(write_sbk), TRXN_READ(old_id, _DS1991_ID_LENGTH), TRXN_WRITE(password, _DS1991_PASSWORD_LENGTH), TRXN_WRITE(data, size), TRXN_END, }; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_write_id( int subkey, BYTE * password, BYTE * id, const struct parsedname * pn ) { BYTE scratch_addr = (3<<6) + _DS1991_ID_START ; BYTE write_scratch[] = { _1W_WRITE_SCRATCHPAD, scratch_addr, BYTE_INVERSE(scratch_addr), } ; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE3(write_scratch), TRXN_WRITE(id, _DS1991_ID_LENGTH), TRXN_END, }; BYTE copy_addr = subkey_byte[ subkey ] ; BYTE copy_scratch[] = { _1W_COPY_SCRATCHPAD, copy_addr, BYTE_INVERSE(copy_addr), } ; struct transaction_log twrite[] = { TRXN_START, TRXN_WRITE3(copy_scratch), TRXN_WRITE(cp_array[block_IDENT], _DS1991_COPY_BLOCK_LENGTH), TRXN_WRITE(password, _DS1991_PASSWORD_LENGTH), TRXN_END, }; RETURN_BAD_IF_BAD( BUS_transaction(twrite,pn) ) ; return BUS_transaction(tcopy, pn) ; } static GOOD_OR_BAD OW_write_password( int subkey, BYTE * old_password, BYTE * new_password, const struct parsedname * pn ) { BYTE scratch_addr = 0x0C + _DS1991_PASSWORD_START ; BYTE write_scratch[] = { _1W_WRITE_SCRATCHPAD, scratch_addr, BYTE_INVERSE(scratch_addr), } ; BYTE copy_addr = subkey_byte[ subkey ] ; BYTE copy_scratch[] = { _1W_COPY_SCRATCHPAD, copy_addr, BYTE_INVERSE(copy_addr), } ; struct transaction_log twrite[] = { TRXN_START, TRXN_WRITE3(write_scratch), TRXN_WRITE(new_password, _DS1991_PASSWORD_LENGTH), TRXN_END, }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE3(copy_scratch), TRXN_WRITE(cp_array[block_PASSWORD], _DS1991_COPY_BLOCK_LENGTH), TRXN_WRITE(old_password, _DS1991_PASSWORD_LENGTH), TRXN_END, }; RETURN_BAD_IF_BAD( BUS_transaction(twrite,pn) ) ; return BUS_transaction(tcopy, pn) ; } static GOOD_OR_BAD ToPassword( char * text, BYTE * psw ) { unsigned int text_length = _DS1991_PASSWORD_LENGTH * 2 ; char convert_text[ text_length + 1 ] ; memset( convert_text, '0', text_length ) ; convert_text[text_length] = '\0' ; if ( text == NULL ) { return gbBAD ; } if ( strlen( text ) > text_length ) { LEVEL_DEBUG("Password extension <%s> longer than %d bytes" , text, _DS1991_PASSWORD_LENGTH ) ; return gbBAD ; } strcpy( & convert_text[ text_length - strlen(text) ] , text ) ; string2bytes( convert_text, psw, _DS1991_PASSWORD_LENGTH ) ; return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_1993.c0000644000175000001440000001256512654730021014416 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_1993.h" /* ------- Prototypes ----------- */ /* DS1902 ibutton memory */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); /* ------- Structures ----------- */ static struct aggregate A1992 = { 4, ag_numbers, ag_separate, }; static struct filetype DS1992[] = { F_STANDARD, {"memory", 128, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A1992, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(08, DS1992, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate A1993 = { 16, ag_numbers, ag_separate, }; static struct filetype DS1993[] = { F_STANDARD, {"memory", 512, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A1993, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(06, DS1993, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate A1995 = { 64, ag_numbers, ag_separate, }; static struct filetype DS1995[] = { F_STANDARD, {"memory", 2048, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A1995, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(0A, DS1995, DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate A1996 = { 256, ag_numbers, ag_separate, }; static struct filetype DS1996[] = { F_STANDARD, {"memory", 8192, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A1996, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(0C, DS1996, DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD 0x55 #define _1W_READ_MEMORY 0xF0 /* ------- Functions ------------ */ /* DS1902 */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn); /* 1902 */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { /* read is not page-limited */ if (COMMON_read_memory_F0(owq, 0, 0)) { return -EINVAL; } return 0; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { /* paged access */ size_t pagesize = 32; return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, pagesize, OW_w_mem)) ; } /* paged, and pre-screened */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[4 + 32] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE3(p), TRXN_WRITE(data, size), TRXN_END, }; struct transaction_log tread[] = { TRXN_START, TRXN_WRITE1(p), TRXN_READ(&p[1], 3 + size), TRXN_COMPARE(data, &p[4], size), TRXN_END, }; struct transaction_log tsram[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_DELAY(32), TRXN_END, }; /* Copy to scratchpad */ RETURN_BAD_IF_BAD(BUS_transaction(tcopy, pn)) ; /* Re-read scratchpad and compare */ p[0] = _1W_READ_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(tread, pn)) ; /* Copy Scratchpad to SRAM */ p[0] = _1W_COPY_SCRATCHPAD; return BUS_transaction(tsram, pn) ; } owfs-3.1p5/module/owlib/src/c/ow_2401.c0000644000175000001440000000324712654730021014374 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* DS2401 Simple ID device */ /* Also needed for all others */ /* ------- Prototypes ----------- */ /* All from ow_xxxx.c file */ #include #include "owfs_config.h" #include "ow_2401.h" /* ------- Structures ----------- */ static struct filetype DS2401[] = { F_STANDARD, }; DeviceEntry(01, DS2401, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS1420[] = { F_STANDARD, }; DeviceEntry(81, DS1420, NO_GENERIC_READ, NO_GENERIC_WRITE); /* ------- Functions ------------ */ owfs-3.1p5/module/owlib/src/c/ow_2404.c0000644000175000001440000002707712654730021014406 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2404.h" /* ------- Prototypes ----------- */ /* DS1902 ibutton memory */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_alarm); READ_FUNCTION(FS_r_set_alarm); WRITE_FUNCTION(FS_w_set_alarm); READ_FUNCTION(FS_r_counter4); WRITE_FUNCTION(FS_w_counter4); READ_FUNCTION(FS_r_counter5); WRITE_FUNCTION(FS_w_counter5); READ_FUNCTION(FS_r_flag); WRITE_FUNCTION(FS_w_flag); /* ------- Structures ----------- */ static struct aggregate A2404 = { 16, ag_numbers, ag_separate, }; static struct filetype DS2404[] = { F_STANDARD, {"memory", 512, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2404, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"alarm", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_alarm, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"set_alarm", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_set_alarm, FS_w_set_alarm, VISIBLE, NO_FILETYPE_DATA, }, {"running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_flag, FS_w_flag, VISIBLE, {.c=0x10}, }, {"auto", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_flag, FS_w_flag, VISIBLE, {.c=0x20}, }, {"start", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_flag, FS_w_flag, VISIBLE, {.c=0x40}, }, {"delay", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_flag, FS_w_flag, VISIBLE, {.c=0x80}, }, {"date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="udate"}, }, {"udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter5, FS_w_counter5, VISIBLE, {.s=0x202}, }, {"cycle", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter4, FS_w_counter4, VISIBLE, {.s=0x20C}, }, {"interval", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"interval/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="interval/udate"}, }, {"interval/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter5, FS_w_counter5, VISIBLE, {.s=0x207}, }, {"trigger", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"trigger/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="trigger/udate"}, }, {"trigger/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter5, FS_w_counter5, VISIBLE, {.s=0x210}, }, {"trigger/interval_date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="trigger/interval_udate"}, }, {"trigger/interval_udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter5, FS_w_counter5, VISIBLE, {.s=0x215}, }, {"trigger/cycle", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter4, FS_w_counter4, VISIBLE, {.s=0x21A}, }, {"readonly", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"readonly/memory", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_flag, FS_w_flag, VISIBLE, {.c=0x08}, }, {"readonly/cycle", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_flag, FS_w_flag, VISIBLE, {.c=0x04}, }, {"readonly/interval", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_flag, FS_w_flag, VISIBLE, {.c=0x02}, }, {"readonly/clock", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_flag, FS_w_flag, VISIBLE, {.c=0x01}, }, }; DeviceEntryExtended(04, DS2404, DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD 0x55 #define _1W_READ_MEMORY 0xF0 /* ------- Functions ------------ */ /* DS2404 */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_r_ulong(uint64_t * L, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_w_ulong(uint64_t * L, size_t size, off_t offset, struct parsedname *pn); static void OW_reset(struct parsedname *pn) ; static UINT Avals[] = { 0, 1, 10, 11, 100, 101, 110, 111, }; /* 2404 */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { /* read is consecutive, unchecked. No paging */ ZERO_OR_ERROR read_status = COMMON_read_memory_F0(owq, 0, 0) ; OW_reset(PN(owq)) ; // DS2404 needs this to release for 3-wire communication return read_status ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { size_t pagesize = 32; ZERO_OR_ERROR error_code = COMMON_readwrite_paged(owq, 0, pagesize, OW_w_mem) ; /* paged write */ if (error_code != 0) { error_code = -EFAULT ; } OW_reset(PN(owq)) ; // DS2404 needs this to release for 3-wire communication return error_code ; } /* set clock */ static ZERO_OR_ERROR FS_w_counter5(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); uint64_t L = ((uint64_t) OWQ_U(owq)) << 8; return OW_w_ulong(&L, 5, pn->selected_filetype->data.s, pn)?-EINVAL:0; } /* set clock */ static ZERO_OR_ERROR FS_w_counter4(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); uint64_t L = ((uint64_t) OWQ_U(owq)); return OW_w_ulong(&L, 4, pn->selected_filetype->data.s, pn)?-EINVAL:0; } /* read clock */ static ZERO_OR_ERROR FS_r_counter5(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); uint64_t L; if (OW_r_ulong(&L, 5, pn->selected_filetype->data.s, pn)) { return -EINVAL; } OWQ_U(owq) = L >> 8; return 0; } /* read clock */ static ZERO_OR_ERROR FS_r_counter4(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); uint64_t L; if (OW_r_ulong(&L, 4, pn->selected_filetype->data.s, pn)) { return -EINVAL; } OWQ_U(owq) = L; return 0; } /* alarm */ static ZERO_OR_ERROR FS_w_set_alarm(struct one_wire_query *owq) { BYTE c; switch (OWQ_U(owq)) { case 0: c = 0 << 3; break; case 1: c = 1 << 3; break; case 10: c = 2 << 3; break; case 11: c = 3 << 3; break; case 100: c = 4 << 3; break; case 101: c = 5 << 3; break; case 110: c = 6 << 3; break; case 111: c = 7 << 3; break; default: return -ERANGE; } if (OW_w_mem(&c, 1, 0x200, PN(owq))) { return -EINVAL; } return 0; } static ZERO_OR_ERROR FS_r_alarm(struct one_wire_query *owq) { BYTE c; OWQ_allocate_struct_and_pointer(owq_alarm); OWQ_create_temporary(owq_alarm, (char *) &c, 1, 0x0200, PN(owq)); if (COMMON_read_memory_F0(owq_alarm, 0, 0)) { return -EINVAL; } OWQ_U(owq) = Avals[c & 0x07]; return 0; } static ZERO_OR_ERROR FS_r_set_alarm(struct one_wire_query *owq) { BYTE c; OWQ_allocate_struct_and_pointer(owq_alarm); OWQ_create_temporary(owq_alarm, (char *) &c, 1, 0x0200, PN(owq)); if (COMMON_read_memory_F0(owq_alarm, 0, 0)) { return -EINVAL; } OWQ_U(owq) = Avals[(c >> 3) & 0x07]; return 0; } /* write flag */ static ZERO_OR_ERROR FS_w_flag(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE cr; BYTE fl = pn->selected_filetype->data.c; OWQ_allocate_struct_and_pointer(owq_flag); OWQ_create_temporary(owq_flag, (char *) &cr, 1, 0x0201, pn); if (COMMON_read_memory_F0(owq_flag, 0, 0)) { return -EINVAL; } if (OWQ_Y(owq)) { if (cr & fl) { return 0; } } else { if ((cr & fl) == 0) { return 0; } } cr ^= fl; /* flip the bit */ if (OW_w_mem(&cr, 1, 0x0201, pn)) { return -EINVAL; } return 0; } /* read flag */ static ZERO_OR_ERROR FS_r_flag(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE cr; BYTE fl = pn->selected_filetype->data.c; OWQ_allocate_struct_and_pointer(owq_flag); OWQ_create_temporary(owq_flag, (char *) &cr, 1, 0x0201, pn); if (COMMON_read_memory_F0(owq_flag, 0, 0)) { return -EINVAL; } OWQ_Y(owq) = (cr & fl) ? 1 : 0; return 0; } /* PAged access -- pre-screened */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[4 + 32] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE3(p), TRXN_WRITE(data, size), TRXN_END, }; struct transaction_log tread[] = { TRXN_START, TRXN_WRITE1(p), TRXN_READ(&p[1], 3 + size), TRXN_COMPARE(data, &p[4], size), TRXN_END, }; struct transaction_log tsram[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_DELAY(32), TRXN_END, }; /* Copy to scratchpad */ RETURN_BAD_IF_BAD(BUS_transaction(tcopy, pn)) ; /* Re-read scratchpad and compare */ p[0] = _1W_READ_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(tread, pn)) ; /* Copy Scratchpad to SRAM */ p[0] = _1W_COPY_SCRATCHPAD; return BUS_transaction(tsram, pn) ; } /* read 4 or 5 byte number */ static GOOD_OR_BAD OW_r_ulong(uint64_t * L, size_t size, off_t offset, struct parsedname *pn) { BYTE data[5] = { 0x00, 0x00, 0x00, 0x00, 0x00, }; OWQ_allocate_struct_and_pointer(owq_ulong); OWQ_create_temporary(owq_ulong, (char *) data, size, offset, pn); if (size > 5) { return gbBAD; } if (COMMON_read_memory_F0(owq_ulong, 0, 0)) { return gbBAD; } L[0] = ((uint64_t) data[0]) + (((uint64_t) data[1]) << 8) + (((uint64_t) data[2]) << 16) + (((uint64_t) data[3]) << 24) + (((uint64_t) data[4]) << 32); return gbGOOD; } /* write 4 or 5 byte number */ static GOOD_OR_BAD OW_w_ulong(uint64_t * L, size_t size, off_t offset, struct parsedname *pn) { BYTE data[5] = { 0x00, 0x00, 0x00, 0x00, 0x00, }; if (size > 5) { return -ERANGE; } data[0] = BYTE_MASK(L[0]); data[1] = BYTE_MASK(L[0] >> 8); data[2] = BYTE_MASK(L[0] >> 16); data[3] = BYTE_MASK(L[0] >> 24); data[4] = BYTE_MASK(L[0] >> 32); if (OW_w_mem(data, size, offset, pn)) { return gbBAD; } return gbGOOD; } static void OW_reset(struct parsedname *pn) { struct transaction_log t[] = { TRXN_RESET, }; BUS_transaction(t, pn) ; } owfs-3.1p5/module/owlib/src/c/ow_2405.c0000644000175000001440000000706012654730021014375 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2405.h" /* ------- Prototypes ----------- */ /* DS2405 */ READ_FUNCTION(FS_r_sense); READ_FUNCTION(FS_r_PIO); WRITE_FUNCTION(FS_w_PIO); /* ------- Structures ----------- */ static struct filetype DS2405[] = { F_STANDARD, {"PIO", PROPERTY_LENGTH_YESNO, NULL, ft_yesno, fc_stable, FS_r_PIO, FS_w_PIO, VISIBLE, NO_FILETYPE_DATA, }, {"sensed", PROPERTY_LENGTH_YESNO, NULL, ft_yesno, fc_volatile, FS_r_sense, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(05, DS2405, DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); /* ------- Functions ------------ */ static GOOD_OR_BAD OW_r_sense(int *val, const struct parsedname *pn); static GOOD_OR_BAD OW_r_PIO(int *val, const struct parsedname *pn); static GOOD_OR_BAD OW_w_PIO(int val, const struct parsedname *pn); /* 2405 switch */ static ZERO_OR_ERROR FS_r_PIO(struct one_wire_query *owq) { int num; RETURN_ERROR_IF_BAD( OW_r_PIO(&num, PN(owq)) ) ; OWQ_Y(owq) = (num != 0); return 0; } /* 2405 switch */ static ZERO_OR_ERROR FS_r_sense(struct one_wire_query *owq) { int num; RETURN_ERROR_IF_BAD( OW_r_sense(&num, PN(owq)) ) ; OWQ_Y(owq) = (num != 0); return 0; } /* write 2405 switch */ static ZERO_OR_ERROR FS_w_PIO(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_w_PIO(OWQ_Y(owq), PN(owq)) ) ; } /* read the sense of the DS2405 switch */ static GOOD_OR_BAD OW_r_sense(int *val, const struct parsedname *pn) { BYTE inp; struct transaction_log r[] = { TRXN_NVERIFY, TRXN_READ1(&inp), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(r, pn)) ; val[0] = (inp != 0); return gbGOOD; } /* read the state of the DS2405 switch */ static GOOD_OR_BAD OW_r_PIO(int *val, const struct parsedname *pn) { struct transaction_log a[] = { TRXN_AVERIFY, TRXN_END, }; if ( BAD( BUS_transaction(a, pn) ) ) { struct transaction_log n[] = { TRXN_NVERIFY, TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(n, pn)) ; val[0] = 0; } else { val[0] = 1; } return gbGOOD; } /* write (set) the state of the DS2405 switch */ static GOOD_OR_BAD OW_w_PIO(const int val, const struct parsedname *pn) { int current; if (OW_r_PIO(¤t, pn)) { return 1; } if (current != val) { struct transaction_log n[] = { TRXN_START, TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(n, pn)) ; } //printf("2405write current=%d new=%d\n",current,val) ; return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_2406.c0000644000175000001440000010253212654730021014376 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Changes 7/2004 Extensive improvements based on input from Serg Oskin */ #include #include "owfs_config.h" #include "ow_2406.h" #define TAI8570 /* AAG barometer */ /* ------- Prototypes ----------- */ /* DS2406 switch */ READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_infobyte); READ_FUNCTION(FS_r_flipflop); READ_FUNCTION(FS_r_pio); WRITE_FUNCTION(FS_w_pio); READ_FUNCTION(FS_sense); READ_FUNCTION(FS_r_latch); WRITE_FUNCTION(FS_w_latch); READ_FUNCTION(FS_r_s_alarm); WRITE_FUNCTION(FS_w_s_alarm); READ_FUNCTION(FS_power); READ_FUNCTION(FS_channel); READ_FUNCTION(FS_r_C); READ_FUNCTION(FS_r_D1); READ_FUNCTION(FS_r_D2); READ_FUNCTION(FS_sibling); READ_FUNCTION(FS_temperature); READ_FUNCTION(FS_pressure); READ_FUNCTION(FS_temperature_5534); READ_FUNCTION(FS_pressure_5534); READ_FUNCTION(FS_temperature_5540); READ_FUNCTION(FS_pressure_5540); READ_FUNCTION(FS_voltage); static enum e_visibility VISIBLE_T8A( const struct parsedname * pn ) ; /* ------- Structures ----------- */ static struct aggregate A2406 = { 2, ag_letters, ag_aggregate, }; static struct aggregate A2406p = { 4, ag_numbers, ag_separate, }; static struct aggregate AT8Ac = { 8, ag_numbers, ag_separate, }; // 8 channel T8A volt meter static struct aggregate ATAI8570 = { 6, ag_numbers, ag_aggregate, } ; static struct filetype DS2406[] = { F_STANDARD, {"memory", 128, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2406p, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"power", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_power, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"channels", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_channel, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"PIO", PROPERTY_LENGTH_BITFIELD, &A2406, ft_bitfield, fc_stable, FS_r_pio, FS_w_pio, VISIBLE, NO_FILETYPE_DATA, }, {"sensed", PROPERTY_LENGTH_BITFIELD, &A2406, ft_bitfield, fc_link, FS_sense, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"latch", PROPERTY_LENGTH_BITFIELD, &A2406, ft_bitfield, fc_volatile, FS_r_latch, FS_w_latch, VISIBLE, NO_FILETYPE_DATA, }, {"flipflop", PROPERTY_LENGTH_BITFIELD, &A2406, ft_bitfield, fc_volatile, FS_r_flipflop, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"set_alarm", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_s_alarm, FS_w_s_alarm, VISIBLE, NO_FILETYPE_DATA, }, {"infobyte", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_infobyte, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, // AAG Barometer {"TAI8570", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/C", PROPERTY_LENGTH_UNSIGNED, &ATAI8570, ft_unsigned, fc_static, FS_r_C, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/D1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_D1, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/D2", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_D2, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/sibling", 16, NON_AGGREGATE, ft_ascii, fc_stable, FS_sibling, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_temperature, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/pressure", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_link, FS_pressure, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/DA5534", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/DA5534/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_temperature_5534, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/DA5534/pressure", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_link, FS_pressure_5534, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/DA5540", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/DA5540/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_temperature_5540, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"TAI8570/DA5540/pressure", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_link, FS_pressure_5540, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, // EDS voltage {"T8A", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_T8A, NO_FILETYPE_DATA, }, {"T8A/volt", PROPERTY_LENGTH_FLOAT, &AT8Ac, ft_float, fc_volatile, FS_voltage, NO_WRITE_FUNCTION, VISIBLE_T8A, NO_FILETYPE_DATA, }, {"aux", 0, NON_AGGREGATE, ft_directory, fc_volatile, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, {.i=eBranch_aux}, }, //3TA 2-line HUB }; DeviceEntryExtended(12, DS2406, DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_READ_MEMORY 0xF0 #define _1W_EXTENDED_READ_MEMORY 0xA5 #define _1W_WRITE_MEMORY 0x0F #define _1W_WRITE_STATUS 0x55 #define _1W_READ_STATUS 0xAA #define _1W_CHANNEL_ACCESS 0xF5 #define _DS2406_ALR 0x80 #define _DS2406_IM 0x40 #define _DS2406_TOG 0x20 #define _DS2406_IC 0x10 #define _DS2406_CHS1 0x08 #define _DS2406_CHS0 0x04 #define _DS2406_CRC1 0x02 #define _DS2406_CRC0 0x01 #define _DS2406_POWER_BIT 0x80 #define _DS2406_FLIPFLOP_BITS 0x60 #define _DS2406_ALARM_BITS 0x1F #define _ADDRESS_STATUS_MEMORY_SRAM 0x0007 /* ------- Functions ------------ */ /* DS2406 */ static GOOD_OR_BAD OW_r_mem(BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_w_s_alarm(const BYTE data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_control(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_w_control(const BYTE data, const struct parsedname *pn); static GOOD_OR_BAD OW_w_pio(const BYTE data, const struct parsedname *pn); static GOOD_OR_BAD OW_access(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_syncaccess(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_clear(const struct parsedname *pn); static GOOD_OR_BAD OW_full_access(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_voltage(_FLOAT * V, struct parsedname *pn ); static int VISIBLE_2406( const struct parsedname * pn ); /* finds the visibility of the DS2406-based T8A */ static int VISIBLE_2406( const struct parsedname * pn ) { int device_id = -1 ; // Unknown LEVEL_DEBUG("Checking visibility of %s",SAFESTRING(pn->path)) ; if ( BAD( GetVisibilityCache( &device_id, pn ) ) ) { struct one_wire_query * owq = OWQ_create_from_path(pn->path) ; // for read size_t memsize = 15 ; BYTE mem[memsize] ; if ( owq != NULL) { if ( FS_r_sibling_binary( mem, &memsize, "memory", owq ) == 0 ) { if ( memcmp( "A189" , &mem[1], 4 ) == 0 ) { device_id = 1 ; // T8A } else { device_id = 0 ; // non T8A } SetVisibilityCache( device_id, pn ) ; } OWQ_destroy(owq) ; } } return device_id ; } static enum e_visibility VISIBLE_T8A( const struct parsedname * pn ) { switch ( VISIBLE_2406(pn) ) { case 1: return visible_now ; default: return visible_not_now ; } } /* 2406 memory read */ static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { /* read is not a "paged" endeavor, no CRC */ OWQ_length(owq) = OWQ_size(owq) ; return GB_to_Z_OR_E(OW_r_mem((BYTE *) OWQ_buffer(owq), OWQ_size(owq), (size_t) OWQ_offset(owq), PN(owq))) ; } /* 2406 memory write */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32 ; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize) ; } /* Note, it's EPROM -- write once */ static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { /* write is "byte at a time" -- not paged */ return COMMON_write_eprom_mem_owq(owq) ; } /* 2406 switch */ static ZERO_OR_ERROR FS_r_pio(struct one_wire_query *owq) { UINT infobyte = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &infobyte, "infobyte", owq ) ; OWQ_U(owq) = BYTE_INVERSE(infobyte>>0) & 0x03; /* reverse bits */ return z_or_e; } /* 2406 switch */ static ZERO_OR_ERROR FS_r_flipflop(struct one_wire_query *owq) { UINT infobyte = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &infobyte, "infobyte", owq ) ; OWQ_U(owq) = (infobyte>>0) & 0x03; /* reverse bits */ return z_or_e; } /* 2406 switch */ static ZERO_OR_ERROR FS_r_infobyte(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD( OW_syncaccess(&data, PN(owq)) ); OWQ_U(owq) = data; /* reverse bits */ return 0; } /* 2406 switch -- is Vcc powered?*/ static ZERO_OR_ERROR FS_power(struct one_wire_query *owq) { UINT infobyte = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &infobyte, "infobyte", owq ) ; OWQ_Y(owq) = (infobyte & _DS2406_POWER_BIT) ? 1 : 0; return z_or_e; } /* 2406 switch -- number of channels (actually, if Vcc powered)*/ static ZERO_OR_ERROR FS_channel(struct one_wire_query *owq) { UINT infobyte = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &infobyte, "infobyte", owq ) ; OWQ_U(owq) = (infobyte & 0x40) ? 2 : 1; return z_or_e; } /* 2406 switch PIO sensed*/ /* bits 2 and 3 */ static ZERO_OR_ERROR FS_sense(struct one_wire_query *owq) { UINT infobyte = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &infobyte, "infobyte", owq ) ; OWQ_U(owq) = (infobyte>>2) & 0x03; return z_or_e ; } /* 2406 switch activity latch*/ /* bites 4 and 5 */ static ZERO_OR_ERROR FS_r_latch(struct one_wire_query *owq) { UINT infobyte = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &infobyte, "infobyte", owq ) ; OWQ_U(owq) = (infobyte >> 4) & 0x03; return z_or_e; } /* 2406 switch activity latch*/ static ZERO_OR_ERROR FS_w_latch(struct one_wire_query *owq) { FS_del_sibling( "infobyte", owq ) ; return GB_to_Z_OR_E(OW_clear(PN(owq))) ; } /* 2406 alarm settings*/ static ZERO_OR_ERROR FS_r_s_alarm(struct one_wire_query *owq) { BYTE data ; RETURN_ERROR_IF_BAD( OW_r_control(&data, PN(owq)) ); OWQ_U(owq) = (data & 0x01) + ((data >> 1) & 0x03) * 10 + ((data >>3) & 0x03) * 100; return 0 ; } /* 2406 alarm settings*/ static ZERO_OR_ERROR FS_w_s_alarm(struct one_wire_query *owq) { BYTE data; UINT U = OWQ_U(owq); data = ((U % 10) & 0x01) | (((U / 10 % 10) & 0x03) << 1) | (((U / 100 % 10) & 0x03) << 3); return GB_to_Z_OR_E(OW_w_s_alarm(data, PN(owq))) ; } /* write 2406 switch -- 2 values*/ static ZERO_OR_ERROR FS_w_pio(struct one_wire_query *owq) { BYTE data = BYTE_INVERSE(OWQ_U(owq)) & 0x03 ; /* reverse bits */ FS_del_sibling( "infobyte", owq ) ; return GB_to_Z_OR_E(OW_w_pio(data, PN(owq))) ; } /* Support for EmbeddedDataSystems's T8A 8 channel A/D Written by Chase Shimmin cshimmin@berkeley.edu */ static ZERO_OR_ERROR FS_voltage(struct one_wire_query *owq) { _FLOAT V ; FS_del_sibling( "infobyte", owq ) ; RETURN_ERROR_IF_BAD( OW_voltage( &V, PN(owq) ) ) ; OWQ_F(owq) = V; return 0; } /* reads memory directly into the buffer, no CRC */ static GOOD_OR_BAD OW_r_mem(BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn) { BYTE p[] = { _1W_READ_MEMORY, LOW_HIGH_ADDRESS(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(p), TRXN_READ(data, size), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; return gbGOOD; } /* read status byte */ static GOOD_OR_BAD OW_r_control(BYTE * data, const struct parsedname *pn) { BYTE p[3 + 1 + 2] = { _1W_READ_STATUS, LOW_HIGH_ADDRESS(_ADDRESS_STATUS_MEMORY_SRAM), }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 3, 1), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; *data = p[3]; return gbGOOD; } /* write status byte */ static GOOD_OR_BAD OW_w_control(const BYTE data, const struct parsedname *pn) { BYTE p[3 + 1 + 2] = { _1W_WRITE_STATUS, LOW_HIGH_ADDRESS(_ADDRESS_STATUS_MEMORY_SRAM), data, }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 4, 0), TRXN_END, }; return BUS_transaction(t, pn) ; } /* write alarm settings */ static GOOD_OR_BAD OW_w_s_alarm(const BYTE data, const struct parsedname *pn) { BYTE b[1]; RETURN_BAD_IF_BAD( OW_r_control(b, pn) ); b[0] = ( b[0] & ~_DS2406_ALARM_BITS) | (data & _DS2406_ALARM_BITS) ; return OW_w_control(b[0], pn); } /* set PIO state bits: bit0=A bit1=B, value: open=1 closed=0 */ static GOOD_OR_BAD OW_w_pio(const BYTE data, const struct parsedname *pn) { BYTE b[1]; RETURN_BAD_IF_BAD( OW_r_control(b, pn) ); b[0] = ( b[0] & ~_DS2406_FLIPFLOP_BITS) | ((data<<5) & _DS2406_FLIPFLOP_BITS) ; return OW_w_control(b[0], pn); } static GOOD_OR_BAD OW_syncaccess(BYTE * data, const struct parsedname *pn) { BYTE d[2] = { _DS2406_IM|_DS2406_CHS1|_DS2406_CHS0|_DS2406_CRC0, 0xFF, }; RETURN_BAD_IF_BAD( OW_full_access(d, pn) ); data[0] = d[0]; return gbGOOD; } static GOOD_OR_BAD OW_access(BYTE * data, const struct parsedname *pn) { BYTE d[2] = { _DS2406_IM|_DS2406_IC|_DS2406_CHS1|_DS2406_CHS0|_DS2406_CRC0, 0xFF, }; RETURN_BAD_IF_BAD( OW_full_access(d, pn) ); data[0] = d[0]; return gbGOOD; } /* Clear latches */ static GOOD_OR_BAD OW_clear(const struct parsedname *pn) { BYTE data[2] = { _DS2406_ALR|_DS2406_IM|_DS2406_IC|_DS2406_CHS0|_DS2406_CRC0, 0xFF, }; return OW_full_access(data, pn);; } // write both control bytes, and read both back static GOOD_OR_BAD OW_full_access(BYTE * data, const struct parsedname *pn) { BYTE p[3 + 2 + 2] = { _1W_CHANNEL_ACCESS, data[0], data[1], }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 3, 2), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; //printf("DS2406 access %.2X %.2X -> %.2X %.2X \n",data[0],data[1],p[3],p[4]); //printf("DS2406 CRC ok\n"); data[0] = p[3]; data[1] = p[4]; return gbGOOD; } /* Support for EmbeddedDataSystems's T8A 8 channel A/D Written by Chase Shimmin cshimmin@berkeley.edu */ static GOOD_OR_BAD OW_voltage(_FLOAT * V, struct parsedname * pn ) { // channel select byte, based on zero-indexed channel number BYTE ch_select = (pn->extension << 2) + 0x02; BYTE data[8+2] = { ch_select,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF, } ; // this is the complete byte sequence we want to write to the ds2406 so it will // select the appropriate channel and initiate adc, and also so it can write // back the results to the trailing 0xFF bytes. BYTE p[] = { _1W_CHANNEL_ACCESS, _DS2406_ALR|_DS2406_TOG|_DS2406_CHS0|_DS2406_CRC1, 0xFF, // Channel control } ; // 'modify' transaction -- so we can read back the trailing bytes. struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(p), TRXN_MODIFY( data, data, 8+2 ), TRXN_CRC16( data, 8+2 ), TRXN_END, }; // most & least significant bytes. for the latter, we're actually only interested // in the least significant nibble. BYTE msb, lsb; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; // grab the msb from the adc (in this case, it will be written in the 6th byte sent out) // then take the ones complement and reverse bits. msb = data[5]; msb = ~msb; msb = ((msb * 0x0802LU & 0x22110LU) | (msb * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; // grab the lsb (8th byte), 1s complement, reverse it, and take the 4 original L.S. bits. lsb = data[7]; lsb = ~lsb; lsb = ((lsb * 0x0802LU & 0x22110LU) | (lsb * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; lsb >>= 4; lsb &= 0xF; // convert the traslated and combined msb and lsb into voltages (this is a 0-5v 12-bit adc // so multiply by 5 and divide by 2^12. Then write it into the float field in the OWQ union & return V[0] = ((msb << 4) + lsb) * 5.0 / 4096; return 0; } struct s_TAI8570 { BYTE master[8]; BYTE sibling[8]; BYTE reader[8]; BYTE writer[8]; UINT C[6]; }; /* Internal files */ Make_SlaveSpecificTag(BAR, fc_persistent); // Read from the TAI8570 microcontroller vias the paired DS2406s // Updated by Simon Melhuish, with ref. to AAG C++ code static BYTE SEC_READW4[] = { 0x0E, 0x0E, 0x0E, 0x04, 0x0E, 0x0E, 0x04, 0x0E, 0x04, 0x04, 0x04, 0x04, 0x00 }; static BYTE SEC_READW2[] = { 0x0E, 0x0E, 0x0E, 0x04, 0x0E, 0x04, 0x0E, 0x0E, 0x04, 0x04, 0x04, 0x04, 0x00 }; static BYTE SEC_READW1[] = { 0x0E, 0x0E, 0x0E, 0x04, 0x0E, 0x04, 0x0E, 0x04, 0x0E, 0x04, 0x04, 0x04, 0x00 }; static BYTE SEC_READW3[] = { 0x0E, 0x0E, 0x0E, 0x04, 0x0E, 0x0E, 0x04, 0x04, 0x0E, 0x04, 0x04, 0x04, 0x00 }; static BYTE SEC_READD1[] = { 0x0E, 0x0E, 0x0E, 0x0E, 0x04, 0x0E, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00 }; static BYTE SEC_READD2[] = { 0x0E, 0x0E, 0x0E, 0x0E, 0x04, 0x04, 0x0E, 0x04, 0x04, 0x04, 0x04, 0x00 }; static BYTE SEC_RESET[] = { 0x0E, 0x04, 0x0E, 0x04, 0x0E, 0x04, 0x0E, 0x04, 0x0E, 0x04, 0x0E, 0x04, 0x0E, 0x04, 0x0E, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00 }; static BYTE CFG_READ = _DS2406_ALR|_DS2406_IM|_DS2406_TOG|_DS2406_CHS1|_DS2406_CHS0; // '11101100' Configuraci� de lectura para DS2407 static BYTE CFG_WRITE = _DS2406_ALR|_DS2406_CHS1|_DS2406_CHS0; // '10001100' Configuraci� de Escritura para DS2407 static BYTE CFG_READPULSE = _DS2406_ALR|_DS2406_IM|_DS2406_CHS1; // '11001000' Configuraci� de lectura de Pulso de conversion para DS2407 static GOOD_OR_BAD ReadTmexPage(BYTE * data, size_t size, int page, const struct parsedname *pn); static GOOD_OR_BAD TAI8570_Calibration(UINT * cal, const struct s_TAI8570 *tai, struct parsedname *pn); static GOOD_OR_BAD testTAI8570(struct s_TAI8570 *tai, struct one_wire_query *owq); static GOOD_OR_BAD TAI8570_Write(BYTE * cmd, const struct s_TAI8570 *tai, struct parsedname *pn); static GOOD_OR_BAD TAI8570_Read(UINT * u, const struct s_TAI8570 *tai, struct parsedname *pn); static GOOD_OR_BAD TAI8570_Reset(const struct s_TAI8570 *tai, struct parsedname *pn); static GOOD_OR_BAD TAI8570_Check(const struct s_TAI8570 *tai, struct parsedname *pn); static GOOD_OR_BAD TAI8570_ClockPulse(const struct s_TAI8570 *tai, struct parsedname *pn); static GOOD_OR_BAD TAI8570_DataPulse(const struct s_TAI8570 *tai, struct parsedname *pn); static GOOD_OR_BAD TAI8570_CalValue(UINT * cal, BYTE * cmd, const struct s_TAI8570 *tai, struct parsedname *pn); static GOOD_OR_BAD TAI8570_SenseValue(UINT * val, BYTE * cmd, const struct s_TAI8570 *tai, struct parsedname *pn); static GOOD_OR_BAD TAI8570_A(struct parsedname *pn); static GOOD_OR_BAD TAI8570_B(struct parsedname *pn); static ZERO_OR_ERROR FS_sibling(struct one_wire_query *owq) { ASCII sib[16]; struct s_TAI8570 tai; FS_del_sibling( "infobyte", owq ) ; if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } bytes2string(sib, tai.sibling, 8); return OWQ_format_output_offset_and_size(sib, 16, owq); } static ZERO_OR_ERROR FS_r_D1(struct one_wire_query *owq) { UINT D; struct s_TAI8570 tai; struct parsedname pn_copy; FS_del_sibling( "infobyte", owq ) ; memcpy(&pn_copy, PN(owq), sizeof(struct parsedname)); //shallow copy if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } RETURN_BAD_IF_BAD( TAI8570_SenseValue(&D, SEC_READD1, &tai, &pn_copy) ); LEVEL_DEBUG("TAI8570 Raw Pressure (D1) = %lu", D); OWQ_U(owq) = D ; return 0; } static ZERO_OR_ERROR FS_r_D2(struct one_wire_query *owq) { UINT D; struct s_TAI8570 tai; struct parsedname pn_copy; FS_del_sibling( "infobyte", owq ) ; memcpy(&pn_copy, PN(owq), sizeof(struct parsedname)); //shallow copy if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } RETURN_BAD_IF_BAD( TAI8570_SenseValue(&D, SEC_READD2, &tai, &pn_copy) ); LEVEL_DEBUG("TAI8570 Raw Temperature (D2) = %lu", D); OWQ_U(owq) = D ; return 0; } static ZERO_OR_ERROR FS_r_C(struct one_wire_query *owq) { struct s_TAI8570 tai; FS_del_sibling( "infobyte", owq ) ; if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } OWQ_array_U( owq, 0 ) = tai.C[0] ; OWQ_array_U( owq, 1 ) = tai.C[1] ; OWQ_array_U( owq, 2 ) = tai.C[2] ; OWQ_array_U( owq, 3 ) = tai.C[3] ; OWQ_array_U( owq, 4 ) = tai.C[4] ; OWQ_array_U( owq, 5 ) = tai.C[5] ; return 0; } static ZERO_OR_ERROR FS_temperature(struct one_wire_query *owq) { UINT D2; UINT UT1 ; _FLOAT dT; struct s_TAI8570 tai; FS_del_sibling( "infobyte", owq ) ; if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } if ( FS_r_sibling_U( &D2, "TAI8570/D2", owq ) != 0 ) { return -EINVAL ; } UT1 = 8 * tai.C[4] + 20224; dT = (_FLOAT)D2 - (_FLOAT)UT1; OWQ_F(owq) = (200. + dT * (tai.C[5] + 50.) / 1024.) / 10.; return 0; } static ZERO_OR_ERROR FS_pressure(struct one_wire_query *owq) { UINT D1 ; UINT D2 ; UINT UT1 ; _FLOAT dT ; _FLOAT OFF, SENS, X ; struct s_TAI8570 tai; FS_del_sibling( "infobyte", owq ) ; if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } if ( FS_r_sibling_U( &D1, "TAI8570/D1", owq ) != 0 ) { return -EINVAL ; } if ( FS_r_sibling_U( &D2, "TAI8570/D2", owq ) != 0 ) { return -EINVAL ; } UT1 = 8 * tai.C[4] + 20224; dT = (_FLOAT)D2 - (_FLOAT)UT1; OFF = 4. * tai.C[1] + ((tai.C[3] - 512.) * dT) / 4096.; SENS = 24576. + tai.C[0] + (tai.C[2] * dT) / 1024.; X = (SENS * (D1 - 7168.)) / 16384. - OFF; OWQ_F(owq) = 250. + X / 32.; return 0; } static ZERO_OR_ERROR FS_temperature_5534(struct one_wire_query *owq) { UINT D2; UINT UT1 ; _FLOAT dT; struct s_TAI8570 tai; FS_del_sibling( "infobyte", owq ) ; if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } if ( FS_r_sibling_U( &D2, "TAI8570/D2", owq ) != 0 ) { return -EINVAL ; } UT1 = 8 * tai.C[4] + 20224; if ( D2 >= UT1 ) { dT = D2 - UT1; OWQ_F(owq) = (200. + dT * (tai.C[5] + 50.) / 1024.) / 10.; } else { dT = D2 - UT1; dT = dT - (dT/256.)*(dT/256.) ; OWQ_F(owq) = (200. + dT * (tai.C[5] + 50.) / 1024. + dT / 256. ) / 10.; } return 0; } static ZERO_OR_ERROR FS_pressure_5534(struct one_wire_query *owq) { UINT D1 ; UINT D2 ; UINT UT1 ; _FLOAT dT ; _FLOAT OFF, SENS, X ; struct s_TAI8570 tai; FS_del_sibling( "infobyte", owq ) ; if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } if ( FS_r_sibling_U( &D1, "TAI8570/D1", owq ) != 0 ) { return -EINVAL ; } if ( FS_r_sibling_U( &D2, "TAI8570/D2", owq ) != 0 ) { return -EINVAL ; } UT1 = 8 * tai.C[4] + 20224; if ( D2 >= UT1 ) { dT = D2 - UT1; } else { dT = D2 - UT1; dT = dT - (dT/256.)*(dT/256.) ; } OFF = 4. * tai.C[1] + ((tai.C[3] - 512.) * dT) / 4096.; SENS = 24576. + tai.C[0] + (tai.C[2] * dT) / 1024.; X = (SENS * (D1 - 7168.)) / 16384. - OFF; OWQ_F(owq) = 250. + X / 32.; return 0; } static ZERO_OR_ERROR FS_temperature_5540(struct one_wire_query *owq) { UINT D2; int UT1 ; _FLOAT dT; _FLOAT T2, TEMP ; struct s_TAI8570 tai; FS_del_sibling( "infobyte", owq ) ; if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } if ( FS_r_sibling_U( &D2, "TAI8570/D2", owq ) != 0 ) { return -EINVAL ; } UT1 = 8 * tai.C[4] + 20224; dT = D2 - UT1; TEMP = (200. + dT * (tai.C[5] + 50.) / 1024.) ; if ( TEMP < 200 ) { T2 = 11 * ( tai.C[5] + 24 ) * ( (200 - TEMP) / 1024. )*( (200 - TEMP) / 1024. ) ; } else if ( TEMP <= 450 ) { T2 = 0. ; } else { T2 = 3 * ( tai.C[5] + 24 ) * ( (450 - TEMP) / 1024. )*( (450 - TEMP) / 1024. ) ; } OWQ_F(owq) = ( TEMP - T2 ) / 10. ; return 0; } static ZERO_OR_ERROR FS_pressure_5540(struct one_wire_query *owq) { UINT D1 ; UINT D2 ; UINT UT1 ; _FLOAT dT ; _FLOAT T2, TEMP ; _FLOAT OFF, SENS, X ; _FLOAT P, P2 ; struct s_TAI8570 tai; FS_del_sibling( "infobyte", owq ) ; if ( BAD( testTAI8570(&tai, owq) ) ) { return -ENOENT; } if ( FS_r_sibling_U( &D1, "TAI8570/D1", owq ) != 0 ) { return -EINVAL ; } if ( FS_r_sibling_U( &D2, "TAI8570/D2", owq ) != 0 ) { return -EINVAL ; } UT1 = 8 * tai.C[4] + 20224; dT = D2 - UT1; TEMP = (200. + dT * (tai.C[5] + 50.) / 1024.) ; OFF = 4. * tai.C[1] + ((tai.C[3] - 512.) * dT) / 4096.; SENS = 24576. + tai.C[0] + (tai.C[2] * dT) / 1024.; X = (SENS * (D1 - 7168.)) / 16384. - OFF; P = 10 * (250. + X / 32. ); if ( TEMP < 200 ) { T2 = 11 * ( tai.C[5] + 24 ) * ( (200 - TEMP) / 1024. )*( (200 - TEMP) / 1024. ) ; P2 = 3 * T2 * ( P - 3500 ) / 16384. ; } else if ( TEMP <= 450 ) { P2 = 0. ; } else { T2 = 3 * ( tai.C[5] + 24 ) * ( (450 - TEMP) / 1024. )*( (450 - TEMP) / 1024. ) ; P2 = T2 * ( P - 10000 ) / 8192. ; } OWQ_F(owq) = ( P - P2 ) / 10. ; return 0; } // Read a page and confirm its a valid tmax page // pn should be pointing to putative master device static GOOD_OR_BAD ReadTmexPage(BYTE * data, size_t size, int page, const struct parsedname *pn) { RETURN_BAD_IF_BAD( OW_r_mem(data, size, size * page, pn) ); if (data[0] > size) { LEVEL_DETAIL("Tmex page %d bad length %d", page, data[0]); return gbBAD; // check length } if (CRC16seeded(data, data[0] + 3, page)) { LEVEL_DETAIL("Tmex page %d CRC16 error", page); return gbBAD; // check length } return gbGOOD; } /* called with a copy of pn already set to the right device */ static int TAI8570_config(BYTE cfg, struct parsedname *pn) { BYTE data[] = { _1W_CHANNEL_ACCESS, cfg, }; BYTE dummy[] = { 0xFF, 0xFF, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(data), TRXN_READ2(dummy), TRXN_END, }; //printf("TAI8570_config\n"); return BUS_transaction(t, pn); } static GOOD_OR_BAD TAI8570_A(struct parsedname *pn) { BYTE b = 0xFF; int i; for (i = 0; i < 5; ++i) { RETURN_BAD_IF_BAD( OW_access(&b, pn) ); RETURN_BAD_IF_BAD( OW_w_control(b | 0x20, pn) ); RETURN_BAD_IF_BAD( OW_access(&b, pn) ); if (b & 0xDF) { return gbGOOD; } } return gbBAD; } static GOOD_OR_BAD TAI8570_B(struct parsedname *pn) { BYTE b = 0xFF; int i; for (i = 0; i < 5; ++i) { RETURN_BAD_IF_BAD( OW_access(&b, pn) ); RETURN_BAD_IF_BAD( OW_w_control(b | 0x40, pn) ) ; RETURN_BAD_IF_BAD( OW_access(&b, pn) ) ; if (b & 0xBF) { return gbGOOD; } } return gbBAD; } /* called with a copy of pn */ static GOOD_OR_BAD TAI8570_ClockPulse(const struct s_TAI8570 *tai, struct parsedname *pn) { memcpy(pn->sn, tai->reader, 8); RETURN_BAD_IF_BAD( TAI8570_A(pn) ); memcpy(pn->sn, tai->writer, 8); return TAI8570_A(pn); } /* called with a copy of pn */ static GOOD_OR_BAD TAI8570_DataPulse(const struct s_TAI8570 *tai, struct parsedname *pn) { memcpy(pn->sn, tai->reader, 8); RETURN_BAD_IF_BAD( TAI8570_B(pn) ); memcpy(pn->sn, tai->writer, 8); return TAI8570_B(pn); } /* called with a copy of pn */ static GOOD_OR_BAD TAI8570_Reset(const struct s_TAI8570 *tai, struct parsedname *pn) { RETURN_BAD_IF_BAD( TAI8570_ClockPulse(tai, pn) ); //printf("TAI8570 Clock ok\n") ; memcpy(pn->sn, tai->writer, 8); RETURN_BAD_IF_BAD( TAI8570_config(CFG_WRITE, pn) ); // config write //printf("TAI8570 config (reset) ok\n") ; return TAI8570_Write(SEC_RESET, tai, pn); } /* called with a copy of pn */ static GOOD_OR_BAD TAI8570_Write(BYTE * cmd, const struct s_TAI8570 *tai, struct parsedname *pn) { size_t len = strlen((ASCII *) cmd); BYTE zero = 0x04; struct transaction_log t[] = { TRXN_BLIND(cmd, len), TRXN_BLIND(&zero, 1), TRXN_END, }; memcpy(pn->sn, tai->writer, 8); RETURN_BAD_IF_BAD( TAI8570_config(CFG_WRITE, pn) ); // config write //printf("TAI8570 config (write) ok\n") ; return BUS_transaction(t, pn); } /* called with a copy of pn */ static GOOD_OR_BAD TAI8570_Read(UINT * u, const struct s_TAI8570 *tai, struct parsedname *pn) { size_t i, j; BYTE data[32]; UINT U = 0; struct transaction_log t[] = { TRXN_MODIFY(data, data, 32), TRXN_END, }; //printf("TAI8570_Read\n"); memcpy(pn->sn, tai->reader, 8); RETURN_BAD_IF_BAD( TAI8570_config(CFG_READ, pn) ); // config write //printf("TAI8570 read ") ; for (i = j = 0; i < 16; ++i) { data[j++] = 0xFF; data[j++] = 0xFA; } RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; for (j = 0; j < 32; j += 2) { U = U << 1; if (data[j] & 0x80) { ++U; } //printf("%.2X%.2X ",data[j],data[j+1]) ; } //printf("\n") ; u[0] = U; return gbGOOD; } /* called with a copy of pn */ static GOOD_OR_BAD TAI8570_Check(const struct s_TAI8570 *tai, struct parsedname *pn) { size_t i; BYTE data[1]; struct transaction_log t[] = { TRXN_DELAY(1), TRXN_READ1(data), TRXN_END, }; UT_delay(29); // conversion time in msec memcpy(pn->sn, tai->writer, 8); RETURN_BAD_IF_BAD( TAI8570_config(CFG_READPULSE, pn) ); // config write for (i = 0; i < 100; ++i) { RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; //printf("%.2X ",data[0]) ; if (data[0] != 0xFF) { break; } } //printf("TAI8570 conversion poll = %d\n",i) ; return gbGOOD; } /* Called with a copy of pn */ static GOOD_OR_BAD TAI8570_SenseValue(UINT * val, BYTE * cmd, const struct s_TAI8570 *tai, struct parsedname *pn) { RETURN_BAD_IF_BAD( TAI8570_Reset(tai, pn) ); RETURN_BAD_IF_BAD( TAI8570_Write(cmd, tai, pn) ); RETURN_BAD_IF_BAD( TAI8570_Check(tai, pn) ); RETURN_BAD_IF_BAD( TAI8570_ClockPulse(tai, pn) ); RETURN_BAD_IF_BAD( TAI8570_Read(val, tai, pn) ); return TAI8570_DataPulse(tai, pn); } /* Called with a copy of pn */ static GOOD_OR_BAD TAI8570_CalValue(UINT * cal, BYTE * cmd, const struct s_TAI8570 *tai, struct parsedname *pn) { RETURN_BAD_IF_BAD( TAI8570_ClockPulse(tai, pn) ); RETURN_BAD_IF_BAD( TAI8570_Write(cmd, tai, pn) ); RETURN_BAD_IF_BAD( TAI8570_ClockPulse(tai, pn) ); RETURN_BAD_IF_BAD( TAI8570_Read(cal, tai, pn) ); TAI8570_DataPulse(tai, pn); return gbGOOD; } /* read calibration constants and put in Cache, too return 0 on successful aquisition */ /* Called with a copy of pn */ static GOOD_OR_BAD TAI8570_Calibration(UINT * cal, const struct s_TAI8570 *tai, struct parsedname *pn) { UINT oldcal[4] = { 0, 0, 0, 0, }; int rep; for (rep = 0; rep < 5; ++rep) { //printf("TAI8570_Calibration #%d\n",rep); RETURN_BAD_IF_BAD( TAI8570_Reset(tai, pn) ) ; //printf("TAI8570 Pre_Cal_Value\n"); TAI8570_CalValue(&cal[0], SEC_READW1, tai, pn); //printf("TAI8570 SIBLING cal[0]=%u ok\n",cal[0]); TAI8570_CalValue(&cal[1], SEC_READW2, tai, pn); //printf("TAI8570 SIBLING cal[1]=%u ok\n",cal[1]); TAI8570_CalValue(&cal[2], SEC_READW3, tai, pn); //printf("TAI8570 SIBLING cal[2]=%u ok\n",cal[2]); TAI8570_CalValue(&cal[3], SEC_READW4, tai, pn); //printf("TAI8570 SIBLING cal[3]=%u ok\n",cal[3]); if (memcmp(cal, oldcal, sizeof(oldcal)) == 0) { return gbGOOD; } memcpy(oldcal, cal, sizeof(oldcal)); } return gbBAD; // couldn't get the same answer twice in a row } /* Called with a copy of pn */ static GOOD_OR_BAD testTAI8570(struct s_TAI8570 *tai, struct one_wire_query *owq) { int pow; BYTE data[32]; UINT cal[4]; struct parsedname *pn = PN(owq); // see which DS2406 is powered if ( FS_r_sibling_Y( &pow, "power", owq ) != 0 ) { return gbBAD ; } // See if already cached if ( GOOD( Cache_Get_SlaveSpecific((void *) tai, sizeof(struct s_TAI8570), SlaveSpecificTag(BAR), pn)) ) { LEVEL_DEBUG("TAI8570 cache read: reader=" SNformat " writer=" SNformat, SNvar(tai->reader), SNvar(tai->writer)); LEVEL_DEBUG("TAI8570 cache read: C1=%u C2=%u C3=%u C4=%u C5=%u C6=%u", tai->C[0], tai->C[1], tai->C[2], tai->C[3], tai->C[4], tai->C[5]); return gbGOOD; } // Set master SN memcpy(tai->master, pn->sn, 8); // read page 0 RETURN_BAD_IF_BAD( ReadTmexPage(data, 32, 0, pn) ) ; if (memcmp("8570", &data[8], 4)) { // check dir entry LEVEL_DETAIL("No 8570 Tmex file"); return gbBAD; } // See if page 1 is readable RETURN_BAD_IF_BAD( ReadTmexPage(data, 32, 1, pn) ) ; memcpy(tai->sibling, &data[1], 8); if (pow) { memcpy(tai->writer, tai->master, 8); memcpy(tai->reader, tai->sibling, 8); } else { memcpy(tai->reader, tai->master, 8); memcpy(tai->writer, tai->sibling, 8); } LEVEL_DETAIL("TAI8570 reader=" SNformat " writer=" SNformat, SNvar(tai->reader), SNvar(tai->writer)); if ( BAD( TAI8570_Calibration(cal, tai, pn) ) ) { LEVEL_DETAIL("Trouble reading TAI8570 calibration constants"); return gbBAD; } // Set data tai->C[0] = ((cal[0]) >> 1); tai->C[1] = ((cal[3]) & 0x3F) | (((cal[2]) & 0x3F) << 6); tai->C[2] = ((cal[3]) >> 6); tai->C[3] = ((cal[2]) >> 6); tai->C[4] = (((cal[1]) >> 6) & 0x3FF) | (((cal[0]) & 0x01) << 10); tai->C[5] = ((cal[1]) & 0x3F); // Enforce data lenths tai->C[0] &= 0x7FFF; // 15 bit tai->C[1] &= 0x0FFF; // 12 bit tai->C[2] &= 0x03FF; // 10 bit tai->C[3] &= 0x03FF; // 10 bit tai->C[4] &= 0x07FF; // 11 bit tai->C[5] &= 0x003F; // 6 bit LEVEL_DETAIL("TAI8570 C1=%u C2=%u C3=%u C4=%u C5=%u C6=%u", tai->C[0], tai->C[1], tai->C[2], tai->C[3], tai->C[4], tai->C[5]); memcpy(pn->sn, tai->master, 8); // restore original for cache return Cache_Add_SlaveSpecific((const void *) tai, sizeof(struct s_TAI8570), SlaveSpecificTag(BAR), pn); } owfs-3.1p5/module/owlib/src/c/ow_2408.c0000644000175000001440000006522112751610047014406 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ // regex /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* LCD drivers, two designs Maxim / AAG uses 7 PIO pins based on Public domain code from Application Note 3286 Hobby-Boards by Eric Vickery Paul, Go right ahead and use it for whatever you want. I just provide it as an example for people who are using the LCD Driver. It originally came from an application that I was working on (and may again) but that particular code is in the public domain now. Let me know if you have any other questions. Eric */ #include #include "owfs_config.h" #include "ow_2408.h" /* ------- Prototypes ----------- */ /* DS2408 switch */ READ_FUNCTION(FS_r_strobe); WRITE_FUNCTION(FS_w_strobe); READ_FUNCTION(FS_r_pio); WRITE_FUNCTION(FS_w_pio); READ_FUNCTION(FS_sense); READ_FUNCTION(FS_power); WRITE_FUNCTION(FS_out_of_testmode); READ_FUNCTION(FS_r_latch); WRITE_FUNCTION(FS_w_latch); READ_FUNCTION(FS_r_s_alarm); WRITE_FUNCTION(FS_w_s_alarm); READ_FUNCTION(FS_r_por); WRITE_FUNCTION(FS_w_por); WRITE_FUNCTION(FS_Mclear); WRITE_FUNCTION(FS_Mhome); WRITE_FUNCTION(FS_Mscreen); WRITE_FUNCTION(FS_Mmessage); WRITE_FUNCTION(FS_Hclear); WRITE_FUNCTION(FS_Hhome); WRITE_FUNCTION(FS_Hscreen); WRITE_FUNCTION(FS_Hscreenyx); WRITE_FUNCTION(FS_Hmessage); WRITE_FUNCTION(FS_Honoff); WRITE_FUNCTION(FS_redefchar); WRITE_FUNCTION(FS_redefchar_hex); #define PROPERTY_LENGTH_LCD_MESSAGE 128 #define LCD_REDEFCHAR_LENGTH 8 #define LCD_REDEFCHAR_LENGTH_HEX (LCD_REDEFCHAR_LENGTH*2) /* ------- Structures ----------- */ static struct aggregate A2408 = { 8, ag_numbers, ag_aggregate, }; static struct aggregate A2408c = { 8, ag_numbers, ag_separate, }; // LCD_M is HD44780 in 8bit mode // LCD_H is HD44780 in 4bit mode static struct filetype DS2408[] = { F_STANDARD, {"power", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_power, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"out_of_testmode", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, NO_READ_FUNCTION, FS_out_of_testmode, VISIBLE, NO_FILETYPE_DATA, }, {"PIO", PROPERTY_LENGTH_BITFIELD, &A2408, ft_bitfield, fc_stable, FS_r_pio, FS_w_pio, VISIBLE, NO_FILETYPE_DATA, }, {"sensed", PROPERTY_LENGTH_BITFIELD, &A2408, ft_bitfield, fc_volatile, FS_sense, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"latch", PROPERTY_LENGTH_BITFIELD, &A2408, ft_bitfield, fc_volatile, FS_r_latch, FS_w_latch, VISIBLE, NO_FILETYPE_DATA, }, {"strobe", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_strobe, FS_w_strobe, VISIBLE, NO_FILETYPE_DATA, }, {"set_alarm", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_s_alarm, FS_w_s_alarm, VISIBLE, NO_FILETYPE_DATA, }, {"por", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_por, FS_w_por, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_M", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_M/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_Mclear, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_M/home", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_Mhome, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_M/screen", PROPERTY_LENGTH_LCD_MESSAGE, NON_AGGREGATE, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_Mscreen, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_M/message", PROPERTY_LENGTH_LCD_MESSAGE, NON_AGGREGATE, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_Mmessage, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_H", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_H/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_Hclear, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_H/home", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_Hhome, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_H/screen", PROPERTY_LENGTH_LCD_MESSAGE, NON_AGGREGATE, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_Hscreen, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_H/screenyx", PROPERTY_LENGTH_LCD_MESSAGE, NON_AGGREGATE, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_Hscreenyx, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_H/message", PROPERTY_LENGTH_LCD_MESSAGE, NON_AGGREGATE, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_Hmessage, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_H/onoff", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, NO_READ_FUNCTION, FS_Honoff, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_H/redefchar", LCD_REDEFCHAR_LENGTH, &A2408c, ft_binary, fc_stable, NO_READ_FUNCTION, FS_redefchar, VISIBLE, NO_FILETYPE_DATA, }, {"LCD_H/redefchar_hex", LCD_REDEFCHAR_LENGTH, &A2408c, ft_binary, fc_stable, NO_READ_FUNCTION, FS_redefchar_hex, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(29, DS2408, DEV_alarm | DEV_resume | DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_READ_PIO_REGISTERS 0xF0 #define _1W_CHANNEL_ACCESS_READ 0xF5 #define _1W_CHANNEL_ACCESS_WRITE 0x5A #define _1W_WRITE_CONDITIONAL_SEARCH_REGISTER 0xCC #define _1W_RESET_ACTIVITY_LATCHES 0xC3 #define _ADDRESS_PIO_LOGIC_STATE 0x0088 #define _ADDRESS_ALARM_REGISTERS 0x008B #define _ADDRESS_CONTROL_STATUS_REGISTER 0x008D /* Internal properties */ Make_SlaveSpecificTag(INI, fc_stable); // LCD screen initialized? /* Nibbles for LCD controller */ /* From Klaus Der Tiger: * Since at least 2.7p6 there has been a bug causing all three buttons of * the Hobbyboards LCD module (using a DS2408) to malfunction. This is due * to the fact, that the three lowest bits of the port register are set to * 0 during initialization of the display module, turning the output * transistors on and by that taking the sensing voltage away from the * buttons. * */ #define LCD_DATA_FLAG 0x08 #define LCD_BUTTON_MASK 0x07 #define LCD_M_VERIFY_MASK 0xFF #define LCD_H_VERIFY_MASK 0xF8 #define NIBBLE_ONE(x) ( ((x)&0xF0) | LCD_BUTTON_MASK ) #define NIBBLE_TWO(x) ( (((x)<<4)&0xF0) | LCD_BUTTON_MASK ) #define NIBBLE_CTRL( x ) NIBBLE_ONE(x) , NIBBLE_TWO(x) #define NIBBLE_DATA( x ) NIBBLE_ONE(x)|LCD_DATA_FLAG , NIBBLE_TWO(x)|LCD_DATA_FLAG /* ------- Functions ------------ */ /* DS2408 */ static GOOD_OR_BAD OW_w_control(const BYTE data, const struct parsedname *pn); static GOOD_OR_BAD OW_c_latch(const struct parsedname *pn); static GOOD_OR_BAD OW_w_pio(const BYTE data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_reg(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_w_s_alarm(const BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_w_pios(const BYTE *data, const size_t size, const BYTE verify_mask, const struct parsedname *pn); static GOOD_OR_BAD OW_redefchar(ASCII * pattern, struct parsedname * pn); static GOOD_OR_BAD OW_out_of_test_mode( const struct parsedname * pn ) ; /* 2408 switch */ /* 2408 switch -- is Vcc powered?*/ static ZERO_OR_ERROR FS_power(struct one_wire_query *owq) { BYTE data[6]; RETURN_ERROR_IF_BAD( OW_r_reg(data, PN(owq)) ); OWQ_Y(owq) = UT_getbit(&data[5], 7); return 0; } static ZERO_OR_ERROR FS_out_of_testmode(struct one_wire_query *owq) { if ( OWQ_Y(owq) ) { RETURN_ERROR_IF_BAD( OW_out_of_test_mode(PN(owq) ) ); } return 0; } static ZERO_OR_ERROR FS_r_strobe(struct one_wire_query *owq) { BYTE data[6]; RETURN_ERROR_IF_BAD( OW_r_reg(data, PN(owq)) ); OWQ_Y(owq) = UT_getbit(&data[5], 2); return 0; } static ZERO_OR_ERROR FS_w_strobe(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE data[6]; RETURN_ERROR_IF_BAD( OW_r_reg(data, pn) ); UT_setbit(&data[5], 2, OWQ_Y(owq)); return GB_to_Z_OR_E( OW_w_control(data[5], pn) ) ; } static ZERO_OR_ERROR FS_Mclear(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int init = 1; if ( BAD( Cache_Get_SlaveSpecific(&init, sizeof(init), SlaveSpecificTag(INI), pn)) ) { OWQ_Y(owq) = 1; if ( FS_r_strobe(owq) != 0 ) { // set reset pin to strobe mode return -EINVAL; } RETURN_ERROR_IF_BAD( OW_w_pio(0x30, pn) ); UT_delay(100); // init RETURN_ERROR_IF_BAD( OW_w_pio(0x38, pn) ) ; UT_delay(10); // Enable Display, Cursor, and Blinking // Entry-mode: auto-increment, no shift RETURN_ERROR_IF_BAD( OW_w_pio(0x0F, pn) ) ; RETURN_ERROR_IF_BAD( OW_w_pio(0x06, pn) ) ; Cache_Add_SlaveSpecific(&init, sizeof(init), SlaveSpecificTag(INI), pn); } // clear RETURN_ERROR_IF_BAD( OW_w_pio(0x01, pn) ); UT_delay(2); return FS_Mhome(owq); } static ZERO_OR_ERROR FS_Mhome(struct one_wire_query *owq) { // home RETURN_ERROR_IF_BAD( OW_w_pio(0x02, PN(owq)) ); UT_delay(2); return 0; } static ZERO_OR_ERROR FS_Mscreen(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); size_t size = OWQ_size(owq); BYTE data[size]; size_t i; for (i = 0; i < size; ++i) { // no upper ascii chars if (OWQ_buffer(owq)[i] & 0x80) { return -EINVAL; } data[i] = OWQ_buffer(owq)[i] | 0x80; } return GB_to_Z_OR_E(OW_w_pios(data, size, LCD_M_VERIFY_MASK, pn)) ; } static ZERO_OR_ERROR FS_Mmessage(struct one_wire_query *owq) { if (FS_Mclear(owq)) { return -EINVAL; } return FS_Mscreen(owq); } /* 2408 switch PIO sensed*/ /* From register 0x88 */ static ZERO_OR_ERROR FS_sense(struct one_wire_query *owq) { BYTE data[6]; RETURN_ERROR_IF_BAD( OW_r_reg(data, PN(owq)) ) ; OWQ_U(owq) = data[0]; return 0; } /* 2408 switch PIO set*/ /* From register 0x89 */ static ZERO_OR_ERROR FS_r_pio(struct one_wire_query *owq) { BYTE data[6]; RETURN_ERROR_IF_BAD( OW_r_reg(data, PN(owq)) ) ; OWQ_U(owq) = BYTE_INVERSE(data[1]); /* reverse bits */ return 0; } /* 2408 switch PIO change*/ static ZERO_OR_ERROR FS_w_pio(struct one_wire_query *owq) { BYTE data = BYTE_INVERSE(OWQ_U(owq)) & 0xFF ; /* reverse bits */ return GB_to_Z_OR_E(OW_w_pio(data, PN(owq))) ; } /* 2408 read activity latch */ /* From register 0x8A */ static ZERO_OR_ERROR FS_r_latch(struct one_wire_query *owq) { BYTE data[6]; RETURN_ERROR_IF_BAD( OW_r_reg(data, PN(owq)) ); OWQ_U(owq) = data[2]; return 0; } /* 2408 write activity latch */ /* Actually resets them all */ static ZERO_OR_ERROR FS_w_latch(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_c_latch(PN(owq))) ; } /* 2408 alarm settings*/ /* From registers 0x8B-0x8D */ static ZERO_OR_ERROR FS_r_s_alarm(struct one_wire_query *owq) { BYTE d[6]; int i, p; UINT U; RETURN_ERROR_IF_BAD( OW_r_reg(d, PN(owq)) ); /* register 0x8D */ U = (d[5] & 0x03) * 100000000; /* registers 0x8B and 0x8C */ for (i = 0, p = 1; i < 8; ++i, p *= 10) { U += (UT_getbit(&d[4], i) | (UT_getbit(&d[3], i) << 1)) * p; } OWQ_U(owq) = U; return 0; } /* 2408 alarm settings*/ /* First digit source and logic data[2] */ /* next 8 channels */ /* data[1] polarity */ /* data[0] selection */ static ZERO_OR_ERROR FS_w_s_alarm(struct one_wire_query *owq) { BYTE data[3] = { 0, 0, 0, }; // coverity likes this initialized int i; UINT p; UINT U = OWQ_U(owq); for (i = 0, p = 1; i < 8; ++i, p *= 10) { UT_setbit(&data[1], i, ((int) (U / p) % 10) & 0x01); UT_setbit(&data[0], i, (((int) (U / p) % 10) & 0x02) >> 1); } data[2] = ((U / 100000000) % 10) & 0x03; return GB_to_Z_OR_E(OW_w_s_alarm(data, PN(owq))) ; } static ZERO_OR_ERROR FS_r_por(struct one_wire_query *owq) { BYTE data[6]; RETURN_ERROR_IF_BAD( OW_r_reg(data, PN(owq)) ); OWQ_Y(owq) = UT_getbit(&data[5], 3); return 0; } static ZERO_OR_ERROR FS_w_por(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE data[6]; RETURN_ERROR_IF_BAD( OW_r_reg(data, pn) ); UT_setbit(&data[5], 3, OWQ_Y(owq)); return GB_to_Z_OR_E( OW_w_control(data[5], pn) ) ; } #define LCD_SECOND_ROW_ADDRESS 0x40 #define LCD_COMMAND_CLEAR_DISPLAY 0x01 #define LCD_COMMAND_RETURN_HOME 0x02 #define LCD_COMMAND_RIGHT_TO_LEFT 0x06 #define LCD_COMMAND_DISPLAY_ON 0x0C #define LCD_COMMAND_DISPLAY_OFF 0x08 #define LCD_COMMAND_4_BIT 0x20 #define LCD_COMMAND_4_BIT_2_LINES 0x28 #define LCD_COMMAND_ATTENTION 0x30 #define LCD_COMMAND_SET_DDRAM_ADDRESS 0x80 // structure holding the information to be placed on the LCD screen struct yx { int y ; // row int x ; // column char * string ; // input string including coordinates size_t length ; // length of string int text_start ; // counter into string } ; static GOOD_OR_BAD Parseyx( struct yx * YX ) ; static GOOD_OR_BAD binaryyx( struct yx * YX ) ; static GOOD_OR_BAD asciiyx( struct yx * YX ) ; static GOOD_OR_BAD OW_Hprintyx(struct yx * YX, struct parsedname * pn) ; static GOOD_OR_BAD OW_Hinit(struct parsedname * pn) ; #define LCD_LINE_START 1 #define LCD_LINE_END 20 #define LCD_FIRST_ROW 1 #define LCD_LAST_ROW 4 #define LCD_SAME_LOCATION_VALUE 0 // Clear the display after potential initialization static ZERO_OR_ERROR FS_Hclear(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE clear[] = { NIBBLE_CTRL(LCD_COMMAND_CLEAR_DISPLAY), NIBBLE_CTRL(LCD_COMMAND_DISPLAY_ON), NIBBLE_CTRL(LCD_COMMAND_RIGHT_TO_LEFT), }; if ( BAD( OW_Hinit(pn) ) ) { LEVEL_DEBUG("Screen initialization error"); return -EINVAL ; } return GB_to_Z_OR_E(OW_w_pios(clear, 6, LCD_H_VERIFY_MASK, pn)) ; } static GOOD_OR_BAD OW_Hinit(struct parsedname * pn) { int init = 1; // clear, display on, mode BYTE start[] = { NIBBLE_ONE(LCD_COMMAND_ATTENTION), }; BYTE next[] = { NIBBLE_ONE(LCD_COMMAND_ATTENTION), NIBBLE_ONE(LCD_COMMAND_ATTENTION), NIBBLE_ONE(LCD_COMMAND_4_BIT), NIBBLE_CTRL(LCD_COMMAND_4_BIT_2_LINES), }; BYTE data[6]; // already done? RETURN_GOOD_IF_GOOD( Cache_Get_SlaveSpecific(&init, sizeof(init), SlaveSpecificTag(INI), pn) ) if ( BAD( OW_w_control(0x04, pn) ) // strobe || BAD( OW_r_reg(data, pn) ) ) { LEVEL_DEBUG("Trouble sending strobe to Hobbyboard LCD") ; return gbBAD; } if ( data[5] != 0x84 ) { LEVEL_DEBUG("LCD is not powered"); // not powered return gbBAD ; } if ( BAD( OW_c_latch(pn) ) ) { LEVEL_DEBUG("Trouble clearing latches") ; return gbBAD ; }// clear PIOs if ( BAD(OW_w_pios(start, 1, LCD_H_VERIFY_MASK, pn)) ) { LEVEL_DEBUG("Error sending initial attention"); return gbBAD; } UT_delay(5); if ( BAD(OW_w_pios(next, 5, LCD_H_VERIFY_MASK, pn)) ) { LEVEL_DEBUG("Error sending setup commands"); return gbBAD; } Cache_Add_SlaveSpecific(&init, sizeof(init), SlaveSpecificTag(INI), pn); return gbGOOD ; } static GOOD_OR_BAD Parseyx( struct yx * YX ) { if ( YX->length < 2 ) { // not long enough to have an address LEVEL_DEBUG("String too short to contain the location (%d bytes)",YX->length); return gbBAD ; } if ( YX->string[0] > '0' ) { // ascii address rather than binary return asciiyx(YX); } return binaryyx( YX ) ; } // Extract coordinates from binary string and point coordinates. string and length already set. static GOOD_OR_BAD binaryyx( struct yx * YX ) { YX->y = YX->string[0] ; YX->x = YX->string[1] ; YX->text_start = 2 ; return gbGOOD ; // next char } // Extract coordinates from ascii string and point past colon. string and length already set. static GOOD_OR_BAD asciiyx( struct yx * YX ) { char * colon = memchr( YX->string, ':', YX->length ) ; // position of mandatory colon if ( colon==NULL ) { LEVEL_DEBUG("No colon in screen text location. Should be 'y.x:text'"); return gbBAD ; } if ( sscanf(YX->string, "%d,%d:", &YX->y, &YX->x ) < 2 ) { // only one value. Set row=1 YX->y = 1 ; if ( sscanf(YX->string, "%d:", &YX->x ) < 1 ) { LEVEL_DEBUG("Ascii string location not valid"); return gbBAD ; } } // start text after colon YX->text_start = ( colon - YX->string ) + 1 ; return gbGOOD ; } // put in home position static ZERO_OR_ERROR FS_Hhome(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); struct yx YX = { 1, 1, "", 0, 0 } ; RETURN_ERROR_IF_BAD( OW_Hinit(pn) ) ; return GB_to_Z_OR_E( OW_Hprintyx(&YX, pn) ); } // Print from home position static ZERO_OR_ERROR FS_Hmessage(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); struct yx YX = { 1, 1, OWQ_buffer(owq), OWQ_size(owq), 0 } ; RETURN_ERROR_IF_BAD( OW_Hinit(pn) ) ; if (FS_Hclear(owq) != 0) { return -EINVAL; } return GB_to_Z_OR_E( OW_Hprintyx(&YX, pn) ); } // print from current position static ZERO_OR_ERROR FS_Hscreen(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); // y=0 is flag to do no position setting struct yx YX = { LCD_SAME_LOCATION_VALUE, LCD_SAME_LOCATION_VALUE, OWQ_buffer(owq), OWQ_size(owq), 0 } ; RETURN_ERROR_IF_BAD( OW_Hinit(pn) ) ; return GB_to_Z_OR_E( OW_Hprintyx(&YX, pn) ); } // print from specified positionh -- // either in ascii format "y.x:text" or "x:text" // or binary (first 2 bytes are y and x) static ZERO_OR_ERROR FS_Hscreenyx(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); struct yx YX = { 0, 0, OWQ_buffer(owq), OWQ_size(owq), 0 } ; RETURN_ERROR_IF_BAD( Parseyx( &YX ) ) ; RETURN_ERROR_IF_BAD( OW_Hinit(pn) ) ; return GB_to_Z_OR_E( OW_Hprintyx(&YX, pn) ); } // YX structure is set with y,x,string,length, and start position of text // Fix from Klaus, dr Tiger static GOOD_OR_BAD OW_Hprintyx(struct yx * YX, struct parsedname * pn) { BYTE translated_data[2 + 2 * (YX->length-YX->text_start)]; size_t original_index ; size_t translate_index = 0; int Valid_YX = ( YX->x <= LCD_LINE_END && YX->y <= LCD_LAST_ROW && YX->x >= LCD_LINE_START && YX->y >= LCD_FIRST_ROW ) ; int Continue_YX = ( YX->y == LCD_SAME_LOCATION_VALUE || YX->x == LCD_SAME_LOCATION_VALUE ) ; if ( Valid_YX ) { BYTE chip_command ; switch (YX->y) { // row value case 1: chip_command = LCD_COMMAND_SET_DDRAM_ADDRESS; break; case 2: chip_command = LCD_COMMAND_SET_DDRAM_ADDRESS + LCD_SECOND_ROW_ADDRESS; break; case 3: chip_command = LCD_COMMAND_SET_DDRAM_ADDRESS + LCD_LINE_END; break; case 4: chip_command = (LCD_COMMAND_SET_DDRAM_ADDRESS + LCD_SECOND_ROW_ADDRESS) + LCD_LINE_END; break; default: LEVEL_DEBUG("Unrecognized row %d",YX->y) ; return gbBAD ; } chip_command += YX->x - 1; // add column (0 index) // Initial location (2 half bytes) translated_data[translate_index++] = NIBBLE_ONE(chip_command); translated_data[translate_index++] = NIBBLE_TWO(chip_command); } else if ( !Continue_YX ) { LEVEL_DEBUG("Bad screen coordinates y=%d x=%d",YX->y,YX->x); return gbBAD; } //printf("Hscreen test<%*s>\n",(int)size,buf) ; for ( original_index = YX->text_start ; original_index < YX->length ; ++original_index ) { if (YX->string[original_index]) { translated_data[translate_index++] = NIBBLE_ONE(YX->string[original_index]) | LCD_DATA_FLAG; translated_data[translate_index++] = NIBBLE_TWO(YX->string[original_index]) | LCD_DATA_FLAG; } else { //null byte becomes space translated_data[translate_index++] = NIBBLE_ONE(' ') | LCD_DATA_FLAG; translated_data[translate_index++] = NIBBLE_TWO(' ') | LCD_DATA_FLAG; } } LEVEL_DEBUG("Print the message"); return OW_w_pios(translated_data, translate_index, LCD_H_VERIFY_MASK, pn); } // 0x01 => blinking cursor on // 0x02 => cursor on // 0x04 => display on static ZERO_OR_ERROR FS_Honoff(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE onoff[] = { NIBBLE_DATA(OWQ_U(owq)) }; RETURN_ERROR_IF_BAD( OW_Hinit(pn) ) ; // onoff if ( BAD(OW_w_pios(onoff, 2, LCD_H_VERIFY_MASK, pn)) ) { LEVEL_DEBUG("Error setting LCD state"); return -EINVAL; } return 0; } static ZERO_OR_ERROR FS_redefchar(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if ( OWQ_size(owq) != LCD_REDEFCHAR_LENGTH ) { return -ERANGE ; } if ( OWQ_offset(owq) != 0 ) { return -ERANGE ; } return GB_to_Z_OR_E( OW_redefchar( OWQ_buffer(owq), pn ) ) ; } static ZERO_OR_ERROR FS_redefchar_hex(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE data[LCD_REDEFCHAR_LENGTH] ; if ( OWQ_size(owq) != LCD_REDEFCHAR_LENGTH_HEX ) { return -ERANGE ; } if ( OWQ_offset(owq) != 0 ) { return -ERANGE ; } string2bytes( OWQ_buffer(owq), data, LCD_REDEFCHAR_LENGTH ) ; return GB_to_Z_OR_E( OW_redefchar( (ASCII *) data, pn ) ) ; } /* Read 6 bytes -- 0x88 PIO logic State 0x89 PIO output Latch state 0x8A PIO Activity Latch 0x8B Conditional Ch Mask 0x8C Londitional Ch Polarity 0x8D Control/Status plus 2 more bytes to get to the end of the page and qualify for a CRC16 checksum */ static GOOD_OR_BAD OW_r_reg(BYTE * data, const struct parsedname *pn) { BYTE p[3 + 8 + 2] = { _1W_READ_PIO_REGISTERS, LOW_HIGH_ADDRESS(_ADDRESS_PIO_LOGIC_STATE), }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 3, 8), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; memcpy(data, &p[3], 6); return gbGOOD; } static GOOD_OR_BAD OW_w_pio(const BYTE data, const struct parsedname *pn) { BYTE write_string[] = { _1W_CHANNEL_ACCESS_WRITE, data, (BYTE) ~ data, }; BYTE read_back[2]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(write_string), TRXN_READ2(read_back), TRXN_END, }; if ( BAD(BUS_transaction(t, pn)) ) { // may be in test mode, which causes Channel Access Write to fail // fix now, but need another attempt to see if will work OW_out_of_test_mode(pn) ; return gbBAD ; } if (read_back[0] != 0xAA) { return gbBAD; } /* Ignore byte 5 read_back[1] the PIO status byte */ return gbGOOD; } /* Send several bytes to the channel, and verify that they where sent properly * verify_mask can be used if we do not have explicit control over all PIOs, i.e. if we don't know if they * are pulled up or not (device with buttons on lower 3 bits, may not be pulled up if no buttons are included) */ static GOOD_OR_BAD OW_w_pios(const BYTE *data, const size_t size, const BYTE verify_mask, const struct parsedname *pn) { BYTE cmd[] = { _1W_CHANNEL_ACCESS_WRITE, }; size_t formatted_size = 4 * size; BYTE formatted_data[formatted_size]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(cmd), TRXN_MODIFY(formatted_data, formatted_data, formatted_size), TRXN_END, }; size_t i; // setup the array // each byte takes 4 bytes after formatting for (i = 0; i < size; ++i) { int formatted_data_index = 4 * i; formatted_data[formatted_data_index + 0] = data[i]; formatted_data[formatted_data_index + 1] = (BYTE) ~ data[i]; formatted_data[formatted_data_index + 2] = 0xFF; formatted_data[formatted_data_index + 3] = 0xFF; } if ( BAD(BUS_transaction(t, pn)) ) { // may be in test mode, which causes Channel Access Write to fail // fix now, but need another attempt to see if will work OW_out_of_test_mode(pn) ; return gbBAD ; } for (i = 0; i < size; ++i) { int formatted_data_index = 4 * i; BYTE rdata = ((BYTE)~data[i]); // get rid of warning: comparison of promoted ~unsigned with unsigned if (formatted_data[formatted_data_index + 0] != data[i]) { return gbBAD; } if (formatted_data[formatted_data_index + 1] != rdata) { return gbBAD; } if (formatted_data[formatted_data_index + 2] != 0xAA) { return gbBAD; } if ((formatted_data[formatted_data_index + 3] & verify_mask) != (data[i] & verify_mask)) { return gbBAD; } } return gbGOOD; } /* Reset activity latch */ static GOOD_OR_BAD OW_c_latch(const struct parsedname *pn) { BYTE reset_string[] = { _1W_RESET_ACTIVITY_LATCHES, }; BYTE read_back[1]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(reset_string), TRXN_READ1(read_back), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; if (read_back[0] != 0xAA) { return gbBAD; } return gbGOOD; } /* Write control/status */ static GOOD_OR_BAD OW_w_control(const BYTE data, const struct parsedname *pn) { BYTE write_string[1 + 2 + 1] = { _1W_WRITE_CONDITIONAL_SEARCH_REGISTER, LOW_HIGH_ADDRESS(_ADDRESS_CONTROL_STATUS_REGISTER), data, }; BYTE check_string[1 + 2 + 3 + 2] = { _1W_READ_PIO_REGISTERS, LOW_HIGH_ADDRESS(_ADDRESS_CONTROL_STATUS_REGISTER), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE(write_string, 4), /* Read registers */ TRXN_START, TRXN_WR_CRC16(check_string, 3, 3), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; return ((data & 0x0F) != (check_string[3] & 0x0F)) ? gbBAD : gbGOOD ; } /* write alarm settings */ static GOOD_OR_BAD OW_w_s_alarm(const BYTE * data, const struct parsedname *pn) { BYTE old_register[6]; BYTE new_register[6]; BYTE control_value[1]; BYTE alarm_access[] = { _1W_WRITE_CONDITIONAL_SEARCH_REGISTER, LOW_HIGH_ADDRESS(_ADDRESS_ALARM_REGISTERS), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(alarm_access), TRXN_WRITE2(data), TRXN_WRITE1(control_value), TRXN_END, }; // get the existing register contents RETURN_BAD_IF_BAD( OW_r_reg(old_register, pn) ) ; control_value[0] = (data[2] & 0x03) | (old_register[5] & 0x0C); RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; /* Re-Read registers */ RETURN_BAD_IF_BAD(OW_r_reg(new_register, pn)) ; return (data[0] != new_register[3]) || (data[1] != new_register[4]) || (control_value[0] != (new_register[5] & 0x0F)) ? gbBAD : gbGOOD; } // very strange command to get out of test mode. // Uses a different 1-wire command static GOOD_OR_BAD OW_out_of_test_mode( const struct parsedname * pn ) { BYTE out_of_test[] = { 0x96, SNvar(pn->sn), 0x3C, } ; struct transaction_log t[] = { TRXN_RESET, TRXN_WRITE(out_of_test, 1 + SERIAL_NUMBER_SIZE + 1 ), TRXN_END, }; return BUS_transaction( t, pn ) ; } /* Redefine a character */ static GOOD_OR_BAD OW_redefchar(ASCII * pattern, struct parsedname * pn) { int i ; int j = 0; int char_num = pn->extension * 8 + 0x40 ; int datalength = 2 * (LCD_REDEFCHAR_LENGTH+1) ; // nibbles for data plus index BYTE data[ datalength ] ; RETURN_BAD_IF_BAD( OW_Hinit(pn) ) ; // Start with char num data[j++] = (char_num & 0xF0); data[j++] = (char_num << 4) & 0xF0; // Add pattern for ( i = 0 ; i < LCD_REDEFCHAR_LENGTH ; ++i ) { data[j++] = NIBBLE_ONE(pattern[i]) | LCD_DATA_FLAG; data[j++] = NIBBLE_TWO(pattern[i]) | LCD_DATA_FLAG; } return OW_w_pios(data, datalength, LCD_H_VERIFY_MASK, pn); } owfs-3.1p5/module/owlib/src/c/ow_2409.c0000644000175000001440000001754012654730021014405 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2409.h" /* ------- Prototypes ----------- */ /* DS2409 switch */ WRITE_FUNCTION(FS_discharge); WRITE_FUNCTION(FS_clearevent); READ_FUNCTION(FS_r_control); WRITE_FUNCTION(FS_w_control); READ_FUNCTION(FS_r_sensed); READ_FUNCTION(FS_r_branch); WRITE_FUNCTION(FS_w_branch); READ_FUNCTION(FS_r_event); /* ------- Structures ----------- */ static struct aggregate A2409 = { 2, ag_numbers, ag_aggregate, }; static struct filetype DS2409[] = { F_STANDARD, {"discharge", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_discharge, VISIBLE, NO_FILETYPE_DATA, }, {"clearevent", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clearevent, VISIBLE, NO_FILETYPE_DATA, }, {"control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_control, FS_w_control, VISIBLE, NO_FILETYPE_DATA, }, {"sensed", PROPERTY_LENGTH_BITFIELD, &A2409, ft_bitfield, fc_volatile, FS_r_sensed, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"branch", PROPERTY_LENGTH_BITFIELD, &A2409, ft_bitfield, fc_volatile, FS_r_branch, FS_w_branch, VISIBLE, NO_FILETYPE_DATA, }, {"event", PROPERTY_LENGTH_BITFIELD, &A2409, ft_bitfield, fc_volatile, FS_r_event, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"aux", 0, NON_AGGREGATE, ft_directory, fc_volatile, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, {.i=eBranch_aux}, }, {"main", 0, NON_AGGREGATE, ft_directory, fc_volatile, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, {.i=eBranch_main}, }, }; DeviceEntry(1F, DS2409, NO_GENERIC_READ, NO_GENERIC_WRITE); /* ------- Functions ------------ */ /* DS2409 */ static GOOD_OR_BAD OW_r_control(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_discharge(const struct parsedname *pn); static GOOD_OR_BAD OW_clearevent(const struct parsedname *pn); static GOOD_OR_BAD OW_w_control(const UINT data, const struct parsedname *pn); static GOOD_OR_BAD OW_select_branch(const UINT data, const struct parsedname *pn); #define _1W_STATUS_READ_WRITE 0x5A #define _1W_ALL_LINES_OFF 0x66 #define _1W_DISCHARGE_LINES 0x99 #define _1W_DIRECT_ON_MAIN 0xA5 #define _1W_SMART_ON_MAIN 0xCC #define _1W_SMART_ON_AUX 0x33 /* discharge 2409 lines */ static ZERO_OR_ERROR FS_discharge(struct one_wire_query *owq) { /* Ignore if not really meant to trigger. */ if ( OWQ_Y(owq)==0 ) { return 0; } /* Discharge and return status. */ return GB_to_Z_OR_E(OW_discharge(PN(owq))); } /* Clear 2409 event flags */ /* Added by Jan Kandziora */ static ZERO_OR_ERROR FS_clearevent(struct one_wire_query *owq) { /* Ignore if not really meant to trigger. */ if ( OWQ_Y(owq)==0 ) { return 0; } /* Clear event and return status. */ return GB_to_Z_OR_E(OW_clearevent(PN(owq))); } /* 2409 switch -- branch pin voltage */ static ZERO_OR_ERROR FS_r_sensed(struct one_wire_query *owq) { BYTE data = 0 ; /* Read control/status byte from chip. */ RETURN_ERROR_IF_BAD( OW_r_control(&data, PN(owq)) ); /* Put sense bits from status byte into result. */ OWQ_U(owq) = ((data >> 1) & 0x01) | ((data >> 2) & 0x02) ; return 0; } /* 2409 switch -- branch status -- note that bit value is reversed */ static ZERO_OR_ERROR FS_r_branch(struct one_wire_query *owq) { BYTE data = 0 ; /* Read control/status byte from chip. */ RETURN_ERROR_IF_BAD( OW_r_control(&data, PN(owq)) ); /* Put branch status bits from status byte into result. */ OWQ_U(owq) = (((data) & 0x01) | ((data >> 1) & 0x02)) ^ 0x03; return 0; } static ZERO_OR_ERROR FS_w_branch(struct one_wire_query *owq) { switch (OWQ_U(owq)) { case 0: /* Select no branch. */ return GB_to_Z_OR_E(OW_clearevent(PN(owq))); case 1: case 2: /* Explicitely select main or aux branch. */ return GB_to_Z_OR_E(OW_select_branch(OWQ_U(owq),PN(owq))); } /* Other values are invalid. */ return -EINVAL; } /* 2409 switch -- event status */ static ZERO_OR_ERROR FS_r_event(struct one_wire_query *owq) { BYTE data = 0 ; /* Read control/status byte from chip. */ RETURN_ERROR_IF_BAD( OW_r_control(&data, PN(owq)) ); /* Put sense bits from status byte into result. */ OWQ_U(owq) = (data >> 4) & 0x03; return 0; } /* 2409 switch -- control pin state */ static ZERO_OR_ERROR FS_r_control(struct one_wire_query *owq) { BYTE data = 0 ; UINT control[] = { 2, 3, 0, 1, }; /* Read control/status byte from chip. */ RETURN_ERROR_IF_BAD( OW_r_control(&data, PN(owq)) ); /* Put control pin state from status byte into result. */ OWQ_U(owq) = control[data >> 6]; return 0; } /* 2409 switch -- control pin state */ static ZERO_OR_ERROR FS_w_control(struct one_wire_query *owq) { if (OWQ_U(owq) > 3) { return -EINVAL; } return GB_to_Z_OR_E(OW_w_control(OWQ_U(owq), PN(owq))) ; } /* Fix from Jan Kandziora for proper command code */ static GOOD_OR_BAD OW_discharge(const struct parsedname *pn) { BYTE dis[] = { _1W_DISCHARGE_LINES, }; BYTE alo[] = { _1W_ALL_LINES_OFF, }; GOOD_OR_BAD gbRet ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(dis), TRXN_DELAY(100), TRXN_START, TRXN_WRITE1(alo), TRXN_END, }; BUSLOCK(pn); // Mark this branching as needing a reset pn->selected_connection->branch.branch = eBranch_bad ; gbRet = BUS_transaction_nolock(t, pn) ; BUSUNLOCK(pn); return gbRet ; } /* Added by Jan Kandziora */ static GOOD_OR_BAD OW_clearevent(const struct parsedname *pn) { BYTE clr[] = { _1W_ALL_LINES_OFF, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(clr), TRXN_END, }; // Could certainly couple this with next transaction return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_w_control(const UINT data, const struct parsedname *pn) { const BYTE d[] = { 0x20, 0xA0, 0x00, 0x40, }; BYTE p[] = { _1W_STATUS_READ_WRITE, d[data], }; const BYTE r[] = { 0x80, 0xC0, 0x00, 0x40, }; BYTE info; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(p), TRXN_READ1(&info), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; /* Check that Info corresponds */ return (info & 0xC0) == r[data] ? gbGOOD : gbBAD; } static GOOD_OR_BAD OW_r_control(BYTE * data, const struct parsedname *pn) { BYTE p[] = { _1W_STATUS_READ_WRITE, 0xFF, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(p), TRXN_READ1(data), TRXN_END, }; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_select_branch(const UINT data, const struct parsedname *pn) { BYTE command[] = { 0, _1W_SMART_ON_MAIN, _1W_SMART_ON_AUX }; BYTE sel[] = { 0x00, 0xff, }; BYTE info[2]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(sel), TRXN_READ2(info), TRXN_END, }; /* Select path. */ sel[0] = command[data]; /* Select branch. */ RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; /* Check whether the branch switching had succeeded. */ return info[1] == sel[0] ? gbGOOD : gbBAD; } owfs-3.1p5/module/owlib/src/c/ow_2413.c0000644000175000001440000001251712654730021014377 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Changes 7/2004 Extensive improvements based on input from Serg Oskin */ #include #include "owfs_config.h" #include "ow_2413.h" /* ------- Prototypes ----------- */ /* DS2413 switch */ READ_FUNCTION(FS_r_piostate); WRITE_FUNCTION(FS_w_piostate); READ_FUNCTION(FS_r_pio); WRITE_FUNCTION(FS_w_pio); READ_FUNCTION(FS_sense); //READ_FUNCTION(FS_r_latch); /* ------- Structures ----------- */ static struct aggregate A2413 = { 2, ag_letters, ag_aggregate, }; static struct filetype DS2413[] = { F_STANDARD, {"piostate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_piostate, FS_w_piostate, INVISIBLE, NO_FILETYPE_DATA, }, {"PIO", PROPERTY_LENGTH_BITFIELD, &A2413, ft_bitfield, fc_link, FS_r_pio, FS_w_pio, VISIBLE, NO_FILETYPE_DATA, }, {"sensed", PROPERTY_LENGTH_BITFIELD, &A2413, ft_bitfield, fc_link, FS_sense, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, // {"latch", PROPERTY_LENGTH_BITFIELD, &A2413, ft_bitfield, fc_link, FS_r_latch, FS_w_pio, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(3A, DS2413, DEV_resume | DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_PIO_ACCESS_READ 0xF5 #define _1W_PIO_ACCESS_WRITE 0x5A #define _1W_2413_LATCH_MASK 0x0A #define _1W_2413_CONFIRMATION 0xAA /* ------- Functions ------------ */ /* DS2413 */ static GOOD_OR_BAD OW_write(BYTE data, const struct parsedname *pn); static GOOD_OR_BAD OW_read(BYTE * data, const struct parsedname *pn); static UINT SENSED_state(UINT status_bits); static UINT LATCH_state(UINT status_bits); static ZERO_OR_ERROR FS_r_piostate(struct one_wire_query *owq) { /* surrogate property bit 0 PIOA pin state bit 1 PIOA latch state bit 2 PIOB pin state bit 3 PIOB latch state */ BYTE piostate ; if ( OW_read( &piostate, PN(owq) ) ) { return -EINVAL ; } OWQ_U(owq) = piostate ; return 0 ; } /* write 2413 switch -- 2 values*/ static ZERO_OR_ERROR FS_w_piostate(struct one_wire_query *owq) { UINT pio = OWQ_U(owq) ; return OW_write( pio, PN(owq) ) ? -EINVAL : 0 ; } /* 2413 switch activity latch is actual set state of PIOs, what we want in this case */ /* bites 1 and 3 */ static ZERO_OR_ERROR FS_r_pio(struct one_wire_query *owq) { UINT piostate = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &piostate, "piostate", owq ) ; // bits 1>0 and 3->1 // complement OWQ_U(owq) = LATCH_state( piostate ) ^ 0x03 ; return z_or_e ; } /* write 2413 switch -- 2 values*/ static ZERO_OR_ERROR FS_w_pio(struct one_wire_query *owq) { // complement ZERO_OR_ERROR ret = FS_w_sibling_U( OWQ_U(owq) ^ 0x03 , "piostate", owq ); if ( ret == 0 ) { // Able to write, but piostate is potentially now incorrect // since we use a different method to set pios FS_del_sibling( "piostate", owq ) ; return 0 ; } return ret ; } /* 2413 switch PIO sensed*/ /* bits 0 and 2 */ static ZERO_OR_ERROR FS_sense(struct one_wire_query *owq) { UINT piostate = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &piostate, "piostate", owq ) ; // bits 0->0 and 2->1 OWQ_U(owq) = SENSED_state(piostate) ; return z_or_e ; } /* read status byte */ static GOOD_OR_BAD OW_read(BYTE * data, const struct parsedname *pn) { BYTE cmd[] = { _1W_PIO_ACCESS_READ, }; BYTE resp[1] ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(cmd), TRXN_READ1(resp), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; // High nibble the complement of low nibble? // Fix thanks to josef_heiler if ((resp[0] & 0x0F) != ((~resp[0] >> 4) & 0x0F)) { return gbBAD; } data[0] = resp[0] & 0x0F ; return gbGOOD; } /* write status byte */ /* top 6 bits are set to 1, complement then sent */ static GOOD_OR_BAD OW_write(BYTE data, const struct parsedname *pn) { BYTE data_masked = data | 0xFC ; BYTE cmd[] = { _1W_PIO_ACCESS_WRITE, data_masked, ~data_masked, }; BYTE chk[1]; BYTE confirm[] = { _1W_2413_CONFIRMATION, } ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(cmd), TRXN_READ1(chk), TRXN_COMPARE(chk,confirm,1), TRXN_END, }; return BUS_transaction(t, pn) ; } // piostate -> sense static UINT SENSED_state(UINT status_bits) { return ((status_bits & 0x01) >> 0) | ((status_bits & 0x04) >>1); } // piostate -> latch static UINT LATCH_state(UINT status_bits) { return ((status_bits & 0x02) >> 1) | ((status_bits & 0x08) >>2); } owfs-3.1p5/module/owlib/src/c/ow_2415.c0000644000175000001440000002142412654730021014376 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2415.h" /* ------- Prototypes ----------- */ /* DS2415/DS1904 Digital clock in a can */ READ_FUNCTION(FS_r_counter); WRITE_FUNCTION(FS_w_counter); READ_FUNCTION(FS_r_run); WRITE_FUNCTION(FS_w_run); READ_FUNCTION(FS_r_enable); WRITE_FUNCTION(FS_w_enable); READ_FUNCTION(FS_r_interval); WRITE_FUNCTION(FS_w_interval); READ_FUNCTION(FS_r_itime); WRITE_FUNCTION(FS_w_itime); READ_FUNCTION(FS_r_control); WRITE_FUNCTION(FS_w_control); /* ------- Structures ----------- */ // struct bitfield { "alias_link", number_of_bits, shift_left, } static struct bitfield DS2415_on = { "ControlRegister", 1, 3, } ; static struct bitfield DS2415_user = { "ControlRegister", 4, 4, } ; //static struct aggregate A2415 = { 4, ag_numbers, ag_aggregate, }; static struct filetype DS2415[] = { F_STANDARD, {"ControlRegister", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_control, FS_w_control, INVISIBLE, NO_FILETYPE_DATA, }, {"user", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE, {.v= &DS2415_user,}, }, // {"running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_run, FS_w_run, VISIBLE, NO_FILETYPE_DATA, }, {"running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE, {.v= &DS2415_on,}, }, {"udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter, FS_w_counter, VISIBLE, NO_FILETYPE_DATA, }, {"date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="udate"}, }, }; DeviceEntry(24, DS2415, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS2417[] = { F_STANDARD, {"ControlRegister", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_control, FS_w_control, INVISIBLE, NO_FILETYPE_DATA, }, {"enable", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_enable, FS_w_enable, VISIBLE, NO_FILETYPE_DATA, }, {"interval", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_link, FS_r_interval, FS_w_interval, VISIBLE, NO_FILETYPE_DATA, }, {"itime", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_link, FS_r_itime, FS_w_itime, VISIBLE, NO_FILETYPE_DATA, }, {"running", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_run, FS_w_run, VISIBLE, NO_FILETYPE_DATA, }, {"udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter, FS_w_counter, VISIBLE, NO_FILETYPE_DATA, }, {"date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="udate"}, }, }; DeviceEntry(27, DS2417, NO_GENERIC_READ, NO_GENERIC_WRITE); static int itimes[] = { 1, 4, 32, 64, 2048, 4096, 65536, 131072, }; #define _1W_READ_CLOCK 0x66 #define _1W_WRITE_CLOCK 0x99 #define _MASK_DS2415_USER 0xF0 #define _MASK_DS2415_OSC 0x0C #define _MASK_DS2417_IE 0x80 #define _MASK_DS2417_IS 0x70 /* ------- Functions ------------ */ /* DS2415/DS1904 Digital clock in a can */ /* DS2415 & DS2417 */ static GOOD_OR_BAD OW_r_udate(UINT * U, const struct parsedname *pn); static GOOD_OR_BAD OW_r_control(BYTE * cr, const struct parsedname *pn); static GOOD_OR_BAD OW_w_udate(UINT control_reg, UINT U, const struct parsedname * pn); static GOOD_OR_BAD OW_w_control(const BYTE cr, const struct parsedname *pn); /* DS2417 interval */ static ZERO_OR_ERROR FS_r_interval(struct one_wire_query *owq) { UINT U = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &U, "ControlRegister", owq ) ; OWQ_U(owq) = ( U & _MASK_DS2417_IS ) >> 4 ; return z_or_e ; } static ZERO_OR_ERROR FS_w_interval(struct one_wire_query *owq) { UINT U = ( OWQ_U(owq) << 4 ) & _MASK_DS2417_IS ; // Move to upper nibble return FS_w_sibling_bitwork( U, _MASK_DS2417_IS, "ControlRegister", owq ) ; } /* DS2415-DS2417 Oscillator control */ static ZERO_OR_ERROR FS_r_run(struct one_wire_query *owq) { UINT U = 0; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &U, "ControlRegister", owq ) ; OWQ_Y(owq) = ( ( U & _MASK_DS2415_OSC ) != 0 ) ; return z_or_e ; } static ZERO_OR_ERROR FS_w_run(struct one_wire_query *owq) { UINT U = OWQ_Y(owq) ? _MASK_DS2415_OSC : 0 ; return FS_w_sibling_bitwork( U, _MASK_DS2415_OSC, "ControlRegister", owq ) ; } /* DS2417 interrupt enable */ static ZERO_OR_ERROR FS_r_enable(struct one_wire_query *owq) { UINT U = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &U, "ControlRegister", owq ) ; OWQ_Y(owq) = ( ( U & _MASK_DS2417_IE ) != 0 ) ; return z_or_e ; } static ZERO_OR_ERROR FS_w_enable(struct one_wire_query *owq) { UINT U = OWQ_Y(owq) ? _MASK_DS2417_IE : 0 ; return FS_w_sibling_bitwork( U, _MASK_DS2417_IE, "ControlRegister", owq ) ; } /* DS1915 Control Register */ static ZERO_OR_ERROR FS_r_control(struct one_wire_query *owq) { BYTE cr ; if ( OW_r_control( &cr, PN(owq) ) ) { return -EINVAL ; } OWQ_U(owq) = cr ; return 0 ; } static ZERO_OR_ERROR FS_w_control(struct one_wire_query *owq) { return OW_w_control( OWQ_U(owq) & 0xFF, PN(owq) ) ? -EINVAL : 0 ; } /* DS2415 - DS2417 couter verions of date */ static ZERO_OR_ERROR FS_r_counter(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_r_udate( &(OWQ_U(owq)), PN(owq) ) ) ; } static ZERO_OR_ERROR FS_w_counter(struct one_wire_query *owq) { UINT control_reg ; // included in write /* read in existing control byte to preserve bits 4-7 */ if ( FS_r_sibling_U( &control_reg, "ControlRegister", owq) != 0 ) { return gbBAD; } return GB_to_Z_OR_E( OW_w_udate( control_reg, OWQ_U(owq), PN(owq) ) ) ; } /* DS2417 interval time (in seconds) */ static ZERO_OR_ERROR FS_w_itime(struct one_wire_query *owq) { UINT IS ; int I = OWQ_I(owq); if (I == 0) { /* Special case -- 0 time equivalent to disable */ return FS_w_sibling_Y( 0, "enable", owq ) ; } else if (I == 1) { IS = 0 ; // 1 sec } else if (I <= 4) { IS = 1 ; // 4 sec } else if (I <= 32) { IS = 2 ; // 32 sec } else if (I <= 64) { IS = 3 ; // 64 sec ~1 min } else if (I <= 2048) { IS = 4 ; // 2048 sec ~30 min } else if (I <= 4096) { IS = 5 ; // 4096 sec ~1 hr } else if (I <= 65536) { IS = 6 ; // 65536 sec ~18 hr } else { IS = 7 ; // 131072 sec ~36 hr } /* Set interval */ if ( FS_w_sibling_U( IS, "interval", owq ) != 0 ) { return -EINVAL ; } /* Enable as well */ return FS_w_sibling_Y( 1, "enable", owq) ; } static ZERO_OR_ERROR FS_r_itime(struct one_wire_query *owq) { UINT interval = 0; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &interval, "interval", owq) ; OWQ_I(owq) = itimes[interval]; return z_or_e ; } /* 1904 clock-in-a-can */ static GOOD_OR_BAD OW_r_control(BYTE * cr, const struct parsedname *pn) { BYTE r[1] = { _1W_READ_CLOCK, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(r), TRXN_READ1(cr), TRXN_END, }; return BUS_transaction(t, pn) ; } /* 1904 clock-in-a-can */ static GOOD_OR_BAD OW_r_udate(UINT * U, const struct parsedname *pn) { BYTE r[1] = { _1W_READ_CLOCK, }; BYTE data[5]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(r), TRXN_READ(data, 5), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; U[0] = UT_int32(&data[1]); return gbGOOD; } static GOOD_OR_BAD OW_w_udate(UINT control_reg, UINT U, const struct parsedname *pn) { BYTE w[6] = { _1W_WRITE_CLOCK, }; struct transaction_log twrite[] = { TRXN_START, TRXN_WRITE(w, 6), TRXN_END, }; w[1] = control_reg & 0xFF ; UT_uint32_to_bytes( U, &w[2] ); return BUS_transaction(twrite, pn) ; } static GOOD_OR_BAD OW_w_control(const BYTE cr, const struct parsedname *pn) { BYTE w[2] = { _1W_WRITE_CLOCK, cr, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(w), TRXN_END, }; /* read in existing control byte to preserve bits 4-7 */ return BUS_transaction(t, pn) ; } owfs-3.1p5/module/owlib/src/c/ow_2423.c0000644000175000001440000001704112654730021014375 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2423.h" /* ------- Prototypes ----------- */ /* DS2423 counter */ READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_counter); READ_FUNCTION(FS_pagecount); READ_FUNCTION(FS_r_mincount); WRITE_FUNCTION(FS_w_mincount); /* ------- Structures ----------- */ static struct aggregate A2423 = { 16, ag_numbers, ag_separate, }; static struct aggregate A2423c = { 2, ag_letters, ag_separate, }; static struct filetype DS2423[] = { F_STANDARD, {"memory", 512, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2423, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"pages/count", PROPERTY_LENGTH_UNSIGNED, &A2423, ft_unsigned, fc_volatile, FS_pagecount, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, // Serg Oskin recommends changing "counters" to "count" -- done but old name is still invisibly available. {"counters", PROPERTY_LENGTH_UNSIGNED, &A2423c, ft_unsigned, fc_volatile, FS_counter, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"counter", PROPERTY_LENGTH_UNSIGNED, &A2423c, ft_unsigned, fc_volatile, FS_counter, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"mincount", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_mincount, FS_w_mincount, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(1D, DS2423, DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD 0x5A #define _1W_READ_MEMORY 0xF0 #define _1W_READ_MEMORY_PLUS_COUNTER 0xA5 #define _1W_COUNTER_FILL 0x00 /* Persistent storage */ Make_SlaveSpecificTag(CUM, fc_persistent); // cumulative /* ------- Functions ------------ */ /* DS2423 */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_r_counter(struct one_wire_query *owq, size_t page, size_t pagesize); /* 2423A/D Counter */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E(COMMON_OWQ_readwrite_paged(owq, 0, pagesize, COMMON_read_memory_toss_counter)) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, pagesize, OW_w_mem)) ; } static ZERO_OR_ERROR FS_counter(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E(OW_r_counter(owq, OWQ_pn(owq).extension + 14, pagesize)) ; } static ZERO_OR_ERROR FS_pagecount(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E(OW_r_counter(owq, OWQ_pn(owq).extension, pagesize)) ; } /* Special code for cumulative counters -- read/write -- uses the caching system for storage */ /* Different from LCD system, counters are NOT reset with each read */ static ZERO_OR_ERROR FS_r_mincount(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT st[3], ct[2]; // stored and current counter values RETURN_ERROR_IF_BAD( OW_r_counter(owq, 14, 32) ) ; ct[0] = OWQ_U(owq); RETURN_ERROR_IF_BAD( OW_r_counter(owq, 15, 32) ) ; ct[1] = OWQ_U(owq); if ( BAD( Cache_Get_SlaveSpecific((void *) st, 3 * sizeof(UINT), SlaveSpecificTag(CUM), pn)) ) { // record doesn't (yet) exist st[2] = ct[0] < ct[1] ? ct[0] : ct[1]; } else { UINT d0 = ct[0] - st[0]; //delta counter.A UINT d1 = ct[1] - st[1]; // delta counter.B st[2] += d0 < d1 ? d0 : d1; // add minimum delta } st[0] = ct[0]; st[1] = ct[1]; OWQ_U(owq) = st[2]; if (Cache_Add_SlaveSpecific((void *) st, 3 * sizeof(UINT), SlaveSpecificTag(CUM), pn)) { return -EINVAL; } return 0; } static ZERO_OR_ERROR FS_w_mincount(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT st[3]; // stored and current counter values st[2] = OWQ_U(owq); RETURN_ERROR_IF_BAD( OW_r_counter(owq, 14, 32) ) ; st[0] = OWQ_U(owq); RETURN_ERROR_IF_BAD( OW_r_counter(owq, 15, 32) ); st[1] = OWQ_U(owq); if (Cache_Add_SlaveSpecific((void *) st, 3 * sizeof(UINT), SlaveSpecificTag(CUM), pn)) { return -EINVAL; } return 0; } static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[1 + 2 + 32 + 2] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; struct transaction_log tcopy_crc[] = { TRXN_START, TRXN_WR_CRC16(p, 3 + size, 0), TRXN_END, }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE(p, 3 + size), TRXN_END, }; struct transaction_log treread[] = { TRXN_START, TRXN_WRITE1(p), TRXN_READ(&p[1], 3 + size), TRXN_COMPARE(&p[4], data, size), TRXN_END, }; struct transaction_log twrite[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_END, }; /* Copy to scratchpad */ memcpy(&p[3], data, size); if (((offset + size) & 0x1F)) { // doesn't end on page boundary, no crc16 RETURN_BAD_IF_BAD(BUS_transaction(tcopy, pn)) ; } else { // DOES end on page boundary, can check CRC16 RETURN_BAD_IF_BAD(BUS_transaction(tcopy_crc, pn)) ; } /* Re-read scratchpad and compare */ /* Note that we tacitly shift the data one byte down for the E/S byte */ p[0] = _1W_READ_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(treread, pn)) ; /* Copy Scratchpad to SRAM */ p[0] = _1W_COPY_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(twrite, pn)) ; UT_delay(32); return gbGOOD; } /* read counter (just past memory) */ /* Nathan Holmes helped troubleshoot this one! */ static GOOD_OR_BAD OW_r_counter(struct one_wire_query *owq, size_t page, size_t pagesize) { BYTE extra[8]; if (COMMON_read_memory_plus_counter(extra, page, pagesize, PN(owq))) { return gbBAD; } #if 0 if (extra[4] != _1W_COUNTER_FILL || extra[5] != _1W_COUNTER_FILL || extra[6] != _1W_COUNTER_FILL || extra[7] != _1W_COUNTER_FILL) { return gbBAD; } #endif /* counter is held in the 4 bytes after the data */ OWQ_U(owq) = UT_uint32(extra); return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_2430.c0000644000175000001440000001363512654730021014400 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2430.h" /* ------- Prototypes ----------- */ /* DS2423 counter */ READ_FUNCTION(FS_r_memory); WRITE_FUNCTION(FS_w_memory); READ_FUNCTION(FS_r_status); READ_FUNCTION(FS_r_application); WRITE_FUNCTION(FS_w_application); #define _DS2430A_MEM_SIZE 32 /* ------- Structures ----------- */ static struct filetype DS2430A[] = { F_STANDARD, {"memory", _DS2430A_MEM_SIZE, NON_AGGREGATE, ft_binary, fc_link, FS_r_memory, FS_w_memory, VISIBLE, NO_FILETYPE_DATA, }, {"application", 8, NON_AGGREGATE, ft_binary, fc_stable, FS_r_application, FS_w_application, VISIBLE, NO_FILETYPE_DATA, }, {"status", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_status, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(14, DS2430A, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD 0x55 #define _1W_COPY_SCRATCHPAD_VALIDATION_KEY 0xA5 #define _1W_READ_MEMORY 0xF0 #define _1W_READ_STATUS_REGISTER 0x66 #define _1W_STATUS_VALIDATION_KEY 0x00 #define _1W_WRITE_APPLICATION_REGISTER 0x99 #define _1W_READ_APPLICATION_REGISTER 0xC3 #define _1W_COPY_AND_LOCK_APPLICATION_REGISTER 0x5A /* ------- Functions ------------ */ /* DS2502 */ static GOOD_OR_BAD OW_w_mem(const BYTE * data, size_t size, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_r_mem(BYTE * data, size_t size, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_w_app(const BYTE * data, size_t size, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_r_app(BYTE * data, size_t size, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_r_status(BYTE * data, const struct parsedname *pn); /* DS2430A memory */ static ZERO_OR_ERROR FS_r_memory(struct one_wire_query *owq) { OWQ_length(owq) = OWQ_size(owq) ; return GB_to_Z_OR_E(OW_r_mem((BYTE *) OWQ_buffer(owq), OWQ_size(owq), (size_t) OWQ_offset(owq), PN(owq))) ; } /* DS2430A memory */ static ZERO_OR_ERROR FS_r_application(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_r_app((BYTE *) OWQ_buffer(owq), OWQ_size(owq), (size_t) OWQ_offset(owq), PN(owq))) ; } static ZERO_OR_ERROR FS_w_memory(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_mem((BYTE *) OWQ_buffer(owq), OWQ_size(owq), (size_t) OWQ_offset(owq), PN(owq))) ; } static ZERO_OR_ERROR FS_w_application(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_app((BYTE *) OWQ_buffer(owq), OWQ_size(owq), (size_t) OWQ_offset(owq), PN(owq))) ; } static ZERO_OR_ERROR FS_r_status(struct one_wire_query *owq) { BYTE data ; ZERO_OR_ERROR z_or_e = OW_r_status(&data, PN(owq)) ; OWQ_U(owq) = data ; return z_or_e ; } /* Byte-oriented write */ static GOOD_OR_BAD OW_w_mem(const BYTE * data, size_t size, off_t offset, const struct parsedname *pn) { BYTE scratch[_DS2430A_MEM_SIZE]; BYTE vr[] = { _1W_READ_SCRATCHPAD, BYTE_MASK(offset), }; BYTE of[] = { _1W_WRITE_SCRATCHPAD, BYTE_MASK(offset), }; BYTE cp[] = { _1W_COPY_SCRATCHPAD, _1W_COPY_SCRATCHPAD_VALIDATION_KEY, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(of), TRXN_WRITE(data, size), TRXN_START, TRXN_WRITE2(vr), TRXN_READ(scratch, size), TRXN_COMPARE(data,scratch,size), TRXN_START, TRXN_WRITE2(cp), TRXN_DELAY(10), TRXN_END, }; /* load scratch pad if incomplete write */ if ( size != _DS2430A_MEM_SIZE ) { RETURN_BAD_IF_BAD( OW_r_mem( scratch, 0, 0x00, pn)) ; } /* write data to scratchpad */ /* read back the scratchpad */ /* copy scratchpad to memory */ return BUS_transaction(t, pn); } /* Byte-oriented write */ static GOOD_OR_BAD OW_r_mem( BYTE * data, size_t size, off_t offset, const struct parsedname *pn) { BYTE fo[] = { _1W_READ_MEMORY, BYTE_MASK(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(fo), TRXN_READ( data, size ) , TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD OW_w_app(const BYTE * data, size_t size, off_t offset, const struct parsedname *pn) { BYTE nn[] = { _1W_WRITE_APPLICATION_REGISTER, BYTE_MASK(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(nn), TRXN_WRITE(data, size), TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD OW_r_app(BYTE * data, size_t size, off_t offset, const struct parsedname *pn) { BYTE c3[] = { _1W_READ_APPLICATION_REGISTER, BYTE_MASK(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(c3), TRXN_READ(data, size), TRXN_END, }; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_r_status(BYTE * data, const struct parsedname *pn) { BYTE ss[] = { _1W_READ_STATUS_REGISTER, _1W_STATUS_VALIDATION_KEY }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(ss), TRXN_READ1(data), TRXN_END, }; return BUS_transaction(t, pn); } owfs-3.1p5/module/owlib/src/c/ow_2433.c0000644000175000001440000001556412654730021014406 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2433.h" /* ------- Prototypes ----------- */ /* DS2433 EEPROM */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); /* ------- Structures ----------- */ static struct aggregate A2431 = { 4, ag_numbers, ag_separate, }; static struct filetype DS2431[] = { F_STANDARD, {"memory", 128, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2431, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(2D, DS2431, DEV_ovdr | DEV_resume, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate A2433 = { 16, ag_numbers, ag_separate, }; static struct filetype DS2433[] = { F_STANDARD, {"memory", 512, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2433, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(23, DS2433, DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate A28EC20 = { 80, ag_numbers, ag_separate, }; static struct filetype DS28EC20[] = { F_STANDARD, {"memory", 2560, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A28EC20, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(43, DS28EC20, DEV_ovdr | DEV_resume, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD 0x55 #define _1W_READ_MEMORY 0xF0 #define _1W_EXTENDED_READ_MEMORY 0xA5 /* ------- Functions ------------ */ /* DS2433 */ static GOOD_OR_BAD OW_w_23page(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_w_2Dpage(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { size_t pagesize = 32; /* read is not page-limited */ if (COMMON_read_memory_F0(owq, 0, pagesize)) { return -EINVAL; } return 0; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { /* paged access */ size_t pagesize; switch (PN(owq)->sn[0]) { case 0x2D: pagesize = 8 ; return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, pagesize, OW_w_2Dpage)) ; default: pagesize = 8 ; return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, pagesize, OW_w_23page)) ; } } static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; if (COMMON_read_memory_F0(owq, OWQ_pn(owq).extension, pagesize)) { return -EINVAL; } return 0; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { /* paged access */ size_t pagesize = 32; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize) ; } /* paged, and pre-screened */ static GOOD_OR_BAD OW_w_23page(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[1 + 2 + 32 + 2] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WR_CRC16(p, 3 + size, 0), TRXN_END, }; struct transaction_log treread[] = { TRXN_START, TRXN_WRITE1(p), TRXN_READ(&p[1], 3 + size), TRXN_COMPARE(&p[4], data, size), TRXN_END, }; struct transaction_log twrite33[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_DELAY(5), TRXN_END, }; struct transaction_log twriteEC20[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_DELAY(10), TRXN_END, }; /* Copy to scratchpad */ memcpy(&p[3], data, size); if (((offset + size) & 0x1F)) { // doesn't end on page boundary, no crc16 tcopy[2].type = tcopy[3].type = trxn_nop; } RETURN_BAD_IF_BAD(BUS_transaction(tcopy, pn)) ; /* Re-read scratchpad and compare */ /* Note that we tacitly shift the data one byte down for the E/S byte */ p[0] = _1W_READ_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(treread, pn)) ; /* Copy Scratchpad to SRAM */ p[0] = _1W_COPY_SCRATCHPAD; switch (pn->sn[0]) { case 0x23: // DS2433 return BUS_transaction(twrite33,pn); case 0x43: default: // DS28EC20 return BUS_transaction(twriteEC20,pn); } } /* paged, and pre-screened */ /* read REAL DS2431 pages -- 8 bytes. */ static GOOD_OR_BAD OW_w_2Dpage(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { off_t pageoff = offset & 0x07; BYTE p[4 + 8 + 2] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset - pageoff), }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE(p, 3 + 8), TRXN_END, }; struct transaction_log tread[] = { TRXN_START, TRXN_WR_CRC16(p, 1, 3 + 8), TRXN_COMPARE(&p[4], data, size), TRXN_END, }; struct transaction_log tsram[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_DELAY(13), TRXN_END, }; if (size != 8) { // incomplete page OWQ_allocate_struct_and_pointer(owq_old); OWQ_create_temporary(owq_old, (char *) &p[3], 8, offset - pageoff, pn); if (COMMON_read_memory_F0(owq_old, 0, 0)) { return gbBAD; } } memcpy(&p[3 + pageoff], data, size); /* Copy to scratchpad */ RETURN_BAD_IF_BAD(BUS_transaction(tcopy, pn)) ; /* Re-read scratchpad and compare */ p[0] = _1W_READ_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(tread, pn)) ; /* Copy Scratchpad to SRAM */ p[0] = _1W_COPY_SCRATCHPAD; return BUS_transaction(tsram, pn) ; } owfs-3.1p5/module/owlib/src/c/ow_2436.c0000644000175000001440000002336412654730021014406 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2436.h" /* ------- Prototypes ----------- */ /* DS2436 Battery */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_temp); READ_FUNCTION(FS_volts); WRITE_FUNCTION(FS_increment); WRITE_FUNCTION(FS_reset); READ_FUNCTION(FS_counter) ; #define _1W_2436_PAGESIZE 32 /* ------- Structures ----------- */ static struct aggregate A2436 = { 3, ag_numbers, ag_separate, }; static struct filetype DS2436[] = { F_STANDARD, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", _1W_2436_PAGESIZE, &A2436, ft_binary, fc_stable, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"volts", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_volts, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"counter/increment", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_uncached, NO_READ_FUNCTION, FS_increment, VISIBLE, NO_FILETYPE_DATA, }, {"counter/reset", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_uncached, NO_READ_FUNCTION, FS_reset, VISIBLE, NO_FILETYPE_DATA, }, {"counter/cycles", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_counter, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(1B, DS2436, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_READ_SCRATCHPAD 0x11 #define _1W_WRITE_SCRATCHPAD 0x17 #define _1W_COPY_SP1_TO_NV1 0x22 #define _1W_COPY_SP2_TO_NV2 0x25 #define _1W_COPY_SP3_TO_NV3 0x28 #define _1W_COPY_NV1_TO_SP1 0x71 #define _1W_COPY_NV2_TO_SP2 0x77 #define _1W_COPY_NV3_TO_SP3 0x7A #define _1W_LOCK_NV1 0x43 #define _1W_UNLOCK_NV1 0x44 #define _1W_CONVERT_T 0xD2 #define _1W_CONVERT_V 0xB4 #define _1W_READ_REGISTERS 0xB2 #define _1W_INCREMENT_CYCLE 0xB5 #define _1W_RESET_CYCLE_COUNTER 0xB8 #define _ADDRESS_TEMPERATURE 0x60 #define _ADDRESS_VOLTAGE 0x77 #define _ADDRESS_CYCLES 0x82 /* ------- Functions ------------ */ /* DS2436 */ static GOOD_OR_BAD OW_r_page(BYTE * p, size_t size, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_w_page(const BYTE * p, size_t size, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_temp(_FLOAT * T, const struct parsedname *pn); static GOOD_OR_BAD OW_volts(_FLOAT * V, const struct parsedname *pn); static GOOD_OR_BAD OW_nv1_lock( const struct parsedname *pn); static GOOD_OR_BAD OW_nv1_unlock( const struct parsedname *pn); static GOOD_OR_BAD OW_reset( const struct parsedname *pn); static GOOD_OR_BAD OW_increment( const struct parsedname *pn); static GOOD_OR_BAD OW_cycles( UINT * C, const struct parsedname *pn); /* 2436 A/D */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); return GB_to_Z_OR_E(OW_r_page((BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq) + (pn->extension)*_1W_2436_PAGESIZE, pn)) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); ZERO_OR_ERROR z_or_e ; // Special case for NV1 (page 0) -- need to unlock if ( pn->extension == 0 ) { RETURN_ERROR_IF_BAD( OW_nv1_unlock( pn ) ) ; } z_or_e = OW_w_page((BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq) + (pn->extension)*_1W_2436_PAGESIZE, pn) ; // Special case for NV1 (page 0) -- need to relock if ( pn->extension == 0 ) { OW_nv1_lock( pn ) ; } return z_or_e ; } static ZERO_OR_ERROR FS_temp(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_temp(&OWQ_F(owq), PN(owq))) ; } static ZERO_OR_ERROR FS_volts(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_volts(&OWQ_F(owq), PN(owq))) ; } static ZERO_OR_ERROR FS_reset(struct one_wire_query *owq) { if ( OWQ_Y(owq) == 0 ) { return 0 ; } FS_del_sibling( "counter/cycles", owq ) ; return GB_to_Z_OR_E (OW_reset( PN(owq) )) ; } static ZERO_OR_ERROR FS_increment(struct one_wire_query *owq) { if ( OWQ_Y(owq) == 0 ) { return 0 ; } FS_del_sibling( "counter/cycles", owq ) ; return GB_to_Z_OR_E (OW_increment( PN(owq) )) ; } static ZERO_OR_ERROR FS_counter(struct one_wire_query *owq) { return GB_to_Z_OR_E ( OW_cycles( &OWQ_U(owq), PN(owq) ) ) ; } /* DS2436 simple battery */ /* only called for a single page, and that page is 0,1,2 only*/ static GOOD_OR_BAD OW_r_page(BYTE * data, size_t size, off_t offset, const struct parsedname *pn) { int page = offset / _1W_2436_PAGESIZE; // integer round-down ok BYTE scratchin[] = { _1W_READ_SCRATCHPAD, offset, }; static BYTE copyin[] = { _1W_COPY_NV1_TO_SP1, _1W_COPY_NV2_TO_SP2, _1W_COPY_NV3_TO_SP3, }; BYTE *copy = ©in[page]; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE1(copy), TRXN_DELAY(10), TRXN_END, }; struct transaction_log tscratch[] = { TRXN_START, TRXN_WRITE2(scratchin), TRXN_READ(data, size), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(tcopy, pn)) ; return BUS_transaction(tscratch, pn) ; } /* only called for a single page, and that page is 0,1,2 only*/ static GOOD_OR_BAD OW_w_page(const BYTE * data, size_t size, off_t offset, const struct parsedname *pn) { int page = offset / _1W_2436_PAGESIZE; // integer round-down ok BYTE scratchin[] = { _1W_READ_SCRATCHPAD, offset, }; BYTE scratchout[] = { _1W_WRITE_SCRATCHPAD, offset, }; BYTE p[_1W_2436_PAGESIZE]; static BYTE copyout[] = { _1W_COPY_SP1_TO_NV1, _1W_COPY_SP2_TO_NV2, _1W_COPY_SP3_TO_NV3, }; BYTE *copy = ©out[page]; struct transaction_log twrite[] = { TRXN_START, TRXN_WRITE2(scratchout), TRXN_WRITE(data, size), TRXN_END, }; struct transaction_log tread[] = { TRXN_START, TRXN_WRITE2(scratchin), TRXN_READ(p, size), TRXN_COMPARE(data, p, size), TRXN_END, }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE1(copy), TRXN_DELAY(10), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(twrite, pn)) ; RETURN_BAD_IF_BAD(BUS_transaction(tread, pn)) ; return BUS_transaction(tcopy, pn) ; } static GOOD_OR_BAD OW_temp(_FLOAT * T, const struct parsedname *pn) { BYTE d2[] = { _1W_CONVERT_T, }; BYTE b2[] = { _1W_READ_REGISTERS, _ADDRESS_TEMPERATURE, }; BYTE t[2]; struct transaction_log tconvert[] = { TRXN_START, TRXN_WRITE1(d2), TRXN_DELAY(10), TRXN_END, }; struct transaction_log tdata[] = { TRXN_START, TRXN_WRITE2(b2), TRXN_READ3(t), TRXN_END, }; // initiate conversion RETURN_BAD_IF_BAD(BUS_transaction(tconvert, pn)) ; /* Get data */ RETURN_BAD_IF_BAD(BUS_transaction(tdata, pn)) ; // success //printf("Temp bytes %0.2X %0.2X\n",t[0],t[1]); //printf("temp int=%d\n",((int)((int8_t)t[1]))); //T[0] = ((int)((int8_t)t[1])) + .00390625*t[0] ; T[0] = UT_int16(t) / 256.; return gbGOOD; } static GOOD_OR_BAD OW_volts(_FLOAT * V, const struct parsedname *pn) { BYTE b4[] = { _1W_CONVERT_V, }; BYTE b2[] = { _1W_READ_REGISTERS, _ADDRESS_VOLTAGE, }; BYTE v[2]; struct transaction_log tconvert[] = { TRXN_START, TRXN_WRITE1(b4), TRXN_DELAY(10), TRXN_END, }; struct transaction_log tdata[] = { TRXN_START, TRXN_WRITE2(b2), TRXN_READ2(v), TRXN_END, }; // initiate conversion RETURN_BAD_IF_BAD(BUS_transaction(tconvert, pn)) ; /* Get data */ RETURN_BAD_IF_BAD( BUS_transaction(tdata, pn)) ; // success //V[0] = .01 * (_FLOAT)( ( ((uint32_t)v[1]) <<8 )|v[0] ) ; V[0] = .01 * (_FLOAT) (UT_uint16(v)); return gbGOOD; } static GOOD_OR_BAD OW_nv1_lock( const struct parsedname *pn) { BYTE p[] = { _1W_LOCK_NV1, } ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(p), TRXN_DELAY(5), TRXN_END, }; return BUS_transaction( t, pn ) ; } static GOOD_OR_BAD OW_nv1_unlock( const struct parsedname *pn) { BYTE p[] = { _1W_UNLOCK_NV1, } ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(p), TRXN_DELAY(5), TRXN_END, }; return BUS_transaction( t, pn ) ; } static GOOD_OR_BAD OW_reset( const struct parsedname *pn) { BYTE p[] = { _1W_RESET_CYCLE_COUNTER, } ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(p), TRXN_END, }; return BUS_transaction( t, pn ) ; } static GOOD_OR_BAD OW_increment( const struct parsedname *pn) { BYTE p[] = { _1W_INCREMENT_CYCLE, } ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(p), TRXN_DELAY(10), TRXN_END, }; return BUS_transaction( t, pn ) ; } static GOOD_OR_BAD OW_cycles( UINT * C, const struct parsedname *pn) { BYTE c[2] ; RETURN_BAD_IF_BAD( OW_r_page( c, 2, _ADDRESS_CYCLES, pn ) ) ; C[0] = UT_uint16(c) ; return 0 ; } owfs-3.1p5/module/owlib/src/c/ow_2438.c0000644000175000001440000010146412665167763014431 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include #include "owfs_config.h" #include "ow_2438.h" /* ------- Prototypes ----------- */ /* DS2438 Battery */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_temp); READ_FUNCTION(FS_latesttemp); READ_FUNCTION(FS_volts); READ_FUNCTION(FS_Humid); READ_FUNCTION(FS_Humid_1735); READ_FUNCTION(FS_Humid_3600); READ_FUNCTION(FS_Humid_4000); READ_FUNCTION(FS_Humid_datanab); WRITE_FUNCTION(FS_reset_datanab); READ_FUNCTION(FS_Current); READ_FUNCTION(FS_r_status); WRITE_FUNCTION(FS_w_status); READ_FUNCTION(FS_r_Offset); WRITE_FUNCTION(FS_w_Offset); READ_FUNCTION(FS_r_counter); WRITE_FUNCTION(FS_w_counter); READ_FUNCTION(FS_MStype); READ_FUNCTION(FS_B1R1A_pressure); READ_FUNCTION(FS_r_B1R1A_offset); WRITE_FUNCTION(FS_w_B1R1A_offset); READ_FUNCTION(FS_r_B1R1A_gain); WRITE_FUNCTION(FS_w_B1R1A_gain); READ_FUNCTION(FS_S3R1A_current); READ_FUNCTION(FS_S3R1A_illuminance); READ_FUNCTION(FS_r_S3R1A_gain); WRITE_FUNCTION(FS_w_S3R1A_gain); static enum e_visibility VISIBLE_DATANAB( const struct parsedname * pn ) ; // src deserves some explanation: // 1 -- VDD (battery) measured // 0 -- VAD (other) measured enum voltage_source { voltage_source_VAD = 0, voltage_source_VDD = 1, } ; /* ------- Structures ----------- */ static struct aggregate A2437 = { 8, ag_numbers, ag_separate, }; static struct filetype DS2437[] = { F_STANDARD, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 8, &A2437, ft_binary, fc_stable, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"VDD", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_volts, NO_WRITE_FUNCTION, VISIBLE, {.i=voltage_source_VAD}, }, {"VAD", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_volts, NO_WRITE_FUNCTION, VISIBLE, {.i=voltage_source_VAD}, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"latesttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_latesttemp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vis", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_Current, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"IAD", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_status, FS_w_status, VISIBLE, {.i=0}, }, {"CA", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_status, FS_w_status, VISIBLE, {.i=1}, }, {"EE", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_status, FS_w_status, VISIBLE, {.i=2}, }, {"udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter, FS_w_counter, VISIBLE, {.s=0x08}, }, {"date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="udate"}, }, {"disconnect", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"disconnect/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_counter, FS_w_counter, VISIBLE, {.s=0x10}, }, {"disconnect/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="disconnect/udate"}, }, {"endcharge", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"endcharge/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_counter, FS_w_counter, VISIBLE, {.s=0x14}, }, {"endcharge/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="endcharge/udate"}, }, }; DeviceEntryExtended(1E, DS2437, DEV_temp | DEV_volt, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate A2438 = { 8, ag_numbers, ag_separate, }; static struct filetype DS2438[] = { F_STANDARD, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 8, &A2438, ft_binary, fc_stable, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"VDD", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_volts, NO_WRITE_FUNCTION, VISIBLE, {.i=voltage_source_VDD}, }, {"VAD", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_volts, NO_WRITE_FUNCTION, VISIBLE, {.i=voltage_source_VAD}, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_simultaneous_temperature, FS_temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"latesttemp", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_latesttemp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"humidity", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_Humid, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vis", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_Current, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"IAD", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_status, FS_w_status, VISIBLE, {.i=0}, }, {"CA", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_status, FS_w_status, VISIBLE, {.i=1}, }, {"EE", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_status, FS_w_status, VISIBLE, {.i=2}, }, {"offset", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_Offset, FS_w_Offset, VISIBLE, NO_FILETYPE_DATA, }, {"udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_counter, FS_w_counter, VISIBLE, {.s=0x08}, }, {"date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="udate"}, }, {"disconnect", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"disconnect/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_counter, FS_w_counter, VISIBLE, {.s=0x10}, }, {"disconnect/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="disconnect/udate"}, }, {"endcharge", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"endcharge/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_counter, FS_w_counter, VISIBLE, {.s=0x14}, }, {"endcharge/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE, {.a="endcharge/udate"}, }, {"HTM1735", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"HTM1735/humidity", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_Humid_1735, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"HIH3600", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"HIH3600/humidity", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_Humid_3600, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"HIH4000", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"HIH4000/humidity", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_Humid_4000, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"DATANAB", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_DATANAB, NO_FILETYPE_DATA, }, {"DATANAB/humidity", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_Humid_datanab, NO_WRITE_FUNCTION, VISIBLE_DATANAB, NO_FILETYPE_DATA, }, {"DATANAB/reset", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_reset_datanab, VISIBLE_DATANAB, NO_FILETYPE_DATA, }, {"MultiSensor", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"MultiSensor/type", 12, NON_AGGREGATE, ft_vascii, fc_stable, FS_MStype, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"B1-R1-A", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"B1-R1-A/pressure", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_volatile, FS_B1R1A_pressure, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"B1-R1-A/offset", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_stable, FS_r_B1R1A_offset, FS_w_B1R1A_offset, VISIBLE, NO_FILETYPE_DATA, }, {"B1-R1-A/gain", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_stable, FS_r_B1R1A_gain, FS_w_B1R1A_gain, VISIBLE, NO_FILETYPE_DATA, }, {"S3-R1-A", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"S3-R1-A/current", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_S3R1A_current, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"S3-R1-A/illuminance", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_S3R1A_illuminance, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"S3-R1-A/gain", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_float, fc_stable, FS_r_S3R1A_gain, FS_w_S3R1A_gain, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(26, DS2438, DEV_temp | DEV_volt, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x4E #define _1W_READ_SCRATCHPAD 0xBE #define _1W_COPY_SCRATCHPAD 0x48 #define _1W_RECALL_SCRATCHPAD 0xB8 #define _1W_CONVERT_T 0x44 #define _1W_CONVERT_V 0xB4 /* ------- Functions ------------ */ /* DS2438 */ static GOOD_OR_BAD OW_r_page(BYTE * p, const int page, const struct parsedname *pn); static GOOD_OR_BAD OW_w_page(const BYTE * p, const int page, const struct parsedname *pn); static GOOD_OR_BAD OW_latesttemp(_FLOAT * T, const struct parsedname *pn); static GOOD_OR_BAD OW_temp(_FLOAT * T, int simul_good, const struct parsedname *pn); static GOOD_OR_BAD OW_volts(_FLOAT * V, enum voltage_source src, const struct parsedname *pn); static GOOD_OR_BAD OW_r_int(int *I, const UINT address, const struct parsedname *pn); static GOOD_OR_BAD OW_w_int(const int I, const UINT address, const struct parsedname *pn); static GOOD_OR_BAD OW_w_offset(const int I, const struct parsedname *pn); static GOOD_OR_BAD OW_r_uint(UINT *U, const UINT address, const struct parsedname *pn); static GOOD_OR_BAD OW_set_AD( enum voltage_source src, const struct parsedname *pn); /* 8 Byte pages */ #define DS2438_ADDRESS_TO_PAGE(a) ((a)>>3) #define DS2438_ADDRESS_TO_OFFSET(a) ((a)&0x07) /* Datanab data */ struct s_datanab { _FLOAT slope ; _FLOAT offset ; }; /* Internal files */ Make_SlaveSpecificTag(NAB, fc_persistent); /* finds the visibility for DATANAB */ static enum e_visibility VISIBLE_DATANAB( const struct parsedname * pn ) { int device_id = -1 ; LEVEL_DEBUG("Checking visibility of %s",SAFESTRING(pn->path)) ; if ( BAD( GetVisibilityCache( &device_id, pn ) ) ) { BYTE page3[8] ; if ( GOOD( OW_r_page( page3, 3, pn ) ) ) { if ( memcmp( page3, "HUMIDIT3", 8 ) == 0 ) { device_id = 1 ; // tag for datanab device } else { device_id = 0 ; // not a datanab } SetVisibilityCache( device_id, pn ) ; } } return device_id==1 ? visible_now : visible_not_now ; } /* 2438 A/D */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE data[8]; RETURN_ERROR_IF_BAD( OW_r_page(data, pn->extension, pn) ) ; memcpy((BYTE *) OWQ_buffer(owq), &data[OWQ_offset(owq)], OWQ_size(owq)); return 0; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); LEVEL_DEBUG("size=%d offset=%d", OWQ_size(owq), OWQ_offset(owq)); if (OWQ_size(owq) < 8) { /* partial page */ BYTE data[8]; RETURN_ERROR_IF_BAD( OW_r_page(data, pn->extension, pn) ); memcpy(&data[OWQ_offset(owq)], (BYTE *) OWQ_buffer(owq), OWQ_size(owq)); RETURN_ERROR_IF_BAD( OW_w_page(data, pn->extension, pn) ) ; } else { /* complete page */ RETURN_ERROR_IF_BAD( OW_w_page((BYTE *) OWQ_buffer(owq), pn->extension, pn) ) ; } return 0; } static ZERO_OR_ERROR FS_MStype(struct one_wire_query *owq) { BYTE data[8]; ASCII *t; // Read page 3 for type -- Michael Markstaller RETURN_ERROR_IF_BAD( OW_r_page(data, 3, PN(owq)) ); switch (data[0]) { case 0x00: t = "MS-T"; break; case 0x19: t = "MS-TH"; break; case 0x1A: t = "MS-TV"; break; case 0x1B: t = "MS-TL"; break; case 0x1C: t = "MS-TC"; break; case 0x1D: t = "MS-TW"; break; default: t = "unknown"; break; } return OWQ_format_output_offset_and_size_z(t, owq); } static ZERO_OR_ERROR FS_temp(struct one_wire_query *owq) { // Double try temperature, with and without simultaneous if ( GOOD( OW_temp(&OWQ_F(owq), OWQ_SIMUL_TEST(owq), PN(owq))) ) { return 0 ; } return GB_to_Z_OR_E( OW_temp(&OWQ_F(owq), 0, PN(owq)) ) ; } static ZERO_OR_ERROR FS_latesttemp(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_latesttemp(&OWQ_F(owq), PN(owq)) ); } static ZERO_OR_ERROR FS_volts(struct one_wire_query *owq) { /* data=1 VDD data=0 VAD */ return GB_to_Z_OR_E( OW_volts(&OWQ_F(owq), OWQ_pn(owq).selected_filetype->data.i, PN(owq)) ); } static ZERO_OR_ERROR FS_Humid(struct one_wire_query *owq) { _FLOAT H = 0.; ZERO_OR_ERROR z_or_e ; if ( VISIBLE_DATANAB(PN(owq)) == visible_not_now ) { z_or_e = FS_r_sibling_F( &H, "HIH3600/humidity", owq ) ; } else { z_or_e = FS_r_sibling_F( &H, "DATANAB/humidity", owq ) ; } OWQ_F(owq) = H ; return z_or_e ; } static ZERO_OR_ERROR FS_Humid_3600(struct one_wire_query *owq) { _FLOAT T, VAD, VDD; _FLOAT humidity_uncompensated ; _FLOAT temperature_compensation ; if ( FS_r_sibling_F( &T, "temperature", owq ) != 0 || FS_r_sibling_F( &VAD, "VAD", owq ) != 0 || FS_r_sibling_F( &VDD, "VDD", owq ) != 0 ) { return -EINVAL ; } //*H = (VAD/VDD-.16)/(.0062*(1.0546-.00216*T)) ; /* From: Vincent Fleming To: owfs-developers@lists.sourceforge.net Date: Jun 7, 2006 8:53 PM Subject: [Owfs-developers] Error in Humidity calculation in ow_2438.c OK, this is a nit, but it will make owfs a little more accurate (admittedly, it’s not very significant difference)… The calculation given by Dallas for a DS2438/HIH-3610 combination is: Sensor_RH = (VAD/VDD) -0.16 / 0.0062 And Honeywell gives the following: VAD = VDD (0.0062(sensor_RH) + 0.16), but they specify that VDD = 5V dc, at 25 deg C. Which is exactly what we have in owfs code (solved for Humidity, of course). Honeywell’s documentation explains that the HIH-3600 series humidity sensors produce a liner voltage response to humidity that is in the range of 0.8 Vdc to 3.8 Vdc (typical) and is proportional to the input voltage. So, the error is, their listed calculations don’t correctly adjust for varying input voltage. The .16 constant is 1/5 of 0.8 – the minimum voltage produced. When adjusting for voltage (such as (VAD/VDD) portion), this constant should also be divided by the input voltage, not by 5 (the calibrated input voltage), as shown in their documentation. So, their documentation is a little wrong. The level of error this produces would be proportional to how far from 5 Vdc your input voltage is. In my case, I seem to have a constant 4.93 Vdc input, so it doesn’t have a great effect (about .25 degrees RH) */ if ( VDD < .01 ) { LEVEL_DEBUG("Low measured VDD %g",VDD); return -EINVAL ; } humidity_uncompensated = (VAD / VDD - (0.8 / VDD)) / .0062 ; temperature_compensation = 1.0546 - 0.00216 * T ; OWQ_F(owq) = humidity_uncompensated / temperature_compensation ; //printf( "%g,%g,%g,%g\n", VAD, VDD, T, OWQ_F(owq) ) ; return 0; } /* The HIH-4010 and HIH-4020 are newer versions of the HIH-4000 */ /* Used in the Hobbyboards humidity product */ /* Formula from Honeywell datasheet (2007) * http://sensing.honeywell.com/index.cfm/ci_id/142534/la_id/1/document/1/re_id/0 * * */ static ZERO_OR_ERROR FS_Humid_4000(struct one_wire_query *owq) { _FLOAT T, VAD, VDD; _FLOAT humidity_uncompensated ; _FLOAT temperature_compensation ; if ( FS_r_sibling_F( &T, "temperature", owq ) != 0 || FS_r_sibling_F( &VAD, "VAD", owq ) != 0 || FS_r_sibling_F( &VDD, "VDD", owq ) != 0 ) { return -EINVAL ; } if ( VDD < .01 ) { LEVEL_DEBUG("Low measured VDD %g",VDD); return -EINVAL ; } humidity_uncompensated = ((VAD/VDD) - 0.16) / 0.0062 ; // temperature compensation temperature_compensation = 1.0546 - 0.00216 * T ; OWQ_F(owq) = humidity_uncompensated / temperature_compensation ; return 0; } /* The Datanab verion of the HIH-4000 */ static ZERO_OR_ERROR FS_Humid_datanab(struct one_wire_query *owq) { _FLOAT T, vis, VAD; _FLOAT humidity_uncompensated ; _FLOAT temperature_adjust ; struct s_datanab nab ; struct parsedname * pn = PN(owq) ; if ( VISIBLE_DATANAB(pn) == visible_not_now ) { return -ENOTSUP ; } // make sure permanent cache has calibration values // this also serves as a check that device setup was done. if ( BAD( Cache_Get_SlaveSpecific((void *) &nab, sizeof(struct s_datanab), SlaveSpecificTag(NAB), pn) )) { // need to call device setup FS_w_sibling_Y( 1, "DATANAB/reset", owq ) ; if ( BAD( Cache_Get_SlaveSpecific((void *) &nab, sizeof(struct s_datanab), SlaveSpecificTag(NAB), pn) )) { return -EINVAL ; } } if ( FS_r_sibling_F( &T, "temperature", owq ) != 0 || FS_r_sibling_F( &VAD, "VAD", owq ) != 0 || FS_r_sibling_F( &vis, "vis", owq ) != 0 ) { return -EINVAL ; } // calculation straight from datasheet: http://www.datanab.com/docs/sensors/1WTH_PRB_commDetails.pdf humidity_uncompensated = ( (vis/VAD) * 85.65 - nab.offset ) / nab.slope ; temperature_adjust = 1.0546 - ( 0.00216 * T ) ; if ( temperature_adjust == 0. ) { temperature_adjust = 1. ; } OWQ_F(owq) = humidity_uncompensated / temperature_adjust ; return 0 ; } /* * Willy Robison's contribution * HTM1735 from Humirel (www.humirel.com) hooked up like everyone * else. The datasheet seems to suggest that the humidity * measurement isn't too sensitive to VCC (VCC=5.0V +/- 0.25V). * The conversion formula is derived directly from the datasheet * (page 2). VAD is assumed to be volts and *H is relative * humidity in percent. */ static ZERO_OR_ERROR FS_Humid_1735(struct one_wire_query *owq) { _FLOAT VAD = 0.; ZERO_OR_ERROR z_or_e = FS_r_sibling_F( &VAD, "VAD", owq ) ; OWQ_F(owq) = 38.92 * VAD - 41.98; return z_or_e ; } // Read current register // turn on (temporary) A/D in scratchpad static ZERO_OR_ERROR FS_Current(struct one_wire_query *owq) { BYTE data[9]; INT iad ; if ( FS_r_sibling_Y( &iad, "IAD", owq ) != 0 ) { return -EINVAL ; } // Actual units are volts-- need to know sense resistor for current RETURN_ERROR_IF_BAD( OW_r_page(data, 0, PN(owq)) ) ; LEVEL_DEBUG("DS2438 vis scratchpad " SNformat, SNvar(data)); //F[0] = .0002441 * (_FLOAT) ((((int) data[6]) << 8) | data[5]); OWQ_F(owq) = .0002441 * UT_int16(&data[5]); return 0 ; } // Set the DataNAB humidity -- sets the vis converting and reads the constants static ZERO_OR_ERROR FS_reset_datanab( struct one_wire_query * owq ) { if ( OWQ_Y(owq) == 1 ) { struct parsedname * pn = PN(owq) ; BYTE page6[8] ; struct s_datanab nab = { .slope = 0.031, .offset = 0.8 , } ; // default values FS_w_sibling_U( 0, "offset", owq ) ; // set current offset to 0 FS_w_sibling_Y( 1, "IAD", owq ) ; // turn on current sensor UT_delay(28) ; // wait 28 msec for 1st conversion // read slope and offset data stored in page 6 -- with some checks if ( GOOD( OW_r_page( page6, 6, pn ) ) && page6[0]==0xAA && page6[1]==0xAA ) { _FLOAT offset, slope ; slope = ( 256. * page6[4] + page6[5] ) / 100000. ; offset = ( 256. * page6[2] + page6[3] ) / 10000. ; if ( slope != 0. ) { nab.slope = slope ; nab.offset = offset ; } } // store slope and offset in permanent cache Cache_Add_SlaveSpecific((const void *) &nab, sizeof(struct s_datanab), SlaveSpecificTag(NAB), pn ) ; } return 0 ; } // status bit static ZERO_OR_ERROR FS_r_status(struct one_wire_query *owq) { BYTE page0[8]; RETURN_ERROR_IF_BAD( OW_r_page(page0, 0, PN(owq)) ); OWQ_Y(owq) = UT_getbit(page0, PN(owq)->selected_filetype->data.i); return 0; } static ZERO_OR_ERROR FS_w_status(struct one_wire_query *owq) { BYTE page0[8]; RETURN_ERROR_IF_BAD( OW_r_page(page0, 0, PN(owq)) ); UT_setbit(page0, PN(owq)->selected_filetype->data.i, OWQ_Y(owq)); RETURN_ERROR_IF_BAD( OW_w_page(page0, 0, PN(owq)) ) ; return 0; } static ZERO_OR_ERROR FS_r_Offset(struct one_wire_query *owq) { RETURN_ERROR_IF_BAD( OW_r_int(&OWQ_I(owq), 0x0D, PN(owq)) ) ; OWQ_I(owq) >>= 3; return 0; } static ZERO_OR_ERROR FS_w_Offset(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int IAD_status ; int I = OWQ_I(owq); ZERO_OR_ERROR z_or_e ; if (I > 255 || I < -256) { return -EINVAL; } if ( BAD(FS_r_sibling_Y( &IAD_status, "IAD", owq )) ) { return -EINVAL ; } if ( IAD_status == 1 ) { // need to turn off if ( BAD(FS_w_sibling_Y( 0, "IAD", owq )) ) { return -EINVAL ; } } z_or_e = OW_w_offset(I << 3, pn) ; Cache_Del_Internal(SlaveSpecificTag(NAB), pn) ; if ( IAD_status == 1 ) { // need to turn back on if ( BAD(FS_w_sibling_Y( 1, "IAD", owq )) ) { return -EINVAL ; } } return z_or_e ; } /* set clock */ static ZERO_OR_ERROR FS_w_counter(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int page = DS2438_ADDRESS_TO_PAGE(pn->selected_filetype->data.s) ; int offset = DS2438_ADDRESS_TO_OFFSET(pn->selected_filetype->data.s); BYTE data[8]; RETURN_ERROR_IF_BAD( OW_r_page(data, page, pn) ) ; UT_uint32_to_bytes( OWQ_U(owq), &data[offset] ); return GB_to_Z_OR_E( OW_w_page(data, page, pn) ) ; } /* read clock */ static ZERO_OR_ERROR FS_r_counter(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int page = DS2438_ADDRESS_TO_PAGE(pn->selected_filetype->data.s); int offset = DS2438_ADDRESS_TO_OFFSET(pn->selected_filetype->data.s); BYTE data[8]; RETURN_ERROR_IF_BAD(OW_r_page(data, page, pn)) ; OWQ_U(owq) = UT_int32(&data[offset]); return 0; } /* * Egil Kvaleberg's contribution * The B1-R1-A barometer from Hobby-Boards has a * temperature compensated MPXA4115A absolute * pressure sensor from Freescale wired to VAD via an INA126 * instrumentation amp with 10x gain and offset adjusted * by a trimmer. The sensor sensitivity is specified as 46 mV/kPa, * which is 21.737 mbar/V. * The default offset is based on the standard calibration where * 2V is 948.2 mbar (28inHg) at sea level, which translates to * 904.7 mbar for 0V */ static ZERO_OR_ERROR FS_B1R1A_pressure(struct one_wire_query *owq) { _FLOAT VAD; _FLOAT gain; _FLOAT offset; _FLOAT mbar; if ( FS_r_sibling_F( &VAD, "VAD", owq ) || FS_r_sibling_F( &gain, "B1-R1-A/gain", owq ) || FS_r_sibling_F( &offset, "B1-R1-A/offset", owq ) ) { return -EINVAL ; } mbar = VAD * gain + offset; LEVEL_DEBUG("B1-R1-A Raw (mbar) = %g gain = %g ofs = %g", mbar, gain, offset); OWQ_F(owq) = mbar; return 0; } static ZERO_OR_ERROR FS_r_B1R1A_offset(struct one_wire_query *owq) { int i = 0; /* Read page 3 byte 6&7 for barometer offset -- Egil Kvaleberg */ RETURN_ERROR_IF_BAD( OW_r_int(&i, (3 << 3) + 6, PN(owq)) ) ; /* Offset in units of 1/20 millibars, default to 948.2 */ if (i == 0) { OWQ_F(owq) = 904.7; } else { OWQ_F(owq) = i / 20.0; } return 0; } static ZERO_OR_ERROR FS_w_B1R1A_offset(struct one_wire_query *owq) { _FLOAT offset = OWQ_F(owq); int i; if (offset < -0x7fff / 20.0 || offset > 0x7fff / 20.0) { return -EINVAL; } /* Offset in units of 1/20 millibars */ i = lrint(offset * 20.0); /* Write page 3 byte 6&7 for B1-R1-A offset -- Egil Kvaleberg */ return GB_to_Z_OR_E(OW_w_int(i, (3 << 3) + 6, PN(owq))) ; } static ZERO_OR_ERROR FS_r_B1R1A_gain(struct one_wire_query *owq) { int i = 0; /* Read page 3 byte 4&5 for barometer gain -- Egil Kvaleberg */ RETURN_ERROR_IF_BAD( OW_r_uint( (UINT*) &i, (3 << 3) + 4, PN(owq)) ) ; /* Gain in units of 1/1000 millibars/volt, default is 21.739 */ if (i == 0) { OWQ_F(owq) = 1000.0 / 46.0; } else { OWQ_F(owq) = i / 1000.0; } return 0; } static ZERO_OR_ERROR FS_w_B1R1A_gain(struct one_wire_query *owq) { _FLOAT gain = OWQ_F(owq); int i; if (gain < -0x7fff / 1000.0 || gain > 0x7fff / 1000.0) { return -EINVAL; } /* Gain in units of 1/1000 millibars/volt */ i = lrint(gain * 1000.0); /* Write page 3 byte 4&5 for B1-R1-A gain -- Egil Kvaleberg */ return GB_to_Z_OR_E(OW_w_int(i, (3 << 3) + 4, PN(owq))) ; } /* * Egil Kvaleberg's contribution * The S3-R1-A solar radiation sensor from Hobby-Boards has a * photodiode where the leakage current is read by the current * sensor over a 390 ohm resistor. The reading is in microamps. * The board is currently delivered with a SFH203P diode from Osram. * The current at 1000 lx is specified as 9.5 uA, the dark current * 0.001 uA. * Also, the actual mounting conditions will need to be * compensated for, such as any integrating sphere and so on. * Previously, the Clairex CLD140 was used, which is more sensitive. */ static ZERO_OR_ERROR FS_S3R1A_current(struct one_wire_query *owq) { _FLOAT vis; if ( FS_r_sibling_F( &vis, "vis", owq ) ) { return -EINVAL ; } /* * A negative current reading can happen, and * would be due to offset errors or noise. */ OWQ_F(owq) = vis * (1000000.0 / 390.0); return 0; } static ZERO_OR_ERROR FS_S3R1A_illuminance(struct one_wire_query *owq) { _FLOAT current; _FLOAT gain; _FLOAT illuminance; if ( FS_r_sibling_F( ¤t, "S3-R1-A/current", owq ) || FS_r_sibling_F( &gain, "S3-R1-A/gain", owq ) ) { return -EINVAL ; } /* * Negative current readings are eliminated to ensure positive * illuminance values. We * ensure they are non-zero to make it easier to deal with any * logaritms that may be applied. * Note that the chip used really is very crude: it has * a resolution of 0.24mV, corresponding to a dark current * resolution of 0.63 uA, corresponding to about 60 lx. * We use 1 lx as a representation of zero. */ illuminance = current * gain; if (illuminance < 1.0) illuminance = 1.0; OWQ_F(owq) = illuminance; return 0; } static ZERO_OR_ERROR FS_r_S3R1A_gain(struct one_wire_query *owq) { unsigned u = 0; /* Read page 3 byte 2&3 for illuminance gain -- Egil Kvaleberg */ RETURN_BAD_IF_BAD( OW_r_uint(&u, (3 << 3) + 2, PN(owq)) ) ; if (u == 0) { /* Default gain assumes SFH203P diode */ OWQ_F(owq) = 1000.0 / 9.5; } else { /* Gain stored in units of 1/10 lx/uA */ OWQ_F(owq) = u / 10.0; } return 0; } static ZERO_OR_ERROR FS_w_S3R1A_gain(struct one_wire_query *owq) { _FLOAT gain = OWQ_F(owq); unsigned u; if (gain < 0.0 || gain > 6553.5) { return -EINVAL; } /* Gain in units of 1/10 lx/uA */ u = lrint(gain * 10.0); /* Write page 3 byte 2&3 for illuminance gain -- Egil Kvaleberg */ return GB_to_Z_OR_E(OW_w_int(u, (3 << 3) + 2, PN(owq))) ; } /* DS2438 read page (8 bytes) */ /* p is 8 bytes long */ static GOOD_OR_BAD OW_r_page(BYTE * p, const int page, const struct parsedname *pn) { BYTE data[9]; BYTE recall[] = { _1W_RECALL_SCRATCHPAD, page, }; BYTE r[] = { _1W_READ_SCRATCHPAD, page, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(recall), TRXN_START, TRXN_WRITE2(r), TRXN_READ(data, 9), TRXN_CRC8(data, 9), TRXN_END, }; // read to scratch, then in RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; // copy to buffer memcpy(p, data, 8); return gbGOOD; } /* write 8 bytes */ /* p is 8 bytes long */ static GOOD_OR_BAD OW_w_page(const BYTE * p, const int page, const struct parsedname *pn) { BYTE data[9]; BYTE w[] = { _1W_WRITE_SCRATCHPAD, page, }; BYTE r[] = { _1W_READ_SCRATCHPAD, page, }; BYTE eeprom[] = { _1W_COPY_SCRATCHPAD, page, }; struct transaction_log t[] = { TRXN_START, // 0 TRXN_WRITE2(w), TRXN_WRITE(p, 8), TRXN_START, TRXN_WRITE2(r), TRXN_READ(data, 9), TRXN_CRC8(data, 9), TRXN_START, TRXN_WRITE2(eeprom), TRXN_DELAY(10), // 10 msec TRXN_END, }; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_latesttemp(_FLOAT * T, const struct parsedname *pn) { BYTE data[9]; // read back registers RETURN_BAD_IF_BAD(OW_r_page(data, 0, pn)) ; //*T = ((int)((signed char)data[2])) + .00390625*data[1] ; T[0] = UT_int16(&data[1]) / 256.0; return gbGOOD; } static GOOD_OR_BAD OW_temp(_FLOAT * T, int simul_good, const struct parsedname *pn) { UINT delay = 10 ; static BYTE t[] = { _1W_CONVERT_T, }; struct transaction_log tconvert[] = { TRXN_START, TRXN_WRITE1(t), TRXN_DELAY(delay), TRXN_END, }; // write conversion command if ( simul_good ) { RETURN_BAD_IF_BAD( FS_Test_Simultaneous( SlaveSpecificTag(S_T), delay, pn) ) ; } else { RETURN_BAD_IF_BAD(BUS_transaction(tconvert, pn)) ; } return OW_latesttemp( T, pn ); } static GOOD_OR_BAD OW_set_AD( enum voltage_source src, const struct parsedname *pn) { // src deserves some explanation: // 1 -- VDD (battery) measured // 0 -- VAD (other) measured BYTE data[1]; BYTE r[] = { _1W_READ_SCRATCHPAD, 0, }; // page 0 struct transaction_log tread[] = { TRXN_START, TRXN_WRITE2(r), TRXN_READ(data, 1), TRXN_END, }; BYTE w[] = { _1W_WRITE_SCRATCHPAD, 0, }; // page 0 struct transaction_log twrite[] = { TRXN_START, // 0 TRXN_WRITE2(w), TRXN_WRITE(data, 1), TRXN_END, }; // read to scratch, then in RETURN_BAD_IF_BAD(BUS_transaction(tread, pn)) ; if ( UT_getbit( data, 3 ) == (BYTE) src ) { // correct setting already. Leave there return gbGOOD ; } UT_setbit( data, 3, (BYTE) src ) ; return BUS_transaction(twrite, pn) ; } static GOOD_OR_BAD OW_volts(_FLOAT * V, enum voltage_source src, const struct parsedname *pn) { // src deserves some explanation: // 1 -- VDD (battery) measured // 0 -- VAD (other) measured BYTE data[9]; static BYTE v[] = { _1W_CONVERT_V, }; struct transaction_log tconvert[] = { TRXN_START, TRXN_WRITE1(v), TRXN_DELAY(10), // 10 ms TRXN_END, }; // set voltage source command RETURN_BAD_IF_BAD( OW_set_AD( src, pn ) ); // write conversion command RETURN_BAD_IF_BAD(BUS_transaction(tconvert, pn)) ; // read back registers RETURN_BAD_IF_BAD(OW_r_page(data, 0, pn)); V[0] = .01 * (_FLOAT) UT_int16(&data[3]); return gbGOOD; } static GOOD_OR_BAD OW_w_offset(const int I, const struct parsedname *pn) { BYTE data[8]; int current_conversion_enabled; // set current readings off source command RETURN_BAD_IF_BAD(OW_r_page(data, 0, pn)); current_conversion_enabled = UT_getbit(data, 0); if (current_conversion_enabled) { UT_setbit(data, 0, 0); // AD bit in status register RETURN_BAD_IF_BAD(OW_w_page(data, 0, pn)); } // read back registers RETURN_BAD_IF_BAD(OW_w_int(I, 0x0D, pn)); if (current_conversion_enabled) { // if ( OW_r_page( data , 0 , pn ) ) return 1 ; /* Assume no change to these fields */ UT_setbit(data, 0, 1); // AD bit in status register RETURN_BAD_IF_BAD(OW_w_page(data, 0, pn)); } return gbGOOD; } static GOOD_OR_BAD OW_r_int(int *I, const UINT address, const struct parsedname *pn) { BYTE data[8]; // read back registers RETURN_BAD_IF_BAD(OW_r_page(data, DS2438_ADDRESS_TO_PAGE(address), pn)); *I = (int) UT_int16(&data[DS2438_ADDRESS_TO_OFFSET(address)]); return gbGOOD; } static GOOD_OR_BAD OW_w_int(const int I, const UINT address, const struct parsedname *pn) { BYTE data[8]; // write 16bit int RETURN_BAD_IF_BAD(OW_r_page(data, DS2438_ADDRESS_TO_PAGE(address), pn)) ; data[DS2438_ADDRESS_TO_OFFSET(address)] = BYTE_MASK(I); data[DS2438_ADDRESS_TO_OFFSET(address+1) & 0x07] = BYTE_MASK(I >> 8); return OW_w_page(data, DS2438_ADDRESS_TO_PAGE(address), pn); } static GOOD_OR_BAD OW_r_uint(UINT *U, const UINT address, const struct parsedname *pn) { BYTE data[8]; // read back registers RETURN_BAD_IF_BAD( OW_r_page(data, address >> 3, pn) ) ; *U = ((UINT) (data[(address + 1) & 0x07])) << 8 | data[address & 0x07]; return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_2450.c0000644000175000001440000005617712665167763014435 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2450.h" /* ------- Prototypes ----------- */ /* DS2450 A/D */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_volts); READ_FUNCTION(FS_latestvolts); READ_FUNCTION(FS_r_power); WRITE_FUNCTION(FS_w_power); READ_FUNCTION(FS_r_enable); WRITE_FUNCTION(FS_w_enable); READ_FUNCTION(FS_r_PIO); WRITE_FUNCTION(FS_w_PIO); READ_FUNCTION(FS_r_setvolt); WRITE_FUNCTION(FS_w_setvolt); READ_FUNCTION(FS_r_flag); WRITE_FUNCTION(FS_w_flag); WRITE_FUNCTION(FS_w_por); READ_FUNCTION(FS_CO2_ppm); READ_FUNCTION(FS_CO2_status); READ_FUNCTION(FS_CO2_power); /* ------- Structures ----------- */ enum V_resolution { r_5V_16bit, // 5V full scale. 16 bits is higher than hardware resolution r_2V_16bit, // actually 2.5V full scale r_5V_8bit, // 5V full scale. 16 bits is higher than hardware resolution r_2V_8bit, // actually 2.5V full scale } ; enum alarm_level { ae_low, ae_high, } ; enum V_alarm_level { V5_ae_low, V5_ae_high, V2_ae_low, V2_ae_high, } ; #define _1W_2450_PAGES 4 #define _1W_2450_PAGESIZE 8 #define _1W_2450_REGISTERS 4 static struct aggregate A2450p = { _1W_2450_PAGES, ag_numbers, ag_separate, }; static struct aggregate A2450 = { _1W_2450_REGISTERS, ag_letters, ag_separate, }; static struct aggregate A2450v = { _1W_2450_REGISTERS, ag_letters, ag_aggregate, }; static struct filetype DS2450[] = { F_STANDARD, {"memory", _1W_2450_PAGESIZE*_1W_2450_PAGES, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", _1W_2450_PAGESIZE, &A2450p, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"power", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_power, FS_w_power, VISIBLE, NO_FILETYPE_DATA, }, {"PIO", PROPERTY_LENGTH_YESNO, &A2450, ft_yesno, fc_stable, FS_r_PIO, FS_w_PIO, VISIBLE, {.i=0}, }, {"volt", PROPERTY_LENGTH_FLOAT, &A2450v, ft_float, fc_volatile, FS_volts, NO_WRITE_FUNCTION, VISIBLE, {.i=r_5V_16bit}, }, {"volt2", PROPERTY_LENGTH_FLOAT, &A2450v, ft_float, fc_volatile, FS_volts, NO_WRITE_FUNCTION, VISIBLE, {.i=r_2V_16bit}, }, {"latestvolt", PROPERTY_LENGTH_FLOAT, &A2450v, ft_float, fc_volatile, FS_latestvolts, NO_WRITE_FUNCTION, VISIBLE, {.i=r_5V_16bit}, }, {"latestvolt2", PROPERTY_LENGTH_FLOAT, &A2450v, ft_float, fc_volatile, FS_latestvolts, NO_WRITE_FUNCTION, VISIBLE, {.i=r_2V_16bit}, }, {"8bit", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"8bit/volt", PROPERTY_LENGTH_FLOAT, &A2450v, ft_float, fc_volatile, FS_volts, NO_WRITE_FUNCTION, VISIBLE, {.i=r_5V_8bit}, }, {"8bit/volt2", PROPERTY_LENGTH_FLOAT, &A2450v, ft_float, fc_volatile, FS_volts, NO_WRITE_FUNCTION, VISIBLE, {.i=r_2V_8bit}, }, {"8bit/latestvolt", PROPERTY_LENGTH_FLOAT, &A2450v, ft_float, fc_volatile, FS_latestvolts, NO_WRITE_FUNCTION, VISIBLE, {.i=r_5V_8bit}, }, {"8bit/latestvolt2", PROPERTY_LENGTH_FLOAT, &A2450v, ft_float, fc_volatile, FS_latestvolts, NO_WRITE_FUNCTION, VISIBLE, {.i=r_2V_8bit}, }, {"set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"set_alarm/volthigh", PROPERTY_LENGTH_FLOAT, &A2450, ft_float, fc_stable, FS_r_setvolt, FS_w_setvolt, VISIBLE, {.i=V5_ae_high}, }, {"set_alarm/volt2high", PROPERTY_LENGTH_FLOAT, &A2450, ft_float, fc_stable, FS_r_setvolt, FS_w_setvolt, VISIBLE, {.i=V2_ae_high}, }, {"set_alarm/voltlow", PROPERTY_LENGTH_FLOAT, &A2450, ft_float, fc_stable, FS_r_setvolt, FS_w_setvolt, VISIBLE, {.i=V5_ae_low}, }, {"set_alarm/volt2low", PROPERTY_LENGTH_FLOAT, &A2450, ft_float, fc_stable, FS_r_setvolt, FS_w_setvolt, VISIBLE, {.i=V2_ae_low}, }, {"set_alarm/high", PROPERTY_LENGTH_YESNO, &A2450, ft_yesno, fc_stable, FS_r_enable, FS_w_enable, VISIBLE, {.i=ae_high}, }, {"set_alarm/low", PROPERTY_LENGTH_YESNO, &A2450, ft_yesno, fc_stable, FS_r_enable, FS_w_enable, VISIBLE, {.i=ae_low}, }, {"set_alarm/unset", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_w_por, VISIBLE, NO_FILETYPE_DATA, }, {"alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"alarm/high", PROPERTY_LENGTH_YESNO, &A2450, ft_yesno, fc_volatile, FS_r_flag, FS_w_flag, VISIBLE, {.i=ae_high}, }, {"alarm/low", PROPERTY_LENGTH_YESNO, &A2450, ft_yesno, fc_volatile, FS_r_flag, FS_w_flag, VISIBLE, {.i=ae_low}, }, {"CO2", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"CO2/ppm", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_CO2_ppm, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"CO2/Vdd", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_yesno, fc_link, FS_CO2_power, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"CO2/status", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_float, fc_link, FS_CO2_status, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(20, DS2450, DEV_volt | DEV_alarm | DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); /* Internal properties */ Make_SlaveSpecificTag(RES, fc_stable); // resolution Make_SlaveSpecificTag(RAN, fc_stable); // range Make_SlaveSpecificTag(POW, fc_stable); // power status #define _1W_READ_MEMORY 0x44 #define _1W_WRITE_MEMORY 0x55 #define _1W_CONVERT 0x3C #define _1W_2450_POWERED 0x40 #define _1W_2450_UNPOWERED 0x00 #define _ADDRESS_CONVERSION_PAGE 0x00 #define _ADDRESS_CONTROL_PAGE 0x08 #define _ADDRESS_ALARM_PAGE 0x10 #define _ADDRESS_POWERED 0x1C #define _1W_2450_REG_A 0 #define _1W_2450_REG_B 2 #define _1W_2450_REG_C 4 #define _1W_2450_REG_D 6 #define _1W_2450_RC_MASK 0x0F // resolution mask in control page // First control byte #define _1W_2450_RES_01 0x0001 // 1 bit resolution #define _1W_2450_RES_02 0x0010 // 2 bit resolution #define _1W_2450_RES_03 0x0011 // 3 bit resolution #define _1W_2450_RES_04 0x0100 // 4 bit resolution #define _1W_2450_RES_05 0x0101 // 5 bit resolution #define _1W_2450_RES_06 0x0110 // 6 bit resolution #define _1W_2450_RES_07 0x0111 // 7 bit resolution #define _1W_2450_RES_08 0x1000 // 8 bit resolution #define _1W_2450_RES_09 0x1001 // 9 bit resolution #define _1W_2450_RES_10 0x1010 // 10 bit resolution #define _1W_2450_RES_11 0x1011 // 11 bit resolution #define _1W_2450_RES_12 0x1100 // 12 bit resolution #define _1W_2450_RES_13 0x1101 // 13 bit resolution #define _1W_2450_RES_14 0x1110 // 14 bit resolution #define _1W_2450_RES_15 0x1111 // 15 bit resolution #define _1W_2450_RES_16 0x0000 // 16 bit resolution #define _1W_2450_OC 0x0040 // Output control #define _1W_2450_OE 0x0080 // Outout enable // Second control Byte #define _1W_2450_IR 0x0001 // Input DAC range #define _1W_2450_AEL 0x04 // Alarm low enable #define _1W_2450_AEH 0x08 // Alarm high enable #define _1W_2450_AFL 0x10 // Alarm low flag #define _1W_2450_AFH 0x20 // Alarm high flag #define _1W_2450_POR 0x80 // Power On Reset bit /* ------- Functions ------------ */ /* DS2450 */ static GOOD_OR_BAD OW_r_mem(BYTE * p, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_w_mem(BYTE * p, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_volts(_FLOAT * f, struct parsedname *pn); static GOOD_OR_BAD OW_convert( int simul_good, int delay, struct parsedname *pn); static GOOD_OR_BAD OW_r_pio(int *pio, struct parsedname *pn); static GOOD_OR_BAD OW_w_pio( int pio, struct parsedname *pn); static GOOD_OR_BAD OW_r_vset( _FLOAT * V, enum V_alarm_level ae, struct parsedname *pn); static GOOD_OR_BAD OW_w_vset( _FLOAT V, enum V_alarm_level ae, struct parsedname *pn) ; static GOOD_OR_BAD OW_r_enable(int *y, enum alarm_level ae, struct parsedname *pn); static GOOD_OR_BAD OW_w_enable( int y, enum alarm_level ae, struct parsedname *pn); static GOOD_OR_BAD OW_r_mask(int *y, BYTE mask, struct parsedname *pn); static GOOD_OR_BAD OW_w_mask( int y, BYTE mask, struct parsedname *pn); static GOOD_OR_BAD OW_r_flag(int *y, enum alarm_level ae, struct parsedname *pn); static GOOD_OR_BAD OW_w_flag( int y, enum alarm_level ae, struct parsedname *pn); static GOOD_OR_BAD OW_w_por( int por, struct parsedname *pn); static GOOD_OR_BAD OW_set_resolution( int resolution, struct parsedname * pn ); static GOOD_OR_BAD OW_set_range( int range, struct parsedname * pn ); static GOOD_OR_BAD OW_get_power( struct parsedname * pn ); /* read a page of memory (8 bytes) */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*_1W_2450_PAGESIZE) ; } /* write an 8-byte page */ static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { return COMMON_offset_process(FS_w_mem, owq, OWQ_pn(owq).extension*_1W_2450_PAGESIZE) ; } /* read powered flag */ static ZERO_OR_ERROR FS_r_power(struct one_wire_query *owq) { BYTE p; RETURN_ERROR_IF_BAD( OW_r_mem(&p, 1, _ADDRESS_POWERED, PN(owq)) ) ; OWQ_Y(owq) = (p == _1W_2450_POWERED); Cache_Add_SlaveSpecific(&OWQ_Y(owq), sizeof(int), SlaveSpecificTag(POW), PN(owq)); return 0; } /* write powered flag */ static ZERO_OR_ERROR FS_w_power(struct one_wire_query *owq) { BYTE p = _1W_2450_POWERED; /* powered */ BYTE q = _1W_2450_UNPOWERED; /* parasitic */ if (OW_w_mem(OWQ_Y(owq) ? &p : &q, 1, _ADDRESS_POWERED, PN(owq))) { return -EINVAL; } Cache_Add_SlaveSpecific(&OWQ_Y(owq), sizeof(int), SlaveSpecificTag(POW), PN(owq)); return 0; } /* write "unset" PowerOnReset flag */ static ZERO_OR_ERROR FS_w_por(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_w_por( OWQ_Y(owq), PN(owq) ) ) ; } /* read high/low voltage alarm flags */ static ZERO_OR_ERROR FS_r_enable(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); return GB_to_Z_OR_E( OW_r_enable( &OWQ_Y(owq), pn->selected_filetype->data.i, pn) ) ; } /* write high/low voltage alarm flags */ static ZERO_OR_ERROR FS_w_enable(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); return GB_to_Z_OR_E( OW_w_enable( OWQ_Y(owq), pn->selected_filetype->data.i, pn) ) ; } /* read high/low voltage triggered state alarm flags */ static ZERO_OR_ERROR FS_r_flag(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); return GB_to_Z_OR_E( OW_r_flag( &OWQ_Y(owq), pn->selected_filetype->data.i, pn) ) ; } /* write high/low voltage triggered state alarm flags */ static ZERO_OR_ERROR FS_w_flag(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); return GB_to_Z_OR_E(OW_w_flag( OWQ_Y(owq), pn->selected_filetype->data.i, pn)) ; } /* 2450 A/D */ // separate static ZERO_OR_ERROR FS_r_PIO(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_r_pio( &OWQ_Y(owq), PN(owq)) ) ; } /* 2450 A/D */ static ZERO_OR_ERROR FS_w_PIO(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_w_pio( OWQ_Y(owq), PN(owq)) ) ; } /* 2450 A/D */ static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { return GB_to_Z_OR_E(COMMON_OWQ_readwrite_paged(owq, 0, _1W_2450_PAGESIZE, COMMON_read_memory_crc16_AA)) ; } /* 2450 A/D */ static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, _1W_2450_PAGESIZE, OW_w_mem)) ; } /* 2450 A/D */ static ZERO_OR_ERROR FS_latestvolts(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); _FLOAT V[4] ; if ( BAD( OW_volts( V, pn ) )) { return -EINVAL ; } switch ( pn->selected_filetype->data.i ) { case r_2V_8bit: case r_2V_16bit: OWQ_array_F(owq, 0) = V[0]*.5; OWQ_array_F(owq, 1) = V[1]*.5; OWQ_array_F(owq, 2) = V[2]*.5; OWQ_array_F(owq, 3) = V[3]*.5; break ; case r_5V_8bit: case r_5V_16bit: default: OWQ_array_F(owq, 0) = V[0]; OWQ_array_F(owq, 1) = V[1]; OWQ_array_F(owq, 2) = V[2]; OWQ_array_F(owq, 3) = V[3]; break ; } return 0 ; } static ZERO_OR_ERROR FS_volts(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int resolution ; int range ; switch ( pn->selected_filetype->data.i ) { case r_2V_8bit: range = 2 ; resolution = 8 ; break ; case r_5V_8bit: range = 5 ; resolution = 8 ; break ; case r_2V_16bit: range = 2 ; resolution = 16 ; break ; case r_5V_16bit: default: range = 5 ; resolution = 16 ; break ; } if ( BAD( OW_set_resolution( resolution, pn ) ) ) { return -EINVAL ; } if ( BAD( OW_set_range( range, pn ) ) ) { return -EINVAL ; } // Start A/D process if needed if ( BAD( OW_convert( OWQ_SIMUL_TEST(owq), (int)(.5+.16+4.*resolution*.08), pn) )) { return -EINVAL ; } return FS_latestvolts( owq ); } static ZERO_OR_ERROR FS_r_setvolt(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); return GB_to_Z_OR_E( OW_r_vset( &OWQ_F(owq), pn->selected_filetype->data.i, pn) ) ; } static ZERO_OR_ERROR FS_w_setvolt(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); RETURN_ERROR_IF_BAD( FS_w_sibling_Y( 0, "set_alarm/unset", owq ) ) ; return GB_to_Z_OR_E(OW_w_vset( OWQ_F(owq), pn->selected_filetype->data.i, pn)) ; } static GOOD_OR_BAD OW_r_mem(BYTE * p, size_t size, off_t offset, struct parsedname *pn) { OWQ_allocate_struct_and_pointer(owq_read); OWQ_create_temporary(owq_read, (char *) p, size, offset, pn); return COMMON_read_memory_crc16_AA(owq_read, 0, _1W_2450_PAGESIZE); } /* write to 2450 */ static GOOD_OR_BAD OW_w_mem(BYTE * p, size_t size, off_t offset, struct parsedname *pn) { // command, address(2) , data , crc(2), databack BYTE buf[6] = { _1W_WRITE_MEMORY, LOW_HIGH_ADDRESS(offset), p[0], }; BYTE echo[1]; size_t i; struct transaction_log tfirst[] = { TRXN_START, TRXN_WR_CRC16(buf, 4, 0), TRXN_READ1(echo), TRXN_COMPARE(echo, p, 1), TRXN_END, }; struct transaction_log trest[] = { // note no TRXN_START TRXN_WRITE1(buf), TRXN_READ2(&buf[1]), TRXN_READ1(echo), TRXN_END, }; //printf("2450 W mem size=%d location=%d\n",size,location) ; if (size == 0) { return gbGOOD; } /* Send the first byte (handled differently) */ RETURN_BAD_IF_BAD(BUS_transaction(tfirst, pn)) ; /* rest of the bytes */ for (i = 1; i < size; ++i) { buf[0] = p[i]; RETURN_BAD_IF_BAD( BUS_transaction(trest, pn) ) ; if ( CRC16seeded(buf, 3, offset + i) || (echo[0] != p[i]) ) { return gbBAD; } } return gbGOOD; } /* Read A/D from 2450 */ /* range adjustment made elsewhere */ static GOOD_OR_BAD OW_volts(_FLOAT * V, struct parsedname *pn) { BYTE data[_1W_2450_PAGESIZE]; // read data RETURN_BAD_IF_BAD( OW_r_mem(data, _1W_2450_PAGESIZE, _ADDRESS_CONVERSION_PAGE, pn) ) ; // data conversions V[0] = 7.8126192E-5 * ((((UINT) data[1]) << 8) | data[0]); V[1] = 7.8126192E-5 * ((((UINT) data[3]) << 8) | data[2]); V[2] = 7.8126192E-5 * ((((UINT) data[5]) << 8) | data[4]); V[3] = 7.8126192E-5 * ((((UINT) data[7]) << 8) | data[6]); return gbGOOD; } /* send A/D conversion command */ static GOOD_OR_BAD OW_convert( int simul_good, int delay, struct parsedname *pn) { BYTE convert[] = { _1W_CONVERT, 0x0F, 0x00, 0xFF, 0xFF, }; struct transaction_log tpower[] = { TRXN_START, TRXN_WR_CRC16(convert, 3, 0), TRXN_END, }; struct transaction_log tdead[] = { TRXN_START, TRXN_WRITE3(convert), TRXN_READ1(&convert[3]), TRXN_POWER( &convert[4], delay ) , TRXN_CRC16(convert, 5), TRXN_END, }; /* See if a conversion was globally triggered */ if ( GOOD(OW_get_power(pn) ) ) { if ( simul_good ) { return FS_Test_Simultaneous( SlaveSpecificTag(S_V), delay, pn) ; } // Start conversion // 6 msec for 16bytex4channel (5.2) RETURN_BAD_IF_BAD(BUS_transaction(tpower, pn)); UT_delay(delay); /* don't need to hold line for conversion! */ } else { // Start conversion // 6 msec for 16bytex4channel (5.2) RETURN_BAD_IF_BAD(BUS_transaction(tdead, pn)) ; } return gbGOOD; } /* read a pio register */ static GOOD_OR_BAD OW_r_pio(int *pio, struct parsedname *pn) { BYTE p[1]; // 2 bytes per register RETURN_BAD_IF_BAD( OW_r_mem(p, 1, _ADDRESS_CONTROL_PAGE + 2 * pn->extension, pn) ) ; pio[0] = ((p[0] & (_1W_2450_OC|_1W_2450_OE)) != _1W_2450_OE); return gbGOOD; } /* Write a pio register */ static GOOD_OR_BAD OW_w_pio( int pio, struct parsedname *pn) { BYTE p[1]; RETURN_BAD_IF_BAD( OW_r_mem(p, 1, _ADDRESS_CONTROL_PAGE + 2 * pn->extension, pn) ) ; p[0] |= _1W_2450_OE | _1W_2450_OC ; if ( pio==0 ) { p[0] &= ~_1W_2450_OC ; } return OW_w_mem(p, 1, _ADDRESS_CONTROL_PAGE + 2 * pn->extension, pn); } static GOOD_OR_BAD OW_r_vset(_FLOAT * V, enum V_alarm_level ae, struct parsedname *pn) { BYTE p[2]; RETURN_BAD_IF_BAD( OW_r_mem(p, 2, _ADDRESS_ALARM_PAGE + 2 * pn->extension, pn) ) ; switch ( ae ) { case V2_ae_high: V[0] = .01 * p[1]; break ; case V2_ae_low: V[0] = .01 * p[0]; break ; case V5_ae_high: V[0] = .02 * p[1]; break ; case V5_ae_low: V[0] = .02 * p[0]; break ; } return gbGOOD; } static GOOD_OR_BAD OW_w_vset( _FLOAT V, enum V_alarm_level ae, struct parsedname *pn) { BYTE p[_1W_2450_PAGESIZE]; RETURN_BAD_IF_BAD( OW_r_mem(p, 2, _ADDRESS_ALARM_PAGE + 2 * pn->extension, pn) ) ; switch ( ae ) { case V2_ae_high: p[1] = 100. * V ; break ; case V2_ae_low: p[0] = 100. * V ; break ; case V5_ae_high: p[1] = 50. * V ; break ; case V5_ae_low: p[0] = 50. * V ; break ; } return OW_w_mem(p, 2, _ADDRESS_ALARM_PAGE + 2 * pn->extension, pn) ; } static GOOD_OR_BAD OW_r_enable(int *y, enum alarm_level ae, struct parsedname *pn) { switch ( ae ) { case ae_low: return OW_r_mask( y, _1W_2450_AEL, pn ) ; case ae_high: return OW_r_mask( y, _1W_2450_AEH, pn ); default: return gbBAD ; } } static GOOD_OR_BAD OW_w_enable( int y, enum alarm_level ae, struct parsedname *pn) { switch ( ae ) { case ae_low: return OW_w_mask( y, _1W_2450_AEL, pn ); case ae_high: return OW_w_mask( y, _1W_2450_AEH, pn ); default: return gbBAD ; } } static GOOD_OR_BAD OW_r_flag(int *y, enum alarm_level ae, struct parsedname *pn) { switch ( ae ) { case ae_low: return OW_r_mask( y, _1W_2450_AFL, pn ) ; case ae_high: return OW_r_mask( y, _1W_2450_AFH, pn ); default: return gbBAD ; } } static GOOD_OR_BAD OW_r_mask(int *y, BYTE mask, struct parsedname *pn) { BYTE p[1]; RETURN_BAD_IF_BAD( OW_r_mem(p, 1, _ADDRESS_CONTROL_PAGE + 2 * pn->extension + 1, pn) ) ; y[0] = (p[0] & mask) ? 1 : 0 ; return gbGOOD; } static GOOD_OR_BAD OW_w_mask( int y, BYTE mask, struct parsedname *pn) { BYTE p[1]; RETURN_BAD_IF_BAD( OW_r_mem(p, 1, _ADDRESS_CONTROL_PAGE + 2 * pn->extension + 1, pn) ) ; if ( y ) { p[0] |= mask ; } else { p[0] &= ~mask ; } // Clear POR as well p[0] &= ~_1W_2450_POR ; return OW_w_mem(p, 1, _ADDRESS_CONTROL_PAGE + 2 * pn->extension + 1, pn) ; } static GOOD_OR_BAD OW_w_flag( int y, enum alarm_level ae, struct parsedname *pn) { switch ( ae ) { case ae_low: return OW_w_mask( y, _1W_2450_AFL, pn ); case ae_high: return OW_w_mask( y, _1W_2450_AFH, pn ); default: return gbBAD ; } } // Always clear static GOOD_OR_BAD OW_w_por( int por, struct parsedname *pn) { // use a NOP mask, since OW_w_mask always clears POR (void) por ; return OW_w_mask( 1, 0x00, pn ) ; } /* Functions for the CO2 sensor */ static ZERO_OR_ERROR FS_CO2_power( struct one_wire_query *owq) { _FLOAT P = 0. ; ZERO_OR_ERROR z_or_e = FS_r_sibling_F(&P,"volt.D",owq) ; OWQ_F(owq) = P ; return z_or_e ; } static ZERO_OR_ERROR FS_CO2_ppm( struct one_wire_query *owq) { _FLOAT P = 0. ; ZERO_OR_ERROR z_or_e = FS_r_sibling_F(&P,"volt.A",owq) ; OWQ_U(owq) = P*1000. ; return z_or_e ; } static ZERO_OR_ERROR FS_CO2_status( struct one_wire_query *owq) { _FLOAT V = 0.; ZERO_OR_ERROR z_or_e = FS_r_sibling_F(&V,"volt.B",owq) ; OWQ_Y(owq) = (V>3.0) && (V<3.4) ; return z_or_e ; } static GOOD_OR_BAD OW_set_resolution( int resolution, struct parsedname * pn ) { int stored_resolution ; /* Resolution */ if ( BAD( Cache_Get_SlaveSpecific(&stored_resolution, sizeof(stored_resolution), SlaveSpecificTag(RES), pn)) || stored_resolution != resolution) { // need to set resolution BYTE p[_1W_2450_PAGESIZE]; RETURN_BAD_IF_BAD( OW_r_mem(p, _1W_2450_PAGESIZE, _ADDRESS_CONTROL_PAGE, pn) ) ; p[_1W_2450_REG_A] &= ~_1W_2450_RC_MASK ; p[_1W_2450_REG_A] |= ( resolution & _1W_2450_RC_MASK ) ; p[_1W_2450_REG_B] &= ~_1W_2450_RC_MASK ; p[_1W_2450_REG_B] |= ( resolution & _1W_2450_RC_MASK ) ; p[_1W_2450_REG_C] &= ~_1W_2450_RC_MASK ; p[_1W_2450_REG_C] |= ( resolution & _1W_2450_RC_MASK ) ; p[_1W_2450_REG_D] &= ~_1W_2450_RC_MASK ; p[_1W_2450_REG_D] |= ( resolution & _1W_2450_RC_MASK ) ; RETURN_BAD_IF_BAD( OW_w_mem(p, _1W_2450_PAGESIZE, _ADDRESS_CONTROL_PAGE, pn) ); return Cache_Add_SlaveSpecific(&resolution, sizeof(int), SlaveSpecificTag(RES), pn); } return gbGOOD ; } // range is 5=5V or 2=2.5V static GOOD_OR_BAD OW_set_range( int range, struct parsedname * pn ) { int stored_range ; /* Range */ if ( BAD( Cache_Get_SlaveSpecific(&stored_range, sizeof(stored_range), SlaveSpecificTag(RAN), pn)) || stored_range != range) { // need to set resolution BYTE p[_1W_2450_PAGESIZE]; RETURN_BAD_IF_BAD( OW_r_mem(p, _1W_2450_PAGESIZE, _ADDRESS_CONTROL_PAGE, pn) ) ; switch ( range ) { case 2: p[_1W_2450_REG_A+1] &= ~_1W_2450_IR ; p[_1W_2450_REG_B+1] &= ~_1W_2450_IR ; p[_1W_2450_REG_C+1] &= ~_1W_2450_IR ; p[_1W_2450_REG_D+1] &= ~_1W_2450_IR ; break ; case 5: default: p[_1W_2450_REG_A+1] |= _1W_2450_IR ; p[_1W_2450_REG_B+1] |= _1W_2450_IR ; p[_1W_2450_REG_C+1] |= _1W_2450_IR ; p[_1W_2450_REG_D+1] |= _1W_2450_IR ; break ; } RETURN_BAD_IF_BAD( OW_w_mem(p, _1W_2450_PAGESIZE, _ADDRESS_CONTROL_PAGE, pn) ); return Cache_Add_SlaveSpecific(&range, sizeof(int), SlaveSpecificTag(RAN), pn); } return gbGOOD ; } // good if powered. static GOOD_OR_BAD OW_get_power( struct parsedname * pn ) { int power ; /* power */ if ( BAD( Cache_Get_SlaveSpecific(&power, sizeof(power), SlaveSpecificTag(POW), pn)) ) { BYTE p[1]; /* get power flag -- to see if pullup can be avoided */ RETURN_BAD_IF_BAD( OW_r_mem(p, 1, _ADDRESS_POWERED, pn) ) ; power = (p[0]==_1W_2450_POWERED) ? 1 : 0 ; Cache_Add_SlaveSpecific(&power, sizeof(power), SlaveSpecificTag(POW), pn); } return power==1 ? gbGOOD : gbBAD ; } owfs-3.1p5/module/owlib/src/c/ow_2502.c0000644000175000001440000001717712654730021014405 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2502.h" /* ------- Prototypes ----------- */ /* DS2502 counter */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_param); #if 0 static enum e_visibility VISIBLE_DS2502( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_DS2407( const struct parsedname * pn ) ; #endif /* ------- Structures ----------- */ static struct aggregate A2502 = { 4, ag_numbers, ag_separate, }; static struct filetype DS2502[] = { F_STANDARD, {"memory", 128, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2502, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(09, DS2502, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS1982U[] = { F_STANDARD, {"memory", 128, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2502, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"mac_e", 6, NON_AGGREGATE, ft_binary, fc_stable, FS_r_param, NO_WRITE_FUNCTION, VISIBLE, {.i=4}, }, {"mac_fw", 8, NON_AGGREGATE, ft_binary, fc_stable, FS_r_param, NO_WRITE_FUNCTION, VISIBLE, {.i=4}, }, {"project", 4, NON_AGGREGATE, ft_binary, fc_stable, FS_r_param, NO_WRITE_FUNCTION, VISIBLE, {.i=0}, }, }; DeviceEntry(89, DS1982U, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_READ_MEMORY 0xF0 #define _1W_READ_STATUS 0xAA #define _1W_READ_DATA_CRC8 0xC3 #define _1W_WRITE_MEMORY 0x0F #define _1W_WRITE_STATUS 0x55 // DS2704 specific #define _1W_WRITE_CHALLENGE 0x0C #define _1W_COMPUTE_MAC_WITHOUT 0x36 #define _1W_COMPUTE_MAC_WITH 0x35 #define _1W_CLEAR_SECRET 0x5A #define _1W_COMPUTE_NEXT_SECRET_WITHOUT 0x30 #define _1W_COMPUTE_NEXT_SECRET_WITH 0x33 #define _1W_LOCK_SECRET 0x6A #define _1W_READ_ALL 0x65 #define _1W_READ_SCRATCHPAD 0x69 #define _1W_WRITE_SCRATCHPAD 0x6C #define _1W_COPY_SCRATCHPAD 0x48 #define _1W_SET_OVERDRIVE 0x8B #define _1W_CLEAR_OVERDRIVE 0x8D #define _1W_RESET 0xBB /* ------- Functions ------------ */ /* DS2502 */ static GOOD_OR_BAD OW_r_page( BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_w_bytes(BYTE * data, size_t size, off_t offset, struct parsedname *pn) ; static GOOD_OR_BAD OW_w_byte(BYTE data, off_t offset, struct parsedname *pn) ; #if 0 static GOOD_OR_BAD OW_r_all(BYTE * data, size_t size, off_t offset, struct parsedname *pn); #endif #if 0 /* finds the visibility value DS2502 vs expanded DS2407 */ enum family_19_type { unknown_19=-1, ds2502_19, ds2407_19, } ; static int VISIBLE_19( const struct parsedname * pn ) { int device_id = unknown_19 ; LEVEL_DEBUG("Checking visibility of %s",SAFESTRING(pn->path)) ; if ( BAD( GetVisibilityCache( &device_id, pn ) ) ) { BYTE a_byte[1] ; // use technique and address only specified on DS2407 if ( BAD( OW_r_all( a_byte, 1, 0x0080, pn ) ) ) { device_id = ds2502_19 ; } else { device_id = ds2407_19 ; } SetVisibilityCache( device_id, pn ) ; } return device_id ; } static enum e_visibility VISIBLE_DS2502( const struct parsedname * pn ) { switch ( VISIBLE_19(pn) ) { case ds2502_19: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_DS2407( const struct parsedname * pn ) { switch ( VISIBLE_19(pn) ) { case ds2407_19: return visible_now ; default: return visible_not_now ; } } #endif /* 2502 memory */ static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E( COMMON_readwrite_paged(owq, 0, pagesize, OW_r_page) ) ; } static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E( OW_r_page( (BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq) + pagesize * PN(owq)->extension, PN(owq) ) ) ; } static ZERO_OR_ERROR FS_r_param(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); size_t pagesize = 32; BYTE data[pagesize]; off_t param_offset = pn->selected_filetype->data.i ; RETURN_ERROR_IF_BAD( OW_r_page(data, pagesize-param_offset, param_offset, pn) ); return OWQ_format_output_offset_and_size((ASCII *) data, FileLength(pn), owq); } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { size_t pagesize = 1; return GB_to_Z_OR_E( COMMON_readwrite_paged(owq, 0, pagesize, OW_w_bytes) ) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize ) ; } // reads to end of page and discards extra // uses CRC8 static GOOD_OR_BAD OW_r_page(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[4] = { _1W_READ_DATA_CRC8, LOW_HIGH_ADDRESS(offset), }; BYTE q[33]; int rest = 33 - (offset & 0x1F); struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(p), TRXN_READ1(&p[3]), TRXN_CRC8(p, 4), TRXN_READ(q, rest), TRXN_CRC8(q, rest), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; memcpy(data, q, size); return gbGOOD; } #if 0 // use new read_all command static GOOD_OR_BAD OW_r_all(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[4] = { _1W_READ_ALL, LOW_HIGH_ADDRESS(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(p), TRXN_READ1(&p[3]), TRXN_CRC8(p, 4), TRXN_READ(data, size), }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; return gbGOOD; } #endif // placeholder for OW_w_byte but uses common arguments for COMMON_readwrite_paged static GOOD_OR_BAD OW_w_bytes(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { (void) size ; // must be 1 return OW_w_byte( data[0], offset, pn ) ; } static GOOD_OR_BAD OW_w_byte(BYTE data, off_t offset, struct parsedname *pn) { BYTE p[5] = { _1W_WRITE_MEMORY, LOW_HIGH_ADDRESS(offset), data, 0xFF }; BYTE q[1]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE(p,4), TRXN_READ1(&p[4]), TRXN_CRC8(p, 4+1), TRXN_PROGRAM, TRXN_READ1(q), TRXN_COMPARE(q,&data,1) , TRXN_END, }; return BUS_transaction(t, pn) ; } owfs-3.1p5/module/owlib/src/c/ow_2505.c0000644000175000001440000001547512654730021014407 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2505.h" /* ------- Prototypes ----------- */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_status); WRITE_FUNCTION(FS_w_status); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); #define _1W_READ_MEMORY 0xF0 #define _1W_READ_STATUS 0xAA #define _1W_EXTENDED_READ_MEMORY 0xA5 #define _1W_WRITE_MEMORY 0x0F #define _1W_SPEED_WRITE_MEMORY 0xF3 #define _1W_WRITE_STATUS 0x55 #define _1W_SPEED_WRITE_STATUS 0xF5 /* ------- Structures ----------- */ static struct aggregate A2505 = { 64, ag_numbers, ag_separate, }; static struct aggregate A2505s = { 11, ag_numbers, ag_separate, }; static struct filetype DS2505[] = { F_STANDARD, {"memory", 2048, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2505, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"status", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"status/page", 8, &A2505s, ft_binary, fc_stable, FS_r_status, FS_w_status, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(0B, DS2505, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS1985U[] = { F_STANDARD, {"memory", 2048, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2505, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"status", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"status/page", 8, &A2505s, ft_binary, fc_stable, FS_r_status, FS_w_status, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(8B, DS1985U, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate A2506 = { 256, ag_numbers, ag_separate, }; static struct aggregate A2506s = { 11, ag_numbers, ag_separate, }; static struct filetype DS2506[] = { F_STANDARD, {"memory", 8192, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2506, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"status", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"status/page", 32, &A2506s, ft_binary, fc_stable, FS_r_status, FS_w_status, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(0F, DS2506, DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS1986U[] = { F_STANDARD, {"memory", 8192, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2506, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"status", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"status/page", 32, &A2506s, ft_binary, fc_stable, FS_r_status, FS_w_status, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(8F, DS1986U, DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); /* ------- Functions ------------ */ /* DS2505 */ static GOOD_OR_BAD OW_w_status(BYTE * data, size_t size, off_t offset, struct parsedname *pn); /* 2505 memory */ static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E(COMMON_OWQ_readwrite_paged(owq, 0, pagesize, COMMON_read_memory_F0)) ; } static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_r_status(struct one_wire_query *owq) { size_t pagesize = FileLength(PN(owq)) ; return GB_to_Z_OR_E(COMMON_OWQ_readwrite_paged(owq, OWQ_pn(owq).extension, pagesize, COMMON_read_memory_crc16_AA)) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { return COMMON_write_eprom_mem_owq(owq) ; } static ZERO_OR_ERROR FS_w_status(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_status(OWQ_explode(owq))) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension * pagesize) ; } static GOOD_OR_BAD OW_w_status(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[6] = { _1W_WRITE_STATUS, LOW_HIGH_ADDRESS(offset), data[0] }; GOOD_OR_BAD ret = gbGOOD; struct transaction_log tfirst[] = { TRXN_START, TRXN_WR_CRC16(p, 4, 0), TRXN_PROGRAM, TRXN_READ1(p), TRXN_END, }; if (size == 0) { return gbGOOD; } if (size == 1) { return BUS_transaction(tfirst, pn) || (p[0] & (~data[0])); } BUSLOCK(pn); if ( BAD(BUS_transaction(tfirst, pn)) || (p[0] & ~data[0])) { ret = gbBAD; } else { size_t i; const BYTE *d = &data[1]; UINT s = offset + 1; struct transaction_log trest[] = { //TRXN_WR_CRC16_SEEDED( p, &s, 1, 0 ) , TRXN_WR_CRC16_SEEDED(p, p, 1, 0), TRXN_PROGRAM, TRXN_READ1(p), TRXN_END, }; for (i = 0; i < size; ++i, ++d, ++s) { if ( BAD(BUS_transaction(trest, pn)) || (p[0] & ~d[0])) { ret = gbBAD; break; } } } BUSUNLOCK(pn); return ret; } owfs-3.1p5/module/owlib/src/c/ow_2760.c0000644000175000001440000016035412711737666014427 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Changes 7/2004 Extensive improvements based on input from Serg Oskin */ #include #include "owfs_config.h" #include "ow_2760.h" #include "ow_thermocouple.h" /* ------- Prototypes ----------- */ /* DS2406 switch */ READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_lock); WRITE_FUNCTION(FS_w_lock); READ_FUNCTION(FS_r_volt); READ_FUNCTION(FS_r_temp); READ_FUNCTION(FS_r_current); READ_FUNCTION(FS_r_vis); READ_FUNCTION(FS_r_vis_avg); READ_FUNCTION(FS_r_pio); WRITE_FUNCTION(FS_w_pio); READ_FUNCTION(FS_r_vh); WRITE_FUNCTION(FS_w_vh); READ_FUNCTION(FS_r_vis_off); WRITE_FUNCTION(FS_w_vis_off); READ_FUNCTION(FS_r_ah); WRITE_FUNCTION(FS_w_ah); READ_FUNCTION(FS_r_abias); WRITE_FUNCTION(FS_w_abias); READ_FUNCTION(FS_r_templim); WRITE_FUNCTION(FS_w_templim); READ_FUNCTION(FS_r_vbias); WRITE_FUNCTION(FS_w_vbias); READ_FUNCTION(FS_r_timer); WRITE_FUNCTION(FS_w_timer); READ_FUNCTION(FS_r_bit); WRITE_FUNCTION(FS_w_bit); WRITE_FUNCTION(FS_charge); WRITE_FUNCTION(FS_refresh); READ_FUNCTION(FS_WS603_temperature); READ_FUNCTION(FS_WS603_r_data); READ_FUNCTION(FS_WS603_r_param); READ_FUNCTION(FS_WS603_wind_speed); READ_FUNCTION(FS_WS603_wind_direction); READ_FUNCTION(FS_WS603_r_led); READ_FUNCTION(FS_WS603_light); READ_FUNCTION(FS_WS603_volt); READ_FUNCTION(FS_WS603_r_wind_calibration); WRITE_FUNCTION(FS_WS603_w_wind_calibration); READ_FUNCTION(FS_WS603_r_direction_calibration); WRITE_FUNCTION(FS_WS603_w_direction_calibration); READ_FUNCTION(FS_WS603_r_light_threshold); WRITE_FUNCTION(FS_WS603_led_control); WRITE_FUNCTION(FS_WS603_r_led_model); READ_FUNCTION(FS_thermocouple); READ_FUNCTION(FS_rangelow); READ_FUNCTION(FS_rangehigh); /* ------- Structures ----------- */ #define F_thermocouple \ {"typeB" ,PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir , fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION , VISIBLE, NO_FILETYPE_DATA, } , \ {"typeB/temperature",PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_volatile, FS_thermocouple, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_b}, } , \ {"typeB/range_low" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangelow, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_b}, } , \ {"typeB/range_high" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangehigh, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_b}, } , \ \ {"typeE" ,PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir , fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION , VISIBLE, NO_FILETYPE_DATA, } , \ {"typeE/temperature",PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_volatile, FS_thermocouple, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_e}, } , \ {"typeE/range_low" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangelow, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_e}, } , \ {"typeE/range_high" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangehigh, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_e}, } , \ \ {"typeJ" ,PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir , fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION , VISIBLE, NO_FILETYPE_DATA, } , \ {"typeJ/temperature",PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_volatile, FS_thermocouple, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_j}, } , \ {"typeJ/range_low" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangelow, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_j}, } , \ {"typeJ/range_high" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangehigh, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_j}, } , \ \ {"typeK" ,PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir , fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION , VISIBLE, NO_FILETYPE_DATA, } , \ {"typeK/temperature",PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_volatile, FS_thermocouple, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_k}, } , \ {"typeK/range_low" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangelow, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_k}, } , \ {"typeK/range_high" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangehigh, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_k}, } , \ \ {"typeN" ,PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir , fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION , VISIBLE, NO_FILETYPE_DATA, } , \ {"typeN/temperature",PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_volatile, FS_thermocouple, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_n}, } , \ {"typeN/range_low" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangelow, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_n}, } , \ {"typeN/range_high" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangehigh, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_n}, } , \ \ {"typeR" ,PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir , fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION , VISIBLE, NO_FILETYPE_DATA, } , \ {"typeR/temperature",PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_volatile, FS_thermocouple, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_r}, } , \ {"typeR/range_low" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangelow, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_r}, } , \ {"typeR/range_high" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangehigh, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_r}, } , \ \ {"typeS" ,PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir , fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION , VISIBLE, NO_FILETYPE_DATA, } , \ {"typeS/temperature",PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_volatile, FS_thermocouple, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_s}, } , \ {"typeS/range_low" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangelow, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_s}, } , \ {"typeS/range_high" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangehigh, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_s}, } , \ \ {"typeT" ,PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir , fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION , VISIBLE, NO_FILETYPE_DATA, } , \ {"typeT/temperature",PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_volatile, FS_thermocouple, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_t}, } , \ {"typeT/range_low" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangelow, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_t}, } , \ {"typeT/range_high" ,PROPERTY_LENGTH_TEMP, NON_AGGREGATE,ft_temperature, fc_static , FS_rangehigh, NO_WRITE_FUNCTION , VISIBLE, {.i=e_type_t}, } , #define _1W_DS27XX_PROTECT_REG 0x00 #define _1W_DS27XX_STATUS_REG 0x01 #define _1W_DS27XX_STATUS_REG_INIT 0x31 #define _1W_DS2770_TIMER 0x02 #define _1W_DS2760_SPECIAL_REG 0x08 #define _1W_DS2780_SPECIAL_REG 0x15 #define _1W_DS2780_AVERAGE_CURRENT 0x08 #define _1W_DS2756_AVERAGE_CURRENT 0x1A #define _1W_DS27XX_VOLTAGE 0x0C #define _1W_DS27XX_CURRENT 0x0E #define _1W_DS27XX_ACCUMULATED 0x10 #define _1W_DS2770_CURRENT_OFFSET 0x32 #define _1W_DS2760_CURRENT_OFFSET 0x33 #define _1W_DS2780_CURRENT_OFFSET 0x61 #define _1W_DS2760_TEMPERATURE 0x18 #define _1W_DS2780_TEMPERATURE 0x0A #define _1W_DS2780_PARAM_REG 0x60 struct LockPage { int pages; size_t reg; size_t size; off_t offset[3]; }; #define Pages2720 2 #define Pages2751 2 #define Pages2755 3 #define Pages2760 2 #define Pages2770 3 #define Pages2780 2 #define Size2720 4 #define Size2751 16 #define Size2755 32 #define Size2760 16 #define Size2770 16 #define Size2780 16 static struct LockPage P2720 = { Pages2720, 0x07, Size2720, {0x20, 0x30, 0x00,}, }; static struct LockPage P2751 = { Pages2751, 0x07, Size2751, {0x20, 0x30, 0x00,}, }; static struct LockPage P2755 = { Pages2755, 0x07, Size2755, {0x20, 0x40, 0x60,}, }; static struct LockPage P2760 = { Pages2760, 0x07, Size2760, {0x20, 0x30, 0x00,}, }; static struct LockPage P2770 = { Pages2770, 0x07, Size2770, {0x20, 0x30, 0x40,}, }; static struct LockPage P2780 = { Pages2780, 0x1F, Size2780, {0x20, 0x60, 0x00,}, }; static struct aggregate L2720 = { Pages2720, ag_numbers, ag_separate }; static struct aggregate L2751 = { Pages2751, ag_numbers, ag_separate }; static struct aggregate L2755 = { Pages2755, ag_numbers, ag_separate }; static struct aggregate L2760 = { Pages2760, ag_numbers, ag_separate }; static struct aggregate L2770 = { Pages2770, ag_numbers, ag_separate }; static struct aggregate L2780 = { Pages2780, ag_numbers, ag_separate }; static struct filetype DS2720[] = { F_STANDARD, {"memory", 256, NULL, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NULL, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", Size2720, &L2720, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, {.v=&P2720}, }, {"lock", PROPERTY_LENGTH_YESNO, &L2720, ft_yesno, fc_stable, FS_r_lock, FS_w_lock, VISIBLE, {.v=&P2720}, }, {"cc", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 3}, }, {"ce", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 1}, }, {"dc", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 2}, }, {"de", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 0}, }, {"doc", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 4}, }, {"ot", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 0}, }, {"ov", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 7}, }, {"psf", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 7}, }, {"uv", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 6}, }, }; DeviceEntry(31, DS2720, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS2740[] = { F_STANDARD, {"memory", 256, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"PIO", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_pio, FS_w_pio, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 6}, }, {"vis", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vis_B", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis, NO_WRITE_FUNCTION, VISIBLE, {.f=1.5625E-6}, }, {"volthours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vh, FS_w_vh, VISIBLE, NO_FILETYPE_DATA, }, {"smod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 6}, }, }; DeviceEntry(36, DS2740, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS2751[] = { F_STANDARD, {"memory", 256, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", Size2751, &L2751, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, {.v=&P2751}, }, {"amphours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_ah, FS_w_ah, VISIBLE, NO_FILETYPE_DATA, }, {"current", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_current, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"currentbias", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_abias, FS_w_abias, VISIBLE, NO_FILETYPE_DATA, }, {"lock", PROPERTY_LENGTH_YESNO, &L2751, ft_yesno, fc_stable, FS_r_lock, FS_w_lock, VISIBLE, {.v=&P2751}, }, {"PIO", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, NO_READ_FUNCTION, FS_w_pio, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 6}, }, {"sensed", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 6}, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vbias", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_vbias, FS_w_vbias, VISIBLE, NO_FILETYPE_DATA, }, {"vis", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volt", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_volt, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volthours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vh, FS_w_vh, VISIBLE, NO_FILETYPE_DATA, }, {"defaultpmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG_INIT << 8) | 5}, }, {"pmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 5}, }, {"por", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 0}, }, {"uven", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 3}, }, F_thermocouple }; DeviceEntry(51, DS2751, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS2755[] = { F_STANDARD, {"memory", 256, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", Size2755, &L2755, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, {.v=&P2755}, }, {"lock", PROPERTY_LENGTH_YESNO, &L2755, ft_yesno, fc_stable, FS_r_lock, FS_w_lock, VISIBLE, {.v=&P2751}, }, {"PIO", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, NO_READ_FUNCTION, FS_w_pio, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 6}, }, {"sensed", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 6}, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vbias", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_vbias, FS_w_vbias, VISIBLE, NO_FILETYPE_DATA, }, {"vis", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vis_avg", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis_avg, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volt", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_volt, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volthours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vh, FS_w_vh, VISIBLE, NO_FILETYPE_DATA, }, {"alarm_set", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_float, fc_volatile, FS_r_templim, FS_w_templim, VISIBLE, {.u=0x85}, }, {"defaultpmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG_INIT << 8) | 5}, }, {"pie1", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 7}, }, {"pie0", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 6}, }, {"pmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 5}, }, {"rnaop", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 4}, }, {"uven", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 3}, }, {"ios", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 2}, }, {"uben", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 1}, }, {"ovd", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 0}, }, {"por", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 0}, }, F_thermocouple }; DeviceEntryExtended(35, DS2755, DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); struct aggregate Aled_control = { 4, ag_numbers, ag_aggregate, }; static struct filetype DS2760[] = { F_STANDARD, {"memory", 256, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", Size2760, &L2760, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, {.v=&P2760}, }, {"amphours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_ah, FS_w_ah, VISIBLE, NO_FILETYPE_DATA, }, {"current", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_current, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"currentbias", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_abias, FS_w_abias, VISIBLE, NO_FILETYPE_DATA, }, {"lock", PROPERTY_LENGTH_YESNO, &L2760, ft_yesno, fc_stable, FS_r_lock, FS_w_lock, VISIBLE, {.v=&P2760}, }, {"PIO", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, NO_READ_FUNCTION, FS_w_pio, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 6}, }, {"sensed", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 6}, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vbias", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_vbias, FS_w_vbias, VISIBLE, NO_FILETYPE_DATA, }, {"vis", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volt", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_volt, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volthours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vh, FS_w_vh, VISIBLE, NO_FILETYPE_DATA, }, {"cc", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 3}, }, {"ce", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 1}, }, {"coc", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 5}, }, {"defaultpmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG_INIT << 8) | 5}, }, {"defaultswen", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG_INIT << 8) | 3}, }, {"dc", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 2}, }, {"de", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 0}, }, {"doc", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 4}, }, {"mstr", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 5}, }, {"ov", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 7}, }, {"ps", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2760_SPECIAL_REG << 8) | 7}, }, {"pmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 5}, }, {"swen", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 3}, }, {"uv", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_PROTECT_REG << 8) | 6}, }, F_thermocouple {"WS603", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/calibration", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/calibration/wind_speed", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_WS603_r_wind_calibration, FS_WS603_w_wind_calibration, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/calibration/direction", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_WS603_r_direction_calibration, FS_WS603_w_direction_calibration, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_link, FS_WS603_temperature, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/data_string", 5, NON_AGGREGATE, ft_binary, fc_volatile, FS_WS603_r_data, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"WS603/param_string", 5, NON_AGGREGATE, ft_binary, fc_stable, FS_WS603_r_param, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"WS603/wind_speed", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_WS603_wind_speed, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/direction", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_WS603_wind_direction, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/LED/status", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_WS603_r_led, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/LED/control", PROPERTY_LENGTH_UNSIGNED, &Aled_control, ft_unsigned, fc_stable, NO_READ_FUNCTION, FS_WS603_led_control, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/LED/model", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_WS603_r_led_model, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/light", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/light/intensity", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_WS603_light, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/light/threshold", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_WS603_r_light_threshold, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"WS603/volt", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_WS603_volt, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(30, DS2760, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS2770[] = { F_STANDARD, {"memory", 256, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", Size2770, &L2770, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, {.v=&P2770}, }, {"amphours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_ah, FS_w_ah, VISIBLE, NO_FILETYPE_DATA, }, {"current", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_current, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"currentbias", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_abias, FS_w_abias, VISIBLE, NO_FILETYPE_DATA, }, {"lock", PROPERTY_LENGTH_YESNO, &L2770, ft_yesno, fc_stable, FS_r_lock, FS_w_lock, VISIBLE, {.v=&P2770}, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vbias", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_vbias, FS_w_vbias, VISIBLE, NO_FILETYPE_DATA, }, {"vis", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volt", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_volt, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volthours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vh, FS_w_vh, VISIBLE, NO_FILETYPE_DATA, }, {"charge", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_charge, VISIBLE, NO_FILETYPE_DATA, }, {"cini", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 1}, }, {"cstat1", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 7}, }, {"cstat0", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 6}, }, {"ctype", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 0}, }, {"defaultpmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG_INIT << 8) | 5}, }, {"pmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 5}, }, {"refresh", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_refresh, VISIBLE, NO_FILETYPE_DATA, }, {"timer", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_timer, FS_w_timer, VISIBLE, NO_FILETYPE_DATA, }, F_thermocouple }; DeviceEntry(2E, DS2770, NO_GENERIC_READ, NO_GENERIC_WRITE); /* DS2780 also includees the DS2775 DS2776 DS2784 */ static struct filetype DS2780[] = { F_STANDARD, {"memory", 256, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", Size2780, &L2780, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, {.v=&P2780}, }, {"lock", PROPERTY_LENGTH_YESNO, &L2780, ft_yesno, fc_stable, FS_r_lock, FS_w_lock, VISIBLE, {.v=&P2780}, }, {"PIO", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, NO_READ_FUNCTION, FS_w_pio, VISIBLE, {.u=(_1W_DS2780_SPECIAL_REG << 8) | 0}, }, {"sensed", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS2780_SPECIAL_REG << 8) | 0}, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vbias", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_vbias, FS_w_vbias, VISIBLE, NO_FILETYPE_DATA, }, {"vis", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vis_avg", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis_avg, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volt", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_volt, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volthours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vh, FS_w_vh, VISIBLE, NO_FILETYPE_DATA, }, {"chgtf", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 7}, }, {"aef", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 6}, }, {"sef", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 5}, }, {"learnf", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 4}, }, {"uvf", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 2}, }, {"porf", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 1}, }, {"nben", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2780_PARAM_REG << 8) | 7}, }, {"uven", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2780_PARAM_REG << 8) | 6}, }, {"pmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2780_PARAM_REG << 8) | 5}, }, {"rnaop", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2780_PARAM_REG << 8) | 4}, }, {"dc", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2780_PARAM_REG << 8) | 3}, }, F_thermocouple }; DeviceEntry(32, DS2780, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct filetype DS2781[] = { F_STANDARD, {"memory", 256, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", Size2780, &L2780, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, {.v=&P2780}, }, {"lock", PROPERTY_LENGTH_YESNO, &L2780, ft_yesno, fc_stable, FS_r_lock, FS_w_lock, VISIBLE, {.v=&P2780}, }, {"PIO", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, NO_READ_FUNCTION, FS_w_pio, VISIBLE, {.u=(_1W_DS2780_SPECIAL_REG << 8) | 0}, }, {"sensed", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, NO_WRITE_FUNCTION, VISIBLE, {.u=(_1W_DS2780_SPECIAL_REG << 8) | 0}, }, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_temp, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vbias", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_vbias, FS_w_vbias, VISIBLE, NO_FILETYPE_DATA, }, {"vis", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"vis_offset", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis_off, FS_w_vis_off, VISIBLE, NO_FILETYPE_DATA, }, {"vis_avg", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vis_avg, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volt", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_volt, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volthours", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_vh, FS_w_vh, VISIBLE, NO_FILETYPE_DATA, }, {"aef", PROPERTY_LENGTH_YESNO,NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 4}, }, {"pmod", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit,VISIBLE, {.u=(_1W_DS2780_PARAM_REG << 8) | 5}, }, {"porf", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 1}, }, {"sef", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 5}, }, {"uven", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS2780_PARAM_REG << 8) | 6}, }, {"uvf", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_bit, FS_w_bit, VISIBLE, {.u=(_1W_DS27XX_STATUS_REG << 8) | 2}, }, F_thermocouple }; DeviceEntry(3D, DS2781, NO_GENERIC_READ, NO_GENERIC_WRITE); /* DS2784 - specific */ #define _1W_WRITE_CHALLENGE 0x0C #define _1W_COMPUTE_MAC_WITHOUT 0x36 #define _1W_COMPUTE_MAC_WITH 0x35 #define _1W_COPY_DATA 0x48 #define _1W_CLEAR_SECRET 0x5A #define _1W_COMPUTE_NEXT_SECRET_WITHOUT 0x30 #define _1W_COMPUTE_NEXT_SECRET_WITH 0x33 #define _1W_LOCK_SECRET 0x60 #define _1W_REFRESH 0x63 #define _1W_READ_DATA 0x69 #define _1W_LOCK 0x6A #define _1W_WRITE_DATA 0x6C #define _1W_SET_OVERDRIVE 0x8B #define _1W_CLEAR_OVERDRIVE 0x8D #define _1W_START_CHARGE 0xB5 #define _1W_RECALL_DATA 0xB8 #define _1W_STOP_CHARGE 0xBE #define _1W_RESET 0xC4 #define _WS603_COMMAND_ADDRESS 0x80 #define _WS603_RESPONSE_ADDRESS 0x88 #define _WS603_READ_DATA 0xA1 #define _WS603_READ_PARAMETER 0xA0 #define _WS603_LED_CONTROL 0xA2 #define _WS603_WIND_SPEED_CALIBRATION 0xA3 #define _WS603_WIND_DIRECTION_CALIBRATION 0xA4 #define WS603_ENDBYTE(b) ( ( ( (b) & 0x0F ) *16 ) + 0x0E ) /* ------- Functions ------------ */ /* DS2406 */ static GOOD_OR_BAD OW_r_sram(BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_w_sram(const BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_r_mem(BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_w_mem(const BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_recall_eeprom(const size_t size, const off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_copy_eeprom(const size_t size, const off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_lock(const struct parsedname *pn); static GOOD_OR_BAD OW_r_int(int *I, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_w_int(const int *I, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_r_int8(int *I, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_w_int8(const int *I, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_cmd(const BYTE cmd, const struct parsedname *pn); static struct LockPage * Lockpage( const struct parsedname * pn ) ; static char WS603_CHECKSUM( BYTE * byt, int length ) ; static GOOD_OR_BAD WS603_Send( BYTE * byt, int length, struct parsedname * pn ) ; static GOOD_OR_BAD WS603_Get( BYTE cmd, BYTE * byt, int length, struct parsedname * pn ) ; static GOOD_OR_BAD WS603_Transaction( BYTE * cmd, int length, BYTE * resp, struct parsedname * pn ) ; static GOOD_OR_BAD WS603_Get_Readings( BYTE * data, struct parsedname * pn ) ; static GOOD_OR_BAD WS603_Get_Parameters( BYTE * data, struct parsedname * pn ) ; /* 2406 memory read */ static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { /* read is not a "paged" endeavor, the CRC comes after a full read */ OWQ_length(owq) = OWQ_size(owq) ; return GB_to_Z_OR_E(OW_r_mem((BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq), PN(owq))) ; } /* 2406 memory write */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { //printf("2406 read size=%d, offset=%d\n",(int)size,(int)offset); return GB_to_Z_OR_E(OW_r_mem((BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq) + ((struct LockPage *) OWQ_pn(owq).selected_filetype->data.v)->offset[OWQ_pn(owq).extension], PN(owq))) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_mem ((BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq) + ((struct LockPage *) OWQ_pn(owq).selected_filetype->data.v)->offset[OWQ_pn(owq).extension], PN(owq))) ; } /* 2406 memory write */ static ZERO_OR_ERROR FS_r_lock(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD( OW_r_mem(&data, 1, ((struct LockPage *) OWQ_pn(owq).selected_filetype->data.v)->reg, PN(owq)) ) ; OWQ_Y(owq) = UT_getbit(&data, OWQ_pn(owq).extension); return 0; } static ZERO_OR_ERROR FS_w_lock(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_lock(PN(owq))) ; } /* Note, it's EPROM -- write once */ static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { /* write is "byte at a time" -- not paged */ return GB_to_Z_OR_E(OW_w_mem((BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq), PN(owq))) ; } static ZERO_OR_ERROR FS_r_vis(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int I; _FLOAT f = 0.; RETURN_ERROR_IF_BAD( OW_r_int(&I, _1W_DS27XX_CURRENT, pn) ); switch (pn->sn[0]) { case 0x36: //DS2740 f = 6.25E-6; if (pn->selected_filetype->data.v) { f = pn->selected_filetype->data.f; // for DS2740BU } break; case 0x51: //DS2751 case 0x35: //DS2755 case 0x30: //DS2760 f = 15.625E-6 / 8; // Jan Bertelsen's correction break; case 0x28: //DS2770 f = 1.56E-6; break; case 0x32: //DS2780 case 0x3D: //DS2781 f = 1.5625E-6; break; } OWQ_F(owq) = f * I; return 0; } // Volt-hours static ZERO_OR_ERROR FS_r_vis_avg(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int I; GOOD_OR_BAD ret = gbBAD; switch (pn->sn[0]) { case 0x32: //DS2780 case 0x3D: //DS2781 ret = OW_r_int(&I, _1W_DS2780_AVERAGE_CURRENT, pn); if(GOOD(ret)) OWQ_F(owq) = .0000015625 * I; break; case 0x35: //DS2755 ret = OW_r_int(&I, _1W_DS2756_AVERAGE_CURRENT, pn); if(GOOD(ret)) OWQ_F(owq) = .000001953 * I; break; } return GB_to_Z_OR_E(ret); } // Volt-hours static ZERO_OR_ERROR FS_r_vh(struct one_wire_query *owq) { int I; RETURN_ERROR_IF_BAD( OW_r_int(&I, _1W_DS27XX_ACCUMULATED, PN(owq)) ) ; OWQ_F(owq) = .00000625 * I; return 0; } // Volt-hours static ZERO_OR_ERROR FS_w_vh(struct one_wire_query *owq) { int I = OWQ_F(owq) / .00000625; return GB_to_Z_OR_E(OW_w_int(&I, _1W_DS27XX_ACCUMULATED, PN(owq))); } // temperature-limits static ZERO_OR_ERROR FS_r_templim(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int I; RETURN_ERROR_IF_BAD( OW_r_int8(&I, pn->selected_filetype->data.u, pn) ) ; OWQ_F(owq) = I; return 0; } // Temperature-limits static ZERO_OR_ERROR FS_w_templim(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int I = OWQ_F(owq); if (I < -128) { return -ERANGE; } if (I > 127) { return -ERANGE; } return GB_to_Z_OR_E( OW_w_int8(&I, pn->selected_filetype->data.u, pn) ); } // timer static ZERO_OR_ERROR FS_r_timer(struct one_wire_query *owq) { int I; RETURN_ERROR_IF_BAD( OW_r_int(&I, _1W_DS2770_TIMER, PN(owq)) ) ; OWQ_F(owq) = .015625 * I; return 0; } // timer static ZERO_OR_ERROR FS_w_timer(struct one_wire_query *owq) { int I = OWQ_F(owq) / .015625; return GB_to_Z_OR_E( OW_w_int(&I, _1W_DS2770_TIMER, PN(owq)) ); } // Amp-hours -- using 25mOhm internal resistor static ZERO_OR_ERROR FS_r_ah(struct one_wire_query *owq) { if (FS_r_vh(owq)) { return -EINVAL; } OWQ_F(owq) = OWQ_F(owq) / .025; return 0; } // Amp-hours -- using 25mOhm internal resistor static ZERO_OR_ERROR FS_w_ah(struct one_wire_query *owq) { OWQ_F(owq) = OWQ_F(owq) * .025; return FS_w_vh(owq); } // current offset static ZERO_OR_ERROR FS_r_vis_off(struct one_wire_query *owq) { int I; RETURN_ERROR_IF_BAD( OW_r_int8(&I, 0x7B, PN(owq)) ); OWQ_F(owq) = 1.56E-6 * I; return 0; } // current offset static ZERO_OR_ERROR FS_w_vis_off(struct one_wire_query *owq) { int I = OWQ_F(owq) / 1.56E-6; if (I < -128) { return -ERANGE; } if (I > 127) { return -ERANGE; } return GB_to_Z_OR_E( OW_w_int8(&I, 0x7B, PN(owq)) ); } // Current bias -- using 25mOhm internal resistor static ZERO_OR_ERROR FS_r_abias(struct one_wire_query *owq) { _FLOAT vbias = 0. ; ZERO_OR_ERROR z_or_e = FS_r_sibling_F( &vbias, "vbias", owq ) ; OWQ_F(owq) = vbias / .025; return z_or_e ; } // Current bias -- using 25mOhm internal resistor static ZERO_OR_ERROR FS_w_abias(struct one_wire_query *owq) { return FS_w_sibling_F( OWQ_F(owq) * .025, "vbias", owq ) ; } // Read current using internal 25mOhm resistor and Vis static ZERO_OR_ERROR FS_r_current(struct one_wire_query *owq) { _FLOAT vis = 0.; ZERO_OR_ERROR z_or_e = FS_r_sibling_F( &vis, "vis", owq ) ; OWQ_F(owq) = vis / .025; return z_or_e ; } static ZERO_OR_ERROR FS_r_vbias(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int I; switch (pn->sn[0]) { case 0x51: //DS2751 case 0x30: //DS2760 RETURN_ERROR_IF_BAD( OW_r_int8(&I, _1W_DS2760_CURRENT_OFFSET, pn) ) ; OWQ_F(owq) = 15.625E-6 * I; break; case 0x35: //DS2755 RETURN_ERROR_IF_BAD( OW_r_int8(&I, _1W_DS2760_CURRENT_OFFSET, pn) ) ; OWQ_F(owq) = 1.95E-6 * I; break; case 0x28: //DS2770 // really a 2byte value! RETURN_ERROR_IF_BAD( OW_r_int(&I, _1W_DS2770_CURRENT_OFFSET, pn) ) ; OWQ_F(owq) = 1.5625E-6 * I; break; case 0x32: //DS2780 case 0x3D: //DS2780 RETURN_ERROR_IF_BAD( OW_r_int8(&I, _1W_DS2780_CURRENT_OFFSET, pn) ) ; OWQ_F(owq) = 1.5625E-6 * I; break; } return 0; } static ZERO_OR_ERROR FS_w_vbias(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int I; GOOD_OR_BAD ret = 0; // assign unnecessarily to avoid compiler warning switch (pn->sn[0]) { case 0x51: //DS2751 case 0x30: //DS2760 I = OWQ_F(owq) / 15.625E-6; if (I < -128) { return -ERANGE; } if (I > 127) { return -ERANGE; } ret = OW_w_int8(&I, _1W_DS2760_CURRENT_OFFSET, pn); break; case 0x35: //DS2755 I = OWQ_F(owq) / 1.95E-6; if (I < -128) { return -ERANGE; } if (I > 127) { return -ERANGE; } ret = OW_w_int8(&I, _1W_DS2760_CURRENT_OFFSET, pn); break; case 0x28: //DS2770 I = OWQ_F(owq) / 1.5625E-6; if (I < -32768) { return -ERANGE; } if (I > 32767) { return -ERANGE; } // really 2 bytes ret = OW_w_int(&I, _1W_DS2770_CURRENT_OFFSET, pn); break; case 0x32: //DS2780 I = OWQ_F(owq) / 1.5625E-6; if (I < -128) { return -ERANGE; } if (I > 127) { return -ERANGE; } ret = OW_w_int8(&I, _1W_DS2780_CURRENT_OFFSET, pn); break; } return GB_to_Z_OR_E( ret ); } static ZERO_OR_ERROR FS_r_volt(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int I; RETURN_ERROR_IF_BAD( OW_r_int(&I, _1W_DS27XX_VOLTAGE, pn) ) ; switch (pn->sn[0]) { case 0x3D: //DS2781 OWQ_F(owq) = ((int)(I >>5)) * .00976; break; default: OWQ_F(owq) = ((int)(I >>5)) * .00488; break; } return 0; } static ZERO_OR_ERROR FS_r_temp(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int I; size_t off; switch (pn->sn[0]) { case 0x32: //DS2780 case 0x3D: //DS2781 off = _1W_DS2780_TEMPERATURE; break; default: off = _1W_DS2760_TEMPERATURE; } RETURN_ERROR_IF_BAD( OW_r_int(&I, off, pn) ) ; OWQ_F(owq) = ( (int) (I >> 5) ) * .125; return 0; } static ZERO_OR_ERROR FS_r_bit(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int bit = BYTE_MASK(pn->selected_filetype->data.u); size_t location = pn->selected_filetype->data.u >> 8; BYTE c[1]; RETURN_ERROR_IF_BAD( OW_r_mem(c, 1, location, pn) ) ; OWQ_Y(owq) = UT_getbit(c, bit); return 0; } static ZERO_OR_ERROR FS_w_bit(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int bit = BYTE_MASK(pn->selected_filetype->data.u); size_t location = pn->selected_filetype->data.u >> 8; BYTE c[1]; RETURN_ERROR_IF_BAD( OW_r_mem(c, 1, location, pn) ) ; UT_setbit(c, bit, OWQ_Y(owq) != 0); return GB_to_Z_OR_E( OW_w_mem(c, 1, location, pn) ); } /* switch PIO sensed*/ static ZERO_OR_ERROR FS_r_pio(struct one_wire_query *owq) { if (FS_r_bit(owq)) { return -EINVAL; } OWQ_Y(owq) = !OWQ_Y(owq); return 0; } static ZERO_OR_ERROR FS_charge(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_cmd(OWQ_Y(owq) ? _1W_START_CHARGE : _1W_STOP_CHARGE, PN(owq))) ; } static ZERO_OR_ERROR FS_refresh(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_cmd(_1W_REFRESH, PN(owq))) ; } /* write PIO -- bit 6 */ static ZERO_OR_ERROR FS_w_pio(struct one_wire_query *owq) { OWQ_Y(owq) = !OWQ_Y(owq); return FS_w_bit(owq); } static ZERO_OR_ERROR FS_WS603_temperature(struct one_wire_query *owq) { return FS_r_sibling_F( &OWQ_F(owq), "temperature", owq ) ; } static ZERO_OR_ERROR FS_WS603_r_data( struct one_wire_query *owq) { BYTE data[5] ; RETURN_ERROR_IF_BAD( WS603_Get_Readings( data, PN(owq) ) ) ; return OWQ_format_output_offset_and_size( (char *) data, 5, owq); } static ZERO_OR_ERROR FS_WS603_r_param( struct one_wire_query *owq) { BYTE data[5] ; RETURN_ERROR_IF_BAD( WS603_Get_Parameters( data, PN(owq) ) ) ; return OWQ_format_output_offset_and_size( (char *) data, 5, owq); } static ZERO_OR_ERROR FS_WS603_wind_speed( struct one_wire_query *owq) { size_t length = 5 ; BYTE data[length] ; UINT wind_cal ; if ( FS_r_sibling_binary( data, &length, "WS603/data_string", owq ) ) { return -EINVAL ; } if ( FS_r_sibling_U( &wind_cal, "WS603/calibration/wind_speed", owq ) ) { wind_cal = 100 ; } else if ( wind_cal == 0 || wind_cal >199 ) { wind_cal = 100 ; } OWQ_F(owq) = data[0]*2.453*1.069*1000*wind_cal/(3600.*100.) ; return 0 ; } static ZERO_OR_ERROR FS_WS603_wind_direction( struct one_wire_query *owq) { size_t length = 5 ; BYTE data[length] ; if ( FS_r_sibling_binary( data, &length, "WS603/data_string", owq ) ) { return -EINVAL ; } OWQ_U(owq) = data[1] ; return 0 ; } static ZERO_OR_ERROR FS_WS603_r_led( struct one_wire_query *owq) { size_t length = 5 ; BYTE data[length] ; if ( FS_r_sibling_binary( data, &length, "WS603/data_string", owq ) ) { return -EINVAL ; } OWQ_U(owq) = data[2] ; return 0 ; } static ZERO_OR_ERROR FS_WS603_light( struct one_wire_query *owq) { size_t length = 5 ; BYTE data[length] ; if ( FS_r_sibling_binary( data, &length, "WS603/data_string", owq ) ) { return -EINVAL ; } OWQ_U(owq) = data[3] ; return 0 ; } static ZERO_OR_ERROR FS_WS603_volt( struct one_wire_query *owq) { size_t length = 5 ; BYTE data[length] ; if ( FS_r_sibling_binary( data, &length, "WS603/data_string", owq ) ) { return -EINVAL ; } OWQ_U(owq) = data[4] ; return 0 ; } static ZERO_OR_ERROR FS_WS603_r_led_model( struct one_wire_query *owq) { size_t length = 5 ; BYTE data[length] ; if ( FS_r_sibling_binary( data, &length, "WS603/param_string", owq ) ) { return -EINVAL ; } OWQ_U(owq) = data[0] ; return 0 ; } static ZERO_OR_ERROR FS_WS603_r_wind_calibration( struct one_wire_query *owq) { size_t length = 5 ; BYTE data[length] ; if ( FS_r_sibling_binary( data, &length, "WS603/param_string", owq ) ) { return -EINVAL ; } OWQ_U(owq) = data[1] ; return 0 ; } static ZERO_OR_ERROR FS_WS603_w_wind_calibration( struct one_wire_query *owq) { BYTE data[4] = { _WS603_WIND_SPEED_CALIBRATION, OWQ_U(owq) & 0xFF, 0x00, 0x00, } ; return GB_to_Z_OR_E( WS603_Send( data, 4, PN(owq) ) ) ; } static ZERO_OR_ERROR FS_WS603_r_direction_calibration( struct one_wire_query *owq) { size_t length = 5 ; BYTE data[length] ; if ( FS_r_sibling_binary( data, &length, "WS603/param_string", owq ) ) { return -EINVAL ; } OWQ_U(owq) = data[2] ; return 0 ; } static ZERO_OR_ERROR FS_WS603_w_direction_calibration( struct one_wire_query *owq) { BYTE data[4] = { _WS603_WIND_DIRECTION_CALIBRATION, OWQ_U(owq) & 0xFF, 0x00, 0x00, } ; return GB_to_Z_OR_E( WS603_Send( data, 4, PN(owq) ) ) ; } static ZERO_OR_ERROR FS_WS603_led_control( struct one_wire_query *owq) { BYTE data[7] = { _WS603_LED_CONTROL, OWQ_array_U(owq, 0) & 0xFF, OWQ_array_U(owq, 1) & 0xFF, OWQ_array_U(owq, 2) & 0xFF, OWQ_array_U(owq, 3) & 0xFF, 0x00, 0x00, } ; return GB_to_Z_OR_E( WS603_Send( data, 7, PN(owq) ) ) ; } static ZERO_OR_ERROR FS_WS603_r_light_threshold( struct one_wire_query *owq) { size_t length = 5 ; BYTE data[length] ; if ( FS_r_sibling_binary( data, &length, "WS603/param_string", owq ) ) { return -EINVAL ; } OWQ_U(owq) = data[3] ; return 0 ; } static struct LockPage * Lockpage( const struct parsedname * pn ) { switch( pn->sn[0]) { case 0x31: //DS2720 return &P2720 ; case 0x36: //DS2740 return NULL ; case 0x51: //DS2751 return &P2751 ; case 0x35: //DS2755 return &P2755 ; case 0x30: //DS2760 return &P2760 ; case 0x28: //DS2770 return &P2770 ; case 0x32: //DS2780 case 0x3D: //DS2781 return &P2780 ; default: return NULL ; } } // This routine tests to see if the memory range is eeprom and calls recall_eeprom if it is // otherwise a good return static GOOD_OR_BAD OW_recall_eeprom( const size_t size, const off_t offset, const struct parsedname *pn) { BYTE p[] = { _1W_RECALL_DATA, 0x00, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(p), TRXN_END, }; int eeprom_range ; struct LockPage * lp = Lockpage(pn) ; if ( lp == NULL ) { LEVEL_DEBUG("No eeprom information for this device.") ; return gbGOOD ; } for ( eeprom_range = 0 ; eeprom_range < lp->pages ; ++eeprom_range ) { off_t range_offset = lp->offset[eeprom_range] ; if ( (off_t)(offset+size) <= range_offset ) { // before this range continue ; } if ( offset >= (off_t)(range_offset + lp->size) ) { // after this range continue ; } p[1] = BYTE_MASK(range_offset) ; return BUS_transaction(t,pn) ; } return gbGOOD ; } /* just read the sram -- eeprom may need to be recalled if you want it */ static GOOD_OR_BAD OW_r_sram(BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn) { BYTE p[] = { _1W_READ_DATA, BYTE_MASK(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(p), TRXN_READ(data, size), TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD OW_r_mem(BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn) { RETURN_BAD_IF_BAD( OW_recall_eeprom(size, offset, pn) ) ; return OW_r_sram(data, size, offset, pn) ; } /* Special processing for eeprom -- page is the address of a 16 byte page (e.g. 0x20) */ static GOOD_OR_BAD OW_copy_eeprom(const size_t size, const off_t offset, const struct parsedname *pn) { BYTE p[] = { _1W_COPY_DATA, 0x00, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(p), TRXN_END, }; int eeprom_range ; struct LockPage * lp = Lockpage(pn) ; if ( lp == NULL ) { LEVEL_DEBUG("No eeprom information for this device.") ; return gbGOOD ; } for ( eeprom_range = 0 ; eeprom_range < lp->pages ; ++eeprom_range ) { off_t range_offset = lp->offset[eeprom_range] ; if ( (off_t) (offset+size) <= range_offset ) { // before this range continue ; } if ( offset >= (off_t)(range_offset + lp->size) ) { // after this range continue ; } p[1] = BYTE_MASK(range_offset) ; return BUS_transaction(t,pn) ; } return gbGOOD ; } static GOOD_OR_BAD OW_w_sram(const BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn) { BYTE p[] = { _1W_WRITE_DATA, BYTE_MASK(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(p), TRXN_WRITE(data, size), TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD OW_cmd(const BYTE cmd, const struct parsedname *pn) { struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(&cmd), TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD OW_w_mem(const BYTE * data, const size_t size, const off_t offset, const struct parsedname *pn) { RETURN_BAD_IF_BAD( OW_recall_eeprom(size, offset, pn) ) ; RETURN_BAD_IF_BAD( OW_w_sram(data, size, offset, pn) ) ; return OW_copy_eeprom(size, offset, pn) ; } static GOOD_OR_BAD OW_r_int(int *I, off_t offset, const struct parsedname *pn) { BYTE i[2]; RETURN_BAD_IF_BAD( OW_r_sram(i, 2, offset, pn) ); // Data in the DS27xx is stored MSB/LSB -- different from DS2438 for example // Thanks to Jan Bertelsen for finding this! I[0] = (((int) ((int8_t) i[0]) << 8) + ((uint8_t) i[1])); return gbGOOD; } static GOOD_OR_BAD OW_w_int(const int *I, off_t offset, const struct parsedname *pn) { BYTE i[2] = { BYTE_MASK(I[0] >> 8), BYTE_MASK(I[0]), }; return OW_w_sram(i, 2, offset, pn); } static GOOD_OR_BAD OW_r_int8(int *I, off_t offset, const struct parsedname *pn) { BYTE i[1]; RETURN_BAD_IF_BAD( OW_r_sram(i, 1, offset, pn) ); //I[0] = ((int)((int8_t)i[0]) ) ; I[0] = UT_int8(i); return gbGOOD; } static GOOD_OR_BAD OW_w_int8(const int *I, off_t offset, const struct parsedname *pn) { BYTE i[1] = { BYTE_MASK(I[0]), }; return OW_w_sram(i, 1, offset, pn); } static GOOD_OR_BAD OW_lock(const struct parsedname *pn) { BYTE lock[] = { _1W_WRITE_DATA, 0x07, 0x40, _1W_LOCK, 0x00 }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE(lock, 5), TRXN_END, }; UT_setbit(&lock[2], pn->extension, 1); lock[4] = ((struct LockPage *) pn->selected_filetype->data.v)->offset[pn->extension]; return BUS_transaction(t, pn); } static ZERO_OR_ERROR FS_rangelow(struct one_wire_query *owq) { OWQ_F(owq) = Thermocouple_range_low(OWQ_pn(owq).selected_filetype->data.i); return 0; } static ZERO_OR_ERROR FS_rangehigh(struct one_wire_query *owq) { OWQ_F(owq) = Thermocouple_range_high(OWQ_pn(owq).selected_filetype->data.i); return 0; } static ZERO_OR_ERROR FS_thermocouple(struct one_wire_query *owq) { _FLOAT T_coldjunction, vis, mV; /* Get measured voltage */ if ( FS_r_sibling_F( &vis, "vis", owq ) != 0 ) { return -EINVAL ; } mV = vis * 1000; /* convert Volts to mVolts */ /* Get cold junction temperature */ if ( FS_r_sibling_F( &T_coldjunction, "temperature", owq ) != 0 ) { return -EINVAL ; } OWQ_F(owq) = ThermocoupleTemperature(mV, T_coldjunction, OWQ_pn(owq).selected_filetype->data.i); return 0; } // Based on Les Arbes notes http://www.lesarbresdesign.info/automation/ws603-weather-instrument static GOOD_OR_BAD WS603_Send( BYTE * byt, int length, struct parsedname * pn ) { int repeat ; BYTE resp[length] ; // Finish setting up string byt[length-2] = WS603_CHECKSUM( byt, length-2 ) ; byt[length-1] = WS603_ENDBYTE( byt[0] ) ; // Send the command and check that it was received for ( repeat = 0 ; repeat < 20; ++repeat ) { if ( GOOD(OW_w_sram( byt, length, _WS603_COMMAND_ADDRESS, pn ) ) && ( GOOD( OW_r_sram( resp, length, _WS603_COMMAND_ADDRESS, pn ) ) ) ) { if ( memcmp( byt, resp, length ) == 0 ) { return gbGOOD ; } } UT_delay(20) ; } LEVEL_DEBUG("Cannot send command to WS603") ; return gbBAD ; } // Based on Les Arbes notes http://www.lesarbresdesign.info/automation/ws603-weather-instrument static GOOD_OR_BAD WS603_Get( BYTE cmd, BYTE * byt, int length, struct parsedname * pn ) { int repeat ; // Send the command and check that it was received for ( repeat = 0 ; repeat < 21; ++repeat ) { UT_delay(20) ; if ( GOOD( OW_r_sram( (BYTE *)byt, length, _WS603_RESPONSE_ADDRESS, pn ) ) ) { if ( ( byt[0] == cmd ) && ( byt[length-1] == WS603_CHECKSUM( byt, length-1 ) ) ) { return gbGOOD ; } } } LEVEL_DEBUG("Cannot read response to WS603") ; return gbBAD ; } static GOOD_OR_BAD WS603_Transaction( BYTE * cmd, int length, BYTE * resp, struct parsedname * pn ) { RETURN_BAD_IF_BAD( WS603_Send( cmd, length, pn ) ) ; return WS603_Get( cmd[0], resp, 7, pn ) ; } static char WS603_CHECKSUM( BYTE * byt, int length ) { int l ; BYTE sum = 0 ; for ( l=0 ; l < length ; ++l ) { sum += byt[l] ; } return sum & 0xFF ; } // return 5 bytes of data static GOOD_OR_BAD WS603_Get_Readings( BYTE * data, struct parsedname * pn ) { BYTE resp[7] ; BYTE cmd[3] = { _WS603_READ_DATA, 0x00, 0x00, } ; RETURN_BAD_IF_BAD( WS603_Transaction( cmd, 3, resp, pn ) ) ; memcpy( data, &resp[1], 5 ) ; return gbGOOD ; } // return 5 bytes of data static GOOD_OR_BAD WS603_Get_Parameters( BYTE * data, struct parsedname * pn ) { BYTE resp[7] ; BYTE cmd[3] = { _WS603_READ_PARAMETER, 0x00, 0x00, } ; RETURN_BAD_IF_BAD( WS603_Transaction( cmd, 3, resp, pn ) ) ; memcpy( data, &resp[1], 5 ) ; return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_2804.c0000644000175000001440000002742112661433173014411 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Changes 7/2004 Extensive improvements based on input from Serg Oskin */ #include #include "owfs_config.h" #include "ow_2804.h" /* ------- Prototypes ----------- */ /* DS2406 switch */ READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_pio); WRITE_FUNCTION(FS_w_pio); READ_FUNCTION(FS_sense); READ_FUNCTION(FS_r_latch); WRITE_FUNCTION(FS_w_latch); READ_FUNCTION(FS_r_s_alarm); WRITE_FUNCTION(FS_w_s_alarm); READ_FUNCTION(FS_power); READ_FUNCTION(FS_r_por); READ_FUNCTION(FS_polarity); WRITE_FUNCTION(FS_w_por); /* ------- Structures ----------- */ static struct aggregate A2804 = { 2, ag_numbers, ag_aggregate, }; static struct aggregate A2804p = { 16, ag_numbers, ag_separate, }; static struct filetype DS28E04[] = { F_STANDARD, {"memory", 550, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", 32, &A2804p, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"polarity", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_polarity, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"power", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_power, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"por", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_por, FS_w_por, VISIBLE, NO_FILETYPE_DATA, }, {"PIO", PROPERTY_LENGTH_BITFIELD, &A2804, ft_bitfield, fc_stable, FS_r_pio, FS_w_pio, VISIBLE, NO_FILETYPE_DATA, }, {"sensed", PROPERTY_LENGTH_BITFIELD, &A2804, ft_bitfield, fc_volatile, FS_sense, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"latch", PROPERTY_LENGTH_BITFIELD, &A2804, ft_bitfield, fc_volatile, FS_r_latch, FS_w_latch, VISIBLE, NO_FILETYPE_DATA, }, {"set_alarm", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_s_alarm, FS_w_s_alarm, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(1C, DS28E04, DEV_alarm | DEV_resume | DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_SCRATCHPAD 0x0F #define _1W_READ_SCRATCHPAD 0xAA #define _1W_COPY_SCRATCHPAD 0x55 #define _1W_READ_MEMORY 0xF0 #define _1W_PIO_ACCESS_READ 0xF5 #define _1W_PIO_ACCESS_WRITE 0x5A #define _1W_READ_ACTIVE_LATCH 0xA5 #define _1W_WRITE_REGISTER 0xCC #define _1W_RESET_ACTIVITY_LATCHES 0xC3 #define _1W_PIO_CONFIRMATION 0xAA #define _ADDRESS_PIO_LOGIC 0x0220 #define _ADDRESS_PIO_OUTPUT 0x0221 #define _ADDRESS_PIO_ACTIVITY 0x0222 #define _ADDRESS_CONDITIONAL_SEARCH_PIO 0x0223 #define _ADDRESS_CONDITIONAL_SEARCH_CONTROL 0x0225 /* ------- Functions ------------ */ /* DS2804 */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_w_scratch(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_w_pio(BYTE data, struct parsedname *pn); static GOOD_OR_BAD OW_clear(struct parsedname *pn); static GOOD_OR_BAD OW_w_reg(BYTE * data, size_t size, off_t offset, struct parsedname *pn); /* 2804 memory read */ static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { size_t pagesize = 32; /* read is not a "paged" endeavor, the CRC comes after a full read */ return GB_to_Z_OR_E(COMMON_read_memory_F0(owq, 0, pagesize)) ; } /* Note, it's EPROM -- write once */ static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { size_t pagesize = 32; /* write is "byte at a time" -- not paged */ return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, pagesize, OW_w_mem)) ; } /* 2804 memory write */ static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { size_t pagesize = 32; return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*pagesize) ; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { size_t pagesize = 32; /* write is "byte at a time" -- not paged */ return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*pagesize ) ; } /* 2804 switch */ static ZERO_OR_ERROR FS_r_pio(struct one_wire_query *owq) { BYTE data; OWQ_allocate_struct_and_pointer(owq_pio); OWQ_create_temporary(owq_pio, (char *) &data, 1, _ADDRESS_PIO_OUTPUT, PN(owq)); if ( COMMON_read_memory_F0(owq_pio, 0, 0) != 0 ) { return -EINVAL; } OWQ_U(owq) = BYTE_INVERSE(data) & 0x03; /* reverse bits */ return 0; } /* write 2804 switch -- 2 values*/ static ZERO_OR_ERROR FS_w_pio(struct one_wire_query *owq) { BYTE data = 0; /* reverse bits */ data = BYTE_INVERSE(OWQ_U(owq)) | 0xFC; /* Set bits 2-7 to "1" */ return GB_to_Z_OR_E(OW_w_pio(data, PN(owq))) ; } /* 2804 switch -- is Vcc powered?*/ static ZERO_OR_ERROR FS_power(struct one_wire_query *owq) { BYTE data; OWQ_allocate_struct_and_pointer(owq_power); OWQ_create_temporary(owq_power, (char *) &data, 1, _ADDRESS_CONDITIONAL_SEARCH_CONTROL, PN(owq)); if ( COMMON_read_memory_F0(owq_power, 0, 0) != 0 ) { return -EINVAL; } OWQ_Y(owq) = UT_getbit(&data, 7); return 0; } /* 2904 switch -- power-on status of polrity pin */ static ZERO_OR_ERROR FS_polarity(struct one_wire_query *owq) { BYTE data; OWQ_allocate_struct_and_pointer(owq_polarity); OWQ_create_temporary(owq_polarity, (char *) &data, 1, _ADDRESS_CONDITIONAL_SEARCH_CONTROL, PN(owq)); if ( COMMON_read_memory_F0(owq_polarity, 0, 0) != 0 ) { return -EINVAL; } OWQ_Y(owq) = UT_getbit(&data, 6); return 0; } /* 2804 switch -- power-on status of polrity pin */ static ZERO_OR_ERROR FS_r_por(struct one_wire_query *owq) { BYTE data; OWQ_allocate_struct_and_pointer(owq_por); OWQ_create_temporary(owq_por, (char *) &data, 1, _ADDRESS_CONDITIONAL_SEARCH_CONTROL, PN(owq)); if ( COMMON_read_memory_F0(owq_por, 0, 0) != 0 ) { return -EINVAL; } OWQ_Y(owq) = UT_getbit(&data, 3); return 0; } /* 2804 switch -- power-on status of polrity pin */ static ZERO_OR_ERROR FS_w_por(struct one_wire_query *owq) { BYTE data; struct parsedname *pn = PN(owq); OWQ_allocate_struct_and_pointer(owq_por); OWQ_create_temporary(owq_por, (char *) &data, 1, _ADDRESS_CONDITIONAL_SEARCH_CONTROL, pn); if (COMMON_read_memory_F0(owq_por, 0, 0)) { return -EINVAL; /* get current register */ } if (UT_getbit(&data, 3)) { /* needs resetting? bit3==1 */ data ^= 0x08; /* flip bit 3 */ RETURN_ERROR_IF_BAD( OW_w_reg(&data, 1, _ADDRESS_CONDITIONAL_SEARCH_CONTROL, pn)) ; if (FS_r_por(owq)) { return -EINVAL; /* reread */ } if (OWQ_Y(owq)) { return -EINVAL; /* not reset despite our try */ } } return 0; /* good */ } /* 2804 switch PIO sensed*/ static ZERO_OR_ERROR FS_sense(struct one_wire_query *owq) { BYTE data; OWQ_allocate_struct_and_pointer(owq_sense); OWQ_create_temporary(owq_sense, (char *) &data, 1, _ADDRESS_PIO_LOGIC, PN(owq)); if ( COMMON_read_memory_F0(owq_sense, 0, 0) != 0 ) { return -EINVAL; } OWQ_U(owq) = (data) & 0x03; return 0; } /* 2804 switch activity latch*/ static ZERO_OR_ERROR FS_r_latch(struct one_wire_query *owq) { BYTE data; OWQ_allocate_struct_and_pointer(owq_latch); OWQ_create_temporary(owq_latch, (char *) &data, 1, _ADDRESS_PIO_ACTIVITY, PN(owq)); if ( COMMON_read_memory_F0(owq_latch, 0, 0) != 0 ) { return -EINVAL; } OWQ_U(owq) = data & 0x03; return 0; } /* 2804 switch activity latch*/ static ZERO_OR_ERROR FS_w_latch(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_clear(PN(owq))) ; } /* 2804 alarm settings*/ static ZERO_OR_ERROR FS_r_s_alarm(struct one_wire_query *owq) { BYTE data[3]; OWQ_allocate_struct_and_pointer(owq_alarm); OWQ_create_temporary(owq_alarm, (char *) data, 3, _ADDRESS_CONDITIONAL_SEARCH_PIO, PN(owq)); if (COMMON_read_memory_F0(owq_alarm, 0, 0)) { return -EINVAL; } OWQ_U(owq) = (data[2] & 0x03) * 100; OWQ_U(owq) += UT_getbit(&data[1], 0) | (UT_getbit(&data[0], 0) << 1); OWQ_U(owq) += UT_getbit(&data[1], 1) | (UT_getbit(&data[0], 1) << 1) * 10; return 0; } /* 2804 alarm settings*/ static ZERO_OR_ERROR FS_w_s_alarm(struct one_wire_query *owq) { BYTE data[3] = { 0, 0, 0, }; UINT U = OWQ_U(owq); OWQ_allocate_struct_and_pointer(owq_alarm); OWQ_create_temporary(owq_alarm, (char *) &data[2], 1, _ADDRESS_CONDITIONAL_SEARCH_CONTROL, PN(owq)); if (COMMON_read_memory_F0(owq_alarm, 0, 0)) { return -EINVAL; } data[2] |= (U / 100 % 10) & 0x03; UT_setbit(&data[1], 0, (int) (U % 10) & 0x01); UT_setbit(&data[1], 1, (int) (U / 10 % 10) & 0x01); UT_setbit(&data[0], 0, ((int) (U % 10) & 0x02) >> 1); UT_setbit(&data[0], 1, ((int) (U / 10 % 10) & 0x02) >> 1); return GB_to_Z_OR_E(OW_w_reg(data, 3, _ADDRESS_CONDITIONAL_SEARCH_PIO, PN(owq))) ; } static GOOD_OR_BAD OW_w_scratch(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[3 + 32 + 2] = { _1W_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE(p, 3 + size), TRXN_END, }; struct transaction_log tcrc[] = { TRXN_START, TRXN_WR_CRC16(p, 3 + size, 0), TRXN_END, }; memcpy(&p[3], data, size); if (((size + offset) & 0x1F) == 0) { /* Check CRC if write is to end of page */ return BUS_transaction(tcrc, pn); } else { return BUS_transaction(t, pn); } } /* pre-paged */ static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[4 + 32 + 2] = { _1W_READ_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; struct transaction_log tread[] = { TRXN_START, TRXN_WR_CRC16(p, 3, 1 + size), TRXN_COMPARE(&p[4], data, size), TRXN_END, }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE3(p), TRXN_POWER( &p[3], 10 ) , TRXN_END, }; RETURN_BAD_IF_BAD( OW_w_scratch(data, size, offset, pn) ); RETURN_BAD_IF_BAD( BUS_transaction(tread, pn)) ; p[0] = _1W_COPY_SCRATCHPAD; return BUS_transaction(tcopy, pn); } //* write status byte */ static GOOD_OR_BAD OW_w_reg(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[3] = { _1W_WRITE_REGISTER, LOW_HIGH_ADDRESS(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(p), TRXN_READ(data, size), TRXN_END, }; return BUS_transaction(t, pn); } /* set PIO state bits: bit0=A bit1=B, value: open=1 closed=0 */ static GOOD_OR_BAD OW_w_pio(BYTE data, struct parsedname *pn) { BYTE p[3] = { _1W_PIO_ACCESS_WRITE, BYTE_MASK(data), BYTE_INVERSE(data), }; BYTE confirm[] = { _1W_PIO_CONFIRMATION, }; BYTE resp[1]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(p), TRXN_READ1(resp), TRXN_COMPARE(resp, confirm, 1), TRXN_END, }; return BUS_transaction(t, pn); } /* Clear latches */ static GOOD_OR_BAD OW_clear(struct parsedname *pn) { BYTE cmd[] = { _1W_RESET_ACTIVITY_LATCHES, }; BYTE resp[1]; BYTE confirm[] = { _1W_PIO_CONFIRMATION, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(cmd), TRXN_READ1(resp), TRXN_COMPARE(resp, confirm, 1), TRXN_END, }; return BUS_transaction(t, pn); } owfs-3.1p5/module/owlib/src/c/ow_2890.c0000644000175000001440000001065412654730021014410 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_2890.h" /* ------- Prototypes ----------- */ /* DS2890 Digital Potentiometer */ READ_FUNCTION(FS_r_cp); WRITE_FUNCTION(FS_w_cp); READ_FUNCTION(FS_r_wiper); WRITE_FUNCTION(FS_w_wiper); /* ------- Structures ----------- */ static struct filetype DS2890[] = { F_STANDARD, {"chargepump", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_cp, FS_w_cp, VISIBLE, NO_FILETYPE_DATA, }, {"wiper", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_wiper, FS_w_wiper, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(2C, DS2890, DEV_alarm | DEV_resume | DEV_ovdr, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_WRITE_POSITION 0x0F #define _1W_READ_POSITION 0xF0 #define _1W_INCREMENT 0xC3 #define _1W_DECREMENT 0x99 #define _1W_WRITE_CONTROL_REGISTER 0x55 #define _1W_READ_CONTROL_REGISTER 0xAA #define _1W_RELEASE_WIPER 0x96 /* ------- Functions ------------ */ /* DS2890 */ static GOOD_OR_BAD OW_r_wiper(UINT * val, const struct parsedname *pn); static GOOD_OR_BAD OW_w_wiper(const UINT val, const struct parsedname *pn); static GOOD_OR_BAD OW_r_cp(int *val, const struct parsedname *pn); static GOOD_OR_BAD OW_w_cp(const int val, const struct parsedname *pn); /* Wiper */ static ZERO_OR_ERROR FS_w_wiper(struct one_wire_query *owq) { UINT num = OWQ_U(owq); if (num > 255) { num = 255; } return GB_to_Z_OR_E(OW_w_wiper(num, PN(owq))) ; } /* write Charge Pump */ static ZERO_OR_ERROR FS_w_cp(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_cp(OWQ_Y(owq), PN(owq))) ; } /* read Wiper */ static ZERO_OR_ERROR FS_r_wiper(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_r_wiper(&OWQ_U(owq), PN(owq))) ; } /* Charge Pump */ static ZERO_OR_ERROR FS_r_cp(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_r_cp(&OWQ_Y(owq), PN(owq))) ; } /* write Wiper */ static GOOD_OR_BAD OW_w_wiper(const UINT val, const struct parsedname *pn) { BYTE resp[1]; BYTE cmd[] = { _1W_WRITE_POSITION, (BYTE) val, }; BYTE ns[] = { _1W_RELEASE_WIPER, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(cmd), TRXN_READ1(resp), TRXN_WRITE1(ns), TRXN_COMPARE(resp, &cmd[1], 1), TRXN_END }; return BUS_transaction(t, pn); } /* read Wiper */ static GOOD_OR_BAD OW_r_wiper(UINT * val, const struct parsedname *pn) { BYTE fo[] = { _1W_READ_POSITION, }; BYTE resp[2]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(fo), TRXN_READ2(resp), TRXN_END }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; *val = resp[1]; return gbGOOD; } /* write Charge Pump */ static GOOD_OR_BAD OW_w_cp(const int val, const struct parsedname *pn) { BYTE resp[1]; BYTE cmd[] = { _1W_WRITE_CONTROL_REGISTER, (val) ? 0x4C : 0x0C }; BYTE ns[] = { _1W_RELEASE_WIPER, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(cmd), TRXN_READ1(resp), TRXN_WRITE1(ns), TRXN_COMPARE(resp, &cmd[1], 1), TRXN_END }; return BUS_transaction(t, pn); } /* read Charge Pump */ static GOOD_OR_BAD OW_r_cp(int *val, const struct parsedname *pn) { BYTE aa[] = { _1W_READ_CONTROL_REGISTER, }; BYTE resp[2]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(aa), TRXN_READ2(resp), TRXN_END }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; *val = ((resp[1] & 0x40) != 0); return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_add_inflight.c0000644000175000001440000000234312654730021016416 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_connection.h" /* Can only be called by a separate (monitoring) thread so the write-lock won't deadlock */ /* This allows adding new Bus Masters while program is running * The master is usually only read-locked for normal operation * write lock is done in a separate thread when no requests are being processed */ void Add_InFlight( GOOD_OR_BAD (*nomatch)(struct port_in * trial,struct port_in * existing), struct port_in * new_pin ) { if ( new_pin == NULL ) { return ; } LEVEL_DEBUG("Request master be added: %s", DEVICENAME(new_pin->first)); CONNIN_WLOCK ; if ( nomatch != NULL ) { struct port_in * pin ; for ( pin = Inbound_Control.head_port ; pin != NULL ; pin = pin->next ) { if ( GOOD( nomatch( new_pin, pin )) ) { continue ; } LEVEL_DEBUG("Already exists as index=%d",pin->first->index) ; CONNIN_WUNLOCK ; RemovePort( new_pin ) ; return ; } } LinkPort(new_pin); CONNIN_WUNLOCK ; } owfs-3.1p5/module/owlib/src/c/ow_alias.c0000644000175000001440000001350512654730021015075 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_opt -- owlib specific command line options processing */ #include #include "owfs_config.h" #include "ow.h" GOOD_OR_BAD ReadAliasFile(const ASCII * file) { FILE *alias_file_pointer ; /* getline parameters. allocated and reallocated by getline. use free rather than owfree */ char * alias_line = NULL ; size_t alias_line_length ; int line_number = 0; /* try to open file for reading */ alias_file_pointer = fopen(file, "r"); if ( alias_file_pointer == NULL ) { ERROR_DEFAULT("Cannot process alias file %s", file); return gbBAD; } /* read each line and parse */ while (getline(&alias_line, &alias_line_length, alias_file_pointer) >= 0) { ++line_number; BYTE sn[SERIAL_NUMBER_SIZE] ; char * a_line = alias_line ; // pointer within the line char * sn_char = NULL ; // pointer to serial number char * name_char = NULL ; // pointer to alias name while ( a_line ) { sn_char = strsep( &a_line, "/ \t=\n"); if ( strlen(sn_char)>0 ) { // non delim char break ; } } if ( Parse_SerialNumber(sn_char, sn) != sn_valid ) { LEVEL_CALL("Problem parsing device name in alias file %s:%d",file,line_number) ; continue ; } if ( a_line ) { a_line += strspn(a_line," \t=") ; } while ( a_line ) { name_char = strsep( &a_line, "\n"); size_t len = strlen(name_char) ; if ( len > 0 ) { while ( len>0 ) { if ( name_char[len-1] != ' ' && name_char[len-1] != '\t' ) { break ; } name_char[--len] = '\0' ; } Test_and_Add_Alias( name_char, sn) ; break ; } } } if ( alias_line != NULL ) { free(alias_line) ; // not owfree since allocated by getline } fclose(alias_file_pointer); return gbGOOD; } /* Name is a null-terminated string */ /* sn is an 8-byte serial number */ /* 1. Trims name * 2. Checks name length * 3. Refuses reserved words * 4. Refuses path separator (/) * 5. Removes any old assignments to name or serial number * 6. Add new alias * */ GOOD_OR_BAD Test_and_Add_Alias( char * name, BYTE * sn ) { BYTE sn_stored[SERIAL_NUMBER_SIZE] ; size_t len ; // Parse off initial spaces while ( name[0] == ' ' ) { ++name ; } // parse off trailing spaces for ( len = strlen(name) ; len > 0 && name[len-1]==' ' ; ) { -- len ; name[len] = '\0' ; } // zero length allowed -- will delete this entry. // Check length if ( len > PROPERTY_LENGTH_ALIAS ) { LEVEL_CALL("Alias too long: sn=" SNformat ", Alias=%s, Length=%d, Max length=%d", SNvar(sn), name, (int) len, PROPERTY_LENGTH_ALIAS ) ; return gbBAD ; } // Reserved word? if ( strcmp( name, "interface" )==0 || strcmp( name, "settings" )==0 || strcmp( name, "uncached" )==0 || strcmp( name, "unaliased" )==0 || strcmp( name, "text" )==0 || strcmp( name, "alarm" )==0 || strcmp( name, "statistics" )==0 || strcmp( name, "simultaneous" )==0 || strcmp( name, "structure" )==0 || strncmp( name, "bus.", 4 )==0 ) { LEVEL_CALL("Alias attempts to redefine reserved filename: %s",name ) ; return gbBAD ; } // No path separator allowed in name if ( strchr( name, '/' ) ) { LEVEL_CALL("Alias contains confusing path separator \'/\': %s",name ) ; return gbBAD ; } // Is there another assignment for this alias name already? if ( GOOD( Cache_Get_Alias_SN( name, sn_stored ) ) ) { if ( memcmp( sn, sn_stored, SERIAL_NUMBER_SIZE ) == 0 ) { // repeat assignment return gbGOOD ; } // delete old serial number LEVEL_CALL("Alias %s reassigned from "SNformat" to "SNformat,name,SNvar(sn_stored),SNvar(sn)) ; Cache_Del_Alias(sn_stored) ; } // Delete any prior assignments for this serial number Cache_Del_Alias(sn) ; // Now add return Cache_Add_Alias( name, sn) ; } void FS_dir_entry_aliased(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn) { if ( ( pn->state & ePS_unaliased ) == 0 ) { // Want alias substituted struct parsedname s_pn_copy ; struct parsedname * pn_copy = & s_pn_copy ; ASCII path[PATH_MAX+3] ; ASCII * path_pointer = path ; // current location in original path // Shallow copy memcpy( pn_copy, pn, sizeof(struct parsedname) ) ; pn_copy->path[0] = '\0' ; // path copy to use for separation strcpy( path, pn->path ) ; // copy segments of path (delimitted by "/") to copy while( path_pointer != NULL ) { ASCII * path_segment = strsep( &path_pointer, "/" ) ; BYTE sn[SERIAL_NUMBER_SIZE] ; if ( PATH_MAX < strlen(pn_copy->path) + strlen(path_segment) ) { // too long, just use initial copy strcpy( pn_copy->path, pn->path ) ; break ; } //test this segment for serial number if ( Parse_SerialNumber(path_segment,sn) == sn_valid ) { //printf("We see serial number in path "SNformat"\n",SNvar(sn)) ; // now test for alias ASCII * name = Cache_Get_Alias( sn ) ; if ( name != NULL ) { //printf("It's aliased to %s\n",name); // now test for room if ( PATH_MAX < strlen(pn_copy->path) + strlen(name) ) { // too long, just use initial copy strcpy( pn_copy->path, pn->path ) ; owfree(name) ; break ; } // overwrite serial number with alias name strcat( pn_copy->path, name ) ; owfree( name ) ; } else { strcat( pn_copy->path, path_segment ) ; } } else { strcat( pn_copy->path, path_segment ) ; } if ( path_pointer != NULL ) { strcat( pn_copy->path, "/" ) ; } //LEVEL_DEBUG( "Alias path so far: %s",pn_copy->path ) ; } if ( dirfunc != NULL ) { DIRLOCK; dirfunc(v, pn_copy); DIRUNLOCK; } } else { // Don't want alias substituted if ( dirfunc != NULL ) { DIRLOCK; dirfunc(v, pn); DIRUNLOCK; } } } owfs-3.1p5/module/owlib/src/c/ow_alloc.c0000644000175000001440000000445612654730021015103 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ #include #include "owfs_config.h" #include "ow.h" #if OW_ALLOC_DEBUG /* Special routines for tracking memory leakage */ /* Turned on by * ./configure --enable-owmalloc * */ void *OWcalloc(const char * file, int line, const char * func, size_t nmemb, size_t size) { void * v = calloc(nmemb,size); printf("%p alloc %s:%s[%d] CALLOC size=%d nmemb=%d\n",v,file,func,line,(int)size,(int)nmemb); return v; } void *OWmalloc(const char * file, int line, const char * func, size_t size) { void * v = malloc(size); printf("%p alloc %s:%s[%d] MALLOC size=%d\n",v,file,func,line,(int)size); return v; } void OWfree(const char * file, int line, const char * func, void *ptr) { printf("%p free %s:%s[%d] FREE\n",ptr,file,func,line); free(ptr); } void OWtreefree(void *ptr) { OWfree("BinaryTree", 0, "tdestroy", ptr) ; } void *OWrealloc(const char * file, int line, const char * func, void *ptr, size_t size) { void * v = realloc(ptr,size); printf("%p free %s:%s[%d] REALLOC\n",ptr,file,func,line); printf("%p alloc %s:%s[%d] REALLOC size=%d\n",v,file,func,line,(int)size); return v; } char *OWstrdup(const char * file, int line, const char * func, const char *s) { char * c = strdup(s); printf("%p alloc %s:%s[%d] STRDUP s=%s\n",c,file,func,line,s); return c; } #endif /* OW_ALLOC_H */ owfs-3.1p5/module/owlib/src/c/ow_api.c0000644000175000001440000001224012654730021014550 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* code for SWIG and owcapi safe access */ /* Uses two mutexes, one for inbound_connections, showing of there are valid 1-wire adapters */ /* Second is paired with a condition variable to prevent "finish" when a "get" or "put" is in progress */ /* Thanks to Geo Carncross for the implementation */ #include #include "owfs_config.h" #include "ow.h" /* ------- Globals ----------- */ pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t access_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t access_cond = PTHREAD_COND_INITIALIZER; #define INITINIT _MUTEX_INIT( init_mutex ) #define ACCESSINIT _MUTEX_INIT( access_mutex ) #define INITLOCK _MUTEX_LOCK( init_mutex ) #define INITUNLOCK _MUTEX_UNLOCK( init_mutex ) #define ACCESSLOCK _MUTEX_LOCK( access_mutex ) #define ACCESSUNLOCK _MUTEX_UNLOCK(access_mutex ) #define ACCESSWAIT my_pthread_cond_wait( &access_cond, &access_mutex ) #define ACCESSSIGNAL my_pthread_cond_signal( &access_cond ) int access_num = 0; static GOOD_OR_BAD setup_from_commandline( const char *command_line ) ; static GOOD_OR_BAD setup_from_args( int argc, char **argv ) ; void API_setup(enum enum_program_type program_type) { static int deja_vue = 0; // poor mans lock for the Lib Setup and Lock Setup if (++deja_vue == 1) { // first time through LibSetup(program_type); INITINIT ; ACCESSINIT ; StateInfo.owlib_state = lib_state_setup; } } void API_set_error_level(const char *params) { if (params != NULL) { Globals.error_level = atoi(params); Globals.error_level_restore = Globals.error_level; } return; } void API_set_error_print(const char *params) { if (params != NULL) { Globals.error_print = atoi(params); } return; } /* Swig ensures that API_Setup is called first, but still we check */ GOOD_OR_BAD API_init(const char *command_line, enum restart_init repeat) { GOOD_OR_BAD return_code = gbGOOD; LEVEL_DEBUG("OWLIB started with <%s>",SAFESTRING(command_line)); if (StateInfo.owlib_state == lib_state_pre) { LibSetup(Globals.program_type); // use previous or default value StateInfo.owlib_state = lib_state_setup; } LIB_WLOCK; // stop if started if (StateInfo.owlib_state == lib_state_started) { if ( repeat == continue_if_repeat ) { LEVEL_DEBUG("Init called on running system -- will ignore"); goto init_exit ; } LEVEL_DEBUG("Init called on running system -- will stop and start again"); LibStop(); StateInfo.owlib_state = lib_state_setup; } // now restart if (StateInfo.owlib_state == lib_state_setup) { return_code = setup_from_commandline( command_line ) ; } init_exit: LIB_WUNLOCK; LEVEL_DEBUG("OWLIB started with <%s>",SAFESTRING(command_line)); return return_code; } static GOOD_OR_BAD setup_from_commandline( const char *command_line ) { RETURN_BAD_IF_BAD( owopt_packed(command_line) ) ; RETURN_BAD_IF_BAD( LibStart(NULL) ); StateInfo.owlib_state = lib_state_started; return gbGOOD ; } static GOOD_OR_BAD setup_from_args( int argc, char **argv ) { /* grab our executable name */ ArgCopy( argc, argv ) ; // process the command line flags do { int c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL) ; if ( c == -1 ) { break ; } RETURN_BAD_IF_BAD( owopt(c, optarg) ) ; } while ( 1 ) ; /* non-option arguments */ while (optind < argc) { RETURN_BAD_IF_BAD( ARG_Generic(argv[optind]) ) ; ++optind; } StateInfo.owlib_state = lib_state_started; return gbGOOD ; } /* Swig ensures that API_Setup is called first, but still we check */ GOOD_OR_BAD API_init_args(int argc, char **argv, enum restart_init repeat) { GOOD_OR_BAD return_code = gbGOOD; if (StateInfo.owlib_state == lib_state_pre) { LibSetup(Globals.program_type); // use previous or default value StateInfo.owlib_state = lib_state_setup; } LIB_WLOCK; // stop if started if (StateInfo.owlib_state == lib_state_started) { if ( repeat == continue_if_repeat ) { LEVEL_DEBUG("Init called on running system -- will ignore"); goto init_exit ; } LEVEL_DEBUG("Init called on running system -- will stop and start again"); LibStop(); StateInfo.owlib_state = lib_state_setup; } // now restart ArgCopy( argc, argv ) ; if (StateInfo.owlib_state == lib_state_setup) { return_code = setup_from_args( argc, argv ) ; } init_exit: LIB_WUNLOCK; LEVEL_DEBUG("OWLIB started"); return return_code; } void API_finish(void) { LEVEL_DEBUG("OWLIB being stopped"); if (StateInfo.owlib_state == lib_state_pre) { return; } LIB_WLOCK; LibStop(); StateInfo.owlib_state = lib_state_pre; LIB_WUNLOCK; } // called before read/write/dir operation -- tests setup state // pair with API_access_end int API_access_start(void) { if (StateInfo.owlib_state == lib_state_pre) { return -EACCES; } LIB_RLOCK; if (StateInfo.owlib_state != lib_state_started) { LIB_RUNLOCK; return -EACCES; } return 0; } // called after read/write/dir operation // pair with API_access_start void API_access_end(void) { LIB_RUNLOCK; } owfs-3.1p5/module/owlib/src/c/ow_avahi_announce.c0000644000175000001440000001677112654730021016772 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #if OW_AVAHI #include "ow.h" #include "ow_connection.h" #ifdef HAVE_SYS_SOCKET_H #include #endif /* HAVE_SYS_SOCKET_H */ #ifdef HAVE_NETINET_IN_H #include #endif /* HAVE_NETINET_IN_H */ #ifdef HAVE_ARPA_INET_H #include #endif /* HAVE_ARPA_INET_H */ static void entry_group_callback(AvahiEntryGroup *group, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void * v) ; static void create_services(struct connection_out * out) ; static void client_callback(AvahiClient *client, AvahiClientState state, AVAHI_GCC_UNUSED void * v) ; static void entry_group_callback(AvahiEntryGroup *group, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void * v) { struct connection_out * out = v ; out->group = group ; /* Called whenever the entry group state changes */ switch (state) { case AVAHI_ENTRY_GROUP_ESTABLISHED : /* The entry group has been established successfully */ break; case AVAHI_ENTRY_GROUP_COLLISION : // Shouldn't happen since we put the pid in the service name LEVEL_DEBUG("inexplicable service name collison"); avahi_threaded_poll_quit(out->poll); break; case AVAHI_ENTRY_GROUP_FAILURE : LEVEL_DEBUG("group failure: %s", avahi_strerror(avahi_client_errno(out->client))); avahi_threaded_poll_quit(out->poll); break; case AVAHI_ENTRY_GROUP_UNCOMMITED: case AVAHI_ENTRY_GROUP_REGISTERING: break ; } } static void create_services(struct connection_out * out) { /* If this is the first time we're called, let's create a new * entry group if necessary */ if (out->group==NULL) { out->group = avahi_entry_group_new(out->client, entry_group_callback, out) ; if ( out->group==NULL) { LEVEL_DEBUG("avahi_entry_group_new() failed: %s", avahi_strerror(avahi_client_errno(out->client))); avahi_threaded_poll_quit(out->poll); return ; } } /* If the group is empty (either because it was just created, or * because it was reset previously, add our entries. */ if (avahi_entry_group_is_empty(out->group)) { struct sockaddr sa; //socklen_t sl = sizeof(sa); socklen_t sl = 128; int ret1 = 0 ; int ret2 = 0 ; uint16_t port ; char * service_name ; char name[63] ; if (getsockname(out->file_descriptor, &sa, &sl)) { LEVEL_CONNECT("Could not get port number of device."); avahi_threaded_poll_quit(out->poll); return; } port = ntohs(((struct sockaddr_in *) (&sa))->sin_port) ; /* Add the service */ switch (Globals.program_type) { case program_type_httpd: service_name = (Globals.announce_name) ? Globals.announce_name : "OWFS (1-wire) Web" ; UCLIBCLOCK; snprintf(name,62,"%s <%d>",service_name,(int)port); UCLIBCUNLOCK; ret1 = avahi_entry_group_add_service( out->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name,"_http._tcp", NULL, NULL, port, NULL) ; ret2 = avahi_entry_group_add_service( out->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name,"_owhttpd._tcp", NULL, NULL, port, NULL) ; break ; case program_type_server: case program_type_external: service_name = (Globals.announce_name) ? Globals.announce_name : "OWFS (1-wire) Server" ; UCLIBCLOCK; snprintf(name,62,"%s <%d>",service_name,(int)port); UCLIBCUNLOCK; ret1 = avahi_entry_group_add_service( out->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name,"_owserver._tcp", NULL, NULL, port, NULL) ; break; case program_type_ftpd: service_name = (Globals.announce_name) ? Globals.announce_name : "OWFS (1-wire) FTP" ; UCLIBCLOCK; snprintf(name,62,"%s <%d>",service_name,(int)port); UCLIBCUNLOCK; ret1 = avahi_entry_group_add_service( out->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name,"_ftp._tcp", NULL, NULL, port, NULL) ; break; default: LEVEL_DEBUG("This program type doesn't support service announcement"); avahi_threaded_poll_quit(out->poll); return; } if ( ret1 < 0 || ret2 < 0 ) { LEVEL_DEBUG("Failed to add a service: %s or %s", avahi_strerror(ret1), avahi_strerror(ret2)); avahi_threaded_poll_quit(out->poll); return; } /* Tell the server to register the service */ ret1 = avahi_entry_group_commit(out->group) ; if ( ret1 < 0 ) { LEVEL_DEBUG("Failed to commit entry group: %s", avahi_strerror(ret1)); avahi_threaded_poll_quit(out->poll); return; } /* Record the service to prevent browsing to ourself */ SAFEFREE( out->zero.name ) ; out->zero.name = owstrdup(name) ; SAFEFREE( out->zero.type ) ; switch (Globals.program_type) { case program_type_httpd: out->zero.type = owstrdup("_owhttpd._tcp") ; break ; case program_type_server: out->zero.type = owstrdup("_owserver._tcp") ; break; case program_type_external: out->zero.type = owstrdup("_owexternal._tcp") ; break; case program_type_ftpd: out->zero.type = owstrdup("_ftp._tcp") ; break; default: break ; } SAFEFREE( out->zero.domain ) ; out->zero.domain = owstrdup(avahi_client_get_domain_name(out->client)) ; } } static void client_callback(AvahiClient *client, AvahiClientState state, AVAHI_GCC_UNUSED void * v) { struct connection_out * out = v ; if ( client==NULL ) { LEVEL_DEBUG("Avahi client is null") ; avahi_threaded_poll_quit(out->poll); return ; } //Set this link here so called routines can use it // (sets it earlier than return code does) out->client = client ; /* Called whenever the client or server state changes */ switch (state) { case AVAHI_CLIENT_S_RUNNING: /* The server has startup successfully and registered its host * name on the network, so it's time to create our services */ create_services(out); break; case AVAHI_CLIENT_FAILURE: LEVEL_DEBUG( "Avahi client failure: %s", avahi_strerror(avahi_client_errno(client))); avahi_threaded_poll_quit(out->poll); break; case AVAHI_CLIENT_S_COLLISION: /* Let's drop our registered services. When the server is back * in AVAHI_SERVER_RUNNING state we will register them * again with the new host name. */ case AVAHI_CLIENT_S_REGISTERING: /* The server records are now being established. This * might be caused by a host name change. We need to wait * for our own records to register until the host name is * properly esatblished. */ if (out->group != NULL) { avahi_entry_group_reset(out->group); } break; case AVAHI_CLIENT_CONNECTING: break ; } } // Now uses Avahi threads GOOD_OR_BAD OW_Avahi_Announce( struct connection_out *out ) { int error ; out->poll = avahi_threaded_poll_new() ; out->client = NULL ; out->group = NULL ; if ( out->poll == NULL ) { LEVEL_CONNECT("Could not create an Avahi object for service announcement"); return gbBAD ; } /* Allocate a new client */ LEVEL_DEBUG("Creating Avahi client"); out->client = avahi_client_new(avahi_threaded_poll_get(out->poll), 0, client_callback, (void *) out, &error); if (out->client == NULL) { LEVEL_CONNECT("Could not create an Avahi client for service announcement"); return gbBAD ; } /* Run the main loop */ LEVEL_DEBUG("Starting Avahi thread"); if ( avahi_threaded_poll_start(out->poll) < 0 ) { LEVEL_CONNECT("Could not start Avahi service discovery thread") ; } // done avahi_threaded_poll_free(out->poll); LEVEL_DEBUG("Freeing Avahi objects"); out->poll = NULL ; out->client = NULL ; out->group = NULL ; return gbBAD ; } #endif /* OW_AVAHI */ owfs-3.1p5/module/owlib/src/c/ow_avahi_browse.c0000644000175000001440000001646112654730021016461 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #if OW_AVAHI #ifdef HAVE_STDLIB_H #include "stdlib.h" // need this for NULL #endif /* HAVE_STDLIB_H */ #include "ow_connection.h" #ifdef HAVE_SYS_SOCKET_H #include #endif /* HAVE_SYS_SOCKET_H */ #ifdef HAVE_NETINET_IN_H #include #endif /* HAVE_NETINET_IN_H */ #ifdef HAVE_ARPA_INET_H #include #endif /* HAVE_ARPA_INET_H */ /* Prototypes */ static int AvahiBrowserNetName( const AvahiAddress *address, int port, struct connection_in * in ) ; static void resolve_callback( AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interface, AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event, const char * name, const char * type, const char *domain, const char * host_name, const AvahiAddress * a, uint16_t port, AvahiStringList * txt, AvahiLookupResultFlags flags, void* v) ; static void browse_callback( AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char * name, const char * type, const char *domain, AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* v) ; static void client_callback( AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * v) ; /* Code */ /* Resolve callback -- a new owserver was found and resolved, add it to the list */ static void resolve_callback( AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interface, AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event, const char * name, const char * type, const char *domain, const char * host_name, const AvahiAddress * address, uint16_t port, AvahiStringList * txt, AvahiLookupResultFlags flags, void* v) { struct connection_in * in = v; (void) host_name ; (void) txt ; (void) flags ; /* Called whenever a service has been resolved successfully or timed out */ switch (event) { case AVAHI_RESOLVER_FAILURE: LEVEL_DEBUG( "Failed to resolve service '%s' of type '%s' in domain '%s': %s", name, type, domain, avahi_strerror(avahi_client_errno(in->master.browse.client))); break; case AVAHI_RESOLVER_FOUND: LEVEL_DEBUG( "Service '%s' of type '%s' in domain '%s'", name, type, domain); if ( AvahiBrowserNetName( address, port, in ) ) { break ; } ZeroAdd( name, type, domain, in->master.browse.host, in->master.browse.service ) ; break ; } avahi_service_resolver_free(r); } static int AvahiBrowserNetName( const AvahiAddress *address, int port, struct connection_in * in ) { memset(in->master.browse.host,0,sizeof(in->master.browse.host)) ; memset(in->master.browse.service,0,sizeof(in->master.browse.service)) ; UCLIBCLOCK ; snprintf(in->master.browse.service, sizeof(in->master.browse.service),"%d",port) ; UCLIBCUNLOCK ; switch (address->proto) { case AVAHI_PROTO_INET: /**< IPv4 */ if ( inet_ntop( AF_INET, (const void *)&(address->data.ipv4), in->master.browse.host, sizeof(in->master.browse.host)) != NULL ) { LEVEL_DEBUG( "Address '%s' Port %d", in->master.browse.host, port); return 0 ; } break ; #if __HAS_IPV6__ case AVAHI_PROTO_INET6: /**< IPv6 */ if ( inet_ntop( AF_INET6, (const void *)&(address->data.ipv6), in->master.browse.host, sizeof(in->master.browse.host)) != NULL ) { LEVEL_DEBUG( "Address '%s' Port %d", in->master.browse.avahi_host, port); return 0 ; } break ; #endif /* __HAS_IPV6__ */ default: strncpy(in->master.browse.host,"Unknown address",sizeof(in->master.browse.host)) ; LEVEL_DEBUG( "Unknown internet protocol"); break ; } return 1 ; } static void browse_callback( AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char * name, const char * type, const char *domain, AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* v) { struct connection_in * in = v; in->master.browse.browser = b ; /* Called whenever a new services becomes available on the LAN or is removed from the LAN */ switch (event) { case AVAHI_BROWSER_FAILURE: LEVEL_DEBUG( "%s", avahi_strerror(avahi_client_errno(in->master.browse.client))); avahi_threaded_poll_quit(in->master.browse.poll); break; case AVAHI_BROWSER_NEW: LEVEL_DEBUG( "NEW: service '%s' of type '%s' in domain '%s' protocol %d", name, type, domain, (int) protocol); /* We ignore the returned resolver object. In the callback function we free it. If the server is terminated before the callback function is called the server will free the resolver for us. */ if (!(avahi_service_resolver_new(in->master.browse.client, interface, protocol, name, type, domain, AVAHI_PROTO_UNSPEC, 0, resolve_callback, (void *) in))) { LEVEL_DEBUG( "Failed to resolve service '%s': %s", name, avahi_strerror(avahi_client_errno(in->master.browse.client))); } break; case AVAHI_BROWSER_REMOVE: LEVEL_DEBUG( "REMOVE: service '%s' of type '%s' in domain '%s'", name, type, domain); ZeroDel(name, type, domain ) ; break; case AVAHI_BROWSER_ALL_FOR_NOW: LEVEL_DEBUG( "ALL_FOR_NOW" ); break; case AVAHI_BROWSER_CACHE_EXHAUSTED: LEVEL_DEBUG( "CACHE_EXHAUSTED" ); break; } } static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * v) { struct connection_in * in = v; in->master.browse.client = c ; /* Called whenever the client or server state changes */ if (state == AVAHI_CLIENT_FAILURE) { LEVEL_DEBUG( "Server connection failure: %s", avahi_strerror(avahi_client_errno(c))); avahi_threaded_poll_quit(in->master.browse.poll); } } GOOD_OR_BAD OW_Avahi_Browse( struct connection_in * in) { int error ; in->master.browse.poll = avahi_threaded_poll_new() ; in->master.browse.browser = NULL ; in->master.browse.client = NULL ; if ( in->master.browse.poll == NULL ) { LEVEL_CONNECT("Could not create an Avahi object for service browsing"); return gbBAD ; } /* Allocate a new client */ LEVEL_DEBUG("Creating Avahi client"); in->master.browse.client = avahi_client_new(avahi_threaded_poll_get(in->master.browse.poll), 0, client_callback, (void *) in, &error); if (in->master.browse.client == NULL) { LEVEL_CONNECT("Could not create an Avahi client for service browsing"); return gbBAD ; } /* Allocate a new browser */ LEVEL_DEBUG("Creating Avahi browser"); in->master.browse.browser = avahi_service_browser_new(in->master.browse.client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_owserver._tcp", NULL, 0, browse_callback, (void *) in); if (in->master.browse.browser == NULL) { LEVEL_CONNECT("Could not create an Avahi browser for service browsing"); return gbBAD ; } /* Run the main loop */ LEVEL_DEBUG("Starting Avahi thread"); if ( avahi_threaded_poll_start(in->master.browse.poll) < 0 ) { LEVEL_CONNECT("Could not start Avahi service discovery thread") ; } // done /* Free the browser object */ avahi_service_browser_free(in->master.browse.browser); in->master.browse.browser = NULL ; avahi_threaded_poll_free(in->master.browse.poll); LEVEL_DEBUG("Freeing Avahi objects"); in->master.browse.poll = NULL ; in->master.browse.browser = NULL ; in->master.browse.client = NULL ; return gbBAD ; } #endif /* OW_AVAHI */ owfs-3.1p5/module/owlib/src/c/ow_badadapter.c0000644000175000001440000000451112654730021016070 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" /* All the rest of the program sees is the BadAdapter_detect and the entry in iroutines */ static RESET_TYPE BadAdapter_reset(const struct parsedname *pn); static GOOD_OR_BAD BadAdapter_sendback_bits(const BYTE * data, BYTE * resp, size_t len, const struct parsedname *pn); static void BadAdapter_close(struct connection_in *in); /* Device-specific functions */ /* Note, the "Bad"adapter" ha not function, and returns "-ENOTSUP" (not supported) for most functions */ /* It does call lower level functions for higher ones, which of course is pointless since the lower ones don't work either */ GOOD_OR_BAD BadAdapter_detect(struct port_in *pin) { struct connection_in * in = pin->first ; pin->type = ct_none ; pin->file_descriptor = FILE_DESCRIPTOR_BAD ; in->Adapter = adapter_Bad; /* OWFS assigned value */ in->iroutines.reset = BadAdapter_reset; in->iroutines.next_both = NO_NEXT_BOTH_ROUTINE; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = NO_SENDBACKDATA_ROUTINE; in->iroutines.sendback_bits = BadAdapter_sendback_bits; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = BadAdapter_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_sham; in->adapter_name = "Bad Adapter"; SAFEFREE( DEVICENAME(in) ) ; DEVICENAME(in) = owstrdup("None") ; pin->busmode = bus_bad ; return gbGOOD; } static RESET_TYPE BadAdapter_reset(const struct parsedname *pn) { (void) pn; return BUS_RESET_ERROR; } static GOOD_OR_BAD BadAdapter_sendback_bits(const BYTE * data, BYTE * resp, size_t len, const struct parsedname *pn) { (void) pn; (void) data; (void) resp; (void) len; return gbBAD; } static void BadAdapter_close(struct connection_in *in) { (void) in; } owfs-3.1p5/module/owlib/src/c/ow_bae.c0000644000175000001440000024255012711737666014557 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Pascal Baerten's BAE 910 device -- functional */ /* Pascal Baerten's BAE 911 device -- preliminary */ #include #include "owfs_config.h" #include "ow_bae.h" /* ------- Prototypes ----------- */ /* BAE */ READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); //READ_FUNCTION(FS_r_flash); WRITE_FUNCTION(FS_w_flash); WRITE_FUNCTION(FS_w_extended); //WRITE_FUNCTION(FS_writebyte); WRITE_FUNCTION(FS_w_iic); WRITE_FUNCTION(FS_r_iic); WRITE_FUNCTION(FS_w_seq_text); WRITE_FUNCTION(FS_w_sector_nr); READ_FUNCTION(FS_r_sector_nr); WRITE_FUNCTION(FS_w_sector_data); READ_FUNCTION(FS_r_sector_data); READ_FUNCTION(FS_version_state) ; READ_FUNCTION(FS_version) ; READ_FUNCTION(FS_version_device) ; READ_FUNCTION(FS_version_bootstrap) ; READ_FUNCTION(FS_type_state) ; READ_FUNCTION(FS_localtype) ; READ_FUNCTION(FS_type_device) ; READ_FUNCTION(FS_type_chip) ; WRITE_FUNCTION(FS_eeprom_erase); READ_FUNCTION(FS_eeprom_r_page); WRITE_FUNCTION(FS_eeprom_w_page); READ_FUNCTION(FS_eeprom_r_mem); WRITE_FUNCTION(FS_eeprom_w_mem); READ_FUNCTION(FS_r_8_ext) ; WRITE_FUNCTION(FS_w_8_ext) ; READ_FUNCTION(FS_r_8) ; WRITE_FUNCTION(FS_w_8) ; READ_FUNCTION(FS_r_16) ; WRITE_FUNCTION(FS_w_16) ; READ_FUNCTION(FS_r_32) ; WRITE_FUNCTION(FS_w_32) ; /* ------- Structures ----------- */ /* common values to all FC chips */ #define _FC_EEPROM_PAGE_SIZE 512 #define _FC_SDCARD_SECTOR_SIZE 512 #define _FC_MAX_EEPROM_PAGES 32 #define _FC_EEPROM_OFFSET 0x0000 //changed adressing scheme, valid from 0911 models #define _FC_MAX_FLASH_SIZE 0x4000 #define _FC_MAX_INTERLEAVE 255 #define _FC02_MEMORY_SIZE 128 #define _FC02_EEPROM_OFFSET 0xE000 #define _FC02_EEPROM_PAGES 2 #define _FC03_EEPROM_PAGES 8 #define _FC02_MAX_WRITE_GULP 32 #define _FC02_MAX_READ_GULP 32 #define _FC02_MAX_COMMAND_GULP 255 /* BAE registers -- memory mapped */ #define _FC02_ADC 50 /* u8 */ #define _FC02_ADC10 62 /* u16 */ #define _FC02_ADCAN 24 /* u16 */ #define _FC02_ADCAP 22 /* u16 */ #define _FC02_ADCC 2 /* u8 */ #define _FC02_ADCTOTN 36 /* u32 */ #define _FC02_ADCTOTP 32 /* u32 */ #define _FC02_ALAN 66 /* u16 */ #define _FC02_ALAP 64 /* u16 */ #define _FC02_ALARM 52 /* u8 */ #define _FC02_ALARMC 6 /* u8 */ #define _FC02_ALCPS 68 /* u16 */ #define _FC02_ALCT 70 /* u32 */ #define _FC02_ALRT 74 /* u32 */ #define _FC02_CNT 51 /* u8 */ #define _FC02_CNTC 3 /* u8 */ #define _FC02_COUNT 44 /* u32 */ #define _FC02_CPS 30 /* u16 */ #define _FC02_DUTY1 14 /* u16 */ #define _FC02_DUTY2 16 /* u16 */ #define _FC02_DUTY3 18 /* u16 */ #define _FC02_DUTY4 20 /* u16 */ #define _FC02_MAXAN 28 /* u16 */ #define _FC02_MAXAP 26 /* u16 */ #define _FC02_MAXCPS 94 /* u16 */ #define _FC02_OUT 48 /* u8 */ #define _FC02_OUTC 4 /* u8 */ #define _FC02_OVRUNCNT 92 /* u16 */ #define _FC02_PC0 54 /* u16 */ #define _FC02_PC1 56 /* u16 */ #define _FC02_PC2 58 /* u16 */ #define _FC02_PC3 60 /* u16 */ #define _FC02_PERIOD1 10 /* u16 */ #define _FC02_PERIOD2 12 /* u16 */ #define _FC02_PIO 49 /* u8 */ #define _FC02_PIOC 5 /* u8 */ #define _FC02_RESETCNT 86 /* u16 */ #define _FC02_RTC 40 /* u32 */ #define _FC02_RTCC 7 /* u8 */ #define _FC02_SELECTCNT 88 /* u16 */ #define _FC02_STALLEDCNT 90 /* u16 */ #define _FC02_TPM1C 8 /* u8 */ #define _FC02_TPM2C 9 /* u8 */ #define _FC02_USERA 96 /* u8 */ #define _FC02_USERB 97 /* u8 */ #define _FC02_USERC 98 /* u8 */ #define _FC02_USERD 99 /* u8 */ #define _FC02_USERE 100 /* u8 */ #define _FC02_USERF 101 /* u8 */ #define _FC02_USERG 102 /* u8 */ #define _FC02_USERH 103 /* u8 */ #define _FC02_USERI 104 /* u16 */ #define _FC02_USERJ 106 /* u16 */ #define _FC02_USERK 108 /* u16 */ #define _FC02_USERL 110 /* u16 */ #define _FC02_USERM 112 /* u32 */ #define _FC02_USERN 116 /* u32 */ #define _FC02_USERO 120 /* u32 */ #define _FC02_USERP 124 /* u32 */ #define _FC03_IICC 0x7E00 /* u8 */ #define _FC03_LCDC 0x7E01 /* u8 */ #define _FC03_SDC 0x7E04 /* u8 */ #define _FC03_SPIC 0x7E05 /* u16 */ #define _FC03_PC0 0x7E07 /* u16 */ #define _FC03_CLATCH 0x7E09 /* u8 */ #define _FC03_SCIC 0x7E0A /* u8 */ #define _FC03_PAGECRC 0x7E0B /* u16 */ #define _FC03_SEQW_LCDD 0x00 #define _FC03_SEQW_SD 0x02 #define _FC03_SEQW_IIC 0x03 #define _FC03_SEQW_SCI 0x04 #define _FC03_SEQR_SD 0x00 #define _FC03_SEQR_IIC 0x01 #define _FC03_SEQR_SCI 0x02 #define _FC03_WR_BEGIN_IIC 0x00 #define _FC03_WR_END_IIC 0x01 #define _FC03_WR_BEGIN_SD_W 0x02 #define _FC03_WR_END_SD_W 0x03 #define _FC03_WR_BEGIN_SD_R 0x04 #define _FC03_WR_END_SD_R 0x05 #define _FC03_ADC0 0x7F00 /* u16 */ #define _FC03_ADC1 0x7F02 /* u16 */ #define _FC03_ADC2 0x7F04 /* u16 */ #define _FC03_ADC3 0x7F06 /* u16 */ #define _FC03_ADC4 0x7F08 /* u16 */ #define _FC03_ADC5 0x7F0A /* u16 */ #define _FC03_ADC6 0x7F0C /* u16 */ #define _FC03_ADC7 0x7F0E /* u16 */ #define _FC03_ADC8 0x7F10 /* u16 */ #define _FC03_ADC9 0x7F12 /* u16 */ #define _FC03_ADC10 0x7F14 /* u16 */ #define _FC03_ADC11 0x7F16 /* u16 */ #define _FC03_ADC12 0x7F18 /* u16 */ #define _FC03_ADC13 0x7F1A /* u16 */ #define _FC03_ADC14 0x7F1C /* u16 */ #define _FC03_ADC15 0x7F1E /* u16 */ #define _FC03_COUNT0 0x7F20 /* u32 */ #define _FC03_COUNT1 0x7F24 /* u32 */ #define _FC03_COUNT2 0x7F28 /* u32 */ #define _FC03_COUNT3 0x7F2C /* u32 */ #define _FC03_COUNT4 0x7F30 /* u32 */ #define _FC03_COUNT5 0x7F34 /* u32 */ #define _FC03_COUNT6 0x7F38 /* u32 */ #define _FC03_COUNT7 0x7F3C /* u32 */ #define _FC03_COUNT8 0x7F40 /* u32 */ #define _FC03_COUNT9 0x7F44 /* u32 */ #define _FC03_COUNT10 0x7F48 /* u32 */ #define _FC03_COUNT11 0x7F4C /* u32 */ #define _FC03_COUNT12 0x7F50 /* u32 */ #define _FC03_COUNT13 0x7F54 /* u32 */ #define _FC03_COUNT14 0x7F58 /* u32 */ #define _FC03_COUNT15 0x7F5C /* u32 */ #define _FC03_COUNT16 0x7F60 /* u32 */ #define _FC03_COUNT17 0x7F64 /* u32 */ #define _FC03_COUNT18 0x7F68 /* u32 */ #define _FC03_COUNT19 0x7F6C /* u32 */ #define _FC03_COUNT20 0x7F70 /* u32 */ #define _FC03_COUNT21 0x7F74 /* u32 */ #define _FC03_EALARMC 0x7F78 /* u8 */ #define _FC03_OWIDLETIME 0x7F79 /* u8 */ #define _FC03_RTCH 0x7F7A /* u32 */ #define _FC03_RTCL 0x7F7E /* u8 */ #define _FC03_TIMER1 0x7F7F /* u16 */ #define _FC03_TIMER2 0x7F81 /* u16 */ #define _FC03_UALARM 0x7F83 /* u32 */ #define _FC03_UALARM_EN 0x7F87 /* u32 */ #define _FC03_USER_ARRAY 0x7F8B /* u256 */ #define _FC03_USER_BYTES 0x7FAB /* u128 */ #define _FC03_USER_WORDS 0x7FBB /* u256 */ #define _FC03_USER_DW 0x7FDB /* u256 */ #define _FC03_WATCHDOG1W 0x7FFB /* u8 */ #define _FC03_PIO0 0x7900 /* u8 */ #define _FC03_PIO1 0x7901 /* u8 */ #define _FC03_PIO2 0x7902 /* u8 */ #define _FC03_PIO3 0x7903 /* u8 */ #define _FC03_PIO4 0x7904 /* u8 */ #define _FC03_PIO5 0x7905 /* u8 */ #define _FC03_PIO6 0x7906 /* u8 */ #define _FC03_PIO7 0x7907 /* u8 */ #define _FC03_PIO8 0x7908 /* u8 */ #define _FC03_PIO9 0x7909 /* u8 */ #define _FC03_PIO10 0x790A /* u8 */ #define _FC03_PIO11 0x790B /* u8 */ #define _FC03_PIO12 0x790C /* u8 */ #define _FC03_PIO13 0x790D /* u8 */ #define _FC03_PIO14 0x790E /* u8 */ #define _FC03_PIO15 0x790F /* u8 */ #define _FC03_PIO16 0x7910 /* u8 */ #define _FC03_PIO17 0x7911 /* u8 */ #define _FC03_PIO18 0x7912 /* u8 */ #define _FC03_PIO19 0x7913 /* u8 */ #define _FC03_PIO20 0x7914 /* u8 */ #define _FC03_PIO21 0x7915 /* u8 */ #define _FC03_PIODIR0 0x7916 /* u8 */ #define _FC03_PIODIR1 0x7917 /* u8 */ #define _FC03_PIODIR2 0x7918 /* u8 */ #define _FC03_PIODIR3 0x7919 /* u8 */ #define _FC03_PIODIR4 0x791A /* u8 */ #define _FC03_PIODIR5 0x791B /* u8 */ #define _FC03_PIODIR6 0x791C /* u8 */ #define _FC03_PIODIR7 0x791D /* u8 */ #define _FC03_PIODIR8 0x791E /* u8 */ #define _FC03_PIODIR9 0x791F /* u8 */ #define _FC03_PIODIR10 0x7920 /* u8 */ #define _FC03_PIODIR11 0x7921 /* u8 */ #define _FC03_PIODIR12 0x7922 /* u8 */ #define _FC03_PIODIR13 0x7923 /* u8 */ #define _FC03_PIODIR14 0x7924 /* u8 */ #define _FC03_PIODIR15 0x7925 /* u8 */ #define _FC03_PIODIR16 0x7926 /* u8 */ #define _FC03_PIODIR17 0x7927 /* u8 */ #define _FC03_PIODIR18 0x7928 /* u8 */ #define _FC03_PIODIR19 0x7929 /* u8 */ #define _FC03_PIODIR20 0x792A /* u8 */ #define _FC03_PIODIR21 0x792B /* u8 */ #define _FC03_PIODS0 0x792C /* u8 */ #define _FC03_PIODS1 0x792D /* u8 */ #define _FC03_PIODS2 0x792E /* u8 */ #define _FC03_PIODS3 0x792F /* u8 */ #define _FC03_PIODS4 0x7930 /* u8 */ #define _FC03_PIODS5 0x7931 /* u8 */ #define _FC03_PIODS6 0x7932 /* u8 */ #define _FC03_PIODS7 0x7933 /* u8 */ #define _FC03_PIODS8 0x7934 /* u8 */ #define _FC03_PIODS9 0x7935 /* u8 */ #define _FC03_PIODS10 0x7936 /* u8 */ #define _FC03_PIODS11 0x7937 /* u8 */ #define _FC03_PIODS12 0x7938 /* u8 */ #define _FC03_PIODS13 0x7939 /* u8 */ #define _FC03_PIODS14 0x793A /* u8 */ #define _FC03_PIODS15 0x793B /* u8 */ #define _FC03_PIODS16 0x793C /* u8 */ #define _FC03_PIODS17 0x793D /* u8 */ #define _FC03_PIODS18 0x793E /* u8 */ #define _FC03_PIODS19 0x793F /* u8 */ #define _FC03_PIODS20 0x7940 /* u8 */ #define _FC03_PIODS21 0x7941 /* u8 */ #define _FC03_PIOPE0 0x7942 /* u8 */ #define _FC03_PIOPE1 0x7943 /* u8 */ #define _FC03_PIOPE2 0x7944 /* u8 */ #define _FC03_PIOPE3 0x7945 /* u8 */ #define _FC03_PIOPE4 0x7946 /* u8 */ #define _FC03_PIOPE5 0x7947 /* u8 */ #define _FC03_PIOPE6 0x7948 /* u8 */ #define _FC03_PIOPE7 0x7949 /* u8 */ #define _FC03_PIOPE8 0x794A /* u8 */ #define _FC03_PIOPE9 0x794B /* u8 */ #define _FC03_PIOPE10 0x794C /* u8 */ #define _FC03_PIOPE11 0x794D /* u8 */ #define _FC03_PIOPE12 0x794E /* u8 */ #define _FC03_PIOPE13 0x794F /* u8 */ #define _FC03_PIOPE14 0x7950 /* u8 */ #define _FC03_PIOPE15 0x7951 /* u8 */ #define _FC03_PIOPE16 0x7952 /* u8 */ #define _FC03_PIOPE17 0x7953 /* u8 */ #define _FC03_PIOPE18 0x7954 /* u8 */ #define _FC03_PIOPE19 0x7955 /* u8 */ #define _FC03_PIOPE20 0x7956 /* u8 */ #define _FC03_PIOPE21 0x7957 /* u8 */ #define _FC03_LATCH0 0x7958 /* u8 */ #define _FC03_LATCH1 0x7959 /* u8 */ #define _FC03_LATCH2 0x795A /* u8 */ #define _FC03_LATCH3 0x795B /* u8 */ #define _FC03_LATCH4 0x795C /* u8 */ #define _FC03_LATCH5 0x795D /* u8 */ #define _FC03_LATCH6 0x795E /* u8 */ #define _FC03_LATCH7 0x795F /* u8 */ #define _FC03_LATCH8 0x7960 /* u8 */ #define _FC03_LATCH9 0x7961 /* u8 */ #define _FC03_LATCH10 0x7962 /* u8 */ #define _FC03_LATCH11 0x7963 /* u8 */ #define _FC03_LATCH12 0x7964 /* u8 */ #define _FC03_LATCH13 0x7965 /* u8 */ #define _FC03_LATCH14 0x7966 /* u8 */ #define _FC03_LATCH15 0x7967 /* u8 */ #define _FC03_LATCH16 0x7968 /* u8 */ #define _FC03_LATCH17 0x7969 /* u8 */ #define _FC03_LATCH18 0x796A /* u8 */ #define _FC03_LATCH19 0x796B /* u8 */ #define _FC03_LATCH20 0x796C /* u8 */ #define _FC03_LATCH21 0x796D /* u8 */ #define _FC03_ECOUNT0 0x796E /* u8 */ #define _FC03_ECOUNT1 0x796F /* u8 */ #define _FC03_ECOUNT2 0x7970 /* u8 */ #define _FC03_ECOUNT3 0x7971 /* u8 */ #define _FC03_ECOUNT4 0x7972 /* u8 */ #define _FC03_ECOUNT5 0x7973 /* u8 */ #define _FC03_ECOUNT6 0x7974 /* u8 */ #define _FC03_ECOUNT7 0x7975 /* u8 */ #define _FC03_ECOUNT8 0x7976 /* u8 */ #define _FC03_ECOUNT9 0x7977 /* u8 */ #define _FC03_ECOUNT10 0x7978 /* u8 */ #define _FC03_ECOUNT11 0x7979 /* u8 */ #define _FC03_ECOUNT12 0x797A /* u8 */ #define _FC03_ECOUNT13 0x797B /* u8 */ #define _FC03_ECOUNT14 0x797C /* u8 */ #define _FC03_ECOUNT15 0x797D /* u8 */ #define _FC03_ECOUNT16 0x797E /* u8 */ #define _FC03_ECOUNT17 0x797F /* u8 */ #define _FC03_ECOUNT18 0x7980 /* u8 */ #define _FC03_ECOUNT19 0x7981 /* u8 */ #define _FC03_ECOUNT20 0x7982 /* u8 */ #define _FC03_ECOUNT21 0x7983 /* u8 */ #define _FC03_ALARM0 0x7984 /* u8 */ #define _FC03_ALARM1 0x7985 /* u8 */ #define _FC03_ALARM2 0x7986 /* u8 */ #define _FC03_ALARM3 0x7987 /* u8 */ #define _FC03_ALARM4 0x7988 /* u8 */ #define _FC03_ALARM5 0x7989 /* u8 */ #define _FC03_ALARM6 0x798A /* u8 */ #define _FC03_ALARM7 0x798B /* u8 */ #define _FC03_ALARM8 0x798C /* u8 */ #define _FC03_ALARM9 0x798D /* u8 */ #define _FC03_ALARM10 0x798E /* u8 */ #define _FC03_ALARM11 0x798F /* u8 */ #define _FC03_ALARM12 0x7990 /* u8 */ #define _FC03_ALARM13 0x7991 /* u8 */ #define _FC03_ALARM14 0x7992 /* u8 */ #define _FC03_ALARM15 0x7993 /* u8 */ #define _FC03_ALARM16 0x7994 /* u8 */ #define _FC03_ALARM17 0x7995 /* u8 */ #define _FC03_ALARM18 0x7996 /* u8 */ #define _FC03_ALARM19 0x7997 /* u8 */ #define _FC03_ALARM20 0x7998 /* u8 */ #define _FC03_ALARM21 0x7999 /* u8 */ #define _FC03_EENCODER0 0x799A /* u8 */ #define _FC03_EENCODER5 0x799B /* u8 */ #define _FC03_EENCODER8 0x799C /* u8 */ #define _FC03_EENCODER9 0x799D /* u8 */ #define _FC03_EENCODER16 0x799E /* u8 */ #define _FC03_EENCODER17 0x799F /* u8 */ #define _FC03_PULLDOWN0 0x79A0 /* u8 */ #define _FC03_PULLDOWN1 0x79A1 /* u8 */ #define _FC03_PULLDOWN2 0x79A2 /* u8 */ #define _FC03_PULLDOWN3 0x79A3 /* u8 */ #define _FC03_PULLDOWN4 0x79A4 /* u8 */ #define _FC03_PULLDOWN5 0x79A5 /* u8 */ #define _FC03_PULLDOWN6 0x79A6 /* u8 */ #define _FC03_PULLDOWN7 0x79A7 /* u8 */ #define _FC03_CAPFLAG1 0x79A8 /* u8 */ #define _FC03_CAPFLAG2 0x79A9 /* u8 */ #define _FC03_CAPFLAG3 0x79AA /* u8 */ #define _FC03_CAPFLAG4 0x79AB /* u8 */ #define _FC03_ACMPE 0x79AC /* u8 */ #define _FC03_ACMPIS 0x79AD /* u8 */ #define _FC03_ACMPLATCH 0x79AE /* u8 */ #define _FC03_ACMPO 0x79AF /* u8 */ #define _FC03_ACMPOE 0x79B0 /* u8 */ #define _FC03_ADCEN 0x79B1 /* u8 */ #define _FC03_TPM1C 0x7A00 /* u8 */ #define _FC03_TPM2C 0x7A01 /* u8 */ #define _FC03_TPM1C 0x7A00 /* u8 */ #define _FC03_TPM2C 0x7A01 /* u8 */ #define _FC03_PERIOD1 0x7A02 /* u16 */ #define _FC03_PERIOD2 0x7A04 /* u16 */ #define _FC03_DUTY1C0 0x7A06 /* u16 */ #define _FC03_DUTY1C1 0x7A08 /* u16 */ #define _FC03_DUTY2C0 0x7A0A /* u16 */ #define _FC03_DUTY2C1 0x7A0C /* u16 */ #define _FC03_C1CH0 0x7A0E /* u8 */ #define _FC03_C1CH1 0x7A0F /* u8 */ #define _FC03_C2CH0 0x7A10 /* u8 */ #define _FC03_C2CH1 0x7A11 /* u8 */ #define _FC03_NBYTES 0x7A12 /* u8 */ #define _FC03_BAUDDIV 0x7A13 /* u16 */ #define _FC03_PORFLAG 0x7A29 /* u8 */ #define _FC03_GLOBAL_MEM 0x7C00 /* u8[64]*/ /* Placeholder for special vsibility code for firmware types "personalities" */ static enum e_visibility VISIBLE_eeprom_pages( const struct parsedname * pn ) ; #if 0 /* eeprom bytes only for testing */ static enum e_visibility VISIBLE_eeprom_bytes( const struct parsedname * pn ) ; #endif /* eeprom bytes only for testing */ static enum e_visibility VISIBLE_generic( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_910( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_911( const struct parsedname * pn ) ; static struct aggregate ABAEeeprom = { _FC_MAX_EEPROM_PAGES, ag_numbers, ag_separate, }; static struct aggregate A911pio = { 22, ag_numbers, ag_separate, }; static struct aggregate A911piodd = { 22, ag_numbers, ag_separate, }; static struct aggregate A911piods = { 22, ag_numbers, ag_separate, }; static struct aggregate A911piope = { 22, ag_numbers, ag_separate, }; static struct aggregate A911piopd = { 8, ag_numbers, ag_separate, }; static struct aggregate A911latch = { 22, ag_numbers, ag_separate, }; static struct aggregate A911elatch = { 22, ag_numbers, ag_separate, }; static struct aggregate A911counter = { 18, ag_numbers, ag_separate, }; static struct aggregate A911ecount = { 18, ag_numbers, ag_separate, }; static struct aggregate A911adc = { 16, ag_numbers, ag_separate, }; static struct aggregate A911userb = { 16, ag_numbers, ag_separate, }; static struct aggregate A911userw = { 16, ag_numbers, ag_separate, }; static struct aggregate A911userdw = { 8, ag_numbers, ag_separate, }; static struct aggregate A911userarray = { 32, ag_numbers, ag_separate, }; static struct aggregate A911globalmem = { 64, ag_numbers, ag_separate, }; static struct aggregate A911globalmemory = { 0, ag_numbers, ag_sparse, }; static struct filetype BAE[] = { F_STANDARD, {"command", _FC02_MAX_COMMAND_GULP, NON_AGGREGATE, ft_binary, fc_stable, NO_READ_FUNCTION, FS_w_extended, VISIBLE, NO_FILETYPE_DATA, }, //{"writebyte", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, NO_READ_FUNCTION, FS_writebyte, VISIBLE, NO_FILETYPE_DATA, }, {"versionstate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_version_state, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"version", 5, NON_AGGREGATE, ft_ascii, fc_link, FS_version, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"device_version", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_version_device, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"bootstrap_version", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_version_bootstrap, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"typestate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_type_state, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"localtype", 5, NON_AGGREGATE, ft_ascii, fc_link, FS_localtype, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"device_type", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_type_device, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"chip_type", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_type_chip, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"firmware", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"firmware/function", _FC_MAX_FLASH_SIZE, NON_AGGREGATE, ft_binary, fc_stable, NO_READ_FUNCTION, FS_w_flash, VISIBLE, NO_FILETYPE_DATA, }, {"eeprom", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, // {"eeprom/memory",_FC_EEPROM_PAGE_SIZE*_FC_MAX_EEPROM_PAGES, NON_AGGREGATE, ft_binary, fc_link, FS_eeprom_r_mem, FS_eeprom_w_mem, VISIBLE_eeprom_bytes, NO_FILETYPE_DATA, }, {"eeprom/page",_FC_EEPROM_PAGE_SIZE, &ABAEeeprom, ft_binary, fc_page, FS_eeprom_r_page, FS_eeprom_w_page, VISIBLE_eeprom_pages, NO_FILETYPE_DATA, }, {"eeprom/erase", PROPERTY_LENGTH_YESNO, &ABAEeeprom, ft_yesno, fc_link, NO_READ_FUNCTION, FS_eeprom_erase, VISIBLE_eeprom_pages, NO_FILETYPE_DATA, }, {"eeprom/pagecrc", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {u:_FC03_PAGECRC,}, }, {"generic", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_generic, NO_FILETYPE_DATA, }, {"generic/memory", _FC02_MEMORY_SIZE, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE_generic, NO_FILETYPE_DATA, }, {"910", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_910, NO_FILETYPE_DATA, }, {"910/adcc", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_ADCC,}, }, {"910/cntc", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_CNTC,}, }, {"910/outc", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_OUTC,}, }, {"910/pioc", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_PIOC,}, }, {"910/alarmc", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_ALARMC,}, }, {"910/rtcc", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_RTCC,}, }, {"910/tpm1c", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_TPM1C,}, }, {"910/tpm2c", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_TPM2C,}, }, {"910/period1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_PERIOD1,}, }, {"910/period2", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_PERIOD2,}, }, {"910/duty1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_DUTY1,}, }, {"910/duty2", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_DUTY2,}, }, {"910/duty3", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_DUTY3,}, }, {"910/duty4", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_DUTY4,}, }, {"910/alap", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_ALAP,}, }, {"910/alan", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_ALAN,}, }, {"910/cps", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, NO_WRITE_FUNCTION, VISIBLE_910, {.u=_FC02_CPS,}, }, {"910/alcps", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_ALCPS,}, }, {"910/alct", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_32, FS_w_32, VISIBLE_910, {.u=_FC02_ALCT,}, }, {"910/adcap", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, VISIBLE_910, {.u=_FC02_ADCAP,}, }, {"910/adcan", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, VISIBLE_910, {.u=_FC02_ADCAN,}, }, {"910/maxap", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_MAXAP,}, }, {"910/maxan", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_MAXAN,}, }, {"910/maxcps", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_MAXCPS,}, }, {"910/adctotp", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_910, {.u=_FC02_ADCTOTP,}, }, {"910/adctotn", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_910, {.u=_FC02_ADCTOTN,}, }, {"910/udate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, FS_w_32, VISIBLE_910, {.u=_FC02_RTC,}, }, {"910/date", PROPERTY_LENGTH_DATE, NON_AGGREGATE, ft_date, fc_link, COMMON_r_date, COMMON_w_date, VISIBLE_910, {.a="910/udate"}, }, {"910/count", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_910, {.u=_FC02_COUNT,}, }, {"910/out", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_OUT,}, }, {"910/pio", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_PIO,}, }, {"910/adc", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, NO_WRITE_FUNCTION, VISIBLE_910, {.u=_FC02_ADC,}, }, {"910/adc10", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, VISIBLE_910, {.u=_FC02_ADC10,}, }, {"910/cnt", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, NO_WRITE_FUNCTION, VISIBLE_910, {.u=_FC02_CNT,}, }, {"910/alarm", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_ALARM,}, }, {"910/ovruncnt", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_OVRUNCNT,}, }, {"910/resetcnt", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_RESETCNT,}, }, {"910/selectcnt", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_SELECTCNT,}, }, {"910/stalledcnt", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_STALLEDCNT,}, }, {"910/usera", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_USERA,}, }, {"910/userb", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_USERB,}, }, {"910/userc", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_USERC,}, }, {"910/userd", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_USERD,}, }, {"910/usere", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_USERE,}, }, {"910/userf", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_USERF,}, }, {"910/userg", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_USERG,}, }, {"910/userh", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_910, {.u=_FC02_USERH,}, }, {"910/useri", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_USERI,}, }, {"910/userj", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_USERJ,}, }, {"910/userk", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_USERK,}, }, {"910/userl", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_USERL,}, }, {"910/userm", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_910, {.u=_FC02_USERM,}, }, {"910/usern", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_910, {.u=_FC02_USERN,}, }, {"910/usero", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_910, {.u=_FC02_USERO,}, }, {"910/userp", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_910, {.u=_FC02_USERP,}, }, {"910/pc0", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_PC0,}, }, {"910/pc1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_PC1,}, }, {"910/pc2", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_PC2,}, }, {"910/pc3", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_910, {.u=_FC02_PC3,}, }, {"911", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/system", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/system/poweronflags", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, NO_WRITE_FUNCTION, VISIBLE_911, {u:_FC03_PORFLAG,}, }, {"911/system/watchdog1w", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_read_stable, FS_r_8, FS_w_8, VISIBLE_911, {u:_FC03_WATCHDOG1W,}, }, {"911/system/owidletime", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {u:_FC03_OWIDLETIME,}, }, {"911/automation_engine", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/automation_engine/pc0", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_PC0,}, }, {"911/automation_engine/global_mem", PROPERTY_LENGTH_UNSIGNED, &A911globalmem, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_GLOBAL_MEM,}, }, {"911/automation_engine/global_memory", PROPERTY_LENGTH_UNSIGNED, &A911globalmemory, ft_unsigned, fc_volatile, FS_r_8_ext, FS_w_8_ext, VISIBLE_911, {.v=(int[2]){_FC03_GLOBAL_MEM, 64,},}, }, {"911/pio", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA,}, {"911/pio/pio", PROPERTY_LENGTH_YESNO, &A911pio , ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_PIO0,}, }, {"911/pio/direction", PROPERTY_LENGTH_YESNO, &A911piodd, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_PIODIR0,}, }, {"911/pio/strength", PROPERTY_LENGTH_YESNO, &A911piods, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_PIODS0,}, }, {"911/pio/pull_enable", PROPERTY_LENGTH_YESNO, &A911piope, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_PIOPE0,}, }, {"911/pio/pull_down", PROPERTY_LENGTH_YESNO, &A911piopd, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_PULLDOWN0,}, }, {"911/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/alarm/latch", PROPERTY_LENGTH_YESNO, &A911latch, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_LATCH0,}, }, {"911/alarm/enable_latch", PROPERTY_LENGTH_YESNO, &A911elatch, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_ALARM0,}, }, {"911/alarm/clear_latchs", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_CLATCH,}, }, {"911/alarm/enable_global", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_EALARMC,}, }, {"911/alarm/userbits", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_911, {.u=_FC03_UALARM,}, }, {"911/alarm/userbits_enable", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_911, {.u=_FC03_UALARM_EN,}, }, {"911/counters", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/counters/count", PROPERTY_LENGTH_UNSIGNED, &A911counter, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_911, {.u=_FC03_COUNT0,}, }, {"911/counters/enable_counter", PROPERTY_LENGTH_YESNO, &A911ecount, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_ECOUNT0,}, }, {"911/counters/enable_encoder0", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_EENCODER0,}, }, {"911/counters/enable_encoder5", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_EENCODER5,}, }, {"911/counters/enable_encoder8", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_EENCODER8,}, }, {"911/counters/enable_encoder9", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_EENCODER9,}, }, {"911/counters/enable_encoder16", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_EENCODER16,}, }, {"911/counters/enable_encoder17", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_EENCODER17,}, }, {"911/timers", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/timers/countdown", PROPERTY_LENGTH_UNSIGNED, &A911userarray, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_USER_ARRAY,}, }, {"911/timers/countdown_number", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_NBYTES,}, }, {"911/timers/clock", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_911, {.u=_FC03_RTCH,}, }, {"911/timers/random", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, NO_WRITE_FUNCTION, VISIBLE_911, {.u=_FC03_RTCL,}, }, {"911/user_registers", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/user_registers/byte", PROPERTY_LENGTH_UNSIGNED, &A911userb, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_USER_BYTES,}, }, {"911/user_registers/word", PROPERTY_LENGTH_UNSIGNED, &A911userw, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_USER_WORDS,}, }, {"911/user_registers/dword", PROPERTY_LENGTH_UNSIGNED, &A911userdw, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_911, {.u=_FC03_USER_DW,}, }, {"911/analog", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA,}, {"911/analog/adc", PROPERTY_LENGTH_UNSIGNED, &A911adc, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, VISIBLE_911, {.u=_FC03_ADC0,}, }, {"911/analog/adc_enable", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_ADCEN,}, }, {"911/analog/comparator", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/analog/comparator/acmp_enable", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_ACMPE,}, }, {"911/analog/comparator/out_enable", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_ACMPOE,}, }, {"911/analog/comparator/out_state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, NO_WRITE_FUNCTION, VISIBLE_911, {.u=_FC03_ACMPO,}, }, {"911/analog/comparator/internal_ref", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_ACMPIS,}, }, {"911/analog/comparator/changed", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_ACMPLATCH,}, }, {"911/pwm1", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/pwm1/ref_clock", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_TPM1C,}, }, {"911/pwm1/period", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_PERIOD1,}, }, {"911/pwm1/mode_ch0", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_C1CH0,}, }, {"911/pwm1/mode_ch1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_C1CH1,}, }, {"911/pwm1/duty_ch0", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_DUTY1C0,}, }, {"911/pwm1/duty_ch1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_DUTY1C1,}, }, {"911/pwm2", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA,}, {"911/pwm2/ref_clock", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_TPM2C,}, }, {"911/pwm2/period", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_PERIOD2,}, }, {"911/pwm2/mode_ch0", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_C2CH0,}, }, {"911/pwm2/mode_ch1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_C2CH1,}, }, {"911/pwm2/duty_ch0", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_DUTY2C0,}, }, {"911/pwm2/duty_ch1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_DUTY2C1,}, }, {"911/iic", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA,}, {"911/iic/init", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_IICC,}, }, {"911/iic/cat9554", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/iic/cat9554/direction", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_iic, FS_w_iic, VISIBLE_911, {.a="x40x03$0-x40x03=$0"}, }, {"911/iic/cat9554/pio", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_iic, FS_w_iic, VISIBLE_911, {.a="x40x01$0-x40x01=$0"}, }, {"911/sdcard", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/sdcard/init", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_SDC,}, }, {"911/sdcard/sector_nr", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_sector_nr, FS_w_sector_nr, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/sdcard/sector_data", _FC_SDCARD_SECTOR_SIZE, NON_AGGREGATE, ft_binary, fc_stable, FS_r_sector_data, FS_w_sector_data, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/lcd", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/lcd/init", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_LCDC,}, }, {"911/lcd/text", 255, NON_AGGREGATE, ft_ascii, fc_volatile, NO_READ_FUNCTION, FS_w_seq_text, VISIBLE_911, {.u=_FC03_SEQW_LCDD,}, }, {"911/serial", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA,}, {"911/serial/baud_divisor", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_BAUDDIV,}, }, {"911/serial/scic", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_SCIC,}, }, {"911/serial/dataout", 255, NON_AGGREGATE, ft_ascii, fc_volatile, NO_READ_FUNCTION, FS_w_seq_text, VISIBLE_911, {.u=_FC03_SEQW_SCI,}, }, /* {"911/pio/piostate", PROPERTY_LENGTH_UNSIGNED, &A911pio, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u=_FC03_PIO0,}, }, {"911/pio/pio", PROPERTY_LENGTH_YESNO, &A911pio, ft_yesno, fc_link, FS_r_911_pio, FS_w_911_pio, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/pio/pio_config", PROPERTY_LENGTH_UNSIGNED, &A911pioc, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u=_FC03_PIO_CONF,}, }, {"911/pio/pio_ds", PROPERTY_LENGTH_YESNO, &A911pioc, ft_yesno, fc_link, FS_r_pio_bit, FS_w_pio_bit, VISIBLE_911, {.u=3,}, }, {"911/pio/pio_pe", PROPERTY_LENGTH_YESNO, &A911pioc, ft_yesno, fc_link, FS_r_pio_bit, FS_w_pio_bit, VISIBLE_911, {.u=1,}, }, {"911/pio/pio_dd", PROPERTY_LENGTH_YESNO, &A911pioc, ft_yesno, fc_link, FS_r_pio_bit, FS_w_pio_bit, VISIBLE_911, {.u=0,}, }, {"911/counter1", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/counter1/count", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_911, {.u=_FC03_CNT1,}, }, {"911/counter1/config", PROPERTY_LENGTH_UNSIGNED, &A911cnt1, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u=_FC03_PIO_CONF+10,}, }, {"911/counter1/pulldown", PROPERTY_LENGTH_YESNO, &A911cnt1, ft_yesno, fc_link, FS_r_cnt1_bit, FS_w_cnt1_bit, VISIBLE_911, {.u=2,}, }, {"911/counter1/enable", PROPERTY_LENGTH_YESNO, &A911cnt1, ft_yesno, fc_link, FS_r_cnt1_bit, FS_w_cnt1_bit, VISIBLE_911, {.u=4,}, }, {"911/counter2", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/counter2/count", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_32, FS_w_32, VISIBLE_911, {.u=_FC03_CNT2,}, }, {"911/counter2/config", PROPERTY_LENGTH_UNSIGNED, &A911cnt2, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u=_FC03_PIO_CONF+16,}, }, {"911/counter2/pulldown", PROPERTY_LENGTH_YESNO, &A911cnt2, ft_yesno, fc_link, FS_r_cnt2_bit, FS_w_cnt2_bit, VISIBLE_911, {.u=2,}, }, {"911/counter2/enable", PROPERTY_LENGTH_YESNO, &A911cnt2, ft_yesno, fc_link, FS_r_cnt2_bit, FS_w_cnt2_bit, VISIBLE_911, {.u=4,}, }, {"911/pwm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/pwm/tpm1c", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_TPM1C,}, }, {"911/pwm/tpm2c", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_TPM2C,}, }, {"911/pwm/period1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_PERIOD1,}, }, {"911/pwm/period2", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_PERIOD2,}, }, {"911/pwm/duty", PROPERTY_LENGTH_UNSIGNED, &A911pwm, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_DUTY,}, }, {"911/spi", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/spi/spic", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_SPIC,}, }, {"911/spi/spibr", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_SPIBR,}, }, {"911/spi/spid", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_911, {.u=_FC03_SPID,}, }, {"911/serial", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_911, NO_FILETYPE_DATA, }, {"911/serial/scic", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, VISIBLE_911, {.u=_FC03_SCIC,}, }, */ }; DeviceEntryExtended(FC, BAE, DEV_resume | DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE ); /* path)) ; if ( BAD( GetVisibilityCache( &visibility_parameter, pn ) ) ) { struct one_wire_query * owq = OWQ_create_from_path(pn->path) ; // for read if ( owq != NULL) { UINT device_type ; if ( FS_r_sibling_U( &device_type, "device_type", owq ) == 0 ) { switch (device_type) { case 2: visibility_parameter = 910 ; SetVisibilityCache( visibility_parameter, pn ) ; break ; case 3: visibility_parameter = 911 ; SetVisibilityCache( visibility_parameter, pn ) ; break ; default: visibility_parameter = -1 ; } } OWQ_destroy(owq) ; } } return visibility_parameter ; } static enum e_visibility VISIBLE_eeprom_pages( const struct parsedname * pn ) { switch ( VISIBLE_BAE(pn) ) { case -1: return visible_not_now ; case 910: //modify ABAEeeprom.elements to number of pages; pn->selected_filetype->ag->elements=_FC02_EEPROM_PAGES; return visible_now ; case 911: pn->selected_filetype->ag->elements=_FC03_EEPROM_PAGES; return visible_now ; default: return visible_not_now ; } } #if 0 /* eeprom bytes only for testing */ static enum e_visibility VISIBLE_eeprom_bytes( const struct parsedname * pn ) { switch ( VISIBLE_BAE(pn) ) { case -1: return visible_not_now ; case 910: pn->selected_filetype->suglen=_FC02_EEPROM_PAGES * _FC_EEPROM_PAGE_SIZE; return visible_now ; case 911: pn->selected_filetype->suglen=_FC03_EEPROM_PAGES * _FC_EEPROM_PAGE_SIZE; return visible_now ; default: return visible_not_now ; } } #endif /* eeprom bytes only for testing */ static enum e_visibility VISIBLE_generic( const struct parsedname * pn ) { switch ( VISIBLE_BAE(pn) ) { case -1: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_910( const struct parsedname * pn ) { switch ( VISIBLE_BAE(pn) ) { case 910: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_911( const struct parsedname * pn ) { switch ( VISIBLE_BAE(pn) ) { case 911: return visible_now ; default: return visible_not_now ; } } static size_t eeprom_offset( const struct parsedname * pn ) { switch ( VISIBLE_BAE(pn) ) { case 910: //future vesion of 910 will work with uniform eeprom offset return _FC02_EEPROM_OFFSET ; default: return _FC_EEPROM_OFFSET ; } } static ZERO_OR_ERROR FS_r_sector_nr(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT sector_nr; if ( BAD( Cache_Get_SlaveSpecific((void *) §or_nr, sizeof(UINT), SlaveSpecificTag(SNR), pn)) ) { // record doesn't (yet) exist sector_nr=0; } OWQ_U(owq) = sector_nr; if (Cache_Add_SlaveSpecific((void *) §or_nr, sizeof(UINT), SlaveSpecificTag(SNR), pn)) { return -EINVAL; } return 0; } static ZERO_OR_ERROR FS_w_sector_nr(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT sector_nr; sector_nr = OWQ_U(owq); FS_del_sibling( "911/sdcard/sector_data", owq ) ; if (Cache_Add_SlaveSpecific((void *) §or_nr, sizeof(UINT), SlaveSpecificTag(SNR), pn)) { return -EINVAL; } return 0; } static ZERO_OR_ERROR FS_w_sector_data(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE *buffer = (BYTE*)OWQ_buffer(owq); BYTE rparam[_FC02_MAX_WRITE_GULP+1]; BYTE wparam[4] ; UINT sector_nr; int size=(int)OWQ_size(owq); int wlen,rlen,i,retry; int timeout=100; if (BAD( Cache_Get_SlaveSpecific((void *) §or_nr, sizeof(UINT), SlaveSpecificTag(SNR), pn))) { sector_nr=0; // record doesn't (yet) exist } LEVEL_DEBUG("write SD sector %d data len=%d",sector_nr,size ) ; if ( OWQ_offset(owq) != 0 ) { return -ERANGE; } if ( size!=512 ) { return -ERANGE; } BAE_uint32_to_bytes( sector_nr*512, wparam ); // convert 32bit value to msb first rlen=0; wlen=4; RETURN_ERROR_IF_BAD(OW_wr_complete_transaction(wlen,_FC03_WR_BEGIN_SD_W, &rlen, wparam, rparam, timeout, pn)); retry=0; for(i=size;i;) { if ( i > _FC02_MAX_WRITE_GULP) { wlen=_FC02_MAX_WRITE_GULP; } else { wlen=i; } LEVEL_DEBUG("WRITE SD %d bytes at offset %d ",size,512-i ) ; if (BAD(OW_seqw_complete_transaction(wlen,_FC03_SEQW_SD, buffer, timeout, pn))) { if (retry++>3) { return gbBAD; } } else { buffer+=wlen; i-=wlen; retry=0; } } rlen=0; wlen=0; LEVEL_DEBUG("WRITE SD END, send trailer " ) ; return GB_to_Z_OR_E( OW_wr_complete_transaction(wlen,_FC03_WR_END_SD_W, &rlen, wparam, rparam, timeout, pn)); } static ZERO_OR_ERROR FS_r_sector_data(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE *buffer = (BYTE*)OWQ_buffer(owq); BYTE rparam[_FC02_MAX_READ_GULP+1]; BYTE wparam[4] ; UINT sector_nr; int size=(int)OWQ_size(owq); int wlen,rlen,i,retry; int timeout=100; if (BAD( Cache_Get_SlaveSpecific((void *) §or_nr, sizeof(UINT), SlaveSpecificTag(SNR), pn))) { sector_nr=0; // record doesn't (yet) exist } LEVEL_DEBUG("read SD sector %d data len=%d",sector_nr,size ) ; if ( OWQ_offset(owq) != 0 ) { return -ERANGE; } if ( size != 512 ) { return -ERANGE; } BAE_uint32_to_bytes( sector_nr*512, wparam ); // convert 32bit value to msb first rlen=0; wlen=4; retry=0; RETURN_ERROR_IF_BAD(OW_wr_complete_transaction(wlen,_FC03_WR_BEGIN_SD_R, &rlen, wparam, rparam, timeout, pn)); rlen= _FC02_MAX_READ_GULP; for(i=size;i;) { if (i>_FC02_MAX_READ_GULP) { rlen=_FC02_MAX_WRITE_GULP; } else { rlen=i; } LEVEL_DEBUG("READ SD %d bytes at offset %d ",size,512-i ) ; if (BAD(OW_seqr_complete_transaction(&rlen,_FC03_SEQR_SD, buffer, timeout, pn))) { if ( retry++ > 3 ) { return gbBAD; } } else { buffer+=rlen; i-=rlen; retry=0; } } OWQ_length(owq) = OWQ_size(owq); rlen=0; wlen=0; LEVEL_DEBUG("READ SD END, send trailer " ) ; return GB_to_Z_OR_E( OW_wr_complete_transaction(wlen,_FC03_WR_END_SD_R, &rlen, wparam, rparam, timeout, pn)); } static int hex_digit(BYTE c) { int v; if ((c>='0') && (c<='9')) { v=c-'0'; } else if ((c>='a') && (c<='f')) { v=c-'a'+10; } else if ((c>='A') && (c<='F')) { v=c-'A'+10; } else { v=-1000; } return v; } static GOOD_OR_BAD scan_token_read(char* mask,BYTE *buffer, struct one_wire_query *owq) { int i = 0 ; char *pt ; LEVEL_DEBUG("begin token read loop: " ) ; OWQ_U(owq)=0; for( pt = mask; *pt; pt++ ) { int v=hex_digit(*pt)*16 + hex_digit(*(pt+1)); if (v>=0) { pt+=2; if ( buffer[i++] != v ) { return gbBAD; //if the received byte doen not match the mask, return error } } switch (*pt) { case '?': i++; // '?' in mask means to ignore this received byte break ; case '$': if ((*(pt+1)>='0') && (*(pt+1) <='7')) { //store received byte on position j int j ; pt++; j=*pt-'0'; OWQ_U(owq)|= buffer[i++]<=0) { buffer[i++]=v; pt+=2; } switch (*pt) { case '=': *plenw=i; //write limit, after '=' this is the receive mask break; case '$': if ((*(pt+1)>='0') && (*(pt+1)<='7')) { int j ; pt++; j=*pt-'0'; LEVEL_DEBUG("token test: @%d= %d", j,BYTE_MASK(OWQ_U(owq)>>j) ) ; buffer[i++]= BYTE_MASK(OWQ_U(owq)>>j); // BYTE_MASK(OWQ_array_U(owq,j)); } break; } } if (*plenw<0) { *plenw=i; } *plenr=i-*plenw; buffer[i]='\0'; //just for level debug } static ZERO_OR_ERROR FS_w_iic(struct one_wire_query *owq) //generic write to iic { struct parsedname *pn = PN(owq); BYTE wparam[(_FC02_MAX_WRITE_GULP+1)*2]; BYTE *rparam; int wlen,rlen,timeout; char mask[255],*pt; rparam=wparam+_FC02_MAX_WRITE_GULP+1; if ( OWQ_offset(owq) != 0 ) { // only allow from beginning return -ERANGE; } mask[254] = '\0' ; strncpy( mask, pn->selected_filetype->data.a, 254); pt=strchr(mask,'-'); if (pt==NULL) { return -EINVAL; //invalid mask for generic iic } *pt=0; //split mask write and mask read scan_token_write(mask, wparam, &wlen, &rlen, owq); timeout=100; LEVEL_DEBUG("iic write: wlen=%d mask=%s wparam=%s", wlen,mask,wparam ) ; RETURN_ERROR_IF_BAD(OW_wr_complete_transaction(wlen,_FC03_WR_BEGIN_IIC, &rlen, wparam, rparam, timeout, pn)); pt=strchr(mask,'='); if (pt) { RETURN_ERROR_IF_BAD(scan_token_read(pt+1, rparam, owq)); } wlen=rlen=0; return GB_to_Z_OR_E( OW_wr_complete_transaction(wlen,_FC03_WR_END_IIC, &rlen, wparam, rparam, timeout, pn)); } static ZERO_OR_ERROR FS_r_iic(struct one_wire_query *owq) //generic read from iic { BYTE wparam[(_FC02_MAX_WRITE_GULP+1)*2]; BYTE *rparam; int wlen, rlen, timeout; char mask[255],*pt; struct parsedname *pn = PN(owq); rparam=wparam+_FC02_MAX_WRITE_GULP+1; if ( OWQ_offset(owq) != 0 ) { // only start at beginning return -ERANGE; } mask[254] = '\0' ; strncpy( mask, pn->selected_filetype->data.a, 254 ); pt=strchr(mask,'-'); if (pt==NULL) { return -EINVAL; //invalid mask for generic iic } scan_token_write(pt+1, wparam, &wlen, &rlen, owq); pt=strchr(mask,'='); if (pt==NULL) { return -EINVAL; //read mask has no '=' token! } timeout=100; LEVEL_DEBUG("iic read: wlen=%d mask=%s wparam=%s", wlen,mask,wparam ) ; RETURN_ERROR_IF_BAD(OW_wr_complete_transaction(wlen,_FC03_WR_BEGIN_IIC, &rlen, wparam, rparam, timeout, pn)); RETURN_ERROR_IF_BAD(scan_token_read(pt+1, rparam, owq)); wlen=rlen=0; return GB_to_Z_OR_E( OW_wr_complete_transaction(wlen,_FC03_WR_END_IIC, &rlen, wparam, rparam, timeout, pn)); } static ZERO_OR_ERROR FS_w_seq_text(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); BYTE *start_of_text = (BYTE*)OWQ_buffer(owq); int i,retry,wlen,timeout; int size=(int)OWQ_size(owq); BYTE func=BYTE_MASK(PN(owq)->selected_filetype->data.u); LEVEL_DEBUG("SEQ text func=%d len=%d, offset=%d",func, size,OWQ_offset(owq) ) ; if (func==_FC03_SEQW_LCDD) { size--; //remove last CR for lcd } retry=0; timeout=100; if (size<=0) { return -EINVAL; } for(i=size;i;) { if (i>_FC02_MAX_WRITE_GULP) { wlen=_FC02_MAX_WRITE_GULP; } else { wlen=i; } LEVEL_DEBUG("WRITE seq %d bytes at position %d ",wlen,size-i ) ; if (BAD(OW_seqw_complete_transaction(wlen,func, start_of_text, timeout, pn))){ if (retry++>3) { return -EINVAL; } } else { start_of_text+=wlen; i-=wlen; retry=0; } } LEVEL_DEBUG("SEQ text end" ) ; return 0; } /* BAE memory functions */ static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { RETURN_ERROR_IF_BAD(OW_r_mem( (BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq), PN(owq))) ; OWQ_length(owq) = OWQ_size(owq) ; return 0; } static ZERO_OR_ERROR FS_eeprom_r_mem(struct one_wire_query *owq) { return COMMON_offset_process(FS_r_mem,owq, eeprom_offset(PN(owq))) ; } static ZERO_OR_ERROR FS_eeprom_r_page(struct one_wire_query *owq) { return COMMON_offset_process(FS_eeprom_r_mem,owq, _FC_EEPROM_PAGE_SIZE * OWQ_pn(owq).extension) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { return GB_to_Z_OR_E( OW_w_mem( (BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq), PN(owq)) ) ; } static ZERO_OR_ERROR FS_eeprom_w_mem(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; size_t size = OWQ_size(owq) ; LEVEL_DEBUG("write eeprom size of %d.", (int)OWQ_size(owq) ) ; LEVEL_DEBUG("write eeprom offset %d.", (int)OWQ_offset(owq) ) ; /* BYTE * eeprom = owmalloc( size ) ; if ( eeprom==NULL ) { return -ENOMEM ; } // read existing eeprom pattern if ( BAD( OW_r_mem(eeprom, size, OWQ_offset(owq)+eeprom_offset(pn), pn)) ) { LEVEL_DEBUG("Cannot read eeprom prior to writing") ; owfree(eeprom) ; return -EINVAL ; } // modify eeprom with new data OW_siumulate_eeprom(eeprom, (const BYTE *) OWQ_buffer(owq), size) ; */ // write back if ( BAD( OW_w_mem((BYTE *) OWQ_buffer(owq), size, OWQ_offset(owq)+eeprom_offset(pn), pn)) ) { LEVEL_DEBUG("Cannot write to eeprom") ; //owfree(eeprom) ; return -EINVAL ; } //owfree(eeprom) ; return 0 ; } static ZERO_OR_ERROR FS_eeprom_w_page(struct one_wire_query *owq) { return COMMON_offset_process(FS_eeprom_w_mem,owq, _FC_EEPROM_PAGE_SIZE * OWQ_pn(owq).extension) ; } static ZERO_OR_ERROR FS_eeprom_erase(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; if (OWQ_Y(owq)) { off_t offset = _FC_EEPROM_PAGE_SIZE * pn->extension + eeprom_offset(pn) ; return GB_to_Z_OR_E( OW_eeprom_erase(offset,pn) ) ; } else{ return 0 ; } } /* BAE flash functions */ static ZERO_OR_ERROR FS_w_flash(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; BYTE * rom_image = (BYTE *) OWQ_buffer(owq) ; size_t rom_offset,expected_size ; if ( OWQ_size(owq) % 0x200 ) { LEVEL_DEBUG("Flash size of %d is not a multiple of 512.", (int)OWQ_size(owq) ) ; return -EBADMSG ; } if ( OWQ_offset(owq) % 0x200 ) { LEVEL_DEBUG("Flash offset %d is not a multiple of 512.", (int)OWQ_offset(owq) ) ; return -EBADMSG ; } //flash firmware may exceed 8192bytes, thus FS_w_flash is called more than once with successive buffers if ( OWQ_offset(owq) == 0 ) { LEVEL_DEBUG("Beginning of flash (from start of buffer).") ; // test size expected_size=1+(rom_image[7]+rom_image[6]*256)-(rom_image[5]+rom_image[4]*256); LEVEL_DEBUG("Flash size=%d, (size calculated from header=%d) .", (int)OWQ_size(owq), (int)expected_size ) ; if ( OWQ_size(owq) > expected_size ) { LEVEL_DEBUG("Flash size of %d is greater than expected %d bytes .", (int)OWQ_size(owq), (int)expected_size ) ; return -ERANGE ; } // start flash process, added duration param calculated as 1ms for 16 bytes if ( BAD( OW_initiate_flash( rom_image, pn, expected_size>>4 ) ) ) { LEVEL_DEBUG("Unsuccessful flash initialization"); return -EFAULT ; } } // loop though pages, up to 5 attempts for each page for ( rom_offset=0 ; rom_offset 4 ) { LEVEL_DEBUG( "Too many failures writing flash at offset %d.", rom_offset ) ; return -EIO ; } LEVEL_DEBUG( "retry %d of 5 when writing flash.", tries ) ; } } LEVEL_DEBUG("Successfully flashed full rom.") ; return 0; } /* static ZERO_OR_ERROR FS_r_flash( struct one_wire_query *owq) { RETURN_ERROR_IF_BAD( OW_r_mem( (BYTE *) OWQ_buffer(owq), OWQ_size(owq), OWQ_offset(owq)+_FC02_FUNCTION_FLASH_OFFSET, PN(owq) ) ); OWQ_length(owq) = OWQ_size(owq) ; return 0 ; } */ /* BAE extended command */ static ZERO_OR_ERROR FS_w_extended(struct one_wire_query *owq) { // Write data 255 bytes maximum (1byte minimum) if ( OWQ_size(owq) == 0 ) { return -EINVAL ; } return GB_to_Z_OR_E( OW_w_extended( (BYTE *) OWQ_buffer(owq), OWQ_size(owq), PN(owq) ) ) ; } /*static ZERO_OR_ERROR FS_writebyte(struct one_wire_query *owq) { off_t location = OWQ_U(owq)>>8 ; BYTE data = OWQ_U(owq) & 0xFF ; // Write 1 byte , return GB_to_Z_OR_E( OW_w_mem( &data, 1, location, PN(owq) ) ) ; }*/ /* BAE version */ static ZERO_OR_ERROR FS_version_state(struct one_wire_query *owq) { UINT v ; RETURN_ERROR_IF_BAD( OW_version( &v, PN(owq) ) ) ; OWQ_U(owq) = v ; return 0 ; } static ZERO_OR_ERROR FS_version(struct one_wire_query *owq) { char v[6]; UINT version ; if ( FS_r_sibling_U( &version, "versionstate", owq ) != 0 ) { return -EINVAL ; } UCLIBCLOCK; snprintf(v,6,"%.2X.%.2X",version&0xFF, (version>>8)&0xFF); UCLIBCUNLOCK; return OWQ_format_output_offset_and_size(v, 5, owq); } static ZERO_OR_ERROR FS_version_device(struct one_wire_query *owq) { UINT version = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &version, "versionstate", owq ) ; OWQ_U(owq) = (version>>8) & 0xFF ; return z_or_e ; } static ZERO_OR_ERROR FS_version_bootstrap(struct one_wire_query *owq) { UINT version = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &version, "versionstate", owq ) ; OWQ_U(owq) = version & 0xFF ; return z_or_e ; } /* BAE type */ static ZERO_OR_ERROR FS_type_state(struct one_wire_query *owq) { UINT t ; RETURN_ERROR_IF_BAD( OW_type( &t, PN(owq) ) ); OWQ_U(owq) = t ; return 0 ; } static ZERO_OR_ERROR FS_localtype(struct one_wire_query *owq) { char t[6]; UINT localtype ; if ( FS_r_sibling_U( &localtype, "typestate", owq ) != 0 ) { return -EINVAL ; } UCLIBCLOCK; snprintf(t,6,"%.2X.%.2X",localtype&0xFF, (localtype>>8)&0xFF); UCLIBCUNLOCK; return OWQ_format_output_offset_and_size(t, 5, owq); } static ZERO_OR_ERROR FS_type_device(struct one_wire_query *owq) { UINT t = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &t, "typestate", owq ) ; OWQ_U(owq) = (t>>8) & 0xFF ; return z_or_e ; } static ZERO_OR_ERROR FS_type_chip(struct one_wire_query *owq) { UINT t = 0 ; ZERO_OR_ERROR z_or_e = FS_r_sibling_U( &t, "typestate", owq ) ; OWQ_U(owq) = t & 0xFF ; return z_or_e ; } static ZERO_OR_ERROR FS_r_8_ext(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 8/8 ; BYTE data[bytes] ; int array_index = pn->extension ; int * v = (int*) pn->selected_filetype->data.v; int ofs = v[0] ; int uplimit= v[1] ; LEVEL_DEBUG("test numeric extension : ofs=%d, uplimit=%d extension=%d", ofs,uplimit,array_index ) ; if ((array_index<0) || (array_index>=uplimit)) { return -EINVAL ; } RETURN_ERROR_IF_BAD( OW_r_mem_small(data, bytes, ofs + bytes * array_index, pn ) ); OWQ_U(owq) = data[0] ; return 0 ; } static ZERO_OR_ERROR FS_w_8_ext(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 8/8 ; BYTE data[bytes] ; int array_index, ofs, uplimit, *v; array_index = pn->extension ; v=(int*) pn->selected_filetype->data.v; ofs= v[0]; uplimit=v[1]; if ((array_index<0) || (array_index>=uplimit)) { return -EINVAL ; } data[0] = BYTE_MASK( OWQ_U(owq) ) ; return GB_to_Z_OR_E(OW_w_mem(data, bytes, ofs + bytes * array_index, pn ) ) ; } /* read an 8 bit value from a register stored in filetype.data plus extension */ static ZERO_OR_ERROR FS_r_8(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 8/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_mem_small(data, bytes, pn->selected_filetype->data.u + bytes * pn->extension, pn ) ); OWQ_U(owq) = data[0] ; return 0 ; } /* write an 8 bit value from a register stored in filetype.data plus extension */ static ZERO_OR_ERROR FS_w_8(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 8/8 ; BYTE data[bytes] ; data[0] = BYTE_MASK( OWQ_U(owq) ) ; return GB_to_Z_OR_E(OW_w_mem(data, bytes, pn->selected_filetype->data.u + bytes * pn->extension, pn ) ) ; } /* read a 16 bit value from a register stored in filetype.data */ static ZERO_OR_ERROR FS_r_16(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 16/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_mem_small(data, bytes, pn->selected_filetype->data.u + bytes * pn->extension, pn ) ); OWQ_U(owq) = BAE_uint16(data) ; return 0 ; } /* write a 16 bit value from a register stored in filetype.data */ static ZERO_OR_ERROR FS_w_16(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 16/8 ; BYTE data[bytes] ; BAE_uint16_to_bytes( OWQ_U(owq), data ) ; return GB_to_Z_OR_E( OW_w_mem(data, bytes, pn->selected_filetype->data.u + bytes * pn->extension, pn ) ) ; } /* read a 32 bit value from a register stored in filetype.data */ static ZERO_OR_ERROR FS_r_32(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 32/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_mem_small(data, bytes, pn->selected_filetype->data.u + bytes * pn->extension, pn ) ); OWQ_U(owq) = BAE_uint32(data) ; return 0 ; } /* write a 32 bit value from a register stored in filetype.data */ static ZERO_OR_ERROR FS_w_32(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 32/8 ; BYTE data[bytes] ; BAE_uint32_to_bytes( OWQ_U(owq), data ) ; return GB_to_Z_OR_E( OW_w_mem(data, bytes, pn->selected_filetype->data.u + bytes * pn->extension, pn ) ) ; } /* Lower level functions */ // Extended command -- insert length, The first byte of the payload is a subcommand but that is invisible to us. static GOOD_OR_BAD OW_w_extended(BYTE * data, size_t size, struct parsedname *pn) { BYTE p[1 + 1 + _FC02_MAX_COMMAND_GULP + 2] = { _1W_EXTENDED_COMMAND, BYTE_MASK(size-1), }; BYTE q[] = { _1W_CONFIRM_WRITE, } ; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 1+1+size, 0), TRXN_WRITE1(q), TRXN_DELAY(2), TRXN_END, }; /* Copy to write buffer */ memcpy(&p[2], data, size); return BUS_transaction(t, pn) ; } // Flow write command without crc /* static GOOD_OR_BAD OW_w_flow_nocrc(BYTE wf, BYTE * param, size_t plen, BYTE * data, size_t size, struct parsedname *pn) { BYTE p[1 + 1 + 1 + 1 + _FC02_MAX_COMMAND_GULP + 2] = { _1W_FLOW, BYTE_MASK(plen),wf, 0, }; BYTE q[] = { _1W_CONFIRM_WRITE, } ; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 4+plen, 0), TRXN_WRITE1(q), TRXN_DELAY(1), TRXN_WRITE(data, size), TRXN_END, }; LEVEL_DEBUG("Send flow command") ; // Copy to write buffer memcpy(&p[4], param, plen); RETURN_BAD_IF_BAD( BUS_transaction(t, pn) ); return gbGOOD ; } // Flow write command WITH crc interleave static GOOD_OR_BAD OW_w_flow_crc(BYTE wf, BYTE * param, size_t plen, BYTE * data, size_t size,size_t chunksize, struct parsedname *pn) { BYTE *pt; size_t i; BYTE p[1 + 1 + 1 + 1 + _FC02_MAX_COMMAND_GULP + 2] = { _1W_FLOW, BYTE_MASK(plen),wf, chunksize, }; BYTE chunk[_FC_MAX_INTERLEAVE+2] ; BYTE q[] = { _1W_CONFIRM_WRITE, } ; struct transaction_log header[] = { TRXN_START, TRXN_WR_CRC16(p, 4+plen, 0), TRXN_WRITE1(q), TRXN_DELAY(1), }; struct transaction_log content[] = { TRXN_WR_CRC16(chunk, chunksize,0), }; struct transaction_log remainder[] = { TRXN_WRITE(chunk, size % chunksize), //remainder of bloc if not multiple }; struct transaction_log trailer[] = { TRXN_END, }; LEVEL_DEBUG("Begin stream write of %d bytes", (int)size ) ; memcpy(&p[4], param, plen); RETURN_BAD_IF_BAD(BUS_transaction(header, pn)); pt=data; for(i=size/chunksize;i;i--){ memcpy(chunk, pt, chunksize); pt+=chunksize; RETURN_BAD_IF_BAD(BUS_transaction(content, pn)); LEVEL_DEBUG("chunk write ok, remaining chunks=%d", (int)i ) ; } if (size % chunksize){ memcpy(chunk, pt, size % chunksize); RETURN_BAD_IF_BAD( BUS_transaction(remainder, pn) ) ; } RETURN_BAD_IF_BAD( BUS_transaction(trailer, pn) ) ; return gbGOOD ; } // Flow read command without crc static GOOD_OR_BAD OW_r_flow_nocrc(BYTE wf, BYTE * param, size_t plen, BYTE * data, size_t size, struct parsedname *pn) { BYTE p[1 + 1 + 1 + 1 + _FC02_MAX_COMMAND_GULP + 2] = { _1W_FLOW, BYTE_MASK(plen), wf, 0, }; BYTE q[] = { _1W_CONFIRM_WRITE, } ; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 4+plen, 0), TRXN_WRITE1(q), TRXN_DELAY(1), TRXN_READ(data, size), TRXN_END, }; // Copy to write buffer memcpy(&p[4], param, plen); RETURN_ERROR_IF_BAD( BUS_transaction(t, pn)) ; Debug_Bytes("BAE flow read",data,size) ; return gbGOOD ; } */ static GOOD_OR_BAD OW_poll_until_timeout(int *prlen, BYTE * rparam, int timeout, struct parsedname *pn) { UINT tries; LEVEL_DEBUG("BAE Query result until timeout (%d ms), expected rlen=%d", timeout, *prlen) ; for ( tries=0 ; tries<= 5 ; ++ tries ) { BYTE retcode; int rlen; //temporary var to hold len received rlen when retcode==0xff LEVEL_DEBUG( "try %d when querying result from previous function.", tries ) ; if ( GOOD(OW_query_cmd(&rlen, &retcode,rparam,pn )) ) { if (retcode==0xff) { timeout-=10; if (timeout<=0) { LEVEL_DEBUG( "Timeout getting result from previous function." ) ; return gbBAD ; } UT_delay(10); //10ms delay if slave still busy } else { *prlen=rlen; //only when retcode is not 0xff LEVEL_DEBUG( "Previous command terminated with retcode=%d, rlen=%d.", retcode,rlen ) ; return (retcode==0) ? gbGOOD : gbBAD ; } } } LEVEL_DEBUG( "Too many failures getting result from previous function." ) ; return gbBAD ; } //WR command 0X17 with query until return of result static GOOD_OR_BAD OW_wr_complete_transaction( int wlen,BYTE func, int *rlen, BYTE * wparam, BYTE * rparam, int timeout, struct parsedname *pn) { BYTE p[1 + 1 + 1 + 1 + _FC02_MAX_COMMAND_GULP + 2] = { _1W_WRCMD, BYTE_MASK(wlen), BYTE_MASK(func), BYTE_MASK(*rlen), 0, }; BYTE q[] = { _1W_CONFIRM_WRITE, } ; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 4+wlen, 0), TRXN_WRITE1(q), TRXN_DELAY(1), //any WR commands require at least 1ms before query result TRXN_END, }; LEVEL_DEBUG("BAE WR transaction function=%d, wlen=%d, rlen=%d", func, wlen, *rlen) ; Debug_Bytes("WR_cmd, data:",wparam,wlen) ; memcpy(p+4, wparam, wlen); RETURN_ERROR_IF_BAD(BUS_transaction(t, pn)) ; return OW_poll_until_timeout(rlen, rparam, timeout, pn); } // SEQW command 0X18 with query until return of result static GOOD_OR_BAD OW_seqw_complete_transaction(int wlen, BYTE func, BYTE * wparam, int timeout, struct parsedname *pn) { BYTE p[1 + 1 + 1 + _FC02_MAX_COMMAND_GULP + 2] = { _1W_SEQWCMD, BYTE_MASK(wlen), BYTE_MASK(func), 0, }; BYTE q[] = { _1W_CONFIRM_WRITE, } ; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 3+wlen, 0), TRXN_WRITE1(q), TRXN_DELAY(1), //any SEQ commands require at least 1ms before query result TRXN_END, }; int rlen=0; LEVEL_DEBUG("BAE SEQWR transaction function=%d, wlen=%d", func, wlen) ; Debug_Bytes("SEQW_cmd, data:",wparam,wlen) ; memcpy(p+3, wparam, wlen); RETURN_ERROR_IF_BAD( BUS_transaction(t, pn)) ; return OW_poll_until_timeout(&rlen, p, timeout, pn); } //SEQR command 0X19 with query until return of result static GOOD_OR_BAD OW_seqr_complete_transaction(int *rlen,BYTE func,BYTE * rparam, int timeout, struct parsedname *pn) { BYTE p[1 + 1 + 1 + 2] = { _1W_SEQRCMD, BYTE_MASK(*rlen), BYTE_MASK(func), 0, }; BYTE q[] = { _1W_CONFIRM_WRITE, } ; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 3, 0), TRXN_WRITE1(q), TRXN_DELAY(1), //any SEQ commands require at least 1ms before query result TRXN_END, }; LEVEL_DEBUG( "BAE SEQR transaction: function=%d, rlen= %d", func, *rlen ) ; RETURN_ERROR_IF_BAD(BUS_transaction(t, pn)); return OW_poll_until_timeout(rlen, rparam, timeout, pn); } //QUERY command 0x1A static GOOD_OR_BAD OW_query_cmd(int *prlen, BYTE *retcode,BYTE * rparam , struct parsedname *pn) { BYTE p[1 + 1 + 1 + _FC02_MAX_COMMAND_GULP + 2] = { _1W_QUERY_DATA_COMMAND }; int rlen; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(p), //query command TRXN_READ2(p+1), //retcode and len TRXN_END, }; LEVEL_DEBUG( "query_cmd: getting header ") ; RETURN_BAD_IF_BAD( BUS_transaction(t, pn)) ; LEVEL_DEBUG( "query_cmd: header received: retcode=%d, rlen=%d ", p[1],p[2]) ; retcode[0]=p[1]; //retcode of previous command rlen=p[2]; *prlen=rlen; if (p[1]==0xff) { return gbGOOD; //no communication error, but still busy processing the previous command } else { struct transaction_log t2[] = { TRXN_READ(p+3,rlen+2), TRXN_CRC16(p,rlen+3+2), TRXN_END, }; RETURN_BAD_IF_BAD( BUS_transaction(t2, pn)) ; memcpy(rparam,p+3, rlen); Debug_Bytes("BAE query_cmd, received:",rparam,rlen) ; return gbGOOD ; } } //read bytes[size] from position static GOOD_OR_BAD OW_r_mem(BYTE * data, size_t size, off_t offset, struct parsedname * pn) { size_t remain = size ; off_t local_offset = 0 ; int retry=0; while ( remain > 0 ) { size_t gulp = remain ; if ( gulp > _FC02_MAX_READ_GULP ) { gulp = _FC02_MAX_READ_GULP ; } // RETURN_BAD_IF_BAD( OW_r_mem_small( &data[local_offset], gulp, offset+local_offset, pn )); if ( BAD( OW_r_mem_small( &data[local_offset], gulp, offset+local_offset, pn ))) { if (retry++>3) return gbBAD; } else { remain -= gulp ; local_offset += gulp ; retry=0; } } return gbGOOD ; } //write bytes[size] to position /*static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname * pn) { size_t remain = size ; off_t local_offset = 0 ; while ( remain > 0 ) { size_t gulp = remain ; if ( gulp > _FC02_MAX_READ_GULP ) { gulp = _FC02_MAX_READ_GULP ; } RETURN_BAD_IF_BAD( OW_w_mem_small( &data[local_offset], gulp, offset+local_offset, pn )); remain -= gulp ; local_offset += gulp ; } return gbGOOD ; } */ //write bytes[size] is now common for normal and eeprom static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname * pn) { size_t remain = size ; off_t local_offset = 0 ; int retry=0; //retry at 32byte block level because it is sometime hard to have a scuccession of 16 successfull bloc writes while ( remain > 0 ) { size_t gulp = remain ; if ( gulp > _FC02_MAX_READ_GULP ) { gulp = _FC02_MAX_READ_GULP ; } // RETURN_BAD_IF_BAD( OW_w_mem_small( &data[local_offset], gulp, offset+local_offset, pn )); if ( BAD( OW_w_mem_small( &data[local_offset], gulp, offset+local_offset, pn ))) { if (retry++>3) return gbBAD; UT_delay(2) ; //give 1.5 msec to finish prev write before retrying (specificly for eeprom write) } else { remain -= gulp ; local_offset += gulp ; retry=0; } } return gbGOOD ; } /* the crc returned is calculated on buffer transmitted and not on resulting memory contents // Simulate eeprom (for correct CRC) static void OW_siumulate_eeprom(BYTE * eeprom, const BYTE * data, size_t size) { size_t i ; for ( i=0 ; i integer */ static uint16_t BAE_uint16(BYTE * p) { return (((uint16_t) p[0]) << 8) | ((uint16_t) p[1]); } static uint32_t BAE_uint32(BYTE * p) { return (((uint32_t) p[0]) << 24) | (((uint32_t) p[1]) << 16) | (((uint32_t) p[2]) << 8) | ((uint32_t) p[3]); } static void BAE_uint16_to_bytes( uint16_t num, unsigned char * p ) { p[1] = num&0xFF ; p[0] = (num>>8)&0xFF ; } static void BAE_uint32_to_bytes( uint32_t num, unsigned char * p ) { p[3] = num&0xFF ; p[2] = (num>>8)&0xFF ; p[1] = (num>>16)&0xFF ; p[0] = (num>>24)&0xFF ; } static GOOD_OR_BAD OW_initiate_flash( BYTE * data, struct parsedname * pn , int duration) { BYTE p[1+1+1+32+2] = { _1W_EXTENDED_COMMAND, 32,_1W_ECMD_ERASE_FIRMWARE, } ; BYTE q[] = { _1W_CONFIRM_WRITE, } ; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 1+1+1+32, 0), TRXN_WRITE1(q), TRXN_DELAY(duration), TRXN_END, } ; memcpy(&p[3], data, 32 ) ; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_write_flash( BYTE * data, struct parsedname * pn ) { BYTE p[1+1+1+32+2] = { _1W_EXTENDED_COMMAND, 32,_1W_ECMD_FLASH_FIRMWARE, } ; BYTE q[] = { _1W_CONFIRM_WRITE, } ; GOOD_OR_BAD ret; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 1+1+1+32, 0), TRXN_WRITE1(q), TRXN_DELAY(2), TRXN_END, } ; memcpy(&p[3], data, 32 ) ; ret=BUS_transaction(t, pn) ; _Debug_Bytes("write flash buffer details",p,37); return ret; } static GOOD_OR_BAD OW_eeprom_erase( off_t offset, struct parsedname * pn ) { BYTE p[1+2+2] = { _1W_ERASE_EEPROM_PAGE, LOW_HIGH_ADDRESS(offset), } ; BYTE q[] = { _1W_CONFIRM_WRITE, } ; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 1+2, 0), TRXN_WRITE1(q), TRXN_END, } ; return BUS_transaction(t, pn) ; } owfs-3.1p5/module/owlib/src/c/ow_browse.c0000644000175000001440000001300312654730021015276 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #if OW_ZERO #include "ow_connection.h" struct BrowseStruct { char *name; char *type; char *domain; }; static struct BrowseStruct *Browse_Struct_Create(const char *name, const char *type, const char *domain); static void Browse_Struct_Destroy(struct BrowseStruct *browse_struct); static void * OW_Browse_Bonjour(void * v) ; static void ResolveWait( DNSServiceRef sref ) ; static void ResolveBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *n, const char *host, uint16_t port, uint16_t tl, const unsigned char *t, void *c); static void BrowseBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *name, const char *type, const char *domain, void *context); static void ResolveBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *n, const char *host, uint16_t port, uint16_t tl, const unsigned char *t, void *c) { struct BrowseStruct *browse_struct = c; char service[11] ; int sn_ret ; (void) tl; (void) t; UCLIBCLOCK ; sn_ret = snprintf(service, 10, "%d", ntohs(port) ) ; UCLIBCUNLOCK ; LEVEL_DETAIL("ref=%d flags=%d index=%d, error=%d name=%s host=%s port=%d", (long int) s, f, i, e, n, host, ntohs(port)); /* remove trailing .local. */ if ( sn_ret >-1 ) { LEVEL_DETAIL("ref=%d flags=%d index=%d, error=%d name=%s host=%s port=%s", (long int) s, f, i, e, n, host, service); ZeroAdd( browse_struct->name, browse_struct->type, browse_struct->domain, host, service ) ; } else { LEVEL_DEBUG("Couldn't translate port %d",ntohs(port) ) ; } Browse_Struct_Destroy(browse_struct); } static struct BrowseStruct *Browse_Struct_Create(const char *name, const char *type, const char *domain) { struct BrowseStruct *browse_struct = owmalloc(sizeof(struct BrowseStruct)); if ( browse_struct == NULL ) { return NULL ; } browse_struct->name = ( name != NULL ) ? owstrdup(name) : NULL; browse_struct->type = ( type != NULL ) ? owstrdup(type) : NULL; browse_struct->domain = ( domain != NULL ) ? owstrdup(domain) : NULL; return browse_struct; } static void Browse_Struct_Destroy(struct BrowseStruct *browse_struct) { if ( browse_struct == NULL ) { return; } SAFEFREE(browse_struct->name ) ; SAFEFREE(browse_struct->type ) ; SAFEFREE(browse_struct->domain) ; owfree(browse_struct); } // Wait for a resolve, then return. Timeout after 2 minutes static void ResolveWait( DNSServiceRef sref ) { FILE_DESCRIPTOR_OR_ERROR file_descriptor = DNSServiceRefSockFD(sref); if ( FILE_DESCRIPTOR_VALID(file_descriptor) ) { while (1) { fd_set readfd; struct timeval tv = { 120, 0 }; FD_ZERO(&readfd); FD_SET(file_descriptor, &readfd); if (select(file_descriptor + 1, &readfd, NULL, NULL, &tv) > 0) { if (FD_ISSET(file_descriptor, &readfd)) { DNSServiceProcessResult(sref); } } else if (errno == EINTR) { continue; } else { ERROR_CONNECT("Resolve timeout error"); } break; } } } /* Sent back from Bounjour -- arbitrarily use it to set the Ref for Deallocation */ static void BrowseBack(DNSServiceRef s, DNSServiceFlags f, uint32_t i, DNSServiceErrorType e, const char *name, const char *type, const char *domain, void *context) { struct BrowseStruct *browse_struct; (void) context; LEVEL_DETAIL("ref=%ld flags=%d index=%d, error=%d name=%s type=%s domain=%s", (long int) s, f, i, e, name, type, domain); if (e != kDNSServiceErr_NoError) { return ; } browse_struct = Browse_Struct_Create( name, type, domain ) ; if (f & kDNSServiceFlagsAdd) { // Add DNSServiceRef sr; if (DNSServiceResolve(&sr, 0, 0, name, type, domain, ResolveBack, (void *)browse_struct) == kDNSServiceErr_NoError) { ResolveWait(sr) ; DNSServiceRefDeallocate(sr); } else { Browse_Struct_Destroy(browse_struct) ; } } else { // Remove Browse_Struct_Destroy(browse_struct) ; ZeroDel( name, type, domain ) ; } } // Called in a thread static void * OW_Browse_Bonjour(void * v) { struct connection_in * in = v ; DNSServiceErrorType dnserr; DETACH_THREAD; MONITOR_RLOCK ; dnserr = DNSServiceBrowse(&in->master.browse.bonjour_browse, 0, 0, "_owserver._tcp", NULL, BrowseBack, NULL); if (dnserr != kDNSServiceErr_NoError) { LEVEL_CONNECT("DNSServiceBrowse error = %d", dnserr); MONITOR_RUNLOCK ; return VOID_RETURN ; } // Blocks, which is why this is in it's own thread while (DNSServiceProcessResult(in->master.browse.bonjour_browse) == kDNSServiceErr_NoError) { //printf("DNSServiceProcessResult ref %ld\n",(long int)rs->sref) ; continue; } DNSServiceRefDeallocate(in->master.browse.bonjour_browse); in->master.browse.bonjour_browse = 0 ; MONITOR_RUNLOCK ; return VOID_RETURN; } void OW_Browse(struct connection_in *in) { if ( Globals.zero == zero_avahi ) { #if OW_AVAHI if ( BAD(OW_Avahi_Browse(in))) { LEVEL_CONNECT("Avahi Browse problem."); } #endif /* OW_AVAHI */ } else if ( Globals.zero == zero_bonjour ) { pthread_t thread; int err = pthread_create(&thread, DEFAULT_THREAD_ATTR, OW_Browse_Bonjour, (void *) in); if (err) { LEVEL_CONNECT("Bonjour Browse thread error %d.", err); } } } #else /* OW_ZERO */ void OW_Browse(struct connection_in *in) { (void) in ; LEVEL_CONNECT("Avahi and Bonjour not enabled"); } #endif /* OW_ZERO */ owfs-3.1p5/module/owlib/src/c/ow_browse_resolve.c0000644000175000001440000000755112654730021017050 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" static struct port_in * CreateZeroPort(const char * name, const char * type, const char * domain, const char * host, const char * service ); static struct connection_out *FindOut(const char * name, const char * type, const char * domain); static GOOD_OR_BAD Zero_nomatch(struct port_in * trial,struct port_in * existing); static GOOD_OR_BAD string_null_or_match( const char * one, const char * two ); void ZeroAdd(const char * name, const char * type, const char * domain, const char * host, const char * service) { struct port_in * pin ; // Don't add yourself if ( FindOut(name,type,domain) != NULL ) { LEVEL_DEBUG( "Attempt to add ourselves -- ignored" ) ; return ; } pin = CreateZeroPort( name, type, domain, host, service ) ; if ( pin != NULL ) { if ( BAD( Zero_detect(pin)) ) { LEVEL_DEBUG("Failed to create new %s", DEVICENAME(pin->first) ) ; RemovePort(pin) ; } else { Add_InFlight( Zero_nomatch, pin ) ; } } } void ZeroDel(const char * name, const char * type, const char * domain ) { struct port_in * pin = CreateZeroPort( name, type, domain, "", "" ) ; // example if ( pin != NULL ) { Del_InFlight( Zero_nomatch, pin ) ; RemovePort( pin ) ; // remove example } } static struct port_in * CreateZeroPort(const char * name, const char * type, const char * domain, const char * host, const char * service ) { char addr_name[128] ; struct port_in * pin = AllocPort(NO_CONNECTION); struct connection_in * in ; if ( pin == NULL ) { LEVEL_DEBUG( "Cannot allocate position for a new Port Master %s (%s:%s) -- ignored",name,host,service) ; return NO_CONNECTION ; } in = pin->first ; if ( in == NO_CONNECTION ) { LEVEL_DEBUG( "Cannot allocate position for a new Bus Master %s (%s:%s) -- ignored",name,host,service) ; return NO_CONNECTION ; } UCLIBCLOCK; snprintf(addr_name,127,"%s:%s",host,service) ; UCLIBCUNLOCK; DEVICENAME(in) = owstrdup(addr_name) ; pin->init_data = owstrdup(addr_name) ; pin->type = ct_tcp ; in->master.server.name = owstrdup( name ) ; in->master.server.type = owstrdup( type ) ; in->master.server.domain = owstrdup( domain) ; return pin ; } // GOOD means no match static GOOD_OR_BAD Zero_nomatch(struct port_in * trial,struct port_in * existing) { if ( get_busmode(existing->first) != bus_zero ) { return gbGOOD ; } if ( BAD( string_null_or_match( trial->first->master.server.name , existing->first->master.server.name )) ) { return gbGOOD ; } if ( BAD( string_null_or_match( trial->first->master.server.type , existing->first->master.server.type )) ) { return gbGOOD ; } if ( BAD( string_null_or_match( trial->first->master.server.domain , existing->first->master.server.domain )) ) { return gbGOOD ; } return gbBAD ; } // Finds matching connection in OUTBOUND list (so you don't match yourself) // returns it if found, // else NULL static struct connection_out *FindOut(const char * name, const char * type, const char * domain) { struct connection_out *now ; for ( now = Outbound_Control.head ; now != NULL ; now = now->next ) { if ( BAD( string_null_or_match( name , now->zero.name )) ) { continue ; } if ( BAD( string_null_or_match( type , now->zero.type )) ) { continue ; } if ( BAD( string_null_or_match( domain , now->zero.domain )) ) { continue ; } return now ; } return NULL; } static GOOD_OR_BAD string_null_or_match( const char * one, const char * two ) { if ( one == NULL ) { return (two==NULL) ? gbGOOD : gbBAD ; } if ( two == NULL ) { return gbBAD ; } return ( strcasecmp(one,two) == 0 ) ? gbGOOD : gbBAD ; } owfs-3.1p5/module/owlib/src/c/ow_browse_monitor.c0000644000175000001440000000550212654730021017052 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" static void Browse_close(struct connection_in *in); static GOOD_OR_BAD browse_in_use(const struct connection_in * in_selected) ; /* Device-specific functions */ GOOD_OR_BAD Browse_detect(struct port_in *pin) { struct connection_in * in = pin->first ; in->iroutines.detect = Browse_detect; in->Adapter = adapter_browse_monitor; /* OWFS assigned value */ in->iroutines.reset = NO_RESET_ROUTINE; in->iroutines.next_both = NO_NEXT_BOTH_ROUTINE; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = NO_SENDBACKDATA_ROUTINE; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = Browse_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_sham; in->adapter_name = "ZeroConf monitor"; pin->busmode = bus_browse ; RETURN_BAD_IF_BAD( browse_in_use(in) ) ; #if OW_ZERO in->master.browse.bonjour_browse = 0 ; #endif #if OW_AVAHI in->master.browse.browser = NULL ; in->master.browse.poll = NULL ; in->master.browse.client = NULL ; #endif /* OW_AVAHI */ if (Globals.zero == zero_none ) { LEVEL_DEFAULT("Zeroconf/Bonjour is disabled since Bonjour or Avahi library wasn't found."); return gbBAD; } else { OW_Browse(in); } return gbGOOD ; } static GOOD_OR_BAD browse_in_use(const struct connection_in * in_selected) { struct port_in * pin ; for ( pin = Inbound_Control.head_port ; pin ; pin = pin->next ) { struct connection_in *cin; if ( pin->busmode != bus_browse ) { continue ; } for (cin = pin->first; cin != NO_CONNECTION; cin = cin->next) { if ( cin == in_selected ) { continue ; } return gbBAD ; } } return gbGOOD; // not found in the current inbound list } static void Browse_close(struct connection_in *in) { #if OW_ZERO if (in->master.browse.bonjour_browse && (libdnssd != NULL)) { DNSServiceRefDeallocate(in->master.browse.bonjour_browse); in->master.browse.bonjour_browse = 0 ; } #if OW_AVAHI if ( in->master.browse.poll != NULL ) { // Signal avahi loop to quit (in ow_avahi_browse.c) // and clean up for itself avahi_threaded_poll_quit(in->master.browse.poll); } #endif /* OW_AVAHI */ #else /* OW_ZERO */ (void) in ; #endif /* OW_ZERO */ } owfs-3.1p5/module/owlib/src/c/ow_bus.c0000644000175000001440000000135012654730021014570 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_connection.h" GOOD_OR_BAD BUS_detect( struct port_in * pin ) { GOOD_OR_BAD (*detect) (struct port_in * pin) = pin->first->iroutines.detect ; if ( detect != NO_DETECT_ROUTINE ) { return (detect)(pin) ; } return gbBAD ; } void BUS_close( struct connection_in * in ) { void (*bus_close) (struct connection_in * in) = in->iroutines.close ; if ( bus_close != NO_CLOSE_ROUTINE ) { return (bus_close)(in); } } owfs-3.1p5/module/owlib/src/c/ow_bus_bitdata.c0000644000175000001440000000367212654730021016271 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" /** BUS_send_data Send a data and expect response match */ GOOD_OR_BAD BUS_send_bits(const BYTE * data, const size_t len, const struct parsedname *pn) { BYTE resp[len]; if (len == 0) { return gbGOOD; } if ( BAD( BUS_sendback_bits(data, resp, len, pn) ) ) { STAT_ADD1_BUS(e_bus_errors, pn->selected_connection); return gbBAD ; } RETURN_GOOD_IF_GOOD( BUS_compare_bits( data, resp, len ) ) ; LEVEL_DEBUG("Response doesn't match bits sent"); STAT_ADD1_BUS(e_bus_errors, pn->selected_connection); return gbBAD ; } // compare bits (just non-zero or zero) GOOD_OR_BAD BUS_compare_bits(const BYTE * data1, const BYTE * data2, const size_t len) { size_t i ; if (len == 0) { return gbGOOD; } for ( i=0 ; i< len ; ++i ) { if ( (data1[i]==0) != (data2[i]==0) ) { return gbBAD ; } } return gbGOOD; } /** readin_data Send 0xFFs and return response block */ GOOD_OR_BAD BUS_readin_bits(BYTE * data, const size_t len, const struct parsedname *pn) { memset(data, 0xFF, (size_t) len) ; RETURN_GOOD_IF_GOOD( BUS_sendback_bits( data, data, len, pn) ) ; STAT_ADD1(BUS_readin_data_errors); return gbBAD; } GOOD_OR_BAD BUS_sendback_bits( const BYTE * databits, BYTE * respbits, const size_t len, const struct parsedname * pn ) { GOOD_OR_BAD (*sendback_bits) (const BYTE * databits, BYTE * respbits, const size_t len, const struct parsedname * pn) = ((pn)->selected_connection->iroutines.sendback_bits) ; if ( sendback_bits != NO_SENDBACKBITS_ROUTINE ) { return (sendback_bits)((databits),(respbits),(len),(pn)) ; } return gbBAD ; } owfs-3.1p5/module/owlib/src/c/ow_bus_config.c0000644000175000001440000000163012654730021016116 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_connection.h" GOOD_OR_BAD BUS_Set_Config(void * v, const struct parsedname *pn) { GOOD_OR_BAD (*set_config) (void * param, const struct parsedname *pn) = pn->selected_connection->iroutines.set_config ; if ( set_config != NO_SET_CONFIG_ROUTINE ) { return (set_config)(v,pn) ; } return gbBAD ; } GOOD_OR_BAD BUS_Get_Config(void * v, const struct parsedname *pn) { GOOD_OR_BAD (*get_config) (void * param, const struct parsedname *pn) = pn->selected_connection->iroutines.get_config ; if ( get_config != NO_GET_CONFIG_ROUTINE ) { return (get_config)(v,pn) ; } return gbBAD ; } owfs-3.1p5/module/owlib/src/c/ow_bus_data.c0000644000175000001440000001031312654730021015560 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" static GOOD_OR_BAD BUS_sendback_data_bitbang(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn) ; /** BUS_send_data Send a data and expect response match */ GOOD_OR_BAD BUS_send_data(const BYTE * data, const size_t len, const struct parsedname *pn) { BYTE resp[len]; if (len == 0) { return gbGOOD; } if ( BAD( BUS_sendback_data(data, resp, len, pn) ) ) { STAT_ADD1_BUS(e_bus_errors, pn->selected_connection); return gbBAD ; } if ( memcmp(data, resp, len) != 0 ) { LEVEL_DEBUG("Response doesn't match data sent"); STAT_ADD1_BUS(e_bus_errors, pn->selected_connection); return gbBAD ; } return gbGOOD; } /** readin_data Send 0xFFs and return response block */ GOOD_OR_BAD BUS_readin_data(BYTE * data, const size_t len, const struct parsedname *pn) { memset(data, 0xFF, (size_t) len) ; RETURN_GOOD_IF_GOOD( BUS_sendback_data( data, data, len, pn) ) ; STAT_ADD1(BUS_readin_data_errors); return gbBAD; } // ---------------------------------------------------------------- // Low level default routines, often superceded by more capable adapters /* Symmetric */ /* send bytes, and read back -- calls lower level bit routine */ GOOD_OR_BAD BUS_select_and_sendback(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn) { GOOD_OR_BAD (*select_and_sendback) (const BYTE * data, BYTE * resp, const size_t len, const struct parsedname * pn) = pn->selected_connection->iroutines.select_and_sendback ; if ( select_and_sendback != NO_SELECTANDSENDBACK_ROUTINE ) { return (select_and_sendback) (data, resp, len, pn); } else { RETURN_BAD_IF_BAD( BUS_select(pn) ); return BUS_sendback_data(data, resp, len, pn); } } /* Symmetric */ /* send bytes, and read back -- calls lower level bit routine */ GOOD_OR_BAD BUS_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn) { GOOD_OR_BAD (*sendback_data) (const BYTE * data, BYTE * resp, const size_t len, const struct parsedname * pn) = pn->selected_connection->iroutines.sendback_data ; /* Empty is ok */ if (len == 0) { return gbGOOD; } /* Native function for this bus master? */ if ( sendback_data != NO_SENDBACKDATA_ROUTINE ) { return (sendback_data) (data, resp, len, pn); } return BUS_sendback_data_bitbang(data, resp, len, pn); } /* Symmetric */ /* send bytes, and read back -- calls lower level bit routine */ static GOOD_OR_BAD BUS_sendback_data_bitbang(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn) { /* Empty is ok */ if (len == 0) { return gbGOOD; } else { int max_split_bytes = MAX_FIFO_SIZE / 8 ; int remain = len - max_split_bytes; /* Possibly split into smaller packets? */ if (remain > 0) { RETURN_BAD_IF_BAD( BUS_sendback_data_bitbang(data, resp, max_split_bytes, pn) ); RETURN_BAD_IF_BAD( BUS_sendback_data_bitbang(&data[max_split_bytes], resp ? (&resp[max_split_bytes]) : NULL, remain, pn) ); } } { UINT i, bits = len * 8; BYTE bit_buffer[ bits ] ; /* Encode bits */ for (i = 0; i < bits; ++i) { #if OW_DEBUG if (Globals.error_level>=e_err_debug) { if ( (i&0x7)==0 ) { int b = i >>3 ; LEVEL_DEBUG("Splitting byte %d of %d = %.2X",b,len,data[b]) ; } } #endif /* OW_DEBUG */ bit_buffer[i] = UT_getbit(data, i) ? 0xFF : 0x00; } /* Communication with bit-level (e.g. DS9097) routine */ if ( BAD( BUS_sendback_bits(bit_buffer, bit_buffer, bits, pn)) ) { STAT_ADD1_BUS(e_bus_errors, pn->selected_connection); return gbBAD; } /* Decode Bits */ if (resp) { for (i = 0; i < bits; ++i) { UT_setbit(resp, i, bit_buffer[i] & 0x01); #if OW_DEBUG if (Globals.error_level>=e_err_debug) { if ( (i&0x7)==7 ) { int b = i >>3 ; LEVEL_DEBUG("Consolidating byte %d of %d = %.2X",b,len,resp[b]); } } #endif /* OW_DEBUG */ } } } return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_buslock.c0000644000175000001440000000371012654730021015443 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* locks are to handle multithreading */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" void BUS_lock(const struct parsedname *pn) { if (pn) { struct connection_in * in = pn->selected_connection ; BUSLOCKIN(in); } } void BUS_unlock(const struct parsedname *pn) { if (pn) { struct connection_in * in = pn->selected_connection ; BUSUNLOCKIN(in); } } void BUS_lock_in(struct connection_in *in) { PORTLOCKIN(in) ; CHANNELLOCKIN(in) ; } void BUS_unlock_in(struct connection_in *in) { CHANNELUNLOCKIN(in) ; PORTUNLOCKIN(in) ; } /* Lock just the bus master channel (and keep time statistics) */ void CHANNEL_lock_in(struct connection_in *in) { if (!in) { return; } _MUTEX_LOCK(in->bus_mutex); timernow( &(in->last_lock) ); /* for statistics */ STAT_ADD1_BUS(e_bus_locks, in); } /* Unlock just the bus master channel (and keep time statistics) */ void CHANNEL_unlock_in(struct connection_in *in) { struct timeval tv; if (!in) { return; } timernow( &tv ); if ( timercmp( &tv, &(in->last_lock), <) ) { LEVEL_DEBUG("System clock moved backward"); timernow( &(in->last_lock) ); } timersub( &tv, &(in->last_lock), &tv ) ; STATLOCK; timeradd( &tv, &(in->bus_time), &(in->bus_time) ) ; ++in->bus_stat[e_bus_unlocks]; STATUNLOCK; _MUTEX_UNLOCK(in->bus_mutex); } void PORT_lock_in(struct connection_in *in) { if (!in) { return; } if ( in->pown != NULL ) { if ( in->pown->connections > 1 ) { _MUTEX_LOCK(in->pown->port_mutex); } } } void PORT_unlock_in(struct connection_in *in) { if (!in) { return; } if ( in->pown != NULL ) { if ( in->pown->connections > 1 ) { _MUTEX_UNLOCK(in->pown->port_mutex); } } } owfs-3.1p5/module/owlib/src/c/ow_cache.c0000644000175000001440000013747212654730021015061 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ // 8/18/2004 -- applied Serg Oskin's correction // 8/20/2004 -- changed everything, specifically no longer using db, tsearch instead! #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" //#define CACHE_DEBUG #include #define EXTENSION_INTERNAL -2 // Directories are bus-specific, but buses are dynamic // The numbering is sequential, however, so use that and an arbitrary // generic unique address for directories. int DirMarkerLoc ; void * Directory_Marker = &DirMarkerLoc ; int AuxDirMarkerLoc ; void * AuxDirectory_Marker = &AuxDirMarkerLoc ; int MainDirMarkerLoc ; void * MainDirectory_Marker = &MainDirMarkerLoc ; // Devices are sn-based // generic unique address for devices. int DevMarkerLoc ; void * Device_Marker = &DevMarkerLoc ; // Aliases are sn-based // generic unique address for devices. int AliasMarkerLoc ; void * Alias_Marker = &AliasMarkerLoc ; /* Put the globals into a struct to declutter the namespace */ struct cache_data { void *temporary_tree_new; // current cache database void *temporary_tree_old; // older cache database void *persistent_tree; // persistent database void *temporary_alias_tree_new; // current cache database void *temporary_alias_tree_old; // older cache database void *persistent_alias_tree; // persistent database size_t old_ram_size; // cache size size_t new_ram_size; // cache size time_t time_retired; // start time of older time_t time_to_kill; // deathtime of older time_t retired_lifespan; // lifetime of older UINT added; // items added }; static struct cache_data cache; /* Cache elements are placed in a Red/Black binary tree -- standard glibc implementation -- use gnu tdestroy extension -- compatibility implementation included Cache key has 3 components: (struct tree_key) sn -- 8 byte serial number of 1-wire slave p -- pointer to internal structure like filetype (guaranteed unique if non-portable) extension -- integer used for array elements Cache node is the entire node not including data payload (struct key_node) key -- sorted component as above expires -- the time that the element is no longer valid dsize -- length in bytes of trailing data Cache data is the actual data allocated at same call as cache node access via macro TREE_DATA freed when cache node is freed Note: This means that cache data must be a copy of program data both on creation and retrieval */ /* Key used for sorting/retrieving cache data sn is for device serial number p is a pointer to filetype, or other things (guaranteed unique and fast lookup extension is used for indexed array properties */ struct tree_key { BYTE sn[8]; void *p; int extension; }; /* How we organize the data in the binary tree used for cache storage A key (see above) An expiration time And a size in bytes Actaully size bytes follows with the data */ struct tree_node { struct tree_key tk; time_t expires; size_t dsize; }; struct alias_tree_node { size_t size; time_t expires; union { INDEX_OR_ERROR bus; BYTE sn[SERIAL_NUMBER_SIZE]; } ; }; /* Bad bad C library */ /* implementation of tfind, tsearch returns an opaque structure */ /* you have to know that the first element is a pointer to your data */ struct tree_opaque { struct tree_node *key; void *other; }; #define TREE_DATA(tn) ( (BYTE *)(tn) + sizeof(struct tree_node) ) #define CONST_TREE_DATA(tn) ( (const BYTE *)(tn) + sizeof(struct tree_node) ) #define ALIAS_TREE_DATA(atn) ( (ASCII *)(atn) + sizeof(struct alias_tree_node) ) #define CONST_ALIAS_TREE_DATA(atn) ( (const ASCII *)(atn) + sizeof(struct alias_tree_node) ) enum cache_task_return { ctr_ok, ctr_not_found, ctr_expired, ctr_size_mismatch, } ; static void FlipTree( void ) ; static int IsThisPersistent( const struct parsedname * pn ) ; static GOOD_OR_BAD Cache_Add(const void *data, const size_t datasize, const struct parsedname *pn); static GOOD_OR_BAD Cache_Add_Common(struct tree_node *tn); static GOOD_OR_BAD Cache_Add_Persistent(struct tree_node *tn); static enum cache_task_return Cache_Get_Common(void *data, size_t * dsize, time_t * duration, const struct tree_node *tn); static enum cache_task_return Cache_Get_Common_Dir(struct dirblob *db, time_t * duration, const struct tree_node *tn); static enum cache_task_return Cache_Get_Persistent(void *data, size_t * dsize, time_t * duration, const struct tree_node *tn); static GOOD_OR_BAD Cache_Get_Simultaneous(const struct internal_prop *ip, struct one_wire_query *owq) ; static GOOD_OR_BAD Cache_Get_Internal(void *data, size_t * dsize, const struct internal_prop *ip, const struct parsedname *pn); static GOOD_OR_BAD Cache_Get_Strict(void *data, size_t dsize, const struct parsedname *pn); static void Cache_Del(const struct parsedname *pn) ; static GOOD_OR_BAD Cache_Del_Common(const struct tree_node *tn); static GOOD_OR_BAD Cache_Del_Persistent(const struct tree_node *tn); static void Cache_Add_Alias_Common(struct alias_tree_node *atn); static INDEX_OR_ERROR Cache_Get_Alias_Common( struct alias_tree_node * atn) ; static void Cache_Add_Alias_SN(const ASCII * alias_name, const BYTE * sn) ; static void Cache_Del_Alias_SN(const ASCII * alias_name) ; static void Cache_Add_Alias_Persistent(struct alias_tree_node *atn); static GOOD_OR_BAD Cache_Get_Alias_Persistent( BYTE * sn, struct alias_tree_node * atn); static void Cache_Del_Alias_Persistent( struct alias_tree_node * atn) ; static GOOD_OR_BAD Add_Stat(struct cache_stats *scache, GOOD_OR_BAD result); static GOOD_OR_BAD Get_Stat(struct cache_stats *scache, const enum cache_task_return result); static void Del_Stat(struct cache_stats *scache, const int result); static int tree_compare(const void *a, const void *b); static time_t TimeOut(const enum fc_change change); static void Aliaslistaction(const void *node, const VISIT which, const int depth) ; static void LoadTK( const BYTE * sn, void * p, int extension, struct tree_node * tn ) ; /* used for the sort/search b-tree routines */ /* big voodoo pointer fuss to just do a standard memory compare of the "key" */ static int tree_compare(const void *a, const void *b) { return memcmp(&((const struct tree_node *) a)->tk, &((const struct tree_node *) b)->tk, sizeof(struct tree_key)); } /* used for the sort/search b-tree routines */ /* big voodoo pointer fuss to just do a standard memory compare of the "key" */ static int alias_tree_compare(const void *a, const void *b) { int da = ((const struct alias_tree_node *) a)->size ; int d = da - ((const struct alias_tree_node *) b)->size ; if ( d != 0 ) { return d ; } return memcmp( CONST_ALIAS_TREE_DATA((const struct alias_tree_node *) a), CONST_ALIAS_TREE_DATA((const struct alias_tree_node *) b), da); } /* Gives the delay for a given property type */ /* Values in seconds (as defined in Globals structure and modified by command line and "settings") */ static time_t TimeOut(const enum fc_change change) { switch (change) { case fc_second: case fc_persistent: /* arbitrary non-zero */ return 1; case fc_volatile: case fc_simultaneous_temperature: case fc_simultaneous_voltage: return Globals.timeout_volatile; case fc_stable: case fc_read_stable: return Globals.timeout_stable; case fc_presence: return Globals.timeout_presence; case fc_directory: return Globals.timeout_directory; case fc_link: case fc_page: case fc_subdir: default: /* static or statistic */ return 0; } } #ifdef CACHE_DEBUG /* debug routine -- shows a table */ /* Run it as twalk(dababase, tree_show ) */ static void node_show(struct tree_node *tn) { int i; char b[26]; ctime_r(&tn->expires, b); fprintf(stderr,"\tNode " SNformat " pointer=%p extension=%d length=%d start=%p expires=%s", SNvar(tn->tk.sn), tn->tk.p, tn->tk.extension, tn->dsize, tn, b ? b : "null\n"); for (i = 0; i < sizeof(struct tree_key); ++i) { fprintf(stderr,"%.2X ", ((uint8_t *) tn)[i]); } fprintf(stderr,"\n"); } static void tree_show(const void *node, const VISIT which, const int depth) { const struct tree_node *tn = *(struct tree_node * *) node; (void) depth; if (node) { switch (which) { case leaf: case postorder: node_show(tn); // fall through default: break; } } else { fprintf(stderr,"Node empty\n"); } } static void new_tree(void) { fprintf(stderr,"Walk the new tree:\n"); twalk(cache.temporary_tree_new, tree_show); } #else /* CACHE_DEBUG */ #define new_tree() #define node_show(tn) #endif /* CACHE_DEBUG */ static int IsThisPersistent( const struct parsedname * pn ) { return ( (pn->selected_filetype->change==fc_persistent) || get_busmode(pn->selected_connection)==bus_mock ) ; } /* DB cache creation code */ /* Note: done in single-threaded mode so locking not yet needed */ void Cache_Open(void) { memset(&cache, 0, sizeof(struct cache_data)); cache.retired_lifespan = TimeOut(fc_stable); if (cache.retired_lifespan > 3600) { cache.retired_lifespan = 3600; /* 1 hour tops */ } // Flip once (at start) to set up old tree. FlipTree() ; } /* Note: done in a simgle single thread mode so locking not needed */ void Cache_Close(void) { Cache_Clear() ; SAFETDESTROY( cache.persistent_tree, owfree_func); SAFETDESTROY( cache.persistent_alias_tree, owfree_func); } /* Moves new to old tree, initializes new tree, and clears former old tree location */ static void FlipTree( void ) { void * flip = cache.temporary_tree_old; // old old saved for later clearing void * flip_alias = cache.temporary_alias_tree_old; // old old saved for later clearing /* Flip caches! old = new. New truncated, reset time and counters and flag */ LEVEL_DEBUG("Flipping cache tree (purging timed-out data)"); // move "new" pointers to "old" cache.temporary_tree_old = cache.temporary_tree_new; cache.old_ram_size = cache.new_ram_size; cache.temporary_alias_tree_old = cache.temporary_alias_tree_new; // New cache setup cache.temporary_tree_new = NULL; cache.temporary_alias_tree_new = NULL; cache.new_ram_size = 0; cache.added = 0; // set up "old" cache times cache.time_retired = NOW_TIME; cache.time_to_kill = cache.time_retired + cache.retired_lifespan; // delete really old tree LEVEL_DEBUG("flip cache. tdestroy() will be called."); SAFETDESTROY( flip, owfree_func); SAFETDESTROY( flip_alias, owfree_func); STATLOCK; ++cache_flips; /* statistics */ memcpy(&old_avg, &new_avg, sizeof(struct average)); AVERAGE_CLEAR(&new_avg); STATUNLOCK; } /* Clear the cache (a change was made that might give stale information) */ void Cache_Clear(void) { CACHE_WLOCK; FlipTree() ; FlipTree() ; CACHE_WUNLOCK; } /* Wrapper to perform a cache function and add statistics */ static GOOD_OR_BAD Add_Stat(struct cache_stats *scache, GOOD_OR_BAD result) { if ( GOOD(result) ) { STAT_ADD1(scache->adds); } return result; } /* Higher level add of a one-wire-query object */ GOOD_OR_BAD OWQ_Cache_Add(const struct one_wire_query *owq) { const struct parsedname *pn = PN(owq); if (pn->extension == EXTENSION_ALL) { switch (pn->selected_filetype->format) { case ft_ascii: case ft_vascii: case ft_alias: case ft_binary: return gbBAD; // cache of string arrays not supported case ft_integer: case ft_unsigned: case ft_yesno: case ft_date: case ft_float: case ft_pressure: case ft_temperature: case ft_tempgap: LEVEL_DEBUG("Adding data for %s", SAFESTRING(pn->path) ); return Cache_Add(OWQ_array(owq), (pn->selected_filetype->ag->elements) * sizeof(union value_object), pn); default: return gbBAD; } } else { switch (pn->selected_filetype->format) { case ft_ascii: case ft_vascii: case ft_alias: case ft_binary: if (OWQ_offset(owq) > 0) { return gbBAD; } LEVEL_DEBUG("Adding data for %s", SAFESTRING(pn->path) ); return Cache_Add(OWQ_buffer(owq), OWQ_length(owq), pn); case ft_integer: case ft_unsigned: case ft_yesno: case ft_date: case ft_float: case ft_pressure: case ft_temperature: case ft_tempgap: LEVEL_DEBUG("Adding data for %s", SAFESTRING(pn->path) ); return Cache_Add(&OWQ_val(owq), sizeof(union value_object), pn); default: return gbBAD; } } } /* Add an item to the cache */ /* return 0 if good, 1 if not */ static GOOD_OR_BAD Cache_Add(const void *data, const size_t datasize, const struct parsedname *pn) { struct tree_node *tn; time_t duration; int persistent ; if (!pn || IsAlarmDir(pn)) { return gbGOOD; // do check here to avoid needless processing } // Special handling of Mock persistent = IsThisPersistent(pn) ; if ( persistent ) { duration = 1 ; } else { duration = TimeOut(pn->selected_filetype->change); if (duration <= 0) { return gbGOOD; /* in case timeout set to 0 */ } } // allocate space for the node and data tn = (struct tree_node *) owmalloc(sizeof(struct tree_node) + datasize); if (!tn) { return gbBAD; } LEVEL_DEBUG(SNformat " size=%d", SNvar(pn->sn), (int) datasize); // populate the node structure with data LoadTK( pn->sn, pn->selected_filetype, pn->extension, tn ); tn->expires = duration + NOW_TIME; tn->dsize = datasize; if (datasize) { memcpy(TREE_DATA(tn), data, datasize); } return persistent ? Add_Stat(&cache_pst, Cache_Add_Persistent(tn)) : Add_Stat(&cache_ext, Cache_Add_Common(tn)) ; } /* Add a directory entry to the cache */ /* return 0 if good, 1 if not */ GOOD_OR_BAD Cache_Add_Dir(const struct dirblob *db, const struct parsedname *pn) { time_t duration = TimeOut(fc_directory); struct tree_node *tn; size_t size = DirblobElements(db) * SERIAL_NUMBER_SIZE; struct parsedname pn_directory; if (pn==NO_PARSEDNAME || pn->selected_connection==NO_CONNECTION) { return gbGOOD; // do check here to avoid needless processing } switch ( get_busmode(pn->selected_connection) ) { case bus_fake: case bus_tester: case bus_mock: case bus_w1: case bus_bad: case bus_unknown: return gbGOOD ; default: break ; } if (duration <= 0) { return 0; /* in case timeout set to 0 */ } if ( DirblobElements(db) < 1 ) { // only cache long directories. // zero (or one?) entry is possibly an error and needs to be repeated more quickly LEVEL_DEBUG("Won\'t cache empty directory"); Cache_Del_Dir( pn ) ; return gbGOOD ; } // allocate space for the node and data tn = (struct tree_node *) owmalloc(sizeof(struct tree_node) + size); if (!tn) { return gbBAD; } LEVEL_DEBUG("Adding directory for " SNformat " elements=%d", SNvar(pn->sn), DirblobElements(db)); // populate node with directory name and dirblob FS_LoadDirectoryOnly(&pn_directory, pn); LoadTK( pn_directory.sn, Directory_Marker, pn->selected_connection->index, tn ); tn->expires = duration + NOW_TIME; tn->dsize = size; if (size) { memcpy(TREE_DATA(tn), db->snlist, size); } return Add_Stat(&cache_dir, Cache_Add_Common(tn)); } /* Add a Simultaneous entry to the cache */ /* return 0 if good, 1 if not */ GOOD_OR_BAD Cache_Add_Simul(const struct internal_prop *ip, const struct parsedname *pn) { // Note: pn already points to directory time_t duration = TimeOut(ip->change); struct tree_node *tn; if (pn==NO_PARSEDNAME || pn->selected_connection==NO_CONNECTION) { return gbGOOD; // do check here to avoid needless processing } // Already removed inappropriate busmodes (like fake and usb_monitor) // Now test requested time if (duration <= 0) { return gbGOOD; /* in case timeout set to 0 */ } // allocate space for the node and data LEVEL_DEBUG("Adding for conversion time for "SNformat, SNvar(pn->sn)); tn = (struct tree_node *) owmalloc(sizeof(struct tree_node)); if (!tn) { return gbBAD; } LEVEL_DEBUG(SNformat, SNvar(pn->sn)); // populate node with directory name and dirblob LoadTK( pn->sn, ip->name, 0, tn) ; LEVEL_DEBUG("Simultaneous add type=%s",ip->name); tn->expires = duration + NOW_TIME; tn->dsize = 0; return Add_Stat(&cache_dir, Cache_Add_Common(tn)); } /* Add a device entry to the cache */ /* return 0 if good, 1 if not */ GOOD_OR_BAD Cache_Add_Device(const int bus_nr, const BYTE * sn) { time_t duration = TimeOut(fc_presence); struct tree_node *tn; if (duration <= 0) { return gbGOOD; /* in case timeout set to 0 */ } if ( sn[0] == 0 ) { //bad serial number return gbGOOD ; } tn = (struct tree_node *) owmalloc(sizeof(struct tree_node) + sizeof(int)); if (!tn) { return gbBAD; } LEVEL_DEBUG("Adding device location " SNformat " bus=%d", SNvar(sn), (int) bus_nr); LoadTK(sn, Device_Marker, 0, tn ); tn->expires = duration + NOW_TIME; tn->dsize = sizeof(int); memcpy(TREE_DATA(tn), &bus_nr, sizeof(int)); return Add_Stat(&cache_dev, Cache_Add_Common(tn)); } /* What do we cache? Type sn extension p What directory 0=root 0 *in dirblob DS2409_branch 0 *in dirblob device device sn EXTENSION_DEVICE=-1 NULL bus_nr internal device sn EXTENSION_INTERNAL=-2 ip->name binary data property device sn extension *ft binary data */ /* Add an item to the cache */ /* return 0 if good, 1 if not */ GOOD_OR_BAD Cache_Add_SlaveSpecific(const void *data, const size_t datasize, const struct internal_prop *ip, const struct parsedname *pn) { struct tree_node *tn; time_t duration; //printf("Cache_Add_SlaveSpecific\n"); if (!pn) { return gbGOOD; // do check here to avoid needless processing } duration = TimeOut(ip->change); if (duration <= 0) { return gbGOOD; /* in case timeout set to 0 */ } tn = (struct tree_node *) owmalloc(sizeof(struct tree_node) + datasize); if (!tn) { return gbBAD; } LEVEL_DEBUG("Adding internal data for "SNformat " size=%d", SNvar(pn->sn), (int) datasize); LoadTK( pn->sn, ip->name, EXTENSION_INTERNAL, tn ); tn->expires = duration + NOW_TIME; tn->dsize = datasize; if (datasize) { memcpy(TREE_DATA(tn), data, datasize); } //printf("ADD INTERNAL name= %s size=%d \n",tn->tk.p.nm,tn->dsize); //printf(" ADD INTERNAL data[0]=%d size=%d \n",((BYTE *)data)[0],datasize); switch (ip->change) { case fc_persistent: return Add_Stat(&cache_pst, Cache_Add_Persistent(tn)); default: return Add_Stat(&cache_int, Cache_Add_Common(tn)); } } /* Add an item to the cache */ /* return 0 if good, 1 if not */ GOOD_OR_BAD Cache_Add_Alias(const ASCII *name, const BYTE * sn) { struct tree_node *tn; size_t size = strlen(name) ; if ( size == 0 ) { return gbGOOD ; } tn = (struct tree_node *) owmalloc(sizeof(struct tree_node) + size + 1 ); if (!tn) { return gbBAD; } LEVEL_DEBUG("Adding alias for " SNformat " = %s", SNvar(sn), name); LoadTK( sn, Alias_Marker, 0, tn ); tn->expires = NOW_TIME; tn->dsize = size; memcpy((ASCII *)TREE_DATA(tn), name, size+1 ); // includes NULL Cache_Add_Alias_SN( name, sn ) ; return Add_Stat(&cache_pst, Cache_Add_Persistent(tn)); } /* Add an item to the cache */ /* retire the cache (flip) if too old, and start a new one (keep the old one for a while) */ /* return 0 if good, 1 if not */ static GOOD_OR_BAD Cache_Add_Common(struct tree_node *tn) { struct tree_opaque *opaque; enum { no_add, yes_add, just_update } state = no_add; node_show(tn); LEVEL_DEBUG("Add to cache sn " SNformat " pointer=%p index=%d size=%d", SNvar(tn->tk.sn), tn->tk.p, tn->tk.extension, tn->dsize); CACHE_WLOCK; if (cache.time_to_kill < NOW_TIME) { // old database has timed out FlipTree() ; } if (Globals.cache_size && (cache.old_ram_size + cache.new_ram_size > Globals.cache_size)) { // failed size test owfree(tn); } else if ((opaque = tsearch(tn, &cache.temporary_tree_new, tree_compare))) { //printf("Cache_Add_Common to %p\n",opaque); if (tn != opaque->key) { cache.new_ram_size += sizeof(tn) - sizeof(opaque->key); owfree(opaque->key); opaque->key = tn; state = just_update; } else { state = yes_add; cache.new_ram_size += sizeof(tn); } } else { // nothing found or added?!? free our memory segment owfree(tn); } CACHE_WUNLOCK; /* Added or updated, update statistics */ switch (state) { case yes_add: // add new entry STATLOCK; AVERAGE_IN(&new_avg); ++cache_adds; /* statistics */ STATUNLOCK; return gbGOOD; case just_update: // update the time mark and data STATLOCK; AVERAGE_MARK(&new_avg); ++cache_adds; /* statistics */ STATUNLOCK; return gbGOOD; default: // unable to add return gbBAD; } } /* Add an item to the cache */ /* retire the cache (flip) if too old, and start a new one (keep the old one for a while) */ /* return 0 if good, 1 if not */ static GOOD_OR_BAD Cache_Add_Persistent(struct tree_node *tn) { struct tree_opaque *opaque; enum { no_add, yes_add, just_update } state = no_add; LEVEL_DEBUG("Adding data to permanent store"); PERSISTENT_WLOCK; opaque = tsearch(tn, &cache.persistent_tree, tree_compare) ; if ( opaque != NULL ) { //printf("CACHE ADD pointer=%p, key=%p\n",tn,opaque->key); if (tn != opaque->key) { owfree(opaque->key); opaque->key = tn; state = just_update; } else { state = yes_add; } } else { // nothing found or added?!? free our memory segment owfree(tn); } PERSISTENT_WUNLOCK; switch (state) { case yes_add: STATLOCK; AVERAGE_IN(&store_avg); STATUNLOCK; return gbGOOD; case just_update: STATLOCK; AVERAGE_MARK(&store_avg); STATUNLOCK; return gbGOOD; default: return gbBAD; } } static GOOD_OR_BAD Get_Stat(struct cache_stats *scache, const enum cache_task_return result) { GOOD_OR_BAD gbret = gbBAD ; // default STATLOCK; ++scache->tries; switch ( result ) { case ctr_expired: ++scache->expires; break ; case ctr_ok: ++scache->hits; gbret = gbGOOD ; break ; default: break ; } STATUNLOCK; return gbret ; } /* Does cache get, but doesn't allow play in data size */ static GOOD_OR_BAD Cache_Get_Strict(void *data, size_t dsize, const struct parsedname *pn) { size_t size = dsize; RETURN_BAD_IF_BAD( Cache_Get(data, &size, pn) ) ; return ( dsize == size) ? gbGOOD : gbBAD ; } GOOD_OR_BAD OWQ_Cache_Get(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); // do check here to avoid needless processing if (IsUncachedDir(pn) || IsAlarmDir(pn)) { return gbBAD; } switch (pn->selected_filetype->change) { case fc_simultaneous_temperature: return Cache_Get_Simultaneous(SlaveSpecificTag(S_T), owq) ; case fc_simultaneous_voltage: return Cache_Get_Simultaneous(SlaveSpecificTag(S_T), owq) ; default: break ; } if (pn->extension == EXTENSION_ALL) { switch (pn->selected_filetype->format) { case ft_ascii: case ft_vascii: case ft_alias: case ft_binary: return gbBAD; // string arrays not supported case ft_integer: case ft_unsigned: case ft_yesno: case ft_date: case ft_float: case ft_pressure: case ft_temperature: case ft_tempgap: return Cache_Get_Strict(OWQ_array(owq), (pn->selected_filetype->ag->elements) * sizeof(union value_object), pn); default: return gbBAD; } } else { switch (pn->selected_filetype->format) { case ft_ascii: case ft_vascii: case ft_alias: case ft_binary: if (OWQ_offset(owq) > 0) { return gbBAD; } OWQ_length(owq) = OWQ_size(owq); return Cache_Get(OWQ_buffer(owq), &OWQ_length(owq), pn); case ft_integer: case ft_unsigned: case ft_yesno: case ft_date: case ft_float: case ft_pressure: case ft_temperature: case ft_tempgap: return Cache_Get_Strict(&OWQ_val(owq), sizeof(union value_object), pn); default: return gbBAD; } } } /* Look in caches, 0=found and valid, 1=not or uncachable in the first place */ GOOD_OR_BAD Cache_Get(void *data, size_t * dsize, const struct parsedname *pn) { time_t duration; struct tree_node tn; int persistent ; // do check here to avoid needless processing if (IsUncachedDir(pn) || IsAlarmDir(pn)) { return gbBAD; } // Special handling of Mock persistent = IsThisPersistent(pn) ; if ( persistent ) { duration = 1 ; } else { duration = TimeOut(pn->selected_filetype->change); if (duration <= 0) { return gbBAD; /* in case timeout set to 0 */ } } LEVEL_DEBUG(SNformat " size=%d IsUncachedDir=%d", SNvar(pn->sn), (int) dsize[0], IsUncachedDir(pn)); LoadTK( pn->sn, pn->selected_filetype, pn->extension, &tn ); return persistent ? Get_Stat(&cache_pst, Cache_Get_Persistent(data, dsize, &duration, &tn)) : Get_Stat(&cache_ext, Cache_Get_Common(data, dsize, &duration, &tn)); } /* Look in caches, 0=found and valid, 1=not or uncachable in the first place */ GOOD_OR_BAD Cache_Get_Dir(struct dirblob *db, const struct parsedname *pn) { time_t duration = TimeOut(fc_directory); struct tree_node tn; struct parsedname pn_directory; DirblobInit(db); if (duration <= 0) { return gbBAD; } LEVEL_DEBUG("Looking for directory "SNformat, SNvar(pn->sn)); FS_LoadDirectoryOnly(&pn_directory, pn); LoadTK( pn_directory.sn, Directory_Marker, pn->selected_connection->index, &tn) ; return Get_Stat(&cache_dir, Cache_Get_Common_Dir(db, &duration, &tn)); } /* Look in caches, 0=found and valid, 1=not or uncachable in the first place */ static enum cache_task_return Cache_Get_Common_Dir(struct dirblob *db, time_t * duration, const struct tree_node *tn) { enum cache_task_return ctr_ret; time_t now = NOW_TIME; size_t size; struct tree_opaque *opaque; LEVEL_DEBUG("Get from cache sn " SNformat " pointer=%p extension=%d", SNvar(tn->tk.sn), tn->tk.p, tn->tk.extension); CACHE_RLOCK; opaque = tfind(tn, &cache.temporary_tree_new, tree_compare) ; if ( opaque == NULL ) { // not found in new tree if ( cache.time_retired + duration[0] > now ) { // old tree could be new enough opaque = tfind(tn, &cache.temporary_tree_old, tree_compare) ; } } if ( opaque != NULL ) { duration[0] = opaque->key->expires - now ; if (duration[0] >= 0) { LEVEL_DEBUG("Dir found in cache"); size = opaque->key->dsize; if (DirblobRecreate(TREE_DATA(opaque->key), size, db) == 0) { //printf("Cache: snlist=%p, devices=%lu, size=%lu\n",*snlist,devices[0],size) ; ctr_ret = ctr_ok; } else { ctr_ret = ctr_size_mismatch; } } else { //char b[26]; //printf("GOT DEAD now:%s",ctime_r(&now,b)) ; //printf(" then:%s",ctime_r(&opaque->key->expires,b)) ; LEVEL_DEBUG("Dir expired in cache"); ctr_ret = ctr_expired; } } else { LEVEL_DEBUG("Dir not found in cache"); ctr_ret = ctr_not_found; } CACHE_RUNLOCK; return ctr_ret; } /* Look in caches, 0=found and valid, 1=not or uncachable in the first place */ GOOD_OR_BAD Cache_Get_Device(void *bus_nr, const struct parsedname *pn) { time_t duration = TimeOut(fc_presence); size_t size = sizeof(int); struct tree_node tn; if (duration <= 0) { return gbBAD; } LEVEL_DEBUG("Looking for device "SNformat, SNvar(pn->sn)); LoadTK( pn->sn, Device_Marker, 0, &tn ) ; return Get_Stat(&cache_dev, Cache_Get_Common(bus_nr, &size, &duration, &tn)); } /* Does cache get, but doesn't allow play in data size */ GOOD_OR_BAD Cache_Get_SlaveSpecific(void *data, size_t dsize, const struct internal_prop *ip, const struct parsedname *pn) { size_t size = dsize; RETURN_BAD_IF_BAD( Cache_Get_Internal(data, &size, ip, pn) ) ; return ( dsize == size) ? gbGOOD : gbBAD ; } /* Look in caches, 0=found and valid, 1=not or uncachable in the first place */ static GOOD_OR_BAD Cache_Get_Internal(void *data, size_t * dsize, const struct internal_prop *ip, const struct parsedname *pn) { struct tree_node tn; time_t duration; //printf("Cache_Get_Internal"); if (!pn) { return gbBAD; // do check here to avoid needless processing } duration = TimeOut(ip->change); if (duration <= 0) { return gbBAD; /* in case timeout set to 0 */ } LEVEL_DEBUG(SNformat " size=%d", SNvar(pn->sn), (int) dsize[0]); LoadTK( pn->sn, ip->name, EXTENSION_INTERNAL, &tn) ; switch (ip->change) { case fc_persistent: return Get_Stat(&cache_pst, Cache_Get_Persistent(data, dsize, &duration, &tn)); default: return Get_Stat(&cache_int, Cache_Get_Common(data, dsize, &duration, &tn)); } } /* Test for a simultaneous property If the property isn't independently cached, return false (1) If the simultaneous conversion is more recent, return false (1) Else return the cached value and true (0) */ GOOD_OR_BAD Cache_Get_Simul_Time(const struct internal_prop *ip, time_t * dwell_time, const struct parsedname * pn) { // valid cached primary data -- see if a simultaneous conversion should be used instead struct tree_node tn; time_t duration ; size_t dsize_simul = 0 ; struct parsedname pn_directory ; duration = TimeOut(ip->change); // time allocated this conversion if ( duration <= 0) { // uncachable return gbBAD; } LEVEL_DEBUG("Looking for conversion time "SNformat, SNvar(pn->sn)); FS_LoadDirectoryOnly(&pn_directory, pn); LoadTK(pn_directory.sn, ip->name, 0, &tn ) ; if ( Get_Stat(&cache_int, Cache_Get_Common(NULL, &dsize_simul, &duration, &tn)) ) { return gbBAD ; } // duration_simul is time left // duration is time allocated // back-compute dwell time dwell_time[0] = TimeOut(ip->change) - duration ; return gbGOOD ; } /* Test for a simultaneous property * return true if simultaneous is the prefered method * bad if no simultaneous, or it's not the best */ static GOOD_OR_BAD Cache_Get_Simultaneous(const struct internal_prop *ip, struct one_wire_query *owq) { struct tree_node tn; time_t duration ; time_t time_left ; time_t dwell_time_simul ; struct parsedname * pn = PN(owq) ; size_t dsize = sizeof(union value_object) ; time_left = duration = TimeOut(pn->selected_filetype->change); if (duration <= 0) { // probably "uncached" requested return gbBAD; } LoadTK( pn->sn, pn->selected_filetype, pn->extension, &tn ) ; if ( Get_Stat(&cache_ext, Cache_Get_Common( &OWQ_val(owq), &dsize, &time_left, &tn)) == 0 ) { // valid cached primary data -- see if a simultaneous conversion should be used instead time_t dwell_time_data = duration - time_left ; if ( BAD( Cache_Get_Simul_Time( ip, &dwell_time_simul, pn)) ) { // Simul not found or timed out LEVEL_DEBUG("Simultaneous conversion not found.") ; OWQ_SIMUL_CLR(owq) ; return gbGOOD ; } if ( dwell_time_simul < dwell_time_data ) { LEVEL_DEBUG("Simultaneous conversion is newer than previous reading.") ; OWQ_SIMUL_SET(owq) ; return gbBAD ; // Simul is newer } // Cached data is newer, so use it OWQ_SIMUL_CLR(owq) ; return gbGOOD ; } // fall through -- no cached primary data if ( BAD( Cache_Get_Simul_Time( ip, &dwell_time_simul, pn)) ) { // no simultaneous either OWQ_SIMUL_CLR(owq) ; return gbBAD ; } OWQ_SIMUL_SET(owq) ; return gbBAD ; // Simul is newer } /* Look in caches, 0=found and valid, 1=not or uncachable in the first place */ /* space allocated, needs to be owfree-d */ /* returns null-terminated string */ ASCII * Cache_Get_Alias(const BYTE * sn) { struct tree_node tn; struct tree_opaque *opaque; ASCII * alias_name = NULL ; LoadTK(sn, Alias_Marker, 0, &tn ) ; PERSISTENT_RLOCK; opaque = tfind(&tn, &cache.persistent_tree, tree_compare) ; if ( opaque != NULL ) { alias_name = owmalloc( opaque->key->dsize + 1 ) ; if ( alias_name != NULL ) { memcpy( alias_name, (ASCII *)TREE_DATA(opaque->key), opaque->key->dsize+1 ) ; LEVEL_DEBUG("Retrieving " SNformat " alias=%s", SNvar(sn), alias_name ); } } PERSISTENT_RUNLOCK; return alias_name ; } /* Look in caches */ /* duration is time left */ /* inputs: dsize, duration, tn * outputs: return value, data, dsize (updated), duration (updated) * */ static enum cache_task_return Cache_Get_Common(void *data, size_t * dsize, time_t * duration, const struct tree_node *tn) { enum cache_task_return ctr_ret; time_t now = NOW_TIME; struct tree_opaque *opaque; LEVEL_DEBUG("Search in cache sn " SNformat " pointer=%p index=%d size=%d", SNvar(tn->tk.sn), tn->tk.p, tn->tk.extension, (int) dsize[0]); //node_show(tn); //new_tree(); CACHE_RLOCK; opaque = tfind(tn, &cache.temporary_tree_new, tree_compare) ; if ( opaque == NULL ) { // not found in new tree if ( cache.time_retired + duration[0] > now ) { // retired time isn't too old for this data item opaque = tfind(tn, &cache.temporary_tree_old, tree_compare) ; } } if ( opaque != NULL ) { // modify duration to time left (can be negative if expired) duration[0] = opaque->key->expires - now ; if (duration[0] > 0) { LEVEL_DEBUG("Value found in cache. Remaining life: %d seconds.",duration[0]); // Compared with >= before, but fc_second(1) always cache for 2 seconds in that case. // Very noticable when reading time-data like "/26.80A742000000/date" for example. if ( dsize[0] >= opaque->key->dsize) { // lower data size if stored value is shorter dsize[0] = opaque->key->dsize; //tree_show(opaque,leaf,0); if (dsize[0] > 0) { memcpy(data, TREE_DATA(opaque->key), dsize[0]); } ctr_ret = ctr_ok; //twalk(cache.temporary_tree_new,tree_show) ; } else { ctr_ret = ctr_size_mismatch; } } else { LEVEL_DEBUG("Value found in cache, but expired by %d seconds.",-duration[0]); ctr_ret = ctr_expired; } } else { LEVEL_DEBUG("Value not found in cache"); ctr_ret = ctr_not_found; } CACHE_RUNLOCK; return ctr_ret; } /* Look in caches, 0=found and valid, 1=not or uncachable in the first place */ static enum cache_task_return Cache_Get_Persistent(void *data, size_t * dsize, time_t * duration, const struct tree_node *tn) { struct tree_opaque *opaque; enum cache_task_return ctr_ret; (void) duration; // ignored -- no timeout PERSISTENT_RLOCK; opaque = tfind(tn, &cache.persistent_tree, tree_compare) ; if ( opaque != NULL ) { if ( dsize[0] >= opaque->key->dsize) { dsize[0] = opaque->key->dsize; if (dsize[0] > 0) { memcpy(data, TREE_DATA(opaque->key), dsize[0]); } ctr_ret = ctr_ok; } else { ctr_ret = ctr_size_mismatch; } } else { ctr_ret = ctr_not_found; } PERSISTENT_RUNLOCK; return ctr_ret; } static void Del_Stat(struct cache_stats *scache, const int result) { if ( GOOD( result)) { STAT_ADD1(scache->deletes); } } void OWQ_Cache_Del(struct one_wire_query *owq) { Cache_Del(PN(owq)); } void OWQ_Cache_Del_ALL(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; // convenience int extension = pn->extension ; // store extension pn->extension = EXTENSION_ALL ; // temporary assignment Cache_Del(pn); pn->extension = extension ; // restore extension } void OWQ_Cache_Del_BYTE(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; // convenience int extension = pn->extension ; // store extension pn->extension = EXTENSION_BYTE ; // temporary assignment Cache_Del(pn); pn->extension = extension ; // restore extension } void OWQ_Cache_Del_parts(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; // convenience if ( pn->selected_filetype->ag != NON_AGGREGATE ) { int extension = pn->extension ; // store extension int extension_index ; for ( extension_index = pn->selected_filetype->ag->elements - 1 ; extension_index >= 0 ; -- extension_index ) { pn->extension = extension_index ; // temporary assignment Cache_Del(pn); } pn->extension = extension ; // restore extension } else { Cache_Del(pn); } } // Delete a serial number's alias // Safe to call if no alias exists // Also deletes from linked alias_sn file void Cache_Del_Alias(const BYTE * sn) { ASCII * alias_name ; struct tree_node *tn; size_t size ; alias_name = Cache_Get_Alias( sn ) ; if ( alias_name == NULL ) { // doesn't exist // (or a memory error -- unlikely) return ; } LEVEL_DEBUG("Deleting alias %s from "SNformat, alias_name, SNvar(sn)) ; size = strlen( alias_name ) ; tn = (struct tree_node *) owmalloc(sizeof(struct tree_node) + size + 1 ); if ( tn != NULL ) { tn->expires = NOW_TIME; tn->dsize = size; memcpy((ASCII *)TREE_DATA(tn), alias_name, size+1); // includes NULL LoadTK( sn, Alias_Marker, 0, tn ) ; Del_Stat(&cache_pst, Cache_Del_Persistent(tn)); Cache_Del_Alias_SN( alias_name ) ; } owfree( alias_name ) ; } static void Cache_Del(const struct parsedname *pn) { struct tree_node tn; time_t duration; //printf("Cache_Del\n") ; //printf("Cache_Del\n") ; if (!pn) { return; // do check here to avoid needless processing } duration = TimeOut(pn->selected_filetype->change); if (duration <= 0) { return; /* in case timeout set to 0 */ } LoadTK( pn->sn, pn->selected_filetype, pn->extension, &tn ) ; switch (pn->selected_filetype->change) { case fc_persistent: Del_Stat(&cache_pst, Cache_Del_Persistent(&tn)); break ; default: Del_Stat(&cache_ext, Cache_Del_Common(&tn)); break ; } } void Cache_Del_Mixed_Individual(const struct parsedname *pn) { struct tree_node tn; time_t duration; //printf("Cache_Del\n") ; if (!pn) { return; // do check here to avoid needless processing } if (pn->selected_filetype->ag==NON_AGGREGATE || pn->selected_filetype->ag->combined!=ag_mixed) { return ; } duration = TimeOut(pn->selected_filetype->change); if (duration <= 0) { return; /* in case timeout set to 0 */ } LoadTK( pn->sn, pn->selected_filetype, 0, &tn) ; for ( tn.tk.extension = pn->selected_filetype->ag->elements-1 ; tn.tk.extension >= 0 ; --tn.tk.extension ) { switch (pn->selected_filetype->change) { case fc_persistent: Del_Stat(&cache_pst, Cache_Del_Persistent(&tn)); break ; default: Del_Stat(&cache_ext, Cache_Del_Common(&tn)); break ; } } } void Cache_Del_Mixed_Aggregate(const struct parsedname *pn) { struct tree_node tn; time_t duration; //printf("Cache_Del\n") ; if (!pn) { return; // do check here to avoid needless processing } if (pn->selected_filetype->ag==NON_AGGREGATE || pn->selected_filetype->ag->combined!=ag_mixed) { return ; } duration = TimeOut(pn->selected_filetype->change); if (duration <= 0) { return; /* in case timeout set to 0 */ } LoadTK( pn->sn, pn->selected_filetype, EXTENSION_ALL, &tn) ; switch (pn->selected_filetype->change) { case fc_persistent: Del_Stat(&cache_pst, Cache_Del_Persistent(&tn)); break ; default: Del_Stat(&cache_ext, Cache_Del_Common(&tn)); break ; } } void Cache_Del_Dir(const struct parsedname *pn) { struct tree_node tn; struct parsedname pn_directory; FS_LoadDirectoryOnly(&pn_directory, pn); LoadTK( pn_directory.sn, Directory_Marker, pn->selected_connection->index, &tn ) ; Del_Stat(&cache_dir, Cache_Del_Common(&tn)); } void Cache_Del_Simul(const struct internal_prop *ip, const struct parsedname *pn) { struct tree_node tn; struct parsedname pn_directory; FS_LoadDirectoryOnly(&pn_directory, pn); LoadTK(pn_directory.sn, ip->name, 0, &tn ); Del_Stat(&cache_dir, Cache_Del_Common(&tn)); } void Cache_Del_Device(const struct parsedname *pn) { struct tree_node tn; time_t duration = TimeOut(fc_presence); if (duration <= 0) { return; } LoadTK(pn->sn, Device_Marker, 0, &tn) ; Del_Stat(&cache_dev, Cache_Del_Common(&tn)); } void Cache_Del_Internal(const struct internal_prop *ip, const struct parsedname *pn) { struct tree_node tn; time_t duration; //printf("Cache_Del_Internal\n") ; if (!pn) { return; // do check here to avoid needless processing } duration = TimeOut(ip->change); if (duration <= 0) { return; /* in case timeout set to 0 */ } LoadTK(pn->sn, ip->name, 0, &tn); switch (ip->change) { case fc_persistent: Del_Stat(&cache_pst, Cache_Del_Persistent(&tn)); break; default: Del_Stat(&cache_int, Cache_Del_Common(&tn)); break; } } static GOOD_OR_BAD Cache_Del_Common(const struct tree_node *tn) { struct tree_opaque *opaque; time_t now = NOW_TIME; GOOD_OR_BAD ret = gbBAD; LEVEL_DEBUG("Delete from cache sn " SNformat " in=%p index=%d", SNvar(tn->tk.sn), tn->tk.p, tn->tk.extension); CACHE_WLOCK; opaque = tfind(tn, &cache.temporary_tree_new, tree_compare) ; if ( opaque == NULL ) { // not in new tree if ( cache.time_to_kill > now ) { // old tree still alive opaque = tfind(tn, &cache.temporary_tree_old, tree_compare) ; } } if ( opaque != NULL ) { opaque->key->expires = now - 1; ret = gbGOOD; } CACHE_WUNLOCK; return ret; } static GOOD_OR_BAD Cache_Del_Persistent(const struct tree_node *tn) { struct tree_opaque *opaque; struct tree_node *tn_found = NULL; PERSISTENT_WLOCK; opaque = tfind(tn, &cache.persistent_tree, tree_compare) ; if ( opaque != NULL ) { tn_found = opaque->key; tdelete(tn, &cache.persistent_tree, tree_compare); } PERSISTENT_WUNLOCK; if ( tn_found == NULL ) { return gbBAD; } owfree(tn_found); STATLOCK; AVERAGE_OUT(&store_avg); STATUNLOCK; return gbGOOD; } static void LoadTK( const BYTE * sn, void * p, int extension, struct tree_node * tn ) { memset(&(tn->tk), 0, sizeof(struct tree_key)); memcpy(tn->tk.sn, sn, SERIAL_NUMBER_SIZE); tn->tk.p = p; tn->tk.extension = extension; } // Alias list from persistent cache // formatted as an alias file: // NNNNNNNNNNNN=alias_name\n // // Need to protect a global variable (aliaslist_cb) since twalk has no way of sending user data. struct memblob * aliaslist_mb ; static void Aliaslistaction(const void *node, const VISIT which, const int depth) { const struct tree_node *p = *(struct tree_node * const *) node; (void) depth; char SN_address[SERIAL_NUMBER_SIZE*2] ; switch (which) { case leaf: case postorder: if ( p->tk.p != Alias_Marker ) { return ; } // Add sn address bytes2string(SN_address, p->tk.sn, SERIAL_NUMBER_SIZE); MemblobAdd( (BYTE *) SN_address, SERIAL_NUMBER_SIZE*2, aliaslist_mb ) ; // Add '=' MemblobAdd( (BYTE *) "=", 1, aliaslist_mb ) ; // Add alias name MemblobAdd( (const BYTE *)CONST_TREE_DATA(p), p->dsize, aliaslist_mb ) ; // Add MemblobAdd( (BYTE *) "\x0D\x0A", 2, aliaslist_mb ) ; return ; case preorder: case endorder: break; } } void Aliaslist( struct memblob * mb ) { PERSISTENT_RLOCK ; ALIASLISTLOCK ; aliaslist_mb = mb ; twalk(cache.persistent_tree, Aliaslistaction); ALIASLISTUNLOCK ; PERSISTENT_RUNLOCK ; } /* Add an alias to the temporary database of name->bus */ /* alias_name is a null-terminated string */ void Cache_Add_Alias_Bus(const ASCII * alias_name, INDEX_OR_ERROR bus) { // allocate space for the node and data size_t datasize = strlen(alias_name) ; struct alias_tree_node *atn = (struct alias_tree_node *) owmalloc(sizeof(struct alias_tree_node) + datasize + 1 ); time_t duration = TimeOut(fc_presence); if (atn==NULL) { return ; } if (datasize==0) { owfree(atn) ; return ; } // populate the node structure with data atn->expires = duration + NOW_TIME; atn->size = datasize ; atn->bus = bus ; memcpy( ALIAS_TREE_DATA(atn), alias_name, datasize + 1 ) ; Cache_Add_Alias_Common( atn ) ; } /* Add an item to the alias cache */ /* retire the cache (flip) if too old, and start a new one (keep the old one for a while) */ static void Cache_Add_Alias_Common(struct alias_tree_node *atn) { struct tree_opaque *opaque; CACHE_WLOCK; if (cache.time_to_kill < NOW_TIME) { // old database has timed out FlipTree() ; } if (Globals.cache_size && (cache.old_ram_size + cache.new_ram_size > Globals.cache_size)) { // failed size test owfree(atn); } else if ((opaque = tsearch(atn, &cache.temporary_alias_tree_new, alias_tree_compare))) { if ( (void *)atn != (void *) (opaque->key) ) { cache.new_ram_size += sizeof(atn) - sizeof(opaque->key); owfree(opaque->key); opaque->key = (void *) atn; } else { cache.new_ram_size += sizeof(atn); } } else { // nothing found or added?!? free our memory segment owfree(atn); } CACHE_WUNLOCK; } /* Add an alias/sn to the persistent database of name->sn */ /* Alias name must be a null-terminated string */ static void Cache_Add_Alias_SN(const ASCII * alias_name, const BYTE * sn) { // allocate space for the node and data size_t datasize = strlen(alias_name) ; struct alias_tree_node *atn = (struct alias_tree_node *) owmalloc(sizeof(struct alias_tree_node) + datasize + 1); if (atn==NULL) { return ; } if (datasize==0) { owfree(atn) ; return ; } // populate the node structure with data atn->expires = NOW_TIME; atn->size = datasize; memcpy( atn->sn, sn, SERIAL_NUMBER_SIZE ) ; memcpy( ALIAS_TREE_DATA(atn), alias_name, datasize+1 ) ; Cache_Add_Alias_Persistent( atn ) ; } static void Cache_Add_Alias_Persistent(struct alias_tree_node *atn) { struct tree_opaque *opaque; PERSISTENT_WLOCK; opaque = tsearch(atn, &cache.persistent_alias_tree, alias_tree_compare) ; if ( opaque != NULL ) { if ( (void *) atn != (void *) (opaque->key) ) { owfree(opaque->key); opaque->key = (void *) atn; } } else { // nothing found or added?!? free our memory segment owfree(atn); } PERSISTENT_WUNLOCK; } /* Find bus from alias name */ /* Alias name must be a null-terminated string */ INDEX_OR_ERROR Cache_Get_Alias_Bus(const ASCII * alias_name) { // allocate space for the node and data size_t datasize = strlen(alias_name) ; struct alias_tree_node *atn = (struct alias_tree_node *) owmalloc(sizeof(struct alias_tree_node) + datasize + 1); if (atn==NULL) { return INDEX_BAD ; } if (datasize==0) { owfree(atn) ; return INDEX_BAD ; } // populate the node structure with data atn->size = datasize; memcpy( ALIAS_TREE_DATA(atn), alias_name, datasize+1 ) ; return Cache_Get_Alias_Common( atn ) ; } static INDEX_OR_ERROR Cache_Get_Alias_Common( struct alias_tree_node * atn) { INDEX_OR_ERROR bus = INDEX_BAD; time_t now = NOW_TIME; struct tree_opaque *opaque; CACHE_RLOCK; opaque = tfind(atn, &cache.temporary_alias_tree_new, alias_tree_compare) ; if ( opaque == NULL ) { // try old tree opaque = tfind(atn, &cache.temporary_alias_tree_old, alias_tree_compare) ; } if ( opaque != NULL ) { // test expiration if ( ((struct alias_tree_node *)(opaque->key))->expires > now) { bus = ((struct alias_tree_node *)(opaque->key))->bus ; LEVEL_DEBUG("Found %s on bus.%d",ALIAS_TREE_DATA(atn),bus) ; } } CACHE_RUNLOCK; LEVEL_DEBUG("Finding %s unsuccessful",ALIAS_TREE_DATA(atn)) ; owfree(atn) ; return bus; } /* sn must point to an 8 byte buffer */ /* Alias name must be a null-terminated string */ GOOD_OR_BAD Cache_Get_Alias_SN(const ASCII * alias_name, BYTE * sn ) { // allocate space for the node and data size_t datasize = strlen(alias_name) ; struct alias_tree_node *atn ; if (datasize==0) { return gbBAD ; } atn = (struct alias_tree_node *) owmalloc(sizeof(struct alias_tree_node) + datasize+1); if (atn==NULL) { return gbBAD ; } // populate the node structure with data atn->size = datasize; memcpy( ALIAS_TREE_DATA(atn), alias_name, datasize+1 ) ; return Cache_Get_Alias_Persistent( sn, atn ) ; } /* look in persistent alias->sn tree */ static GOOD_OR_BAD Cache_Get_Alias_Persistent( BYTE * sn, struct alias_tree_node * atn) { struct tree_opaque *opaque; GOOD_OR_BAD ret = gbBAD ; PERSISTENT_RLOCK; opaque = tfind(atn, &cache.persistent_alias_tree, alias_tree_compare) ; if ( opaque != NULL ) { memcpy( sn, ((struct alias_tree_node *)(opaque->key))->sn, SERIAL_NUMBER_SIZE ) ; LEVEL_DEBUG("Lookup of %s gives "SNformat, CONST_ALIAS_TREE_DATA(atn), SNvar(sn) ) ; ret = gbGOOD ; } else { LEVEL_DEBUG("Lookup of %s unsuccessful",CONST_ALIAS_TREE_DATA(atn)) ; } PERSISTENT_RUNLOCK; owfree(atn) ; return ret; } /* Alias name must be a null-terminated string */ static void Cache_Del_Alias_SN(const ASCII * alias_name) { // allocate space for the node and data size_t datasize = strlen(alias_name) ; struct alias_tree_node *atn = (struct alias_tree_node *) owmalloc(sizeof(struct alias_tree_node) + datasize + 1); if (atn==NULL) { return ; } // populate the node structure with data atn->expires = NOW_TIME; atn->size = datasize; memcpy( ALIAS_TREE_DATA(atn), alias_name, datasize+1 ) ; Cache_Del_Alias_Persistent( atn ) ; } /* look in persistent alias->sn tree */ static void Cache_Del_Alias_Persistent( struct alias_tree_node * atn) { struct tree_opaque *opaque; struct alias_tree_node *atn_found = NULL; PERSISTENT_RLOCK; opaque = tfind(atn, &cache.persistent_alias_tree, alias_tree_compare) ; if ( opaque != NULL ) { atn_found = (struct alias_tree_node *) (opaque->key); } PERSISTENT_RUNLOCK; owfree(atn_found) ; } /* Delete bus from alias name */ /* Alias name must be a null-terminated string */ void Cache_Del_Alias_Bus(const ASCII * alias_name) { // Cheat -- just change to a bad bus value LEVEL_DEBUG("Hide %s",alias_name) ; Cache_Add_Alias_Bus( alias_name, INDEX_BAD ) ; } owfs-3.1p5/module/owlib/src/c/ow_charblob.c0000644000175000001440000000557212654730021015565 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Implementation: 2006 dirblob */ #include #include "owfs_config.h" #include "ow.h" /* A "charblob" is a structure holding a list of files Most interesting, it allocates memory dynamically. */ void CharblobClear(struct charblob *cb) { SAFEFREE(cb->blob) ; cb->blob = NO_CHARBLOB ; CharblobInit(cb); } void CharblobInit(struct charblob *cb) { cb->used = 0; cb->allocated = 0; cb->blob = NO_CHARBLOB; cb->troubled = 0; } int CharblobPure(struct charblob *cb) { return !cb->troubled; } int CharblobAdd(const ASCII * a, size_t s, struct charblob *cb) { size_t incr = 1024; if (incr < s) { incr = s; } // make more room? -- blocks of 1k if (cb->used) { CharblobAddChar(',', cb); // add a comma } if (cb->used + s > cb->allocated) { int newalloc = cb->allocated + incr; ASCII *temp = owrealloc(cb->blob, newalloc); if (temp != NULL) { memset(&temp[cb->allocated], 0, incr); // set the new memory to blank cb->allocated = newalloc; cb->blob = temp; } else { // allocation failed -- keep old cb->troubled = 1; return -ENOMEM; } } memcpy(&cb->blob[cb->used], a, s); cb->used += s; return 0; } int CharblobAddChar(const ASCII a, struct charblob *cb) { // make more room? -- blocks of 1k if (cb->used + 1 > cb->allocated) { int newalloc = cb->allocated + 1024; ASCII *temp = owrealloc(cb->blob, newalloc); if (temp != NULL) { memset(&temp[cb->allocated], 0, 1024); // set the new memory to blank cb->allocated = newalloc; cb->blob = temp; } else { // allocation failed -- keep old cb->troubled = 1; return -ENOMEM; } } cb->blob[cb->used] = a; ++cb->used; return 0; } size_t CharblobLength( struct charblob * cb ) { return cb->used ; } ASCII * CharblobData(struct charblob * cb) { return cb->blob ; } owfs-3.1p5/module/owlib/src/c/ow_com.c0000644000175000001440000000463312672234566014601 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_ftdi.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif GOOD_OR_BAD COM_test( struct connection_in * connection ) { if (connection == NO_CONNECTION) { LEVEL_DEBUG("Attempt to open a NULL serial device"); return gbBAD; } switch ( connection->pown->type ) { case ct_unknown: case ct_none: LEVEL_DEBUG("ERROR!!! ----------- ERROR!"); return gbBAD ; case ct_netlink: case ct_telnet: case ct_tcp: break ; case ct_i2c: case ct_usb: LEVEL_DEBUG("Unimplemented!!!"); return gbBAD ; case ct_serial: case ct_ftdi: break ; } if ( connection->pown->state == cs_virgin ) { LEVEL_DEBUG("Auto initialization of %s", SAFESTRING(DEVICENAME(connection))) ; } else if ( FILE_DESCRIPTOR_VALID( connection->pown->file_descriptor ) ) { return gbGOOD ; } return COM_open(connection) ; } void COM_flush( const struct connection_in *connection) { if (connection == NO_CONNECTION) { LEVEL_DEBUG("Attempt to flush a NULL device"); return ; } switch ( connection->pown->type ) { case ct_unknown: case ct_none: LEVEL_DEBUG("ERROR!!! ----------- ERROR!"); return ; case ct_netlink: case ct_telnet: case ct_tcp: tcp_read_flush( connection->pown->file_descriptor) ; break ; case ct_i2c: case ct_usb: LEVEL_DEBUG("Unimplemented!!!"); return ; case ct_serial: tcflush( connection->pown->file_descriptor, TCIOFLUSH); return; case ct_ftdi: #if OW_FTDI owftdi_flush(connection); #endif break ; } } void COM_break(struct connection_in *in) { if (in == NO_CONNECTION) { LEVEL_DEBUG("Attempt to break a NULL device"); return ; } if ( BAD( COM_test(in) ) ) { return ; } switch ( in->pown->type ) { case ct_unknown: case ct_none: LEVEL_DEBUG("ERROR!!! ----------- ERROR!"); return ; case ct_telnet: telnet_break(in) ; break ; case ct_tcp: case ct_netlink: case ct_i2c: case ct_usb: LEVEL_DEBUG("Unimplemented!!!"); return ; case ct_serial: tcsendbreak(in->pown->file_descriptor, 0); return; case ct_ftdi: #if OW_FTDI owftdi_break(in); #endif break ; } } owfs-3.1p5/module/owlib/src/c/ow_com_change.c0000644000175000001440000000432212672234566016101 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_ftdi.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif GOOD_OR_BAD COM_change( struct connection_in *connection) { struct port_in * pin ; if ( connection == NO_CONNECTION ) { return gbBAD ; } pin = connection->pown ; // is connection thought to be open? RETURN_BAD_IF_BAD( COM_test(connection) ) ; switch ( pin->type ) { case ct_i2c: case ct_usb: LEVEL_DEBUG("Unimplemented!!!"); return gbBAD ; case ct_telnet: // set to change settings at next write if ( pin->dev.telnet.telnet_negotiated == completed_negotiation ) { pin->dev.telnet.telnet_negotiated = needs_negotiation ; } return gbGOOD ; case ct_tcp: case ct_netlink: LEVEL_DEBUG("Cannot change baud rate on %s",SAFESTRING(DEVICENAME(connection))) ; return gbGOOD ; case ct_serial: return serial_change( connection ) ; case ct_ftdi: #if OW_FTDI return owftdi_change( connection ) ; #endif case ct_unknown: case ct_none: default: LEVEL_DEBUG("ERROR!!! ----------- ERROR!"); return gbBAD ; } } void COM_set_standard( struct connection_in *connection) { struct port_in * pin = connection->pown ; pin -> baud = B9600 ; pin -> vmin = 0; // minimum chars pin -> vtime = 3; // decisec wait pin -> parity = parity_none; // parity pin -> stop = stop_1; // stop bits pin -> bits = 8; // bits/byte pin -> state = cs_virgin ; pin -> dev.telnet.telnet_negotiated = needs_negotiation ; connection->CRLF_size = 2 ; switch (pin->type) { case ct_telnet: pin->timeout.tv_sec = Globals.timeout_network ; pin->timeout.tv_usec = 0 ; break ; case ct_serial: case ct_ftdi: default: pin->timeout.tv_sec = Globals.timeout_serial ; pin->timeout.tv_usec = 0 ; break ; } pin->flow = flow_first; // flow control } owfs-3.1p5/module/owlib/src/c/ow_com_close.c0000644000175000001440000000221012672234566015753 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_ftdi.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif void COM_close(struct connection_in *connection) { struct port_in * pin ; if (connection == NO_CONNECTION) { LEVEL_DEBUG("Attempt to close a NULL device"); return ; } pin = connection->pown ; switch ( pin->type ) { case ct_unknown: case ct_none: case ct_usb: LEVEL_DEBUG("ERROR!!! ----------- ERROR!"); return ; case ct_telnet: case ct_tcp: break ; case ct_i2c: case ct_netlink: LEVEL_DEBUG("Unimplemented!!!"); return ; case ct_serial: break ; case ct_ftdi: #if OW_FTDI return owftdi_close(connection); #endif break; } switch ( pin->state ) { case cs_virgin: break ; default: case cs_deflowered: Test_and_Close( &( pin->file_descriptor) ) ; break ; } } owfs-3.1p5/module/owlib/src/c/ow_com_free.c0000644000175000001440000000202212672234566015570 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_ftdi.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif void COM_free(struct connection_in *connection) { if (connection == NO_CONNECTION) { LEVEL_DEBUG("Attempt to close a NULL device"); return ; } if ( connection->pown->state == cs_virgin ) { return ; } switch ( connection->pown->type ) { case ct_unknown: case ct_none: case ct_usb: break ; case ct_telnet: case ct_tcp: tcp_free( connection ) ; break ; case ct_i2c: case ct_netlink: break ; case ct_serial: serial_free( connection ) ; break ; case ct_ftdi: #if OW_FTDI owftdi_free( connection ) ; #endif break ; } connection->pown->state = cs_virgin ; } owfs-3.1p5/module/owlib/src/c/ow_com_open.c0000644000175000001440000000341412672234566015616 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_w1.h" #include "ow_ftdi.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif /* ---------------------------------------------- */ /* raw COM port interface routines */ /* ---------------------------------------------- */ //open a port (serial or tcp) GOOD_OR_BAD COM_open(struct connection_in *connection) { struct port_in * pin ; struct connection_in * head_in ; if (connection == NO_CONNECTION) { LEVEL_DEBUG("Attempt to open a NULL serial device"); return gbBAD; } pin = connection->pown ; head_in = pin->first ; // head of multigroup bus switch ( pin->state ) { case cs_deflowered: // Attempt to reopen a good connection? COM_close(head_in) ; break ; case cs_virgin: break ; } switch ( pin->type ) { case ct_telnet: if ( pin->dev.telnet.telnet_negotiated == completed_negotiation ) { pin->dev.telnet.telnet_negotiated = needs_negotiation ; } pin->dev.telnet.telnet_supported = 0 ; return tcp_open( head_in ) ; case ct_tcp: return tcp_open( head_in ) ; case ct_netlink: #if OW_W1 return w1_bind( connection ) ; #endif /* OW_W1 */ case ct_i2c: case ct_usb: LEVEL_DEBUG("Unimplemented"); return gbBAD ; case ct_serial: return serial_open( head_in ) ; case ct_ftdi: #if OW_FTDI return owftdi_open( head_in ) ; #endif /* OW_FTDI */ case ct_unknown: case ct_none: default: LEVEL_DEBUG("Unknown type."); return gbBAD ; } } owfs-3.1p5/module/owlib/src/c/ow_com_write.c0000644000175000001440000001260712672234566016013 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_ftdi.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif static GOOD_OR_BAD COM_write_once( const BYTE * data, size_t length, struct connection_in *connection) ; /* Called on head of multibus group */ GOOD_OR_BAD COM_write( const BYTE * data, size_t length, struct connection_in *connection) { struct port_in * pin ; if ( connection == NO_CONNECTION ) { return gbBAD ; } pin = connection->pown ; switch ( pin->type ) { case ct_unknown: case ct_none: LEVEL_DEBUG("Bad bus type for writing %s",SAFESTRING(DEVICENAME(connection))); return gbBAD ; case ct_i2c: case ct_usb: // usb and i2c use their own write logic currently LEVEL_DEBUG("Unimplemented write %s",SAFESTRING(DEVICENAME(connection))); return gbBAD ; case ct_telnet: // telnet gets special processing to send communication parameters (in band) if ( pin->dev.telnet.telnet_negotiated == needs_negotiation ) { if (Globals.traffic) { LEVEL_DEBUG("TELNET: Do negotiation"); } RETURN_BAD_IF_BAD( telnet_change( connection ) ) ; pin->dev.telnet.telnet_negotiated = completed_negotiation ; } break ; case ct_tcp: case ct_serial: case ct_netlink: case ct_ftdi: // These protocols need no special pre-processing break ; } // is connection thought to be open? RETURN_BAD_IF_BAD( COM_test(connection) ) ; if ( length == 0 || data == NULL ) { return gbGOOD ; } // try the write switch ( pin->type ) { case ct_ftdi: #if OW_FTDI RETURN_GOOD_IF_GOOD( owftdi_write_once( data, length, connection ) ); break; #endif default: RETURN_GOOD_IF_GOOD( COM_write_once( data, length, connection ) ); } LEVEL_DEBUG("Trouble writing to %s", SAFESTRING(DEVICENAME(connection)) ) ; if ( connection->pown->file_descriptor == FILE_DESCRIPTOR_BAD ) { // connection was bad, now closed, try again LEVEL_DEBUG("Need to reopen %s", SAFESTRING(DEVICENAME(connection)) ) ; RETURN_BAD_IF_BAD( COM_test(connection) ) ; LEVEL_DEBUG("Reopened %s, now slurp", SAFESTRING(DEVICENAME(connection)) ) ; COM_slurp(connection) ; LEVEL_DEBUG("Write again to %s", SAFESTRING(DEVICENAME(connection)) ) ; switch ( pin->type ) { case ct_ftdi: #if OW_FTDI return owftdi_write_once( data, length, connection ); #endif default: return COM_write_once( data, length, connection ); } } // Can't open or another type of error return gbBAD ; } // No retries, let the upper level handle problems. GOOD_OR_BAD COM_write_simple( const BYTE * data, size_t length, struct connection_in *connection) { struct port_in * pin ; if ( length == 0 || data == NULL ) { return gbGOOD ; } if ( connection == NO_CONNECTION ) { return gbBAD ; } pin = connection->pown ; switch ( pin->type ) { case ct_unknown: case ct_none: LEVEL_DEBUG("ERROR!!! ----------- ERROR!"); return gbBAD ; case ct_i2c: case ct_usb: LEVEL_DEBUG("Unimplemented!!!"); return gbBAD ; case ct_telnet: case ct_tcp: case ct_serial: case ct_netlink: break ; case ct_ftdi: #if OW_FTDI return owftdi_write_once(data, length, connection); #endif break; } if ( pin->file_descriptor == FILE_DESCRIPTOR_BAD ) { LEVEL_DEBUG("Writing to closed device %d",SAFESTRING(DEVICENAME(connection))); return gbBAD ; } return COM_write_once( data, length, connection ) ; } /* Called on head of multibus group */ static GOOD_OR_BAD COM_write_once( const BYTE * data, size_t length, struct connection_in *connection) { ssize_t to_be_written = length ; FILE_DESCRIPTOR_OR_ERROR fd = connection->pown->file_descriptor ; while (to_be_written > 0) { int select_result ; fd_set writeset; // use same timeout as read for write struct timeval tv = { Globals.timeout_serial, 0 } ; /* Initialize readset */ FD_ZERO(&writeset); FD_SET( fd, &writeset); /* Read if it doesn't timeout first */ select_result = select( fd + 1, NULL, &writeset, NULL, &tv); if (select_result > 0) { ssize_t write_result ; if (FD_ISSET( fd, &writeset) == 0) { ERROR_CONNECT("Select no FD found on write to %s", SAFESTRING(DEVICENAME(connection))); STAT_ADD1_BUS(e_bus_write_errors, connection); return gbBAD; /* error */ } TrafficOut("write", &data[length - to_be_written], to_be_written, connection ); write_result = write( fd, &data[length - to_be_written], to_be_written); /* write bytes */ if (write_result < 0) { if (errno != EWOULDBLOCK && errno != EAGAIN) { ERROR_CONNECT("Trouble writing to %s", SAFESTRING(DEVICENAME(connection))); COM_close(connection) ; STAT_ADD1_BUS(e_bus_write_errors, connection); return gbBAD; } /* write() was interrupted, try again */ STAT_ADD1_BUS(e_bus_timeouts, connection); } else { to_be_written -= write_result ; } } else { /* timed out or select error */ ERROR_CONNECT("Select/timeout error writing to %s", SAFESTRING(DEVICENAME(connection))); STAT_ADD1_BUS(e_bus_timeouts, connection); if ( errno == EBADF ) { LEVEL_DEBUG("Close file descriptor -- EBADF"); COM_close(connection) ; } return gbBAD; } } tcdrain( fd ); return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_com_read.c0000644000175000001440000000722612756335043015570 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_ftdi.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif static SIZE_OR_ERROR COM_read_get_size( BYTE * data, size_t length, struct connection_in *connection ) ; // read length bytes. // return BAD if any error or timeout before full length /* Called on head of multibus group */ GOOD_OR_BAD COM_read( BYTE * data, size_t length, struct connection_in *connection) { struct port_in * pin ; if ( length == 0 ) { return gbGOOD ; } if ( connection == NO_CONNECTION || data == NULL ) { // bad parameters return gbBAD ; } pin = connection->pown ; // unlike write or open, a closed connection isn't automatically opened. // the reason is that reopening won't have the data waiting. We really need // to restart the transaction from the "write" portion if ( FILE_DESCRIPTOR_NOT_VALID( pin->file_descriptor ) ) { return gbBAD ; } switch ( pin->type ) { // test the type of connection case ct_unknown: case ct_none: LEVEL_DEBUG("Unknown type"); break ; case ct_telnet: return telnet_read( data, length, connection ) ; case ct_tcp: // network is ok return COM_read_get_size( data, length, connection ) == (ssize_t) length ? gbGOOD : gbBAD ; case ct_i2c: case ct_netlink: case ct_usb: LEVEL_DEBUG("Unimplemented"); break ; case ct_serial: // serial is ok // printf("Serial read fd=%d length=%d\n",pin->file_descriptor, (int) length); { ssize_t actual = COM_read_get_size( data, length, connection ) ; if ( FILE_DESCRIPTOR_VALID( pin->file_descriptor ) ) { // tcdrain only works on serial conections tcdrain( pin->file_descriptor ); return actual == (ssize_t) length ? gbGOOD : gbBAD ; } break ; } case ct_ftdi: { #if OW_FTDI SIZE_OR_ERROR actual = owftdi_read(data, length, connection); return (actual == (SIZE_OR_ERROR) length) ? gbGOOD : gbBAD ; #else LEVEL_DEBUG("Unimplemented"); break; #endif } } return gbBAD ; } // try to read bytes and return number actually read. // Timeout ok /* Called on head of multibus group */ SIZE_OR_ERROR COM_read_with_timeout( BYTE * data, size_t length, struct connection_in *connection) { struct port_in * pin ; if ( length == 0 ) { return 0 ; } if ( connection == NO_CONNECTION || data == NULL ) { // bad parameters return -EIO ; } pin = connection->pown ; // unlike write or open, a closed connection isn't automatically opened. // the reason is that reopening won't have the data waiting. We really need // to restart the transaction from the "write" portion if ( FILE_DESCRIPTOR_NOT_VALID( pin->file_descriptor ) ) { return -EBADF ; } else { size_t actual_size ; ZERO_OR_ERROR zoe = tcp_read( pin->file_descriptor, data, length, &(pin->timeout), &actual_size ) ; if ( zoe == -EBADF ) { COM_close(connection) ; return zoe ; } else { return actual_size ; } } } // Read only if no errors // Returns actual read size /* Called on head of multibus group */ static SIZE_OR_ERROR COM_read_get_size( BYTE * data, size_t length, struct connection_in *connection ) { size_t actual_size ; struct port_in * pin = connection->pown ; // tcp_read seems to work with serial and network ZERO_OR_ERROR zoe = tcp_read( pin->file_descriptor, data, length, &(pin->timeout), &actual_size ) ; if ( zoe < 0 ) { COM_close(connection) ; return zoe ; } else { return actual_size ; } } owfs-3.1p5/module/owlib/src/c/ow_connect.c0000644000175000001440000001736112672234566015456 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" static struct connection_in *AllocIn(const struct connection_in *old_in) ; /* Routines for handling a linked list of connections in*/ /* typical connection in would be the serial port or USB */ /* Globals */ struct inbound_control Inbound_Control = { .active = 0, .next_index = 0, .head_port = NULL, .next_fake = 0, .next_tester = 0, .next_mock = 0, .w1_monitor = NO_CONNECTION , .external = NO_CONNECTION , }; struct connection_in *find_connection_in(int bus_number) { struct port_in * pin ; for ( pin = Inbound_Control.head_port ; pin != NULL ; pin = pin->next ) { struct connection_in *cin; for ( cin = pin->first; cin != NO_CONNECTION; cin = cin->next) { if (cin->index == bus_number) { return cin; } } } LEVEL_DEBUG("Couldn't find bus number %d",bus_number); return NO_CONNECTION; } int SetKnownBus( int bus_number, struct parsedname * pn) { struct connection_in * found = find_connection_in( bus_number ) ; if ( found == NO_CONNECTION ) { return 1 ; } pn->state |= ePS_bus; pn->selected_connection=found ; pn->known_bus=found; return 0 ; } enum bus_mode get_busmode(const struct connection_in *in) { if (in == NO_CONNECTION) { return bus_unknown; } return in->pown->busmode; } // return true (non-zero) if the connection_in exists, and is remote int BusIsServer(struct connection_in *in) { if ( in == NO_CONNECTION ) { return 0 ; } switch ( get_busmode(in) ) { case bus_server: case bus_zero: return 1 ; default: return 0 ; } } /* Make a new connection_in entry, but DON'T place it in the chain (yet)*/ /* Based on a shallow copy of "in" if not NULL */ static struct connection_in *AllocIn(const struct connection_in *old_in) { size_t len = sizeof(struct connection_in); struct connection_in *new_in = (struct connection_in *) owmalloc(len); if (new_in != NO_CONNECTION) { if (old_in == NO_CONNECTION) { // Not a copy memset(new_in, 0, len); DEVICENAME(new_in) = NULL ; /* Not yet a valid bus */ new_in->iroutines.flags = ADAP_FLAG_sham ; } else { // Copy of prior bus memcpy(new_in, old_in, len); if ( DEVICENAME(new_in) != NULL ) { // Don't make the name point to the same string, make a copy DEVICENAME(new_in) = owstrdup( DEVICENAME(old_in) ) ; } } /* not yet linked */ new_in->next = NO_CONNECTION ; /* Support DS1994/DS2404 which require longer delays, and is automatically * turned on in *_next_both(). * If it's turned off, it will result into a faster reset-sequence. */ new_in->ds2404_found = 0; /* Flag first pass as need to clear all branches if DS2409 present */ new_in->branch.branch = eBranch_bad ; /* Arbitrary guess at root directory size for allocating cache blob */ new_in->last_root_devs = 10; new_in->AnyDevices = anydevices_unknown ; ++Inbound_Control.active ; new_in->index = Inbound_Control.next_index++; _MUTEX_INIT(new_in->bus_mutex); _MUTEX_INIT(new_in->dev_mutex); new_in->dev_db = NULL; } else { LEVEL_DEFAULT("Cannot allocate memory for bus master structure"); } return new_in; } struct port_in * AllocPort( const struct port_in * old_pin ) { size_t len = sizeof(struct port_in); struct port_in *new_pin = (struct port_in *) owmalloc(len); if ( new_pin != NULL ) { if (old_pin == NULL) { // Not a copy memset(new_pin, 0, len); new_pin->first = AllocIn(NO_CONNECTION) ; } else { // Copy of prior bus memcpy(new_pin, old_pin, len); new_pin->first = AllocIn(old_pin->first) ; if ( old_pin->init_data != NULL ) { new_pin->init_data = owstrdup( old_pin->init_data ) ; } } // never copy file_descriptor (it's unique to port) new_pin->file_descriptor = FILE_DESCRIPTOR_BAD ; new_pin->type = ct_unknown ; new_pin->state = cs_virgin ; if ( new_pin->first == NO_CONNECTION ) { LEVEL_DEBUG("Port creation incomplete"); owfree(new_pin) ; return NULL ; } new_pin->connections = 1 ; new_pin->first->channel = 0 ; /* port not yet linked */ new_pin->next = NULL ; /* connnection_in needs to be linked */ new_pin->first->pown = new_pin ; } else { LEVEL_DEFAULT("Cannot allocate memory for port master structure"); } return new_pin; } /* Place a new connection in the chain */ struct port_in *LinkPort(struct port_in *pin) { if (pin != NULL) { // Housekeeping to place in linked list // Locking done at a higher level pin->next = Inbound_Control.head_port; /* put in linked list at start */ Inbound_Control.head_port = pin ; _MUTEX_INIT(pin->port_mutex); } return pin; } /* Create a new inbound structure and place it in the chain */ struct port_in *NewPort(const struct port_in *pin) { return LinkPort( AllocPort(pin) ) ; } /* Free all connection_in in reverse order (Added to head on creation, head-first deletion) */ void FreeInAll( void ) { while ( Inbound_Control.head_port ) { RemovePort(Inbound_Control.head_port); } } void RemoveIn( struct connection_in * conn ) { struct port_in * pin ; /* NULL safe */ if ( conn == NO_CONNECTION ) { return ; } /* Close master-specific resources. This may do writes * and what-not that expects the conn to be kept setup. */ BUS_close(conn) ; // owning port pin = conn->pown ; /* First unlink from list */ if ( pin == NULL ) { // free-floating } else if ( pin->first == conn ) { /* Head of list, easy */ pin->first = conn->next ; -- pin->connections ; --Inbound_Control.active ; } else { struct connection_in * now ; /* find in list and splice out */ for ( now = pin->first ; now != NO_CONNECTION ; now = now->next ) { /* Works even if not linked, since won't match and will just fall through */ if ( now->next == conn ) { now->next = conn->next ; -- pin->connections ; --Inbound_Control.active ; break ; } } } if ( conn->index == Inbound_Control.next_index-1 ) { Inbound_Control.next_index-- ; } /* Now free up thread-sync resources */ _MUTEX_DESTROY(conn->bus_mutex); _MUTEX_DESTROY(conn->dev_mutex); SAFETDESTROY( conn->dev_db, owfree_func); /* Free port */ COM_free( conn ) ; /* Next free up internal resources */ SAFEFREE( DEVICENAME(conn) ) ; /* Finally delete the structure */ owfree(conn); } void RemovePort( struct port_in * pin ) { /* NULL safe */ if ( pin == NULL ) { return ; } /* First delete connections */ while ( pin->first != NO_CONNECTION ) { RemoveIn( pin->first ) ; } /* Next unlink from list */ if ( pin == Inbound_Control.head_port ) { /* Head of list, easy */ Inbound_Control.head_port = pin->next ; } else { struct port_in * now ; /* find in list and splice out */ for ( now = Inbound_Control.head_port ; now != NULL ; now = now->next ) { /* Works even if not linked, since won't match and will just fall through */ if ( now->next == pin ) { now->next = pin->next ; break ; } } } /* Now free up thread-sync resources */ /* Only if actually linked in and possibly active */ _MUTEX_DESTROY(pin->port_mutex); SAFEFREE(pin->init_data) ; /* Finally delete the structure */ owfree(pin); pin = NULL ; } struct connection_in * AddtoPort( struct port_in * pin ) { struct connection_in * add_in = AllocIn( pin->first ) ; if ( add_in == NO_CONNECTION ) { // cannot allocate return NO_CONNECTION ; } // Housekeeping to place in linked list // Locking done at a higher level add_in->next = pin->first; /* put in linked list at start */ pin->first = add_in; add_in->pown = pin ; add_in->channel = pin->connections ; ++pin->connections ; return add_in ; } owfs-3.1p5/module/owlib/src/c/ow_connect_out.c0000644000175000001440000000361512654730021016325 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" /* Routines for handling a linked list of connections out */ /* typical connection out would be a network port for owserver or web access */ struct outbound_control Outbound_Control = { .active = 0, .next_index = 0, .head = NULL, }; struct connection_out *NewOut(void) { size_t len = sizeof(struct connection_out); struct connection_out *now = (struct connection_out *) owmalloc(len); if (now) { memset(now, 0, len); now->next = Outbound_Control.head; now->inet_type = inet_none ; Outbound_Control.head = now; now->index = Outbound_Control.next_index++; ++Outbound_Control.active ; // Zero sref's -- done with struct memset //now->sref0 = 0 ; //now->sref1 = 0 ; } else { LEVEL_DEFAULT("Cannot allocate memory for server structure,"); } return now; } void FreeOutAll(void) { struct connection_out *next = Outbound_Control.head; struct connection_out *now; Outbound_Control.head = NULL; Outbound_Control.active = 0; while (next) { now = next; next = now->next; SAFEFREE(now->zero.name) ; SAFEFREE(now->zero.type) ; SAFEFREE(now->zero.domain) ; SAFEFREE(now->name) ; SAFEFREE(now->host) ; SAFEFREE(now->service) ; if (now->ai) { freeaddrinfo(now->ai); now->ai = NULL; } if ( FILE_DESCRIPTOR_VALID(now->file_descriptor) ) { shutdown(now->file_descriptor, SHUT_RDWR ) ; close(now->file_descriptor) ; } #if OW_ZERO if (libdnssd != NULL) { if (now->sref0) { DNSServiceRefDeallocate(now->sref0); } if (now->sref1) { DNSServiceRefDeallocate(now->sref1); } } #endif owfree(now); } } owfs-3.1p5/module/owlib/src/c/ow_cmciel.c0000644000175000001440000003210312654730021015233 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer */ #include #include "owfs_config.h" #include "ow_cmciel.h" /* ------- Prototypes ----------- */ /* CMCIEL sensors */ READ_FUNCTION(FS_r_data); READ_FUNCTION(FS_r_data17); READ_FUNCTION(FS_r_temperature); READ_FUNCTION(FS_r_current); READ_FUNCTION(FS_r_AM001_v); READ_FUNCTION(FS_r_AM001_a); READ_FUNCTION(FS_r_RPM); READ_FUNCTION(FS_r_vibration); WRITE_FUNCTION(FS_w_vib_mode); /* ------- Structures ----------- */ #define mTS017_type 0x4000 // bit 14 #define mTS017_object 0x0000 // bit 14 #define mTS017_ambient 0x4000 // bit 14 #define mTS017_plex 0x8000 // bit 15 #define mTS017_single 0x0000 // bit 15 #define mTS017_multi 0x8000 // bit 15 enum e_mVM001 { e_mVM001_peak=1, e_mVM001_rms=2, e_mVM001_multi=4, } ; /* Infrared temperature sensor */ static struct filetype mTS017[] = { F_STANDARD, {"reading", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_data17, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"object", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_temperature, fc_link, FS_r_temperature, NO_WRITE_FUNCTION, VISIBLE, {.u=mTS017_object}, }, {"ambient", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_temperature, fc_link, FS_r_temperature, NO_WRITE_FUNCTION, VISIBLE, {.u=mTS017_ambient}, }, }; DeviceEntry(A6, mTS017, NO_GENERIC_READ, NO_GENERIC_WRITE); /* Vibration Sensor */ static struct filetype mVM001[] = { F_STANDARD, {"reading", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_data, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"RMS", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_vibration, NO_WRITE_FUNCTION, VISIBLE, {.i=e_mVM001_rms, }, }, {"peak", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_vibration, NO_WRITE_FUNCTION, VISIBLE, {.i=e_mVM001_peak, }, }, {"configure", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"configure/read_mode", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, NO_READ_FUNCTION, FS_w_vib_mode, VISIBLE, NO_FILETYPE_DATA, }, {"configure/peak_interval", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"configure/multiplex_interval", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(A1, mVM001, NO_GENERIC_READ, NO_GENERIC_WRITE); /* AC current meter */ static struct filetype mCM001[] = { F_STANDARD, {"reading", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_data, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"current", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_current, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(A2, mCM001, NO_GENERIC_READ, NO_GENERIC_WRITE); /* Analog Input meter */ static struct filetype mAM001[] = { F_STANDARD, {"reading", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_data, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"current", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_AM001_a, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"volts", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_link, FS_r_AM001_v, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(B2, mAM001, NO_GENERIC_READ, NO_GENERIC_WRITE); /* Rotation Sensor */ static struct filetype mRS001[] = { F_STANDARD, {"reading", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_data, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"RPM", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_RPM, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntry(A0, mRS001, NO_GENERIC_READ, NO_GENERIC_WRITE); // struct bitfield { "alias_link", number_of_bits, shift_left, } static struct bitfield mDI001_switch = { "reading", 4, 0, } ; static struct bitfield mDI001_shorted = { "reading", 4, 4, } ; static struct bitfield mDI001_open = { "reading", 8, 0, } ; static struct bitfield mDI001_switch_closed = { "switch", 1, 0, } ; static struct bitfield mDI001_loop_shorted = { "shorted", 1, 0, } ; static struct bitfield mDI001_loop_open = { "open", 1, 0, } ; /* Digital Input Sensor */ static struct aggregate mDI001_state = { 4, ag_numbers, ag_aggregate, }; // 4 inputs static struct filetype mDI001[] = { F_STANDARD, {"reading", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_data, NO_WRITE_FUNCTION, INVISIBLE, NO_FILETYPE_DATA, }, {"switch", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_bitfield, NO_WRITE_FUNCTION, INVISIBLE, {.v= &mDI001_switch,}, }, {"shorted", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_bitfield, NO_WRITE_FUNCTION, INVISIBLE, {.v= &mDI001_shorted,}, }, {"open", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_bitfield, NO_WRITE_FUNCTION, INVISIBLE, {.v= &mDI001_open,}, }, {"switch_closed", PROPERTY_LENGTH_BITFIELD, &mDI001_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE, {.v= &mDI001_switch_closed,}, }, {"loop_shorted", PROPERTY_LENGTH_BITFIELD, &mDI001_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE, {.v= &mDI001_loop_shorted,}, }, {"loop_open", PROPERTY_LENGTH_BITFIELD, &mDI001_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE, {.v= &mDI001_loop_open,}, }, }; DeviceEntry(A5, mDI001, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_READ_SCRATCHPAD 0xBE #define _1W_WRITE_CONFIG 0x4E #define _1W_READ_CONFIG 0x4F #define _mTS017_CONFIG_OBJECT 0x01 #define _mTS017_CONFIG_AMBIENT 0x02 #define _mTS017_CONFIG_MULTIPLEX 0x04 #define _mTS017_CONFIG_UNPROTECT 0x08 #define _mTS017_CONFIG_PARAMETERS 0x20 #define _mTS017_CONFIG_EMISSIVITY 0x40 #define _mTS017_ADDRESS_CONFIG 0x55 #define _mTS017_ADDRESS_EMISSIVITY_LOW 0xA1 #define _mTS017_ADDRESS_EMISSIVITY_HI 0xA2 #define _mTS017_ADDRESS_HAND_DETECT_THRESHOLD 0xA3 #define _mTS017_ADDRESS_HAND_DETECT_HOLD 0xA4 #define _mTS017_ADDRESS_AVG_NUMBER 0xA5 #define _mTS017_ADDRESS_AVG_OVERRIDE 0xA6 #define _mVM001_CONFIG_OBJECT 0x01 #define _mVM001_CONFIG_AMBIENT 0x02 #define _mVM001_CONFIG_MULTIPLEX 0x04 #define _mVM001_CONFIG_UNPROTECT 0x10 #define _mVM001_ADDRESS_CONFIG 0x55 #define _mVM001_ADDRESS_READ_MODE 0x80 #define _mVM001_ADDRESS_PEAK_INTERVAL 0x81 #define _mVM001_ADDRESS_MULTIPLEX_INTERVAL 0x82 #define _mDI001_ADDRESS_CONFIG 0x55 #define _mDI001_ADDRESS_READ_PARAMETER 0x01 #define _mDI001_CONFIG_UNPROTECT 0x08 #define _mDI001_CONFIG_PROTECT 0x10 #define _mDI001_CONFIG_MASK 0xF000 #define _mDI001_CONFIG_TIME 0x6000 #define _mDI001_CONFIG_STATUS 0x8000 #define _mDI001_CONFIG_RAW1 0x9000 #define _mDI001_CONFIG_RAW2 0xA000 #define _mDI001_CONFIG_RAW3 0xB000 #define _mDI001_CONFIG_RAW4 0xC000 #define _mDI001_CONFIG_DELAY 0xD000 /* Internal properties */ Make_SlaveSpecificTag(VIB, fc_stable); // vibration mode /* ------- Functions ------------ */ /* */ static GOOD_OR_BAD OW_w_config(BYTE config0, BYTE config1, struct parsedname *pn); static GOOD_OR_BAD OW_reading( BYTE * data, struct parsedname *pn); static GOOD_OR_BAD OW_set_vib_mode(BYTE read_mode, struct parsedname *pn) ; static GOOD_OR_BAD OW_unprotect(struct parsedname *pn) ; #if 0 static GOOD_OR_BAD OW_set_read_mode(BYTE read_mode, struct parsedname *pn); #endif /* mTS017 */ static ZERO_OR_ERROR FS_r_temperature(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT reading ; if ( FS_r_sibling_U( &reading, "reading", owq ) < 0 ) { return -EINVAL ; } // Is this the correct type? if ( (reading & mTS017_type) == pn->selected_filetype->data.u ) { // Pare off top 2 bits and sign extend OWQ_F(owq) = ( ( (int16_t)(reading << 2) ) / 4 ) / 10. ; return 0 ; } // Is it a multiplex? Then try again if ( (reading & mTS017_plex) == mTS017_multi ) { // reread if ( FS_r_sibling_U( &reading, "reading", owq ) < 0 ) { return -EINVAL ; } // Is this the correct type? if ( (reading & mTS017_type) == pn->selected_filetype->data.u ) { // Pare off top 2 bits and sign extend OWQ_F(owq) = ( ( (int16_t)(reading << 2) ) / 4 ) / 10. ; return 0 ; } } else { // switch mode if we knew how } return -EINVAL ; } /* mvM001 Vibration */ static ZERO_OR_ERROR FS_r_vibration(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT reading ; BYTE vib_mode = pn->selected_filetype->data.i ; if ( FS_w_sibling_U( vib_mode, "configure/read_mode", owq ) < 0 ) { return -EINVAL ; } if ( FS_r_sibling_U( &reading, "reading", owq ) < 0 ) { return -EINVAL ; } OWQ_F(owq) = .01 * reading ; return -EINVAL ; } static ZERO_OR_ERROR FS_w_vib_mode(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT vib_request = OWQ_U(owq) ; BYTE vib_stored ; switch (vib_request) { case e_mVM001_peak: case e_mVM001_rms: case e_mVM001_multi: break ; default: return -EINVAL ; } if ( BAD( Cache_Get_SlaveSpecific(&vib_stored, sizeof(vib_stored), SlaveSpecificTag(VIB), pn)) ) { if ( vib_stored == vib_request ) { return 0 ; } } if ( BAD( OW_set_vib_mode( vib_request, pn ) ) ) { return -EINVAL ; } Cache_Add_SlaveSpecific(&vib_request, sizeof(vib_request), SlaveSpecificTag(VIB), pn); return 0 ; } //; Special version for the mTS017 that knows about multiplexing for the cache static ZERO_OR_ERROR FS_r_data17(struct one_wire_query *owq) { if ( FS_r_data(owq) < 0 ) { return -EINVAL ; } // Is it a multiplex? Then kill cache if ( (OWQ_U(owq) & mTS017_plex) == mTS017_multi ) { OWQ_Cache_Del(owq) ; } return 0 ; } static ZERO_OR_ERROR FS_r_data(struct one_wire_query *owq) { BYTE data[2]; if ( BAD( OW_reading( data, PN(owq) ) ) ) { return -EINVAL ; } OWQ_U(owq) = data[1] * 256 + data[0] ; return 0 ; } // uses CRC8 static GOOD_OR_BAD OW_reading(BYTE * data, struct parsedname *pn) { BYTE p[1] = { _1W_READ_SCRATCHPAD, }; BYTE q[3]; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(p), TRXN_WRITE2(q), TRXN_READ1(&q[2]), TRXN_CRC8(q,3), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; memcpy(data, q, 2); return gbGOOD; } static GOOD_OR_BAD OW_w_config(BYTE config0, BYTE config1, struct parsedname *pn) { BYTE p[4] ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE(p,4), TRXN_END, }; p[0] = _1W_WRITE_CONFIG ; p[1] = config0 ; p[2] = config1 ; p[3] = CRC8( &p[1], 2 ) ; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_unprotect(struct parsedname *pn) { return OW_w_config( _mTS017_ADDRESS_CONFIG, _mTS017_CONFIG_UNPROTECT, pn ) ; } #if 0 static GOOD_OR_BAD OW_set_read_mode(BYTE read_mode, struct parsedname *pn) { // 1=object 2=ambient 4= multiplex RETURN_BAD_IF_BAD( OW_unprotect(pn) ) ; return OW_w_config( _mTS017_ADDRESS_CONFIG, read_mode, pn ) ; } #endif static GOOD_OR_BAD OW_set_vib_mode(BYTE read_mode, struct parsedname *pn) { // 1=peak 2=rms 4= multiplex RETURN_BAD_IF_BAD( OW_unprotect(pn) ) ; return OW_w_config( _mVM001_ADDRESS_READ_MODE, read_mode, pn ) ; } /* mCM001 AC current */ static ZERO_OR_ERROR FS_r_current(struct one_wire_query *owq) { UINT reading ; if ( FS_r_sibling_U( &reading, "reading", owq ) < 0 ) { return -EINVAL ; } OWQ_F(owq) = reading / 100. ; return 0 ; } /* mAM001 Analog input */ static ZERO_OR_ERROR FS_r_AM001_a(struct one_wire_query *owq) { UINT reading ; if ( FS_r_sibling_U( &reading, "reading", owq ) < 0 ) { return -EINVAL ; } OWQ_F(owq) = .02 * reading / 10000. ; return 0 ; } static ZERO_OR_ERROR FS_r_AM001_v(struct one_wire_query *owq) { UINT reading ; if ( FS_r_sibling_U( &reading, "reading", owq ) < 0 ) { return -EINVAL ; } OWQ_F(owq) = 10. * reading / 10000. ; return 0 ; } /* mRS001 Rotation Sensor */ static ZERO_OR_ERROR FS_r_RPM(struct one_wire_query *owq) { UINT reading ; if ( FS_r_sibling_U( &reading, "reading", owq ) < 0 ) { return -EINVAL ; } OWQ_I(owq) = (int16_t) reading ; return 0 ; } owfs-3.1p5/module/owlib/src/c/ow_crc.c0000644000175000001440000000670612654730021014560 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" /* ---------------------------------------------- */ /* CRC and Hex utility functions */ /* ---------------------------------------------- */ /* CRC stuff from PDKit */ static BYTE crc8_table[] = { 0x00, 0x5E, 0xBC, 0xE2, 0x61, 0x3F, 0xDD, 0x83, 0xC2, 0x9C, 0x7E, 0x20, 0xA3, 0xFD, 0x1F, 0x41, 0x9D, 0xC3, 0x21, 0x7F, 0xFC, 0xA2, 0x40, 0x1E, 0x5F, 0x01, 0xE3, 0xBD, 0x3E, 0x60, 0x82, 0xDC, 0x23, 0x7D, 0x9F, 0xC1, 0x42, 0x1C, 0xFE, 0xA0, 0xE1, 0xBF, 0x5D, 0x03, 0x80, 0xDE, 0x3C, 0x62, 0xBE, 0xE0, 0x02, 0x5C, 0xDF, 0x81, 0x63, 0x3D, 0x7C, 0x22, 0xC0, 0x9E, 0x1D, 0x43, 0xA1, 0xFF, 0x46, 0x18, 0xFA, 0xA4, 0x27, 0x79, 0x9B, 0xC5, 0x84, 0xDA, 0x38, 0x66, 0xE5, 0xBB, 0x59, 0x07, 0xDB, 0x85, 0x67, 0x39, 0xBA, 0xE4, 0x06, 0x58, 0x19, 0x47, 0xA5, 0xFB, 0x78, 0x26, 0xC4, 0x9A, 0x65, 0x3B, 0xD9, 0x87, 0x04, 0x5A, 0xB8, 0xE6, 0xA7, 0xF9, 0x1B, 0x45, 0xC6, 0x98, 0x7A, 0x24, 0xF8, 0xA6, 0x44, 0x1A, 0x99, 0xC7, 0x25, 0x7B, 0x3A, 0x64, 0x86, 0xD8, 0x5B, 0x05, 0xE7, 0xB9, 0x8C, 0xD2, 0x30, 0x6E, 0xED, 0xB3, 0x51, 0x0F, 0x4E, 0x10, 0xF2, 0xAC, 0x2F, 0x71, 0x93, 0xCD, 0x11, 0x4F, 0xAD, 0xF3, 0x70, 0x2E, 0xCC, 0x92, 0xD3, 0x8D, 0x6F, 0x31, 0xB2, 0xEC, 0x0E, 0x50, 0xAF, 0xF1, 0x13, 0x4D, 0xCE, 0x90, 0x72, 0x2C, 0x6D, 0x33, 0xD1, 0x8F, 0x0C, 0x52, 0xB0, 0xEE, 0x32, 0x6C, 0x8E, 0xD0, 0x53, 0x0D, 0xEF, 0xB1, 0xF0, 0xAE, 0x4C, 0x12, 0x91, 0xCF, 0x2D, 0x73, 0xCA, 0x94, 0x76, 0x28, 0xAB, 0xF5, 0x17, 0x49, 0x08, 0x56, 0xB4, 0xEA, 0x69, 0x37, 0xD5, 0x8B, 0x57, 0x09, 0xEB, 0xB5, 0x36, 0x68, 0x8A, 0xD4, 0x95, 0xCB, 0x29, 0x77, 0xF4, 0xAA, 0x48, 0x16, 0xE9, 0xB7, 0x55, 0x0B, 0x88, 0xD6, 0x34, 0x6A, 0x2B, 0x75, 0x97, 0xC9, 0x4A, 0x14, 0xF6, 0xA8, 0x74, 0x2A, 0xC8, 0x96, 0x15, 0x4B, 0xA9, 0xF7, 0xB6, 0xE8, 0x0A, 0x54, 0xD7, 0x89, 0x6B, 0x35 }; static UINT crc16_table[16] = { 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0 }; BYTE CRC8compute(const BYTE * bytes, const size_t length, const UINT seed) { BYTE crc = seed; size_t i = 0; while (i < length) { crc = crc8_table[crc ^ bytes[i++]]; } return crc; } /* wrap CRC8 calculation in statistics */ BYTE CRC8(const BYTE * bytes, const size_t length) { return CRC8seeded(bytes, length, 0); } /* wrap CRC8 calculation in statistics */ BYTE CRC8seeded(const BYTE * bytes, const size_t length, const UINT seed) { BYTE r = CRC8compute(bytes, length, seed); STATLOCK; ++CRC8_tries; /* statistics */ if (r) { ++CRC8_errors; /* statistics */ } STATUNLOCK; return r; } /* Returns 0 for good match */ /* Standard -- seed = 0 */ int CRC16(const BYTE * bytes, const size_t length) { return CRC16seeded(bytes, length, 0); } /* Returns 0 for good match */ int CRC16seeded(const BYTE * bytes, const size_t length, const UINT seed) { UINT sd = seed; int ret; size_t i; for (i = 0; i < length; ++i) { UINT c = (bytes[i] ^ (sd & 0xFF)) & 0xFF; sd >>= 8; if (crc16_table[c & 0x0F] ^ crc16_table[c >> 4]) { sd ^= 0xC001; } sd ^= (c <<= 6); sd ^= (c << 1); } STATLOCK; ++CRC16_tries; /* statistics */ if (sd == 0xB001) { ret = 0; /* good */ } else { ret = -1; /* error */ ++CRC16_errors; /* statistics */ } STATUNLOCK; return ret; } owfs-3.1p5/module/owlib/src/c/ow_daemon.c0000644000175000001440000001024612654730021015246 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_devices.h" #include "ow_pid.h" #if defined(__UCLIBC__) #if (defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__)) #define HAVE_DAEMON 1 #else /* __UCLIBC_HAS_MMU__ */ #undef HAVE_DAEMON #endif /* __UCLIBC_HAS_MMU__ */ #endif /* __UCLIBC__ */ #ifndef HAVE_DAEMON #include #include static void catchchild(int sig) { pid_t pid; int status; pid = wait4(-1, &status, WUNTRACED, 0); } /* This is a test to implement daemon() */ static int my_daemon(int nochdir, int noclose) { struct sigaction act; int pid; FILE_DESCRIPTOR_OR_ERROR file_descriptor; signal(SIGCHLD, SIG_DFL); #if defined(__UCLIBC__) pid = vfork(); #else /* __UCLIBC__ */ pid = fork(); #endif /* __UCLIBC__ */ switch (pid) { case -1: memset(&act, 0, sizeof(act)); act.sa_handler = catchchild; act.sa_flags = SA_RESTART; sigaction(SIGCHLD, &act, NULL); //printf("owlib: my_daemon: pid=%d fork error\n", getpid()); LEVEL_CALL("Libsetup ok"); return (-1); case 0: break; default: //signal(SIGCHLD, SIG_DFL); //printf("owlib: my_daemon: pid=%d exit parent\n", getpid()); _exit(0); } if (setsid() < 0) { perror("setsid:"); return -1; } /* Make certain we are not a session leader, or else we * might reacquire a controlling terminal */ #ifdef __UCLIBC__ pid = vfork(); #else /* __UCLIBC__ */ pid = fork(); #endif /* __UCLIBC__ */ if (pid) { //printf("owlib: my_daemon: _exit() pid=%d\n", getpid()); _exit(0); } memset(&act, 0, sizeof(act)); act.sa_handler = catchchild; act.sa_flags = SA_RESTART; sigaction(SIGCHLD, &act, NULL); if (!nochdir) { chdir("/"); } if (!noclose) { close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); if (dup(dup(open("/dev/null", O_APPEND))) == -1) { perror("dup:"); return -1; } } return 0; } #endif /* HAVE_DAEMON */ /* Start the owlib process -- actually only tests for backgrounding */ GOOD_OR_BAD EnterBackground(void) { /* First call to pthread should be done after daemon() in uClibc, so * I moved it here to avoid calling __pthread_initialize() */ /* daemon() is called BEFORE initialization of USB adapter etc... Cygwin will fail to * use the adapter after daemon otherwise. Some permissions are changed on the process * (or process-group id) which libusb-win32 is depending on. */ //printf("Enter Background\n") ; switch (Globals.daemon_status) { case e_daemon_want_bg: switch (Globals.program_type) { case program_type_filesystem: // handles PID from a callback break; case program_type_httpd: case program_type_ftpd: case program_type_server: case program_type_external: if ( // daemonize // current directory left unchanged (not root) // stdin, stdout and stderr sent to /dev/null #ifdef HAVE_DAEMON daemon(1, 0) #else /* HAVE_DAEMON */ my_daemon(1, 0) #endif /* HAVE_DAEMON */ ) { LEVEL_DEFAULT("Cannot enter background mode, quitting."); return gbBAD; } else { Globals.daemon_status = e_daemon_bg ; LEVEL_DEFAULT("Entered background mode, quitting."); #ifdef __UCLIBC__ /* Have to re-initialize pthread since the main-process is gone. * * This workaround will probably be fixed in uClibc-0.9.28 * Other uClibc developers have noticed similar problems which are * trigged when pthread functions are used in shared libraries. */ LockSetup(); #endif /* __UCLIBC__ */ } PIDstart(); break; default: // other type of program PIDstart(); break; } break ; default: // not want-background if (Globals.program_type != program_type_filesystem) { PIDstart(); } break; } main_threadid = pthread_self(); main_threadid_init = 1 ; LEVEL_DEBUG("main thread id = %lu", (unsigned long int) main_threadid); return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_date.c0000644000175000001440000000135212654730021014716 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" /* Uses udate to read and write date */ ZERO_OR_ERROR COMMON_r_date( struct one_wire_query * owq ) { UINT U ; ZERO_OR_ERROR read_sibling = FS_r_sibling_U( &U, PN(owq)->selected_filetype->data.a, owq ) ; OWQ_D(owq) = (_DATE) U ; return read_sibling ; } ZERO_OR_ERROR COMMON_w_date( struct one_wire_query * owq ) { UINT U = (UINT) OWQ_D(owq) ; return FS_w_sibling_U( U, PN(owq)->selected_filetype->data.a, owq) ; } owfs-3.1p5/module/owlib/src/c/ow_delay.c0000644000175000001440000000371312654730021015102 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" //-------------------------------------------------------------------------- // Description: // Delay for at least 'len' ms // void UT_delay(const UINT len) { UT_delay_us( len * 1000 ) ; } //-------------------------------------------------------------------------- // Description: // Delay for at least 'len' us // void UT_delay_us(const unsigned long len) { #ifdef DELAY_BUSY_WHILE /* Just a test to create a busy-while-loop and trace wait time. */ struct timeval rem = { len / 1000000, len % 1000000 } ; struct timeval tv, tvnow; int i, j = 0; if (len == 0) { return; } timernow( &tv ); timeradd( &tv, &rem, &tv ); do { timernow( &tvnow ); for (i = 0; i < 10; i++) { j += i; } } while ( timercmp( &tvnow, &tv, < ) ) ; #else /* DELAY_BUSY_WHILE */ #ifdef HAVE_NANOSLEEP struct timespec s; struct timespec rem = { len / 1000000, 1000 * (len % 1000000) } ; if (len == 0) { return; } while (1) { s.tv_sec = rem.tv_sec; s.tv_nsec = rem.tv_nsec; if (nanosleep(&s, &rem) < 0) { if (errno != EINTR) { break; } /* was interupted... continue sleeping... */ //printf("UT_delay: EINTR s=%ld.%ld r=%ld.%ld: %s\n", s.tv_sec, s.tv_nsec, rem.tv_sec, rem.tv_nsec, strerror(errno)); #ifdef __UCLIBC__ errno = 0; // clear errno every time in uclibc at least #endif /* __UCLIBC__ */ } else { /* completed sleeping */ break; } } #ifdef __UCLIBC__ errno = 0; // clear errno in uclibc at least #endif /* __UCLIBC__ */ #else /* HAVE_NANOSLEEP */ usleep((unsigned long) len); #endif /* HAVE_NANOSLEEP */ #endif /* DELAY_BUSY_WHILE */ } owfs-3.1p5/module/owlib/src/c/ow_del_inflight.c0000644000175000001440000000305512654730021016433 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_connection.h" static GOOD_OR_BAD Default_nomatch( struct port_in * trial, struct port_in * existing ) ; /* Can only be called by a separate (monitoring) thread so the write-lock won't deadlock */ /* This allows removing Bus Masters while program is running * The master is usually only read-locked for normal operation * write lock is done in a separate thread when no requests are being processed */ void Del_InFlight( GOOD_OR_BAD (*nomatch)(struct port_in * trial,struct port_in * existing), struct port_in * old_pin ) { struct connection_in * old_in ; struct port_in * pin ; if ( old_pin == NULL ) { return ; } old_in = old_pin->first ; LEVEL_DEBUG("Request master be removed: %s", DEVICENAME(old_in)); if ( nomatch == NULL ) { nomatch = Default_nomatch ; } CONNIN_WLOCK ; for ( pin = Inbound_Control.head_port ; pin != NULL ; pin = pin->next ) { if ( BAD( nomatch( old_pin, pin )) ) { LEVEL_DEBUG("Removing BUS index=%d %s",pin->first->index,SAFESTRING(DEVICENAME(pin->first))); RemovePort(pin) ; } } CONNIN_WUNLOCK ; } // GOOD means no match static GOOD_OR_BAD Default_nomatch( struct port_in * trial, struct port_in * existing ) { // just delete this port if ( trial != existing ) { return gbGOOD ; } return gbBAD; } owfs-3.1p5/module/owlib/src/c/ow_detail.c0000644000175000001440000000423612654730021015247 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" // Switch to debug mode when this device is referenced // Unfortunately, this only occurs after parsing. struct debug_detail { // global int details ; // number of details to match int lock_depth ; // number of detail (mutex locked) struct dirblob sn ; // to match struct dirblob length ; // use only first byte } DD ; void Detail_Init( void ) { DD.details = 0 ; DD.lock_depth = 0 ; DirblobInit( & (DD.sn) ) ; DirblobInit( & (DD.length) ) ; } void Detail_Close( void ) { DirblobClear( & (DD.sn) ) ; DirblobClear( & (DD.length) ) ; } void Detail_Test( struct parsedname * pn ) { int test_index ; for ( test_index = 0 ; test_index < DD.details ; ++ test_index ) { BYTE sn[SERIAL_NUMBER_SIZE] ; BYTE length[SERIAL_NUMBER_SIZE] ; DirblobGet( test_index, sn, &(DD.sn) ) ; DirblobGet( test_index, length, &(DD.length) ) ; if ( memcmp( pn->sn, sn, length[0] ) == 0 ) { pn->detail_flag = 1 ; DETAILLOCK ; ++DD.lock_depth ; Globals.error_level = 9 ; DETAILUNLOCK ; break ; } } } void Detail_Free( struct parsedname * pn ) { if ( pn->detail_flag == 1 ) { DETAILLOCK ; --DD.lock_depth ; if ( DD.lock_depth == 0 ) { Globals.error_level = Globals.error_level_restore ; } DETAILUNLOCK ; } } GOOD_OR_BAD Detail_Add( const char *arg ) { char * arg_copy = owstrdup( arg ) ; char * next_p = arg_copy ; while ( next_p != NULL ) { BYTE sn[SERIAL_NUMBER_SIZE] ; BYTE length[SERIAL_NUMBER_SIZE] ; char * this_p = strsep( &next_p, " ," ) ; length[0] = SerialNumber_length( this_p, sn ) ; if ( length[0] > 0 ) { ++ DD.details ; switch (Globals.daemon_status) { case e_daemon_want_bg: case e_daemon_unknown: Globals.daemon_status = e_daemon_fg ; break ; default: break ; } DirblobAdd( sn, &(DD.sn) ) ; DirblobAdd( length, &(DD.length) ) ; } } return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_devicelock.c0000644000175000001440000001053412654730021016113 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" // dynamically created access control for a 1-wire device // used to negotiate between different threads (queries) struct devlock { pthread_mutex_t lock; BYTE sn[SERIAL_NUMBER_SIZE]; UINT users; }; /* We keep all the devlocks, organized in a tree for faster searching. */ #define DEVTREE_LOCK(pn) _MUTEX_LOCK( ((pn)->selected_connection)->dev_mutex ) #define DEVTREE_UNLOCK(pn) _MUTEX_UNLOCK( ((pn)->selected_connection)->dev_mutex ) /* Bad bad C library */ /* implementation of tfind, tsearch returns an opaque structure */ /* you have to know that the first element is a pointer to your data */ /* This is a tree element for the devlocks */ struct dev_opaque { struct devlock *key; void *other; }; /* compilation error in gcc version 4.0.0 20050519 if dev_compare * is defined as an embedded function */ /* Use the serial numbers to find the right devlock */ static int dev_compare(const void *a, const void *b) { return memcmp(&((const struct devlock *) a)->sn, &((const struct devlock *) b)->sn, SERIAL_NUMBER_SIZE); } /* Grabs a device lock, either one already matching, or creates one */ /* called per-adapter */ /* The device locks (devlock) are kept in a tree */ ZERO_OR_ERROR DeviceLockGet(struct parsedname *pn) { struct devlock *local_devicelock; struct devlock *tree_devicelock; struct dev_opaque *opaque; if (pn->selected_device == DeviceSimultaneous) { /* Shouldn't call DeviceLockGet() on DeviceSimultaneous. No sn exists */ return 0; } /* Cannot lock without knowing which bus since the device trees are bus-specific */ if (pn->selected_connection == NO_CONNECTION) { return -EINVAL ; } /* Need locking? */ /* Exclude external */ if ( pn->selected_filetype->read == FS_r_external || pn->selected_filetype->write == FS_w_external ) { return 0 ; } // Test type switch (pn->selected_filetype->format) { case ft_directory: case ft_subdir: return 0; default: break; } // Ignore static and atomic switch (pn->selected_filetype->change) { case fc_static: case fc_statistic: return 0; default: break; } // Create a devlock block to add to the tree local_devicelock = owmalloc(sizeof(struct devlock)) ; if ( local_devicelock == NULL ) { return -ENOMEM; } memcpy(local_devicelock->sn, pn->sn, SERIAL_NUMBER_SIZE); DEVTREE_LOCK(pn); /* in->dev_db points to the root of a tree of queries that are using this device */ opaque = (struct dev_opaque *)tsearch(local_devicelock, &(pn->selected_connection->dev_db), dev_compare) ; if ( opaque == NULL ) { // unfound and uncreatable DEVTREE_UNLOCK(pn); owfree(local_devicelock); // kill the allocated devlock return -ENOMEM; } tree_devicelock = opaque->key ; if ( local_devicelock == tree_devicelock) { // new device slot // No longer "local" -- the local_device lock now belongs to the device_tree // It will need to be freed later, when the user count returns to zero. _MUTEX_INIT(tree_devicelock->lock); // create a mutex tree_devicelock->users = 0 ; } else { // existing device slot owfree(local_devicelock); // kill the locally allocated devlock (since there already is a matching devlock) } ++(tree_devicelock->users); // add our claim to the device DEVTREE_UNLOCK(pn); _MUTEX_LOCK(tree_devicelock->lock); // now grab the device pn->lock = tree_devicelock; // use this new devlock return 0; } // Unlock the device void DeviceLockRelease(struct parsedname *pn) { if (pn->lock) { // this is the stored pointer to the device in the appropriate device tree // Free the device _MUTEX_UNLOCK(pn->lock->lock); /* Serg: This coredump on his 64-bit server */ // Now mark our disinterest in the device tree (and possibly reap the node)) DEVTREE_LOCK(pn); --pn->lock->users; // remove our interest if (pn->lock->users == 0) { // Nobody's interested! tdelete(pn->lock, &(pn->selected_connection->dev_db), dev_compare); /* Serg: Address 0x5A0D750 is 0 bytes inside a block of size 32 free'd */ _MUTEX_DESTROY(pn->lock->lock); owfree(pn->lock); } DEVTREE_UNLOCK(pn); pn->lock = NULL; } } owfs-3.1p5/module/owlib/src/c/ow_dir.c0000644000175000001440000010004412711737666014575 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ // regex #include #include "owfs_config.h" #include "ow_devices.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_dirblob.h" #include "ow.h" #include "ow_external.h" static enum search_status PossiblyLockedBusCall( enum search_status (* first_next)(struct device_search *, const struct parsedname *), struct device_search * ds, const struct parsedname * pn ) ; static ZERO_OR_ERROR FS_dir_both(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_directory, uint32_t * flags); static ZERO_OR_ERROR FS_dir_all_connections(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_directory, uint32_t * flags); static ZERO_OR_ERROR FS_devdir(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn2); static ZERO_OR_ERROR FS_structdevdir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_device_directory); static ZERO_OR_ERROR FS_alarmdir(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn2); static ZERO_OR_ERROR FS_typedir(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn_type_directory); static ZERO_OR_ERROR FS_realdir(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn2, uint32_t * flags); static ZERO_OR_ERROR FS_cache_or_real(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn2, uint32_t * flags); static ZERO_OR_ERROR FS_busdir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_directory); static void FS_stype_dir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory); static ZERO_OR_ERROR FS_externaldir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_external_directory); static void FS_interface_dir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory); static void FS_alarm_entry(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory); static void FS_simultaneous_entry(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory); static void FS_uncached_dir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory); static ZERO_OR_ERROR FS_dir_plus(void (*dirfunc) (void *, const struct parsedname *), void *v, uint32_t * flags, const struct parsedname *pn_directory, const char *file) ; /* Calls dirfunc() for each element in directory */ /* void * data is arbitrary user data passed along -- e.g. output file descriptor */ /* pn_directory -- input: pn_directory->selected_device == NO_DEVICE -- root directory, give list of all devices pn_directory->selected_device non-null, -- device directory, give all properties branch aware cache aware pn_directory -- output (with each call to dirfunc) ROOT pn_directory->selected_device set pn_directory->sn set appropriately pn_directory->selected_filetype not set DEVICE pn_directory->selected_device and pn_directory->sn still set pn_directory->selected_filetype loops through */ /* FS_dir produces the "invariant" portion of the directory, passing on to FS_dir_all_connections the variable part */ ZERO_OR_ERROR FS_dir(void (*dirfunc) (void *, const struct parsedname *), void *v, struct parsedname *pn_directory) { /* applies 'dirfunc' to each directory element of pn_directory */ /* void * v is extra information passed along */ uint32_t flags; LEVEL_DEBUG("path=%s", pn_directory->path); pn_directory->control_flags |= ALIAS_REQUEST ; // All local directory queries want alias translation return FS_dir_both(dirfunc, v, pn_directory, &flags); } /* path is the path which "pn_directory" parses */ /* FS_dir_remote is the entry into FS_dir_all_connections from ServerDir */ /* More checking is done, and the flags are returned */ ZERO_OR_ERROR FS_dir_remote(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_directory, uint32_t * flags) { LEVEL_DEBUG("path=%s", pn_directory->path); return FS_dir_both(dirfunc, v, pn_directory, flags); } static ZERO_OR_ERROR FS_dir_both(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_raw_directory, uint32_t * flags) { ZERO_OR_ERROR ret = 0; /* initialize flags */ flags[0] = 0; /* pn_raw_directory->selected_connection Could be NULL here... * It will then return a root-directory containing * /uncached,/settings,/system,/statistics,/structure * instead of an empty directory. */ if (pn_raw_directory == NO_PARSEDNAME) { LEVEL_CALL("return ENODEV pn_raw_directory=%p selected_connection=%p", pn_raw_directory, (pn_raw_directory ? pn_raw_directory->selected_connection : NO_CONNECTION)); return -ENODEV; } LEVEL_CALL("path=%s", SAFESTRING(pn_raw_directory->path)); STATLOCK; AVERAGE_IN(&dir_avg); AVERAGE_IN(&all_avg); STATUNLOCK; FSTATLOCK; StateInfo.dir_time = NOW_TIME; // protected by mutex FSTATUNLOCK; if (pn_raw_directory->selected_filetype != NO_FILETYPE) { // File, not directory ret = -ENOTDIR; } else if (SpecifiedVeryRemoteBus(pn_raw_directory)) { //printf("SPECIFIED_BUS BUS_IS_SERVER (very remote)\n"); // Send remotely only (all evaluation done there) ret = ServerDir(dirfunc, v, pn_raw_directory, flags); } else if (SpecifiedRemoteBus(pn_raw_directory)) { //printf("SPECIFIED_BUS BUS_IS_SERVER (just remote)\n"); //printf("Add extra INTERFACE\n"); FS_interface_dir(dirfunc, v, pn_raw_directory); // Send remotely only (all evaluation done there) ret = ServerDir(dirfunc, v, pn_raw_directory, flags); } else if (pn_raw_directory->selected_device != NO_DEVICE) { //printf("YES SELECTED_DEVICE\n"); // device directory -- not bus-specific if ( IsInterfaceDir(pn_raw_directory) ) { ret = FS_devdir(dirfunc, v, pn_raw_directory); } else if ( BusIsServer( pn_raw_directory->selected_connection) ) { ret = ServerDir(dirfunc, v, pn_raw_directory, flags); } else if ( IsStructureDir( pn_raw_directory ) ) { ret = FS_structdevdir( dirfunc, v, pn_raw_directory ) ; } else { ret = FS_devdir(dirfunc, v, pn_raw_directory); } } else if (NotRealDir(pn_raw_directory)) { //printf("NOT_REAL_DIR\n"); // structure, statistics, system or settings dir -- not bus-specific ret = FS_typedir(dirfunc, v, pn_raw_directory); } else if (SpecifiedLocalBus(pn_raw_directory)) { if (IsAlarmDir(pn_raw_directory)) { /* root or branch directory -- alarm state */ ret = FS_alarmdir(dirfunc, v, pn_raw_directory); } else { if (pn_raw_directory->ds2409_depth == 0) { // only add funny directories for non-micro hub (DS2409) branches FS_interface_dir(dirfunc, v, pn_raw_directory); } /* Now get the actual devices */ ret = FS_cache_or_real(dirfunc, v, pn_raw_directory, flags); /* simultaneous directory */ if (flags[0] & (DEV_temp | DEV_volt)) { FS_simultaneous_entry(dirfunc, v, pn_raw_directory); } if (flags[0] & DEV_alarm) { FS_alarm_entry(dirfunc, v, pn_raw_directory); } } } else if ( IsAlarmDir(pn_raw_directory)) { // alarm for all busses // Not specified bus, so scan through all and print union ret = FS_dir_all_connections(dirfunc, v, pn_raw_directory, flags); // add no chaff to alarm directory -- no "uncached", "bus.x" etc } else { // standard directory search -- all busses // Not specified bus, so scan through all and print union int server_type = Globals.program_type==program_type_server || Globals.program_type==program_type_external ; ret = FS_dir_all_connections(dirfunc, v, pn_raw_directory, flags); if ( !server_type || ShouldReturnBusList(pn_raw_directory)) { if (pn_raw_directory->ds2409_depth == 0) { // only add funny directories for non-micro hub (DS2409) branches FS_busdir(dirfunc, v, pn_raw_directory); FS_uncached_dir(dirfunc, v, pn_raw_directory); FS_stype_dir(dirfunc, v, pn_raw_directory); } /* simultaneous directory */ if (flags[0] & (DEV_temp | DEV_volt)) { FS_simultaneous_entry(dirfunc, v, pn_raw_directory); } if (flags[0] & DEV_alarm) { FS_alarm_entry(dirfunc, v, pn_raw_directory); } } } STATLOCK; AVERAGE_OUT(&dir_avg); AVERAGE_OUT(&all_avg); STATUNLOCK; LEVEL_DEBUG("ret=%d", ret); return ret; } /* directories about the internal pogram state and configuration rather than device data */ static void FS_stype_dir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory) { uint32_t ignoreflag = 0; FS_dir_plus(dirfunc, v, &ignoreflag, pn_root_directory, ePN_name[ePN_settings]); FS_dir_plus(dirfunc, v, &ignoreflag, pn_root_directory, ePN_name[ePN_system]); FS_dir_plus(dirfunc, v, &ignoreflag, pn_root_directory, ePN_name[ePN_statistics]); FS_dir_plus(dirfunc, v, &ignoreflag, pn_root_directory, ePN_name[ePN_structure]); } /* interface (only for bus directories) -- actually generated by the layer ABOVE that bus. */ static void FS_interface_dir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory) { uint32_t ignoreflag = 0; FS_dir_plus(dirfunc, v, &ignoreflag, pn_root_directory, ePN_name[ePN_interface]); } /* Some devices have a special state when certain events are found called the ALARM state */ static void FS_alarm_entry(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory) { uint32_t ignoreflag = 0 ; FS_dir_plus(dirfunc, v, &ignoreflag, pn_root_directory, "alarm"); } /* Add the "uncached" directory as a mnenomic aid to top level directory listings. */ static void FS_uncached_dir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory) { uint32_t ignoreflag = 0 ; if (IsUncachedDir(pn_root_directory)) { /* already uncached */ return; } FS_dir_plus(dirfunc, v, &ignoreflag, pn_root_directory, "uncached"); } /* Some temperature and voltage measurements can be triggered globally for considerable speed improvements */ static void FS_simultaneous_entry(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_root_directory) { uint32_t ignoreflag = 0 ; FS_dir_plus(dirfunc, v, &ignoreflag, pn_root_directory, "simultaneous"); } /* path is the path which "pn_directory" parses */ /* FS_dir_all_connections produces the data that can vary: device lists, etc. */ struct dir_all_connections_struct { struct port_in * pin ; struct connection_in * cin ; struct parsedname pn_directory; void (*dirfunc) (void *, const struct parsedname *); void *v; uint32_t flags; ZERO_OR_ERROR ret; }; /* Embedded function */ /* Directory on a particular port's channel */ static void FS_dir_all_connections_callback_conn( struct dir_all_connections_struct * dacs ) { if ( dacs->cin == NO_CONNECTION ) { return ; } SetKnownBus(dacs->cin->index, &(dacs->pn_directory) ); if ( BAD(TestConnection( &(dacs->pn_directory) )) ) { // reconnect ok? dacs->ret = -ECONNABORTED; } else if (BusIsServer(dacs->pn_directory.selected_connection)) { /* is this a remote bus? */ //printf("FS_dir_all_connections: Call ServerDir %s\n", dacs->pn_directory->path); dacs->ret = ServerDir(dacs->dirfunc, dacs->v, &(dacs->pn_directory), &(dacs->flags)); } else if (IsAlarmDir( &(dacs->pn_directory) ) ) { /* root or branch directory -- alarm state */ //printf("FS_dir_all_connections: Call FS_alarmdir %s\n", dacs->pn_directory->path); dacs->ret = FS_alarmdir(dacs->dirfunc, dacs->v, &(dacs->pn_directory) ); } else { dacs->ret = FS_cache_or_real(dacs->dirfunc, dacs->v, &(dacs->pn_directory), &(dacs->flags)); } // next channel dacs->cin = dacs->cin->next ; FS_dir_all_connections_callback_conn( dacs ) ; } /* Callback (thread) once per port */ /* Will need to probe each connection (channel) on this port */ static void *FS_dir_all_connections_callback_port(void *v) { struct dir_all_connections_struct *dacs = v; struct dir_all_connections_struct dacs_next ; pthread_t thread; int threadbad = 0; if ( dacs->pin == NULL ) { return VOID_RETURN; } // set up structure dacs_next.pin = dacs->pin->next ; if ( dacs_next.pin == NULL ) { threadbad = 1 ; } else { dacs_next.dirfunc = dacs->dirfunc ; memcpy( &(dacs_next.pn_directory), &(dacs->pn_directory), sizeof(struct parsedname)); // shallow copy dacs_next.v = dacs->v ; dacs_next.flags = dacs->flags ; dacs_next.ret = dacs->ret ; threadbad = pthread_create(&thread, DEFAULT_THREAD_ATTR, FS_dir_all_connections_callback_port, (void *) (&dacs_next)); } // First channel dacs->cin = dacs->pin->first ; FS_dir_all_connections_callback_conn( v ) ; //printf("FS_dir_all_connections4 pid=%ld adapter=%d ret=%d\n",pthread_self(), dacs->pn_directory->selected_connection->index,ret); /* See if next bus was also queried */ if (threadbad == 0) { /* was a thread created? */ if (pthread_join(thread, NULL)!= 0) { return VOID_RETURN ; /* cannot join, so return only this result */ } if (dacs_next.ret >= 0) { dacs->ret = dacs_next.ret; /* is it an error return? Then return this one */ } else { dacs->flags |= dacs_next.flags ; } } return VOID_RETURN; } static ZERO_OR_ERROR FS_dir_all_connections(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_directory, uint32_t * flags) { struct dir_all_connections_struct dacs ; // set up structure dacs.pin = Inbound_Control.head_port ; dacs.dirfunc = dirfunc ; memcpy( &(dacs.pn_directory), pn_directory, sizeof(struct parsedname)); // shallow copy dacs.v = v ; dacs.flags = 0 ; dacs.ret = 0 ; // Start iterating through buses FS_dir_all_connections_callback_port( (void *) (& dacs) ) ; *flags = dacs.flags ; return dacs.ret ; } /* Device directory (i.e. show the properties) -- all from memory */ /* Respect the Visibility status and also show only the correct subdir level */ static ZERO_OR_ERROR FS_devdir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_device_directory) { struct device * dev = pn_device_directory->selected_device ; struct filetype *lastft = &(dev->filetype_array[dev->count_of_filetypes]); /* last filetype struct */ struct filetype *ft_pointer; /* first filetype struct */ char subdir_name[OW_FULLNAME_MAX + 1]; size_t subdir_len; uint32_t ignoreflag = 0; STAT_ADD1(dir_dev.calls); // Add subdir to name (SubDirectory is within a device, but an extra layer of grouping of properties) if (pn_device_directory->subdir == NO_SUBDIR) { // not sub directory subdir_name[0] = '\0' ; subdir_len = 0; ft_pointer = dev->filetype_array; } else { // device subdirectory -- so use the sorted list to find all entries with the same prefix strncpy(subdir_name, pn_device_directory->subdir->name, OW_FULLNAME_MAX); strcat(subdir_name, "/"); subdir_len = strlen(subdir_name); ft_pointer = pn_device_directory->subdir + 1; // next element (first one truly in the subdir) } for (; ft_pointer < lastft; ++ft_pointer) { /* loop through filetypes */ char *namepart ; /* test that start of name matches directory name */ if (strncmp(ft_pointer->name, subdir_name, subdir_len) != 0) { // end of subdir break; } namepart = &ft_pointer->name[subdir_len]; // point after subdir name if ( strchr( namepart, '/') != NULL) { // subdir elements (and we're not in this subdir!) continue; } if (ft_pointer->ag==NON_AGGREGATE) { FS_dir_plus(dirfunc, v, &ignoreflag, pn_device_directory, namepart); STAT_ADD1(dir_dev.entries); } else if (ft_pointer->ag->combined==ag_sparse) { struct parsedname s_pn_file_entry; struct parsedname *pn_file_entry = &s_pn_file_entry; if (ft_pointer->ag->letters==ag_letters) { if (FS_ParsedNamePlusText(pn_device_directory->path, namepart, "xxx", pn_file_entry) == 0) { pn_file_entry->extension = EXTENSION_UNKNOWN ; // unspecified (for owhttpd) switch ( FS_visible(pn_file_entry) ) { // hide hidden properties case visible_now : case visible_always: FS_dir_entry_aliased( dirfunc, v, pn_file_entry) ; STAT_ADD1(dir_dev.entries); break ; default: break ; } FS_ParsedName_destroy(pn_file_entry); } } else { if (FS_ParsedNamePlusText(pn_device_directory->path, namepart, "000", pn_file_entry) == 0) { pn_file_entry->extension = EXTENSION_UNKNOWN ; // unspecified (for owhttpd) switch ( FS_visible(pn_file_entry) ) { // hide hidden properties case visible_now : case visible_always: FS_dir_entry_aliased( dirfunc, v, pn_file_entry) ; STAT_ADD1(dir_dev.entries); break ; default: break ; } FS_ParsedName_destroy(pn_file_entry); } } } else { int extension; int first_extension = (ft_pointer->format == ft_bitfield) ? EXTENSION_BYTE : EXTENSION_ALL; struct parsedname s_pn_file_entry; struct parsedname *pn_file_entry = &s_pn_file_entry; for (extension = first_extension; extension < ft_pointer->ag->elements; ++extension) { if (FS_ParsedNamePlusExt(pn_device_directory->path, namepart, extension, ft_pointer->ag->letters, pn_file_entry) == 0) { switch ( FS_visible(pn_file_entry) ) { // hide hidden properties case visible_now : case visible_always: FS_dir_entry_aliased( dirfunc, v, pn_file_entry) ; STAT_ADD1(dir_dev.entries); break ; default: break ; } FS_ParsedName_destroy(pn_file_entry); } } } } return 0; } /* Device directory -- all from memory -- for structure */ static ZERO_OR_ERROR FS_structdevdir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_device_directory) { struct filetype *lastft = &(pn_device_directory->selected_device->filetype_array[pn_device_directory->selected_device->count_of_filetypes]); /* last filetype struct */ struct filetype *ft_pointer; /* first filetype struct */ char subdir_name[OW_FULLNAME_MAX + 1]; size_t subdir_len; // Add subdir to name (SubDirectory is within a device, but an extra layer of grouping of properties) if (pn_device_directory->subdir == NO_SUBDIR) { // not sub directory subdir_name[0] = '\0' ; subdir_len = 0; ft_pointer = pn_device_directory->selected_device->filetype_array; } else { // device subdirectory -- so use the sorted list to find all entries with the same prefix strncpy(subdir_name, pn_device_directory->subdir->name, OW_FULLNAME_MAX); strcat(subdir_name, "/"); subdir_len = strlen(subdir_name); ft_pointer = pn_device_directory->subdir + 1; // next element (first one truly in the subdir) } for (; ft_pointer < lastft; ++ft_pointer) { /* loop through filetypes */ char *namepart ; if ( ft_pointer->visible == INVISIBLE ) { // hide always invisible // done without actually calling the visibility function since // the device is generic for structure listings and may not // be an actual device. continue ; } /* test that start of name matches directory name */ if (strncmp(ft_pointer->name, subdir_name, subdir_len) != 0) { // end of subdir break; } namepart = &ft_pointer->name[subdir_len]; // point after subdir name if ( strchr( namepart, '/') != NULL) { // subdir elements (and we're not in this subdir!) continue; } if (ft_pointer->ag==NON_AGGREGATE) { struct parsedname s_pn_file_entry; struct parsedname *pn_file_entry = &s_pn_file_entry; if (FS_ParsedNamePlus(pn_device_directory->path, namepart, pn_file_entry) == 0) { FS_dir_entry_aliased( dirfunc, v, pn_file_entry) ; FS_ParsedName_destroy(pn_file_entry); } } else if (ft_pointer->ag->combined==ag_sparse) { // Aggregate property struct parsedname s_pn_file_entry; struct parsedname *pn_file_entry = &s_pn_file_entry; if ( ft_pointer->ag->letters == ag_letters ) { if (FS_ParsedNamePlusText(pn_device_directory->path, namepart, "xxx", pn_file_entry) == 0) { FS_dir_entry_aliased( dirfunc, v, pn_file_entry) ; FS_ParsedName_destroy(pn_file_entry); } } else { if (FS_ParsedNamePlusText(pn_device_directory->path, namepart, "000", pn_file_entry) == 0) { FS_dir_entry_aliased( dirfunc, v, pn_file_entry) ; FS_ParsedName_destroy(pn_file_entry); } } } else { // Aggregate property struct parsedname s_pn_file_entry; struct parsedname *pn_file_entry = &s_pn_file_entry; if ( ft_pointer->format == ft_bitfield ) { if (FS_ParsedNamePlusExt(pn_device_directory->path, namepart, EXTENSION_BYTE, ft_pointer->ag->letters, pn_file_entry) == 0) { FS_dir_entry_aliased( dirfunc, v, pn_file_entry) ; FS_ParsedName_destroy(pn_file_entry); } } if (FS_ParsedNamePlusExt(pn_device_directory->path, namepart, EXTENSION_ALL, ft_pointer->ag->letters, pn_file_entry) == 0) { FS_dir_entry_aliased( dirfunc, v, pn_file_entry) ; FS_ParsedName_destroy(pn_file_entry); } // unlike real directory, only show the first array element since the data is redundant if (FS_ParsedNamePlusExt(pn_device_directory->path, namepart, 0, ft_pointer->ag->letters, pn_file_entry) == 0) { FS_dir_entry_aliased( dirfunc, v, pn_file_entry) ; FS_ParsedName_destroy(pn_file_entry); } } } return 0; } /* Note -- alarm directory is smaller, no adapters or stats or uncached */ static ZERO_OR_ERROR FS_alarmdir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_alarm_directory) { enum search_status ret; struct device_search ds; // holds search state uint32_t ignoreflag = 0; /* Special handling for External directory -- no alarm */ if ( get_busmode(pn_alarm_directory->selected_connection) == bus_external ) { return 0 ; } /* cache from Server if this is a remote bus */ if (BusIsServer(pn_alarm_directory->selected_connection)) { return ServerDir(dirfunc, v, pn_alarm_directory, &ignoreflag); } /* Certain buses are not real bus masters (like usb-monitor and w1-monitor) */ if ( pn_alarm_directory->selected_connection->iroutines.flags & ADAP_FLAG_sham ) { return 0 ; } /* STATISCTICS */ STAT_ADD1(dir_main.calls); ret = PossiblyLockedBusCall( BUS_first_alarm, &ds, pn_alarm_directory) ; while ( ret == search_good ) { char dev[PROPERTY_LENGTH_ALIAS + 1]; STAT_ADD1(dir_main.entries); FS_devicename(dev, PROPERTY_LENGTH_ALIAS, ds.sn, pn_alarm_directory); FS_dir_plus(dirfunc, v, &ignoreflag, pn_alarm_directory, dev); ret = PossiblyLockedBusCall( BUS_next, &ds, pn_alarm_directory) ; } switch ( ret ) { case search_good: // include fo completeness -- can't actually be a value. case search_done: return 0 ; case search_error: default: return -EIO; } } static enum search_status PossiblyLockedBusCall( enum search_status (* first_next)(struct device_search *, const struct parsedname *), struct device_search * ds, const struct parsedname * pn ) { enum search_status ret; // This is also called from the reconnection routine -- we use a flag to avoid mutex doubling and deadlock if ( NotReconnect(pn) ) { BUSLOCK(pn); ret = first_next(ds, pn) ; BUSUNLOCK(pn); } else { ret = first_next(ds, pn) ; } return ret ; } /* A directory of devices -- either main or branch */ /* not within a device, nor alarm state */ /* Also, adapters and stats handled elsewhere */ /* Scan the directory from the BUS and add to cache */ static ZERO_OR_ERROR FS_realdir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_whole_directory, uint32_t * flags) { struct device_search ds; size_t devices = 0; struct dirblob db; enum search_status ret; /* cache from Server if this is a remote bus */ if (BusIsServer(pn_whole_directory->selected_connection)) { return ServerDir(dirfunc, v, pn_whole_directory, flags); } /* Certain buses are not real bus masters (like usb-monitor and w1-monitor) */ if ( pn_whole_directory->selected_connection->iroutines.flags & ADAP_FLAG_sham ) { return 0 ; } /* STATISTICS */ STAT_ADD1(dir_main.calls); DirblobInit(&db); // set up a fresh dirblob ret = PossiblyLockedBusCall( BUS_first, &ds, pn_whole_directory) ; if (RootNotBranch(pn_whole_directory)) { db.allocated = pn_whole_directory->selected_connection->last_root_devs; // root dir estimated length } while ( ret == search_good ) { char dev[PROPERTY_LENGTH_ALIAS + 1]; /* Add to device cache */ Cache_Add_Device(pn_whole_directory->selected_connection->index,ds.sn) ; /* Get proper device name (including alias subst) */ FS_devicename(dev, PROPERTY_LENGTH_ALIAS, ds.sn, pn_whole_directory); /* Execute callback function */ if ( FS_dir_plus(dirfunc, v, flags, pn_whole_directory, dev) != 0 ) { DirblobPoison(&db); break ; } DirblobAdd(ds.sn, &db); ++devices; ret = PossiblyLockedBusCall( BUS_next, &ds, pn_whole_directory) ; } STATLOCK; dir_main.entries += devices; STATUNLOCK; switch ( ret ) { case search_done: if ( RootNotBranch(pn_whole_directory) ) { pn_whole_directory->selected_connection->last_root_devs = devices; // root dir estimated length } /* Add to the cache (full list as a single element */ if (DirblobPure(&db) && (ret == search_done) ) { Cache_Add_Dir(&db, pn_whole_directory); } DirblobClear(&db); return 0 ; case search_good: case search_error: default: DirblobClear(&db); return -EIO ; } } /* points "serial number" to directory -- 0 for root -- DS2409/main|aux for branch -- DS2409 needs only the last element since each DS2409 is unique */ void FS_LoadDirectoryOnly(struct parsedname *pn_directory, const struct parsedname *pn_original) { memmove( pn_directory, pn_original, sizeof(struct parsedname)) ; // shallow copy if (RootNotBranch(pn_directory)) { memset(pn_directory->sn, 0, SERIAL_NUMBER_SIZE); } else { // Stuff the branch into the checksum slot // Makes the branch address unique (DS2409 id + branch) --pn_directory->ds2409_depth; memcpy(pn_directory->sn, pn_directory->bp[pn_directory->ds2409_depth].sn, SERIAL_NUMBER_SIZE-1); pn_directory->sn[SERIAL_NUMBER_SIZE-1] = pn_directory->bp[pn_directory->ds2409_depth].branch; } pn_directory->selected_device = NO_DEVICE; } /* A directory of devices -- either main or branch */ /* not within a device, nor alarm state */ /* Also, adapters and stats handled elsewhere */ /* Cache2Real try the cache first, else get directory from bus (and add to cache) */ static ZERO_OR_ERROR FS_cache_or_real(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_real_directory, uint32_t * flags) { size_t dindex; struct dirblob db; BYTE sn[SERIAL_NUMBER_SIZE]; /* Special handling for External directory -- just walk tree */ if ( get_busmode(pn_real_directory->selected_connection) == bus_external ) { return FS_externaldir(dirfunc, v, pn_real_directory) ; } /* Test to see whether we should get the directory "directly" */ if ( SpecifiedBus(pn_real_directory) || IsUncachedDir(pn_real_directory) // asking for uncached || BAD( Cache_Get_Dir(&db, pn_real_directory)) // cache'd version isn't available (or old) ) { // directly return FS_realdir(dirfunc, v, pn_real_directory, flags); } // Use cached version of directory /* STATISTICS */ STAT_ADD1(dir_main.calls); /* Get directory from the cache */ for (dindex = 0; DirblobGet(dindex, sn, &db) == 0; ++dindex) { char dev[PROPERTY_LENGTH_ALIAS + 1]; FS_devicename(dev, PROPERTY_LENGTH_ALIAS, sn, pn_real_directory); FS_dir_plus(dirfunc, v, flags, pn_real_directory, dev); } DirblobClear(&db); /* allocated in Cache_Get_Dir */ STATLOCK; dir_main.entries += dindex; STATUNLOCK; return 0; } // must lock a global struct for walking through tree -- limitation of "twalk" // struct for walking through tree -- cannot send data except globally struct { void (*dirfunc) (void *, const struct parsedname *); void *v; struct parsedname *pn_directory; } typedir_action_struct; static void Typediraction(const void *t, const VISIT which, const int depth) { uint32_t ignoreflag = 0; (void) depth; switch (which) { case leaf: case postorder: FS_dir_plus(typedir_action_struct.dirfunc, typedir_action_struct.v, &ignoreflag, typedir_action_struct.pn_directory, ((const struct device_opaque *) t)->key->family_code); default: break; } } /* Show the pn_directory->type (statistics, system, ...) entries */ /* Only the top levels, the rest will be shown by FS_devdir */ static ZERO_OR_ERROR FS_typedir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_type_directory) { struct parsedname s_pn_type_device; struct parsedname *pn_type_device = &s_pn_type_device; memcpy(pn_type_device, pn_type_directory, sizeof(struct parsedname)); // shallow copy LEVEL_DEBUG("called on %s", pn_type_directory->path); TYPEDIRLOCK; typedir_action_struct.dirfunc = dirfunc; typedir_action_struct.v = v; typedir_action_struct.pn_directory = pn_type_device; twalk(Tree[pn_type_directory->type], Typediraction); // Ignore dangling pointer warning of s_pn_type_device; typedir_action_struct not used outside of this fn TYPEDIRUNLOCK; return 0; } // must lock a global struct for walking through tree -- limitation of "twalk" // struct for walking through tree -- cannot send data except globally struct { void (*dirfunc) (void *, const struct parsedname *); void *v; struct parsedname *pn_directory; } externaldir_action_struct; static void Externaldiraction(const void *nodep, const VISIT which, const int depth) { const struct sensor_node *p = *(struct sensor_node * const *) nodep; uint32_t ignoreflag = 0; (void) depth; switch (which) { case leaf: case postorder: FS_dir_plus(externaldir_action_struct.dirfunc, externaldir_action_struct.v, &ignoreflag, externaldir_action_struct.pn_directory,p->name); default: break; } } /* Show the external entries */ /* Only the sensors */ static ZERO_OR_ERROR FS_externaldir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_external_directory) { struct parsedname s_pn_external_device; struct parsedname *pn_external_device = &s_pn_external_device; memcpy(pn_external_device, pn_external_directory, sizeof(struct parsedname)); // shallow copy LEVEL_DEBUG("called on %s", pn_external_directory->path); EXTERNALDIRLOCK; externaldir_action_struct.dirfunc = dirfunc; externaldir_action_struct.v = v; externaldir_action_struct.pn_directory = pn_external_device; twalk( sensor_tree, Externaldiraction); // Ignore dangling pointer warning of s_pn_external_device; externaldir_action_struct not used outside of this fn EXTERNALDIRUNLOCK; return 0; } /* Show the bus entries */ static ZERO_OR_ERROR FS_busdir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn_directory) { char bus[OW_FULLNAME_MAX]; struct port_in * pin ; uint32_t ignoreflag = 0 ; if (!RootNotBranch(pn_directory)) { return 0; } for ( pin = Inbound_Control.head_port ; pin != NULL ; pin = pin->next ) { struct connection_in * cin ; for ( cin = pin->first ; cin != NO_CONNECTION ; cin = cin->next ) { UCLIBCLOCK; snprintf(bus, OW_FULLNAME_MAX, "bus.%d", cin->index); UCLIBCUNLOCK; FS_dir_plus(dirfunc, v, &ignoreflag, pn_directory, bus); } } return 0; } /* Parse and show */ static ZERO_OR_ERROR FS_dir_plus(void (*dirfunc) (void *, const struct parsedname *), void *v, uint32_t * flags, const struct parsedname *pn_directory, const char *file) { struct parsedname s_pn_plus_directory; struct parsedname *pn_plus_directory = &s_pn_plus_directory; if (FS_ParsedNamePlus(pn_directory->path, file, pn_plus_directory) == 0) { switch ( FS_visible(pn_plus_directory) ) { // hide hidden properties case visible_now : case visible_always: FS_dir_entry_aliased( dirfunc, v, pn_plus_directory) ; if ( pn_plus_directory->selected_device ){ flags[0] |= pn_plus_directory->selected_device->flags; } break ; default: break ; } FS_ParsedName_destroy(pn_plus_directory) ; return 0; } return -ENOENT; } owfs-3.1p5/module/owlib/src/c/ow_dirblob.c0000644000175000001440000000736012654730021015423 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. --------------------------------------------------------------------------- Implementation: 2006 dirblob */ #include #include "owfs_config.h" #include "ow.h" #define DIRBLOB_ELEMENT_LENGTH 8 #define DIRBLOB_ALLOCATION_INCREMENT 10 /* A "dirblob" is a structure holding a list of 1-wire serial numbers (8 bytes each) with some housekeeping information It is used for directory caches, and some "all at once" adapters types Most interestingly, it allocates memory dynamically. */ void DirblobClear(struct dirblob *db) { SAFEFREE(db->snlist) ; db->allocated = db->devices; db->devices = 0; db->troubled = 0; } void DirblobInit(struct dirblob *db) { db->devices = 0; db->allocated = 0; db->snlist = 0; db->troubled = 0; } int DirblobPure(const struct dirblob *db) { return !db->troubled; } void DirblobPoison(struct dirblob *db) { db->troubled = 1; } int DirblobElements(const struct dirblob *db) { return db->devices; } int DirblobAdd(const BYTE * sn, struct dirblob *db) { if ( db->troubled ) { return -EINVAL ; } // make more room? -- blocks of 10 devices (80byte) if ((db->devices >= db->allocated) || (db->snlist == NULL)) { int newalloc = db->allocated + DIRBLOB_ALLOCATION_INCREMENT; BYTE *try_bigger_block = owrealloc(db->snlist, DIRBLOB_ELEMENT_LENGTH * newalloc); if (try_bigger_block != NULL) { db->allocated = newalloc; db->snlist = try_bigger_block; } else { // allocation failed -- keep old db->troubled = 1; return -ENOMEM; } } // add the device and increment the counter memcpy(&(db->snlist[DIRBLOB_ELEMENT_LENGTH * db->devices]), sn, DIRBLOB_ELEMENT_LENGTH); ++db->devices; return 0; } int DirblobGet(int device_index, BYTE * sn, const struct dirblob *db) { if (device_index >= db->devices) { return -ENODEV; } memcpy(sn, &(db->snlist[DIRBLOB_ELEMENT_LENGTH * device_index]), DIRBLOB_ELEMENT_LENGTH); return 0; } /* Search for a serial number return position (>=0) on match return -1 on no match or error */ int DirblobSearch(BYTE * sn, const struct dirblob *db) { int device_index; if (db == NULL || db->devices < 1) { return INDEX_BAD; } for (device_index = 0; device_index < db->devices; ++device_index) { if (memcmp(sn, &(db->snlist[DIRBLOB_ELEMENT_LENGTH * device_index]), DIRBLOB_ELEMENT_LENGTH) == 0) { return device_index; } } return INDEX_BAD; } // used in cache, fixes up a dirblob when retrieved from the cache int DirblobRecreate( BYTE * snlist, int size, struct dirblob *db) { DirblobInit( db ) ; if ( size == 0 ) { return 0 ; } db->snlist = (BYTE *) owmalloc(size) ; if ( db->snlist == NULL ) { db->troubled = 1 ; return -ENOMEM ; } memcpy(db->snlist, snlist, size); db->allocated = db->devices = size / 8; return 0 ; } owfs-3.1p5/module/owlib/src/c/ow_ds2482.c0000644000175000001440000007022512654730021014734 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* i2c support for the DS2482-100 and DS2482-800 1-wire host adapters */ /* Stolen shamelessly from Ben Gardners kernel module */ /* Actually, Dallas datasheet has the information, the module code showed a nice implementation, the eventual format is owfs-specific (using similar primatives, data structures) Testing by Jan Kandziora and Daniel Höper. */ /** * ds2482.c - provides i2c to w1-master bridge(s) * Copyright (C) 2005 Ben Gardner * * The DS2482 is a sensor chip made by Dallas Semiconductor (Maxim). * It is a I2C to 1-wire bridge. * There are two variations: -100 and -800, which have 1 or 8 1-wire ports. * The complete datasheet can be obtained from MAXIM's website at: * http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4382 * * 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; version 2 of the License. * * MODULE_AUTHOR("Ben Gardner "); * MODULE_DESCRIPTION("DS2482 driver"); * MODULE_LICENSE("GPL"); */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #if OW_I2C // Header taken from lm-sensors code // specifically lm-sensors-2.10.0 #include "i2c-dev.h" enum ds2482_address { ds2482_any=-2, ds2482_all=-1, ds2482_18, ds2482_19, ds2482_1A, ds2482_1B, ds2482_1C, ds2482_1D, ds2482_1E, ds2482_1F, ds2482_too_far } ; static GOOD_OR_BAD DS2482_detect_bus(enum ds2482_address chip_num, char * i2c_device, struct port_in *pin) ; static GOOD_OR_BAD DS2482_detect_sys( int any, enum ds2482_address chip_num, struct port_in *pin) ; static GOOD_OR_BAD DS2482_detect_dir( int any, enum ds2482_address chip_num, struct port_in *pin) ; static GOOD_OR_BAD DS2482_detect_single(int lowindex, int highindex, char * i2c_device, struct port_in *pin) ; static enum search_status DS2482_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD DS2482_triple(BYTE * bits, int direction, FILE_DESCRIPTOR_OR_ERROR file_descriptor); static GOOD_OR_BAD DS2482_send_and_get(FILE_DESCRIPTOR_OR_ERROR file_descriptor, const BYTE wr, BYTE * rd); static RESET_TYPE DS2482_reset(const struct parsedname *pn); static GOOD_OR_BAD DS2482_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD DS2483_test(FILE_DESCRIPTOR_OR_ERROR file_descriptor); static void DS2482_setroutines(struct connection_in *in); static GOOD_OR_BAD HeadChannel(struct connection_in *head); static GOOD_OR_BAD CreateChannels(struct connection_in *head); static GOOD_OR_BAD DS2482_channel_select(struct connection_in * in); static GOOD_OR_BAD DS2482_readstatus(BYTE * c, FILE_DESCRIPTOR_OR_ERROR file_descriptor, unsigned long int min_usec, unsigned long int max_usec); static GOOD_OR_BAD SetConfiguration(BYTE c, struct connection_in *in); static void DS2482_close(struct connection_in *in); static GOOD_OR_BAD DS2482_redetect(const struct parsedname *pn); static GOOD_OR_BAD DS2482_PowerByte(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn); /** * The DS2482 registers - there are 3 registers that are addressed by a read * pointer. The read pointer is set by the last command executed. * * To read the data, issue a register read for any address */ #define DS2482_CMD_RESET 0xF0 /* No param */ #define DS2482_CMD_SET_READ_PTR 0xE1 /* Param: DS2482_PTR_CODE_xxx */ #define DS2482_CMD_CHANNEL_SELECT 0xC3 /* Param: Channel byte - DS2482-800 only */ #define DS2482_CMD_WRITE_CONFIG 0xD2 /* Param: Config byte */ #define DS2482_CMD_1WIRE_RESET 0xB4 /* Param: None */ #define DS2482_CMD_1WIRE_SINGLE_BIT 0x87 /* Param: Bit byte (bit7) */ #define DS2482_CMD_1WIRE_WRITE_BYTE 0xA5 /* Param: Data byte */ #define DS2482_CMD_1WIRE_READ_BYTE 0x96 /* Param: None */ /* Note to read the byte, Set the ReadPtr to Data then read (any addr) */ #define DS2482_CMD_1WIRE_TRIPLET 0x78 /* Param: Dir byte (bit7) */ /* Values for DS2482_CMD_SET_READ_PTR */ #define DS2482_STATUS_REGISTER 0xF0 #define DS2482_READ_DATA_REGISTER 0xE1 #define DS2482_DEVICE_CONFIGURATION_REGISTER 0xC3 #define DS2482_CHANNEL_SELECTION_REGISTER 0xD2 /* DS2482-800 only */ #define DS2482_PORT_CONFIGURATION_REGISTER 0xB4 /* DS2483 only */ /** * Configure Register bit definitions * The top 4 bits always read 0. * To write, the top nibble must be the 1's compl. of the low nibble. */ #define DS2482_REG_CFG_1WS 0x08 #define DS2482_REG_CFG_SPU 0x04 #define DS2482_REG_CFG_PDN 0x02 /* DS2483 only, power down */ #define DS2482_REG_CFG_PPM 0x02 /* non-DS2483, presence pulse masking */ #define DS2482_REG_CFG_APU 0x01 /** * Status Register bit definitions (read only) */ #define DS2482_REG_STS_DIR 0x80 #define DS2482_REG_STS_TSB 0x40 #define DS2482_REG_STS_SBR 0x20 #define DS2482_REG_STS_RST 0x10 #define DS2482_REG_STS_LL 0x08 #define DS2482_REG_STS_SD 0x04 #define DS2482_REG_STS_PPD 0x02 #define DS2482_REG_STS_1WB 0x01 /* Time limits for communication unsigned long int min_usec, unsigned long int max_usec */ #define DS2482_Chip_reset_usec 1, 2 #define DS2482_1wire_reset_usec 1125, 1250 #define DS2482_1wire_write_usec 530, 585 #define DS2482_1wire_triplet_usec 198, 219 /* Defines for making messages more explicit */ #define I2Cformat "I2C bus %s, channel %d/%d" #define I2Cvar(in) DEVICENAME(in), (in)->master.i2c.index, (in)->master.i2c.channels /* Device-specific functions */ static void DS2482_setroutines(struct connection_in *in) { in->iroutines.detect = DS2482_detect; in->iroutines.reset = DS2482_reset; in->iroutines.next_both = DS2482_next_both; in->iroutines.PowerByte = DS2482_PowerByte; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = DS2482_sendback_data; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = DS2482_redetect; in->iroutines.close = DS2482_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_overdrive; in->bundling_length = I2C_FIFO_SIZE; } /* All the rest of the program sees is the DS2482_detect and the entry in iroutines */ /* Open a DS2482 */ /* Top level detect routine */ GOOD_OR_BAD DS2482_detect(struct port_in *pin) { struct address_pair ap ; GOOD_OR_BAD gbResult ; enum ds2482_address chip_num ; Parse_Address( pin->init_data, &ap ) ; switch ( ap.second.type ) { case address_numeric: if ( ap.second.number < ds2482_18 || ap.second.number >= ds2482_too_far ) { LEVEL_CALL("DS2482 bus address <%s> invalid. Will search.", ap.second.alpha) ; chip_num = ds2482_any ; } else { chip_num = ap.second.number ; } break ; case address_all: case address_asterix: chip_num = ds2482_all ; break ; case address_none: chip_num = ds2482_any ; break ; default: LEVEL_CALL("DS2482 bus address <%s> invalid. Will scan.", ap.second.alpha) ; chip_num = ds2482_any ; break ; } switch ( ap.first.type ) { case address_all: case address_asterix: // All adapters gbResult = DS2482_detect_sys( 0, chip_num, pin ) ; break ; case address_none: // Any adapter -- first one found gbResult = DS2482_detect_sys( 1, chip_num, pin ) ; break ; default: // traditional, actual bus specified gbResult = DS2482_detect_bus( chip_num, ap.first.alpha, pin ) ; break ; } Free_Address( &ap ) ; return gbResult ; } #define SYSFS_I2C_Path "/sys/class/i2c-adapter" /* Use sysfs to find i2c adapters */ /* cycle through SYSFS_I2C_Path */ /* return GOOD if any found */ static GOOD_OR_BAD DS2482_detect_sys( int any, enum ds2482_address chip_num, struct port_in *pin_original) { DIR * i2c_list_dir ; struct dirent * i2c_bus ; int found = 0 ; struct port_in * pin_current = pin_original ; // We'll look in this directory for available i2c adapters. // This may be linux 2.6 specific i2c_list_dir = opendir( SYSFS_I2C_Path ) ; if ( i2c_list_dir == NULL ) { ERROR_CONNECT( "Cannot open %d to find available i2c devices",SYSFS_I2C_Path ) ; // Use the cruder approach of trying all possible numbers return DS2482_detect_dir( any, chip_num, pin_original ) ; } /* cycle through entries in /sys/class/i2c-adapter */ while ( (i2c_bus=readdir(i2c_list_dir)) != NULL ) { char dev_name[128] ; // room for /dev/name int sn_ret ; UCLIBCLOCK ; sn_ret = snprintf( dev_name, 128, "/dev/%s", i2c_bus->d_name ) ; UCLIBCUNLOCK ; if ( sn_ret < 0 ) { break ; } // Now look for the ds2482's if ( BAD( DS2482_detect_bus( chip_num, dev_name, pin_current ) ) ) { continue ; // none found on this i2c bus } // at least one found on this i2c bus ++found ; if ( any ) { // found one -- that's enough closedir( i2c_list_dir ) ; return gbGOOD ; } // ALL? then set up a new connection_in slot for the next one pin_current = NewPort(pin_current) ; if ( pin_current == NULL ) { break ; } } closedir( i2c_list_dir ) ; if ( found==0 ) { return gbBAD ; } if ( pin_current != pin_original ) { RemovePort( pin_current ) ; } return gbGOOD ; } /* non sysfs method -- try by bus name */ /* cycle through /dev/i2c-n */ /* returns GOOD if any adpters found */ static GOOD_OR_BAD DS2482_detect_dir( int any, enum ds2482_address chip_num, struct port_in *pin_original) { int found = 0 ; struct port_in * pin_current = pin_original ; int bus = 0 ; int sn_ret ; for ( bus=0 ; bus<99 ; ++bus ) { char dev_name[128] ; UCLIBCLOCK ; sn_ret = snprintf( dev_name, 128-1, "/dev/i2c-%d", bus ) ; UCLIBCUNLOCK ; if ( sn_ret < 0 ) { break ; } if ( access(dev_name, F_OK) < 0 ) { continue ; } // Now look for the ds2482's if ( BAD( DS2482_detect_bus( chip_num, dev_name, pin_current ) ) ) { continue ; } // at least one found ++found ; if ( any ) { return gbGOOD ; } // ALL? then set up a new connection_in slot pin_current = NewPort(pin_current) ; if ( pin_current == NULL ) { break ; } } if ( found == 0 ) { return gbBAD ; } if ( pin_original != pin_current ) { RemovePort(pin_current) ; } return gbGOOD ; } /* Try to see if there is a DS2482 device on the specified i2c bus */ /* Includes a fix from Pascal Baerten */ static GOOD_OR_BAD DS2482_detect_bus(enum ds2482_address chip_num, char * i2c_device, struct port_in * pin_original) { switch (chip_num) { case ds2482_any: // usual case, find the first adapter return DS2482_detect_single( 0, 7, i2c_device, pin_original ) ; case ds2482_all: // Look through all the possible i2c addresses { int start_chip = 0 ; struct port_in * all_pin = pin_original ; do { if ( BAD( DS2482_detect_single( start_chip, 7, i2c_device, all_pin ) ) ) { if ( pin_original == all_pin ) { //first time return gbBAD ; } LEVEL_DEBUG("Cleaning excess allocated i2c structure"); RemovePort(all_pin); //Pascal Baerten :this removes the false DS2482-100 provisioned return gbGOOD ; } start_chip = all_pin->first->master.i2c.i2c_index + 1 ; if ( start_chip > 7 ) { return gbGOOD ; } all_pin = NewPort(all_pin) ; if ( all_pin == NULL ) { return gbBAD ; } } while (1) ; } break ; default: // specific i2c address return DS2482_detect_single( chip_num, chip_num, i2c_device, pin_original ) ; } } /* Try to see if there is a DS2482 device on the specified i2c bus */ static GOOD_OR_BAD DS2482_detect_single(int lowindex, int highindex, char * i2c_device, struct port_in *pin) { int test_address[8] = { 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, }; // the last 4 are -800 only int i2c_index; FILE_DESCRIPTOR_OR_ERROR file_descriptor; struct connection_in * in = pin->first ; /* Sanity check */ if ( lowindex < 0 ) { LEVEL_DEBUG("Bad lower bound"); return gbBAD ; } if ( highindex >= (int) (sizeof(test_address)/sizeof(int)) ) { LEVEL_DEBUG("Bad upper bound"); return gbBAD ; } /* open the i2c port */ file_descriptor = open(i2c_device, O_RDWR); if ( FILE_DESCRIPTOR_NOT_VALID(file_descriptor) ) { ERROR_CONNECT("Could not open i2c device %s", i2c_device); return gbBAD; } /* Set up low-level routines */ DS2482_setroutines(in); for (i2c_index = lowindex; i2c_index <= highindex; ++i2c_index) { int trial_address = test_address[i2c_index] ; /* set the candidate address */ if (ioctl(file_descriptor, I2C_SLAVE, trial_address) < 0) { ERROR_CONNECT("Cound not set trial i2c address to %.2X", trial_address); } else { BYTE c; LEVEL_CONNECT("Found an i2c device at %s address %.2X", i2c_device, trial_address); /* Provisional setup as a DS2482-100 ( 1 channel ) */ in->pown->file_descriptor = file_descriptor; pin->state = cs_deflowered; pin->type = ct_i2c ; in->master.i2c.i2c_address = trial_address; in->master.i2c.i2c_index = i2c_index; in->master.i2c.index = 0; in->master.i2c.channels = 1; in->master.i2c.current = 0; in->master.i2c.head = in; in->adapter_name = "DS2482-100"; in->master.i2c.configreg = 0x00 ; // default configuration setting desired if ( Globals.i2c_APU ) { in->master.i2c.configreg |= DS2482_REG_CFG_APU ; } if ( Globals.i2c_PPM ) { in->master.i2c.configreg |= DS2482_REG_CFG_PPM ; } in->Adapter = adapter_DS2482_100; /* write the RESET code */ if (i2c_smbus_write_byte(file_descriptor, DS2482_CMD_RESET) // reset || BAD(DS2482_readstatus(&c, file_descriptor, DS2482_Chip_reset_usec)) // pause .5 usec then read status || (c != (DS2482_REG_STS_LL | DS2482_REG_STS_RST)) // make sure status is properly set ) { LEVEL_CONNECT("i2c device at %s address %.2X cannot be reset. Not a DS2482.", i2c_device, trial_address); in->pown->file_descriptor = FILE_DESCRIPTOR_BAD ; continue; } LEVEL_CONNECT("i2c device at %s address %.2X appears to be DS2482-x00", i2c_device, trial_address); in->master.i2c.configchip = 0x00; // default configuration register after RESET // Note, only the lower nibble of the device config stored // Create name SAFEFREE( DEVICENAME(in) ) ; DEVICENAME(in) = owmalloc( strlen(i2c_device) + 10 ) ; if ( DEVICENAME(in) ) { UCLIBCLOCK; snprintf(DEVICENAME(in), strlen(i2c_device) + 10, "%s:%.2X", i2c_device, trial_address); UCLIBCUNLOCK; } /* Now see if DS2482-100 or DS2482-800 */ return HeadChannel(in); } } /* fell though, no device found */ COM_close( in ) ; Test_and_Close( & file_descriptor ) ; return gbBAD; } /* Re-open a DS2482 */ static GOOD_OR_BAD DS2482_redetect(const struct parsedname *pn) { struct connection_in *head = pn->selected_connection->master.i2c.head; int address = head->master.i2c.i2c_address; FILE_DESCRIPTOR_OR_ERROR file_descriptor; struct address_pair ap ; // to get device name from device:address /* open the i2c port */ Parse_Address( DEVICENAME(head), &ap ) ; file_descriptor = open(ap.first.alpha, O_RDWR ); Free_Address( &ap ) ; if ( FILE_DESCRIPTOR_NOT_VALID(file_descriptor) ) { ERROR_CONNECT("Could not open i2c device %s", DEVICENAME(head)); return gbBAD; } /* address is known */ if (ioctl(file_descriptor, I2C_SLAVE, address) < 0) { ERROR_CONNECT("Cound not set i2c address to %.2X", address); } else { BYTE c; /* write the RESET code */ if (i2c_smbus_write_byte(file_descriptor, DS2482_CMD_RESET) // reset || BAD(DS2482_readstatus(&c, file_descriptor, DS2482_Chip_reset_usec)) // pause .5 usec then read status || (c != (DS2482_REG_STS_LL | DS2482_REG_STS_RST)) // make sure status is properly set ) { LEVEL_CONNECT("i2c device at %s address %d cannot be reset. Not a DS2482.", DEVICENAME(head), address); } else { struct connection_in * next ; head->master.i2c.current = 0; head->pown->file_descriptor = file_descriptor; head->pown->state = cs_deflowered ; head->pown->type = ct_i2c ; head->master.i2c.configchip = 0x00; // default configuration register after RESET LEVEL_CONNECT("i2c device at %s address %d reset successfully", DEVICENAME(head), address); for ( next = head->pown->first; next; next = next->next ) { /* loop through devices, matching those that have the same "head" */ /* BUSLOCK also locks the sister channels for this */ next->reconnect_state = reconnect_ok; } return gbGOOD; } } /* fellthough, no device found */ close(file_descriptor); return gbBAD; } /* read status register */ /* should already be set to read from there */ /* will read at min time, avg time, max time, and another 50% */ /* returns 0 good, 1 bad */ /* tests to make sure bus not busy */ static GOOD_OR_BAD DS2482_readstatus(BYTE * c, FILE_DESCRIPTOR_OR_ERROR file_descriptor, unsigned long int min_usec, unsigned long int max_usec) { unsigned long int delta_usec = (max_usec - min_usec + 1) / 2; int i = 0; UT_delay_us(min_usec); // at least get minimum out of the way do { int ret = i2c_smbus_read_byte(file_descriptor); if (ret < 0) { LEVEL_DEBUG("problem min=%lu max=%lu i=%d ret=%d", min_usec, max_usec, i, ret); return gbBAD; } if ((ret & DS2482_REG_STS_1WB) == 0x00) { c[0] = (BYTE) ret; LEVEL_DEBUG("ok"); return gbGOOD; } if (i++ == 3) { LEVEL_DEBUG("still busy min=%lu max=%lu i=%d ret=%d", min_usec, max_usec, i, ret); return gbBAD; } UT_delay_us(delta_usec); // increment up to three times } while (1); } /* uses the "Triple" primative for faster search */ static enum search_status DS2482_next_both(struct device_search *ds, const struct parsedname *pn) { int search_direction = 0; /* initialization just to forestall incorrect compiler warning */ int bit_number; int last_zero = -1; FILE_DESCRIPTOR_OR_ERROR file_descriptor = pn->selected_connection->pown->file_descriptor; BYTE bits[3]; // initialize for search // if the last call was not the last one if (ds->LastDevice) { return search_done; } if ( BAD( BUS_select(pn) ) ) { return search_error ; } // need the reset done in BUS-select to set AnyDevices if ( pn->selected_connection->AnyDevices == anydevices_no ) { ds->LastDevice = 1; return search_done; } /* Make sure we're using the correct channel */ /* Appropriate search command */ if ( BAD(BUS_send_data(&(ds->search), 1, pn)) ) { return search_error; } // loop to do the search for (bit_number = 0; bit_number < 64; ++bit_number) { LEVEL_DEBUG("bit number %d", bit_number); /* Set the direction bit */ if (bit_number < ds->LastDiscrepancy) { search_direction = UT_getbit(ds->sn, bit_number); } else { search_direction = (bit_number == ds->LastDiscrepancy) ? 1 : 0; } /* Appropriate search command */ if ( BAD( DS2482_triple(bits, search_direction, file_descriptor) ) ) { return search_error; } if (bits[0] || bits[1] || bits[2]) { if (bits[0] && bits[1]) { /* 1,1 */ /* No devices respond */ ds->LastDevice = 1; return search_done; } } else { /* 0,0,0 */ last_zero = bit_number; } UT_setbit(ds->sn, bit_number, bits[2]); } // loop until through serial number bits if (CRC8(ds->sn, SERIAL_NUMBER_SIZE) || (bit_number < 64) || (ds->sn[0] == 0)) { /* Unsuccessful search or error -- possibly a device suddenly added */ return search_error; } // if the search was successful then ds->LastDiscrepancy = last_zero; ds->LastDevice = (last_zero < 0); LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; } /* DS2482 Reset -- A little different from DS2480B */ // return 1 shorted, 0 ok, <0 error static RESET_TYPE DS2482_reset(const struct parsedname *pn) { BYTE status_byte; struct connection_in * in = pn->selected_connection ; FILE_DESCRIPTOR_OR_ERROR file_descriptor = in->pown->file_descriptor; /* Make sure we're using the correct channel */ if ( BAD(DS2482_channel_select(in)) ) { return BUS_RESET_ERROR; } /* write the RESET code */ if (i2c_smbus_write_byte(file_descriptor, DS2482_CMD_1WIRE_RESET)) { return BUS_RESET_ERROR; } /* wait */ // rstl+rsth+.25 usec /* read status */ if ( BAD( DS2482_readstatus(&status_byte, file_descriptor, DS2482_1wire_reset_usec) ) ) { return BUS_RESET_ERROR; // 8 * Tslot } in->AnyDevices = (status_byte & DS2482_REG_STS_PPD) ? anydevices_yes : anydevices_no ; LEVEL_DEBUG("DS2482 "I2Cformat" Any devices found on reset? %s",I2Cvar(in),in->AnyDevices==anydevices_yes?"Yes":"No"); return (status_byte & DS2482_REG_STS_SD) ? BUS_RESET_SHORT : BUS_RESET_OK; } static GOOD_OR_BAD DS2482_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; FILE_DESCRIPTOR_OR_ERROR file_descriptor = in->pown->file_descriptor; size_t i; /* Make sure we're using the correct channel */ RETURN_BAD_IF_BAD(DS2482_channel_select(in)) ; TrafficOut( "write", data, len, in ) ; for (i = 0; i < len; ++i) { RETURN_BAD_IF_BAD(DS2482_send_and_get(file_descriptor, data[i], &resp[i])) ; } TrafficOut( "response", resp, len, in ) ; return gbGOOD; } /* Single byte -- assumes channel selection already done */ static GOOD_OR_BAD DS2482_send_and_get(FILE_DESCRIPTOR_OR_ERROR file_descriptor, const BYTE wr, BYTE * rd) { int read_back; BYTE c; /* Write data byte */ if (i2c_smbus_write_byte_data(file_descriptor, DS2482_CMD_1WIRE_WRITE_BYTE, wr) < 0) { return gbBAD; } /* read status for done */ RETURN_BAD_IF_BAD( DS2482_readstatus(&c, file_descriptor, DS2482_1wire_write_usec) ) ; /* Select the data register */ if (i2c_smbus_write_byte_data(file_descriptor, DS2482_CMD_SET_READ_PTR, DS2482_READ_DATA_REGISTER) < 0) { return gbBAD; } /* Read the data byte */ read_back = i2c_smbus_read_byte(file_descriptor); if (read_back < 0) { return gbBAD; } rd[0] = (BYTE) read_back; return gbGOOD; } /* Is this a DS2483? Try to set to new register */ static GOOD_OR_BAD DS2483_test(FILE_DESCRIPTOR_OR_ERROR file_descriptor) { /* Select the data register */ if (i2c_smbus_write_byte_data(file_descriptor, DS2482_CMD_SET_READ_PTR, DS2482_PORT_CONFIGURATION_REGISTER) < 0) { LEVEL_DEBUG("Cannot set to port configuration -- not a DS2483"); return gbBAD; } LEVEL_DEBUG("Can set to port configuration! a DS2483!"); return gbGOOD; } /* It's a DS2482 -- whether 1 channel or 8 channel not yet determined */ /* All general stored data will be assigned to this "head" channel */ static GOOD_OR_BAD HeadChannel(struct connection_in *head) { /* Intentionally put the wrong index */ head->master.i2c.index = 1; if ( BAD(DS2482_channel_select(head)) ) { /* Couldn't switch */ head->master.i2c.index = 0; /* restore correct value */ LEVEL_CONNECT("DS2482-100 (Single channel)"); if ( GOOD(DS2483_test(head->pown->file_descriptor)) ) { head->master.i2c.type = ds2483 ; } else { head->master.i2c.type = ds2482_100 ; } return gbGOOD; /* happy as DS2482-100 */ } // It's a DS2482-800 (8 channels) to set up other 7 with this one as "head" LEVEL_CONNECT("DS2482-800 (Eight channels)"); /* Must be a DS2482-800 */ head->master.i2c.channels = 8; head->master.i2c.type = ds2482_800 ; head->Adapter = adapter_DS2482_800; return CreateChannels(head); } /* create more channels, inserts in connection_in chain "in" points to first (head) channel called only for DS12482-800 NOTE: coded assuming num = 1 or 8 only */ static GOOD_OR_BAD CreateChannels(struct connection_in *head) { int i; char *name[] = { "DS2482-800(0)", "DS2482-800(1)", "DS2482-800(2)", "DS2482-800(3)", "DS2482-800(4)", "DS2482-800(5)", "DS2482-800(6)", "DS2482-800(7)", }; head->master.i2c.index = 0; head->adapter_name = name[0]; for (i = 1; i < 8; ++i) { struct connection_in * added = AddtoPort(head->pown); if (added == NO_CONNECTION) { return gbBAD; } added->master.i2c.index = i; added->adapter_name = name[i]; } return gbGOOD; } static GOOD_OR_BAD DS2482_triple(BYTE * bits, int direction, FILE_DESCRIPTOR_OR_ERROR file_descriptor) { /* 3 bits in bits */ BYTE c; LEVEL_DEBUG("-> TRIPLET attempt direction %d", direction); /* Write TRIPLE command */ if (i2c_smbus_write_byte_data(file_descriptor, DS2482_CMD_1WIRE_TRIPLET, direction ? 0xFF : 0) < 0) { return gbBAD; } /* read status */ RETURN_BAD_IF_BAD(DS2482_readstatus(&c, file_descriptor, DS2482_1wire_triplet_usec)) ; bits[0] = (c & DS2482_REG_STS_SBR) != 0; bits[1] = (c & DS2482_REG_STS_TSB) != 0; bits[2] = (c & DS2482_REG_STS_DIR) != 0; LEVEL_DEBUG("<- TRIPLET %d %d %d", bits[0], bits[1], bits[2]); return gbGOOD; } static GOOD_OR_BAD DS2482_channel_select(struct connection_in * in) { struct connection_in *head = in->master.i2c.head; int chan = in->master.i2c.index; FILE_DESCRIPTOR_OR_ERROR file_descriptor = in->pown->file_descriptor; /* Write and verify codes for the CHANNEL_SELECT command (DS2482-800 only). To set the channel, write the value at the index of the channel. Read and compare against the corresponding value to verify the change. */ static const BYTE W_chan[8] = { 0xF0, 0xE1, 0xD2, 0xC3, 0xB4, 0xA5, 0x96, 0x87 }; static const BYTE R_chan[8] = { 0xB8, 0xB1, 0xAA, 0xA3, 0x9C, 0x95, 0x8E, 0x87 }; if ( FILE_DESCRIPTOR_NOT_VALID(file_descriptor) ) { LEVEL_CONNECT("Calling a closed i2c channel (%d) "I2Cformat" ", chan,I2Cvar(in)); return gbBAD; } /* Already properly selected? */ /* All `100 (1 channel) will be caught here */ if (chan != head->master.i2c.current) { int read_back; /* Select command */ if (i2c_smbus_write_byte_data(file_descriptor, DS2482_CMD_CHANNEL_SELECT, W_chan[chan]) < 0) { LEVEL_DEBUG("Channel select set error"); return gbBAD; } /* Read back and confirm */ read_back = i2c_smbus_read_byte(file_descriptor); if (read_back < 0) { LEVEL_DEBUG("Channel select get error"); return gbBAD; // flag for DS2482-100 vs -800 detection } if (((BYTE) read_back) != R_chan[chan]) { LEVEL_DEBUG("Channel selected doesn't match"); return gbBAD; // flag for DS2482-100 vs -800 detection } /* Set the channel in head */ head->master.i2c.current = in->master.i2c.index; } /* Now check the configuration register */ /* This is since configuration is per chip, not just channel */ if (in->master.i2c.configreg != head->master.i2c.configchip) { return SetConfiguration(in->master.i2c.configreg, in); } return gbGOOD; } /* Set the configuration register, both for this channel, and for head global data */ /* Note, config is stored as only the lower nibble */ static GOOD_OR_BAD SetConfiguration(BYTE c, struct connection_in *in) { struct connection_in *head = in->master.i2c.head; FILE_DESCRIPTOR_OR_ERROR file_descriptor = in->pown->file_descriptor; int read_back; /* Write, readback, and compare configuration register */ /* Logic error fix from Uli Raich */ if (i2c_smbus_write_byte_data(file_descriptor, DS2482_CMD_WRITE_CONFIG, c | ((~c) << 4)) || (read_back = i2c_smbus_read_byte(file_descriptor)) < 0 || ((BYTE) read_back != c) ) { head->master.i2c.configchip = 0xFF; // bad value to trigger retry LEVEL_CONNECT("Trouble changing DS2482 configuration register "I2Cformat" ",I2Cvar(in)); return gbBAD; } /* Clear the strong pull-up power bit(register is automatically cleared by reset) */ in->master.i2c.configreg = head->master.i2c.configchip = c & ~DS2482_REG_CFG_SPU; return gbGOOD; } static GOOD_OR_BAD DS2482_PowerByte(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; /* Make sure we're using the correct channel */ RETURN_BAD_IF_BAD(DS2482_channel_select(in)) ; /* Set the power (bit is automatically cleared by reset) */ TrafficOut("power write", &byte, 1, in ) ; RETURN_BAD_IF_BAD(SetConfiguration( in->master.i2c.configreg | DS2482_REG_CFG_SPU, in)) ; /* send and get byte (and trigger strong pull-up */ RETURN_BAD_IF_BAD(DS2482_send_and_get( in->pown->file_descriptor, byte, resp)) ; TrafficOut("power response", resp, 1, in ) ; UT_delay(delay); return gbGOOD; } static void DS2482_close(struct connection_in *in) { if (in == NO_CONNECTION) { return; } } #endif /* OW_I2C */ owfs-3.1p5/module/owlib/src/c/ow_ds9097.c0000644000175000001440000001641512654730021014746 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" /* All the rest of the program sees is the DS9907_detect and the entry in iroutines */ static RESET_TYPE DS9097_reset(const struct parsedname *pn); static RESET_TYPE DS9097_reset_in( struct connection_in * in ); static GOOD_OR_BAD DS9097_pre_reset(struct connection_in *in ) ; static void DS9097_post_reset(struct connection_in *in ) ; static GOOD_OR_BAD DS9097_sendback_bits(const BYTE * outbits, BYTE * inbits, const size_t length, const struct parsedname *pn); static void DS9097_setroutines(struct connection_in *in); static GOOD_OR_BAD DS9097_send_and_get(const BYTE * bussend, BYTE * busget, const size_t length, struct connection_in *in); #define OneBit 0xFF //#define ZeroBit 0xC0 // Should be all zero's when we send 8 bits. digitemp write 0xFF or 0x00 #define ZeroBit 0x00 // at slower speed of course #define RESET_BYTE 0xF0 /* Device-specific functions */ static void DS9097_setroutines(struct connection_in *in) { in->iroutines.detect = DS9097_detect; in->iroutines.reset = DS9097_reset; in->iroutines.next_both = NO_NEXT_BOTH_ROUTINE; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = NO_SENDBACKDATA_ROUTINE; in->iroutines.sendback_bits = DS9097_sendback_bits; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = COM_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_default; in->bundling_length = UART_FIFO_SIZE / 10; } /* _detect is a bit of a misnomer, no detection is actually done */ // no bus locking here (higher up) GOOD_OR_BAD DS9097_detect(struct port_in *pin) { struct connection_in * in = pin->first ; /* Set up low-level routines */ DS9097_setroutines(in); in->Adapter = adapter_DS9097; // in->adapter_name already set, to support HA3 and HA4B pin->busmode = bus_passive; // in case initially tried DS9097U /* open the COM port in 9600 Baud */ COM_set_standard( in ) ; // standard COM port settings pin->vmin = 1; // minimum chars pin->vtime = 0; // decisec wait if (pin->init_data == NULL) { LEVEL_DEFAULT("DS9097 (passive) busmaster requires port name"); return gbBAD; } RETURN_BAD_IF_BAD(COM_open(in)) ; pin->flow = flow_first; // flow control switch( DS9097_reset_in(in) ) { case BUS_RESET_OK: case BUS_RESET_SHORT: return gbGOOD ; default: break ; } if ( GOOD(serial_powercycle(in)) ) { switch( DS9097_reset_in(in) ) { case BUS_RESET_OK: case BUS_RESET_SHORT: return gbGOOD ; default: break ; } } /* open the COM port in 9600 Baud */ /* Second pass */ pin->flow = flow_second ; RETURN_BAD_IF_BAD(COM_change(in)) ; switch( DS9097_reset_in(in) ) { case BUS_RESET_OK: case BUS_RESET_SHORT: return gbGOOD ; default: break ; } /* open the COM port in 9600 Baud */ /* Third pass, hardware flow control */ pin->flow = flow_first ; RETURN_BAD_IF_BAD(COM_change(in)) ; switch( DS9097_reset_in(in) ) { case BUS_RESET_OK: case BUS_RESET_SHORT: return gbGOOD ; default: break ; } return gbBAD ; } /* DS9097 Reset -- A little different from DS2480B */ /* Puts in 9600 baud, sends 11110000 then reads response */ static RESET_TYPE DS9097_reset(const struct parsedname *pn) { return DS9097_reset_in( pn->selected_connection ) ; } /* DS9097 Reset -- A little different from DS2480B */ /* Puts in 9600 baud, sends 11110000 then reads response */ static RESET_TYPE DS9097_reset_in( struct connection_in * in ) { BYTE resetbyte = RESET_BYTE; BYTE responsebyte; if ( BAD( DS9097_pre_reset( in ) ) ) { return BUS_RESET_ERROR ; } if ( BAD( DS9097_send_and_get(&resetbyte, &responsebyte, 1, in )) ) { DS9097_post_reset( in) ; return BUS_RESET_ERROR ; } DS9097_post_reset(in) ; switch (responsebyte) { case 0x00: return BUS_RESET_SHORT; case RESET_BYTE: // no presence in->AnyDevices = anydevices_no ; return BUS_RESET_OK; default: in->AnyDevices = anydevices_yes ; return BUS_RESET_OK; } } /* Puts in 9600 baud */ static GOOD_OR_BAD DS9097_pre_reset(struct connection_in *in ) { struct port_in * pin = in->pown ; RETURN_BAD_IF_BAD( COM_test(in) ) ; /* 8 data bits */ pin->bits = 8 ; pin->baud = B9600 ; if ( BAD( COM_change(in)) ) { ERROR_CONNECT("Cannot set attributes: %s", SAFESTRING(DEVICENAME(in))); DS9097_post_reset( in ) ; return gbBAD; } return gbGOOD; } /* Restore terminal settings (serial port settings) */ static void DS9097_post_reset(struct connection_in *in ) { struct port_in * pin = in->pown ; if (Globals.eightbit_serial) { /* coninue with 8 data bits */ pin->bits = 8; } else { /* 6 data bits, Receiver enabled, Hangup, Dont change "owner" */ pin->bits = 6; } #ifndef B115200 /* MacOSX support max 38400 in termios.h ? */ pin->baud = B38400 ; #else pin->baud = B115200 ; #endif /* Flush the input and output buffers */ COM_flush(in); // Adds no appreciable time COM_change(in) ; } /* Symmetric */ /* send bits -- read bits */ /* Actually uses bit zero of each byte */ /* So each "byte" has already been expanded to 1 bit/byte */ /* Dispatches DS9097_MAX_BITS "bits" at a time */ #define DS9097_MAX_BITS 24 static GOOD_OR_BAD DS9097_sendback_bits(const BYTE * outbits, BYTE * inbits, const size_t length, const struct parsedname *pn) { BYTE local_data[DS9097_MAX_BITS]; size_t global_counter ; size_t local_counter ; size_t offset ; struct connection_in * in = pn->selected_connection ; /* Split into smaller packets? */ for ( local_counter = global_counter = offset = 0 ; offset < length ; ) { // encode this bit local_data[local_counter] = outbits[global_counter] ? OneBit : ZeroBit; // point to next one ++local_counter ; ++global_counter ; // test if enough bits to send to master if (local_counter == DS9097_MAX_BITS || global_counter == length) { /* Communication with DS9097 routine */ /* Up to DS9097_MAX_BITS bits at a time */ if ( BAD( DS9097_send_and_get( local_data, &inbits[offset], local_counter, in )) ) { STAT_ADD1_BUS(e_bus_errors, in); return gbBAD; } offset += local_counter ; local_counter = 0 ; } } /* Decode Bits */ for (global_counter = 0; global_counter < length; ++global_counter) { inbits[global_counter] &= 0x01; // mask out all but lowest bit } return gbGOOD; } /* Routine to send a string of bits and get another string back */ static GOOD_OR_BAD DS9097_send_and_get(const BYTE * bussend, BYTE * busget, const size_t length, struct connection_in * in) { switch( in->pown->type ) { case ct_telnet: RETURN_BAD_IF_BAD( telnet_write_binary( bussend, length, in) ) ; break ; case ct_serial: default: RETURN_BAD_IF_BAD( COM_write( bussend, length, in ) ) ; break ; } /* get back string -- with timeout and partial read loop */ return COM_read( busget, length, in ) ; } owfs-3.1p5/module/owlib/src/c/ow_ds1410.c0000644000175000001440000000101412654730021014710 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" /* The parallel adapter has never worked for us, let's not pretend */ #if OW_PARPORT GOOD_OR_BAD DS1410_detect(struct port_in *pin) { (void) pin; return gbBAD; } #endif /* OW_PARPORT */ owfs-3.1p5/module/owlib/src/c/ow_ds1wm.c0000644000175000001440000004327012654730021015041 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* This is the busmaster code for the DS1WM * The "Synthesizable 1-wire Bus MAster" adapter from Dallas Maxim * * Out technique is a little dangerous -- direct memory access to the registers * We use /dev/mem although writing a UIO kernel module is also a possibility * Obviously we'll nee root access * */ /* Based on a device used by Kistler Corporation * and tested in-house by Martin Rapavy * * That testing also covers this, the DS1WM * */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include // DS1WM Registers #define DS1WM_COMMAND_REGISTER 0 #define DS1WM_TXRX_BUFFER 1 #define DS1WM_INTERRUPT_REGISTER 2 #define DS1WM_INTERRUPT_ENABLE_REGISTER 3 #define DS1WM_CLOCK_DEVISOR_REGISTER 4 #define DS1WM_CONTROL_REGISTER 5 // Access register via mmap-ed memory #define DS1WM_register(in, off) (((uint8_t *) (in->master.ds1wm.page_start))[(in->master.ds1wm.page_offset)+off]) // Register access macros #define DS1WM_command(in) DS1WM_register(in,DS1WM_COMMAND_REGISTER) #define DS1WM_txrx(in) DS1WM_register(in,DS1WM_TXRX_BUFFER) #define DS1WM_interrupt(in) DS1WM_register(in,DS1WM_INTERRUPT_REGISTER) #define DS1WM_enable(in) DS1WM_register(in,DS1WM_INTERRUPT_ENABLE_REGISTER) #define DS1WM_clock(in) DS1WM_register(in,DS1WM_CLOCK_DEVISOR_REGISTER) #define DS1WM_control(in) DS1WM_register(in,DS1WM_CONTROL_REGISTER) enum e_DS1WM_command { e_ds1wm_1wr=0, e_ds1wm_sra, e_ds1wm_fow, e_ds1wm_ow_in, } ; enum e_DS1WM_int { e_ds1wm_pd=0, e_ds1wm_pdr, e_ds1wm_tbe, e_ds1wm_temt, e_ds1wm_rbf, e_ds1wm_rsrf, e_ds1wm_ow_short, e_ds1wm_ow_low, } ; enum e_DS1WM_enable { e_ds1wm_epd=0, e_ds1wm_ias, e_ds1wm_etbe, e_ds1wm_etmt, e_ds1wm_erbf, e_ds1wm_ersf, e_ds1wm_eowsh, e_ds1wm_eowl } ; enum e_DS1WM_control { e_ds1wm_llm=0, e_ds1wm_ppm, e_ds1wm_en_fow, e_ds1wm_stpen, e_ds1wm_stp_sply, e_ds1wm_bit_ctl, e_ds1wm_od } ; static RESET_TYPE DS1WM_reset(const struct parsedname *pn); static enum search_status DS1WM_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD DS1WM_PowerByte(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn); static GOOD_OR_BAD DS1WM_PowerBit(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn); static GOOD_OR_BAD DS1WM_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD DS1WM_sendback_bits(const BYTE * databits, BYTE * respbits, const size_t len, const struct parsedname * pn); static GOOD_OR_BAD DS1WM_reconnect(const struct parsedname * pn); static void DS1WM_close(struct connection_in *in) ; static void DS1WM_setroutines(struct connection_in *in); static unsigned char DS1WM_freq( unsigned long f ); static GOOD_OR_BAD DS1WM_setup( struct connection_in * in ); static RESET_TYPE DS1WM_wait_for_reset( struct connection_in * in ); static GOOD_OR_BAD DS1WM_wait_for_read( const struct connection_in * in ); static GOOD_OR_BAD DS1WM_wait_for_write( const struct connection_in * in ); static GOOD_OR_BAD DS1WM_wait_for_byte( const struct connection_in * in ); static GOOD_OR_BAD DS1WM_sendback_byte(const BYTE * data, BYTE * resp, const struct connection_in * in ) ; static void DS1WM_setroutines(struct connection_in *in) { in->iroutines.detect = DS1WM_detect; in->iroutines.reset = DS1WM_reset; in->iroutines.next_both = DS1WM_next_both; in->iroutines.PowerByte = DS1WM_PowerByte; in->iroutines.PowerBit = DS1WM_PowerBit; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = DS1WM_sendback_data; in->iroutines.sendback_bits = DS1WM_sendback_bits; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = DS1WM_reconnect ; in->iroutines.close = DS1WM_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_default; in->bundling_length = UART_FIFO_SIZE; } // Search defines #define SEARCH_BIT_ON 0x01 /* Setup DS1WM bus master structure */ // bus locking at a higher level GOOD_OR_BAD DS1WM_detect(struct port_in *pin) { struct connection_in * in = pin->first ; long long int prebase ; off_t base ; void * mm ; FILE_DESCRIPTOR_OR_ERROR mem_fd ; const char * mem_device = "/dev/mem"; in->Adapter = adapter_ds1wm ; in->master.ds1wm.longline = 0 ; // longline timing in->master.ds1wm.frequency = 10000000 ; // 10MHz in->master.ds1wm.presence_mask = 1 ; // pulse presence mask in->master.ds1wm.active_channel = 0; // always for ds1wm in->master.ds1wm.channels_count = 1; // always for ds1wm if (pin->init_data == NULL) { LEVEL_DEFAULT("DS1WM needs a memory location"); return gbBAD; } if ( sscanf( pin->init_data, "%lli", &prebase ) != 1 ) { LEVEL_DEFAULT("DS1WM: Could not interpret <%s> as a memory address", pin->init_data ) ; return gbBAD ; } base = prebase ; // convert types long long int -> off_t if ( base == 0 ) { LEVEL_DEFAULT("DS1WM: Illegal address 0x0000 from <%s>", pin->init_data ) ; return gbBAD ; } LEVEL_DEBUG("DS1WM at address %p",(void *)base); in->master.ds1wm.mm_size = (size_t) getpagesize() ; in->master.ds1wm.base = base ; in->master.ds1wm.page_offset = base % in->master.ds1wm.mm_size ; in->master.ds1wm.page_start = base - in->master.ds1wm.page_offset ; // open /dev/mem mem_fd = open( mem_device, O_RDWR | O_SYNC ) ; if ( FILE_DESCRIPTOR_NOT_VALID(mem_fd) ) { LEVEL_DEFAULT("DS1WM: Cannot open memory directly -- permissions problem?"); return gbBAD ; } mm = mmap( NULL, in->master.ds1wm.mm_size, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, in->master.ds1wm.page_start ); close(mem_fd) ; // no longer needed if ( mm == MAP_FAILED ) { LEVEL_DEFAULT("DS1WM: Cannot map memory") ; return gbBAD ; } in->master.ds1wm.mm = mm ; /* Set up low-level routines */ DS1WM_setroutines(in); in->adapter_name = "DS1WM"; return DS1WM_setup(in) ; } static unsigned char DS1WM_freq( unsigned long f ) { static struct { unsigned long freq; unsigned char divisor; } freq[] = { { 1000000, 0x80 }, { 2000000, 0x84 }, { 3000000, 0x81 }, { 4000000, 0x88 }, { 5000000, 0x82 }, { 6000000, 0x85 }, { 7000000, 0x83 }, { 8000000, 0x8c }, { 10000000, 0x86 }, { 12000000, 0x89 }, { 14000000, 0x87 }, { 16000000, 0x90 }, { 20000000, 0x8a }, { 24000000, 0x8d }, { 28000000, 0x8b }, { 32000000, 0x94 }, { 40000000, 0x8e }, { 48000000, 0x91 }, { 56000000, 0x8f }, { 64000000, 0x98 }, { 80000000, 0x92 }, { 96000000, 0x95 }, { 112000000, 0x93 }, { 128000000, 0x9c }, /* you can continue this table, consult the OPERATION - CLOCK DIVISOR section of the ds1wm spec sheet. */ }; int n = sizeof(freq) / sizeof(freq[0]) ; int i ; int last = 0 ; for ( i=1 ; i f ) { break ; } last = i ; } LEVEL_DEBUG( "Frequency %ld matches %ld",f,freq[last],freq ) ; return freq[last].divisor ; } // set control pins and frequency for defauts and global settings static GOOD_OR_BAD DS1WM_setup( struct connection_in * in ) { uint8_t control_register = DS1WM_control(in) ; DS1WM_clock(in) = 0x00 ; // off (causes reset?) // set some defaults: UT_setbit( &control_register, e_ds1wm_ppm, in->master.ds1wm.presence_mask ) ; // pulse presence masked UT_setbit( &control_register, e_ds1wm_en_fow, 0 ) ; // no bit banging UT_setbit( &control_register, e_ds1wm_stpen, 1 ) ; // allow strong pullup UT_setbit( &control_register, e_ds1wm_stp_sply, 0 ) ; // not in strong pullup state, however in->master.ds1wm.byte_mode = 1 ; // default UT_setbit( &control_register, e_ds1wm_bit_ctl, 0 ) ; // byte mode UT_setbit( &control_register, e_ds1wm_od, in->overdrive ) ; // not overdrive UT_setbit( &control_register, e_ds1wm_llm, in->master.ds1wm.longline ) ; // set long line flag DS1WM_control(in) = control_register ; if ( DS1WM_control(in) != control_register ) { return gbBAD ; } DS1WM_clock(in) = DS1WM_freq( in->master.ds1wm.frequency ) ; return gbGOOD ; } static GOOD_OR_BAD DS1WM_reconnect(const struct parsedname * pn) { LEVEL_DEBUG("Attempting reconnect on %s",SAFESTRING(DEVICENAME(pn->selected_connection))); return DS1WM_setup(pn->selected_connection) ; } //-------------------------------------------------------------------------- // Reset all of the devices on the 1-Wire Net and return the result. // // This routine will not function correctly on some // Alarm reset types of the DS1994/DS1427/DS2404 with // Rev 1,2, and 3 of the DS2480/DS2480B. static RESET_TYPE DS1WM_reset(const struct parsedname * pn) { struct connection_in * in = pn->selected_connection ; if ( in->changed_bus_settings != 0) { in->changed_bus_settings = 0 ; DS1WM_setup(in); // reset paramters } UT_setbit( &DS1WM_command(in), e_ds1wm_1wr, 1 ) ; switch( DS1WM_wait_for_reset(in) ) { case BUS_RESET_SHORT: return BUS_RESET_SHORT ; case BUS_RESET_OK: return BUS_RESET_OK ; default: return DS1WM_wait_for_reset(in) ; } } #define SERIAL_NUMBER_BITS (8*SERIAL_NUMBER_SIZE) /* search = normal and alarm */ static enum search_status DS1WM_next_both(struct device_search *ds, const struct parsedname *pn) { int mismatched; BYTE sn[SERIAL_NUMBER_SIZE]; BYTE bitpairs[SERIAL_NUMBER_SIZE*2]; BYTE dummy ; struct connection_in * in = pn->selected_connection ; int i; if (ds->LastDevice) { LEVEL_DEBUG("[%s] ds->LastDevice == true -> search_done", __FUNCTION__); return search_done; } if ( BAD( BUS_select(pn) ) ) { return search_error; } // need the reset done in BUS-select to set AnyDevices if ( in->AnyDevices == anydevices_no ) { ds->LastDevice = 1; LEVEL_DEBUG("[%s] in->AnyDevices == anydevices_no -> search_done", __FUNCTION__); return search_done; } // clear sn to satisfy static error checking (Coverity) memset( sn, 0, SERIAL_NUMBER_SIZE ) ; // build the command stream // call a function that may add the change mode command to the buff // check if correct mode // issue the search command // change back to command mode // search mode on // change back to data mode // set the temp Last Descrep to none mismatched = -1; // add the 16 bytes of the search memset(bitpairs, 0, SERIAL_NUMBER_SIZE*2); // set the bits in the added buffer for (i = 0; i < ds->LastDiscrepancy; i++) { // before last discrepancy UT_set2bit(bitpairs, i, UT_getbit(ds->sn, i) << 1); } // at last discrepancy if (ds->LastDiscrepancy > -1) { UT_set2bit(bitpairs, ds->LastDiscrepancy, 1 << 1); } // after last discrepancy so leave zeros // search ON // Send search rom or conditional search byte if ( BAD( DS1WM_sendback_byte(&(ds->search), &dummy, in) ) ) { return search_error; } // Set search accelerator UT_setbit( &DS1WM_command(in), e_ds1wm_sra, 1 ) ; // send the packet // cannot use single-bit mode with search accerator // search OFF if ( BAD( DS1WM_sendback_data(bitpairs, bitpairs, SERIAL_NUMBER_SIZE*2, pn) ) ) { // Clear search accelerator UT_setbit( &DS1WM_command(in), e_ds1wm_sra, 0 ) ; return search_error; } // Clear search accelerator UT_setbit( &DS1WM_command(in), e_ds1wm_sra, 0 ) ; // interpret the bit stream for (i = 0; i < SERIAL_NUMBER_BITS; i++) { // get the SerialNum bit UT_setbit(sn, i, UT_get2bit(bitpairs, i) >> 1); // check LastDiscrepancy if (UT_get2bit(bitpairs, i) == SEARCH_BIT_ON ) { mismatched = i; } } if ( sn[0]==0xFF && sn[1]==0xFF && sn[2]==0xFF && sn[3]==0xFF && sn[4]==0xFF && sn[5]==0xFF && sn[6]==0xFF && sn[7]==0xFF ) { // special case for no alarm present return search_done ; } // CRC check if (CRC8(sn, SERIAL_NUMBER_SIZE) || (ds->LastDiscrepancy == SERIAL_NUMBER_BITS-1) || (sn[0] == 0)) { return search_error; } // successful search // check for last one if ((mismatched == ds->LastDiscrepancy) || (mismatched == -1)) { ds->LastDevice = 1; } // copy the SerialNum to the buffer memcpy(ds->sn, sn, 8); // set the count ds->LastDiscrepancy = mismatched; LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; } //-------------------------------------------------------------------------- // Send 8 bits of communication to the 1-Wire Net and verify that the // 8 bits read from the 1-Wire Net is the same (write operation). // The parameter 'byte' least significant 8 bits are used. After the // 8 bits are sent change the level of the 1-Wire net. // Delay delay msec and return to normal // static GOOD_OR_BAD DS1WM_PowerByte(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn) { GOOD_OR_BAD ret = gbBAD ; // default struct connection_in * in = pn->selected_connection ; uint8_t control_register ; // Set power on control_register = DS1WM_control(in) ; UT_setbit( &control_register,e_ds1wm_stp_sply, 1 ) ; DS1WM_control(in) = control_register ; if ( GOOD( DS1WM_sendback_byte( &byte, resp, in ) ) && GOOD( DS1WM_wait_for_write(in) ) ) { UT_delay(delay); ret = gbGOOD ; } // Set power off control_register = DS1WM_control(in) ; UT_setbit( &control_register,e_ds1wm_stp_sply, 0 ) ; DS1WM_control(in) = control_register ; return ret ; } //-------------------------------------------------------------------------- // Send 1 bit of communication to the 1-Wire Net and verify that the // bit read from the 1-Wire Net is the same (write operation). // Delay delay msec and return to normal // static GOOD_OR_BAD DS1WM_PowerBit(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn) { GOOD_OR_BAD ret = gbBAD ; // default struct connection_in * in = pn->selected_connection ; uint8_t control_register ; // Set power, bitmode on control_register = DS1WM_control(in) ; UT_setbit( &control_register,e_ds1wm_stp_sply, 1 ) ; UT_setbit( &control_register,e_ds1wm_bit_ctl, 1 ) ; in->master.ds1wm.byte_mode = 0 ; DS1WM_control(in) = control_register ; if ( GOOD( DS1WM_sendback_byte( &byte, resp, in ) ) && GOOD( DS1WM_wait_for_write(in) ) ) { UT_delay(delay); ret = gbGOOD ; } // Set power, bitmode off control_register = DS1WM_control(in) ; UT_setbit( &control_register,e_ds1wm_stp_sply, 0 ) ; UT_setbit( &control_register,e_ds1wm_bit_ctl, 0 ) ; in->master.ds1wm.byte_mode = 1 ; DS1WM_control(in) = control_register ; return ret ; } //-------------------------------------------------------------------------- // Send and receive 1 bit of communication to the 1-Wire // static GOOD_OR_BAD DS1WM_sendback_bits(const BYTE * databits, BYTE * respbits, const size_t len, const struct parsedname * pn) { struct connection_in * in = pn->selected_connection ; uint8_t control_register ; GOOD_OR_BAD ret ; // Set bitmode on control_register = DS1WM_control(in) ; UT_setbit( &control_register,e_ds1wm_bit_ctl, 1 ) ; in->master.ds1wm.byte_mode = 0 ; DS1WM_control(in) = control_register ; ret = DS1WM_sendback_data( databits, respbits, len, pn ) ; // Set bitmode off control_register = DS1WM_control(in) ; in->master.ds1wm.byte_mode = 1 ; UT_setbit( &control_register,e_ds1wm_bit_ctl, 0 ) ; DS1WM_control(in) = control_register ; return ret ; } static GOOD_OR_BAD DS1WM_sendback_byte(const BYTE * data, BYTE * resp, const struct connection_in * in ) { RETURN_BAD_IF_BAD( DS1WM_wait_for_write(in) ) ; DS1WM_txrx(in) = data[0] ; RETURN_BAD_IF_BAD( DS1WM_wait_for_read(in) ) ; resp[0] = DS1WM_txrx(in) ; return gbGOOD ; } // // sendback_data // Send data and return response block static GOOD_OR_BAD DS1WM_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; size_t i ; for (i=0 ; imaster.ds1wm.mm, in->master.ds1wm.mm_size ); } // wait for reset static GOOD_OR_BAD DS1WM_wait_for_byte( const struct connection_in * in ) { int bits = in->master.ds1wm.byte_mode ? 8 : 1 ; long int t_slot = in->overdrive ? 15000 : 86000 ; // nsec struct timespec t = { 0, t_slot*bits, }; if ( nanosleep( & t, NULL ) != 0 ) { return gbBAD ; } return gbGOOD ; } // Wait max time needed for reset static RESET_TYPE DS1WM_wait_for_reset( struct connection_in * in ) { long int t_reset = in->overdrive ? (74000+63000) : (636000+626000) ; // nsec uint8_t interrupt ; struct timespec t = { 0, t_reset, } ; if ( nanosleep( & t, NULL ) != 0 ) { return gbBAD ; } interrupt = DS1WM_interrupt(in) ; if ( UT_getbit( &interrupt, e_ds1wm_pd ) == 0 ) { return BUS_RESET_ERROR ; } if ( UT_getbit( &interrupt, e_ds1wm_ow_short ) == 1 ) { return BUS_RESET_SHORT ; } in->AnyDevices = ( UT_getbit( &interrupt, e_ds1wm_pdr ) == 0 ) ? anydevices_yes : anydevices_no ; return BUS_RESET_OK ; } static GOOD_OR_BAD DS1WM_wait_for_read( const struct connection_in * in ) { int i ; if ( UT_getbit( &DS1WM_interrupt(in), e_ds1wm_rbf ) == 1 ) { return gbGOOD ; } for ( i=0 ; i < 5 ; ++i ) { RETURN_BAD_IF_BAD( DS1WM_wait_for_byte(in) ) ; if ( UT_getbit( &DS1WM_interrupt(in), e_ds1wm_rbf ) == 1 ) { return gbGOOD ; } } return gbBAD ; } static GOOD_OR_BAD DS1WM_wait_for_write( const struct connection_in * in ) { int i ; if ( UT_getbit( &DS1WM_interrupt(in), e_ds1wm_tbe ) == 1 ) { return gbGOOD ; } for ( i=0 ; i < 5 ; ++i ) { RETURN_BAD_IF_BAD( DS1WM_wait_for_byte(in) ) ; if ( UT_getbit( &DS1WM_interrupt(in), e_ds1wm_tbe ) == 1 ) { return gbGOOD ; } } return gbBAD ; } owfs-3.1p5/module/owlib/src/c/ow_ds9097U.c0000644000175000001440000011475712654730021015103 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* This is the busmaster code for the DS2480B-based DS9097U * The serial adapter from Dallas Maxim */ /* Multimaster: * In general the link is DS9097U a multimaster design (only one bus master per serial or telnet port) * None the less, all settings are assigned to the head line */ /* lsusb for the TAI603B Bus 001 Device 025: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x10c4 Cygnal Integrated Products, Inc. idProduct 0xea60 CP210x UART Bridge / myAVR mySmartUSB light bcdDevice 1.00 iManufacturer 1 Silicon Labs iProduct 2 CP2102 USB to UART Bridge Controller iSerial 3 0001 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 2 CP2102 USB to UART Bridge Controller Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 */ /* lsusb for the USB9097 (PCsensor) Bus 001 Device 037: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 255 Vendor Specific Class bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x1a86 QinHeng Electronics idProduct 0x7523 HL-340 USB-Serial adapter bcdDevice 2.54 iManufacturer 0 iProduct 2 USB2.0-Serial iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 39 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 96mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 1 bInterfaceProtocol 2 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0020 1x 32 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0020 1x 32 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 1 */ /* lsusb for the ECLO adapter Bus 001 Device 035: ID 0403:ea90 Future Technology Devices International, Ltd Eclo 1-Wire Adapter Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0403 Future Technology Devices International, Ltd idProduct 0xea90 Eclo 1-Wire Adapter bcdDevice 4.00 iManufacturer 1 Eclo iProduct 2 Eclo COM to 1-Wire USB adapter iSerial 3 04000220 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 2 Eclo COM to 1-Wire USB adapter Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" static RESET_TYPE DS2480_reset(const struct parsedname *pn); static enum search_status DS2480_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD DS2480_PowerByte(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn); static GOOD_OR_BAD DS2480_PowerBit(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn); static GOOD_OR_BAD DS2480_ProgramPulse(const struct parsedname *pn); static GOOD_OR_BAD DS2480_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD DS2480_sendback_bits(const BYTE * databits, BYTE * respbits, const size_t len, const struct parsedname * pn); static GOOD_OR_BAD DS2480_reconnect(const struct parsedname * pn); static void DS2480_close(struct connection_in *in) ; static void DS2480_setroutines(struct connection_in *in); static GOOD_OR_BAD DS2480_detect_serial(struct connection_in *in) ; static RESET_TYPE DS2480_reset_in(struct connection_in * in); static GOOD_OR_BAD DS2480_initialize_repeatedly(struct connection_in * in); static GOOD_OR_BAD DS2480_big_reset(struct connection_in * in) ; static GOOD_OR_BAD DS2480_big_reset_serial(struct connection_in * in) ; static void DS2480_adapter(struct connection_in *in) ; static GOOD_OR_BAD DS2480_big_configuration(struct connection_in * in) ; static GOOD_OR_BAD DS2480_read(BYTE * buf, const size_t size, struct connection_in * in); static GOOD_OR_BAD DS2480_write(const BYTE * buf, const size_t size, struct connection_in * in); static GOOD_OR_BAD DS2480_sendout_cmd(const BYTE * cmd, const size_t len, struct connection_in * in); static GOOD_OR_BAD DS2480_sendback_cmd(const BYTE * cmd, BYTE * resp, const size_t len, struct connection_in * in); static GOOD_OR_BAD DS2480_configuration_write(BYTE parameter_code, BYTE value_code, struct connection_in * in); static GOOD_OR_BAD DS2480_configuration_read(BYTE parameter_code, BYTE value_code, struct connection_in * in); static GOOD_OR_BAD DS2480_stop_pulse(BYTE * response, struct connection_in * in); static RESET_TYPE DS2480_reset_once(struct connection_in * in) ; static GOOD_OR_BAD DS2480_set_baud(struct connection_in * in) ; static void DS2480_set_baud_control(struct connection_in * in) ; static BYTE DS2480b_speed_byte( struct connection_in * in ) ; static void DS2480_flush( const struct connection_in * in ) ; static void DS2480_slurp( struct connection_in * in ) ; static void DS2480_setroutines(struct connection_in *in) { in->iroutines.detect = DS2480_detect; in->iroutines.reset = DS2480_reset; in->iroutines.next_both = DS2480_next_both; in->iroutines.PowerByte = DS2480_PowerByte; in->iroutines.PowerBit = DS2480_PowerBit; in->iroutines.ProgramPulse = DS2480_ProgramPulse; // in->iroutines.sendback_data = NO_SENDBACKDATA_ROUTINE; in->iroutines.sendback_data = DS2480_sendback_data; in->iroutines.sendback_bits = DS2480_sendback_bits; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = DS2480_reconnect ; in->iroutines.close = DS2480_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_default; in->bundling_length = UART_FIFO_SIZE; } // Number of times to try init (from digitemp code)) #define DS9097U_INIT_CYCLES 3 /* --------------------------- */ /* DS2480 defines from PDkit */ /* --------------------------- */ // Mode Commands #define MODE_DATA 0xE1 #define MODE_COMMAND 0xE3 #define MODE_STOP_PULSE 0xF1 // Return byte value #define RB_CHIPID_MASK 0x1C #define RB_RESET_MASK 0x03 #define RB_1WIRESHORT 0x00 #define RB_PRESENCE 0x01 #define RB_ALARMPRESENCE 0x02 #define RB_NOPRESENCE 0x03 #define RB_BIT_MASK 0x03 #define RB_BIT_ONE 0x03 #define RB_BIT_ZERO 0x00 // Masks for all bit ranges #define CMD_MASK 0x80 #define FUNCTSEL_MASK 0x60 #define BITPOL_MASK 0x10 #define SPEEDSEL_MASK 0x0C #define MODSEL_MASK 0x02 #define PARMSEL_MASK 0x70 #define PARMSET_MASK 0x0E // Command or config bit #define CMD_COMM 0x81 #define CMD_COMM_RESPONSE 0x80 #define CMD_CONFIG 0x01 #define CMD_CONFIG_RESPONSE 0x00 // Function select bits #define FUNCTSEL_BIT 0x00 #define FUNCTSEL_SEARCHON 0x30 #define FUNCTSEL_SEARCHOFF 0x20 #define FUNCTSEL_RESET 0x40 #define FUNCTSEL_CHMOD 0x60 // Bit polarity/Pulse voltage bits #define BITPOL_ONE 0x10 #define BITPOL_ZERO 0x00 #define BITPOL_5V 0x00 #define BITPOL_12V 0x10 // One Wire speed bits #define SPEEDSEL_STD 0x00 #define SPEEDSEL_FLEX 0x04 #define SPEEDSEL_OD 0x08 #define SPEEDSEL_PULSE 0x0C // Data/Command mode select bits #define MODSEL_DATA 0x00 #define MODSEL_COMMAND 0x02 // 5V Follow Pulse select bits (If 5V pulse // will be following the next byte or bit.) #define PRIME5V_TRUE 0x02 #define PRIME5V_FALSE 0x00 // Parameter select bits #define PARMSEL_PARMREAD 0x00 #define PARMSEL_SLEW 0x10 #define PARMSEL_12VPULSE 0x20 #define PARMSEL_5VPULSE 0x30 #define PARMSEL_WRITE1LOW 0x40 #define PARMSEL_SAMPLEOFFSET 0x50 #define PARMSEL_ACTIVEPULLUPTIME 0x60 #define PARMSEL_BAUDRATE 0x70 // Pull down slew rate. #define PARMSET_Slew15Vus 0x00 #define PARMSET_Slew2p2Vus 0x02 #define PARMSET_Slew1p65Vus 0x04 #define PARMSET_Slew1p37Vus 0x06 #define PARMSET_Slew1p1Vus 0x08 #define PARMSET_Slew0p83Vus 0x0A #define PARMSET_Slew0p7Vus 0x0C #define PARMSET_Slew0p55Vus 0x0E // 12V programming pulse time table #define PARMSET_32us 0x00 #define PARMSET_64us 0x02 #define PARMSET_128us 0x04 #define PARMSET_256us 0x06 #define PARMSET_512us 0x08 #define PARMSET_1024us 0x0A #define PARMSET_2048us 0x0C #define PARMSET_infinite 0x0E // 5V strong pull up pulse time table #define PARMSET_16p4ms 0x00 #define PARMSET_65p5ms 0x02 #define PARMSET_131ms 0x04 #define PARMSET_262ms 0x06 #define PARMSET_524ms 0x08 #define PARMSET_1p05s 0x0A #define PARMSET_2p10s 0x0C #define PARMSET_infinite 0x0E // Write 1 low time #define PARMSET_Write8us 0x00 #define PARMSET_Write9us 0x02 #define PARMSET_Write10us 0x04 #define PARMSET_Write11us 0x06 #define PARMSET_Write12us 0x08 #define PARMSET_Write13us 0x0A #define PARMSET_Write14us 0x0C #define PARMSET_Write15us 0x0E // Data sample offset and Write 0 recovery time #define PARMSET_SampOff3us 0x00 #define PARMSET_SampOff4us 0x02 #define PARMSET_SampOff5us 0x04 #define PARMSET_SampOff6us 0x06 #define PARMSET_SampOff7us 0x08 #define PARMSET_SampOff8us 0x0A #define PARMSET_SampOff9us 0x0C #define PARMSET_SampOff10us 0x0E // Active pull up on time #define PARMSET_PullUp0p0us 0x00 #define PARMSET_PullUp0p5us 0x02 #define PARMSET_PullUp1p0us 0x04 #define PARMSET_PullUp1p5us 0x06 #define PARMSET_PullUp2p0us 0x08 #define PARMSET_PullUp2p5us 0x0A #define PARMSET_PullUp3p0us 0x0C #define PARMSET_PullUp3p5us 0x0E // Baud rate bits #define PARMSET_9600 0x00 #define PARMSET_19200 0x02 #define PARMSET_57600 0x04 #define PARMSET_115200 0x06 #define PARMSET_REVERSE_POLARITY 0x08 // Search defines #define SEARCH_BIT_ON 0x01 #define DS2404_family 0x04 // Could probably be UART_FIFO_SIZE (160) but that will take some testing #define MAX_SEND_SIZE 64 /* Reset and detect a DS2480B */ /* returns 0=good */ // bus locking at a higher level GOOD_OR_BAD DS2480_detect(struct port_in *pin) { struct connection_in * in = pin->first ; if (pin->init_data == NULL) { LEVEL_DEFAULT("DS2480B-based bus master needs a port name"); return gbBAD; } /* Set up low-level routines */ DS2480_setroutines(in); in->overdrive = 0 ; in->flex = Globals.serial_flextime ; pin->busmode = bus_serial; // Now set desired baud and polarity // BUS_reset will do the actual changes in->master.serial.reverse_polarity = Globals.serial_reverse ; COM_set_standard( in ) ; // standard COM port settings // first pass with hardware flow control RETURN_GOOD_IF_GOOD( DS2480_detect_serial(in) ) ; pin->flow = flow_second; // flow control RETURN_BAD_IF_BAD(COM_change(in)) ; return DS2480_detect_serial(in) ; } // setting for serial port already made static GOOD_OR_BAD DS2480_detect_serial(struct connection_in *in) { in->pown->state = cs_virgin ; if ( BAD(DS2480_initialize_repeatedly(in)) ) { LEVEL_DEBUG("Could not initilize the DS9097U even after several tries") ; COM_close(in) ; return gbBAD ; } DS2480_adapter(in) ; return gbGOOD ; } // Make several attempts to initialize -- based on Digitemp example static GOOD_OR_BAD DS2480_initialize_repeatedly(struct connection_in * in) { int init_cycles ; for ( init_cycles = 0 ; init_cycles < DS9097U_INIT_CYCLES ; ++init_cycles ) { LEVEL_DEBUG("Attempt %d of %d to initialize the DS9097U",init_cycles,DS9097U_INIT_CYCLES) ; RETURN_GOOD_IF_GOOD( DS2480_big_reset(in) ) ; } return gbBAD ; } static void DS2480_adapter(struct connection_in *in) { // in->Adapter is set in DS2480_reset from some status bits switch (in->Adapter) { case adapter_DS9097U2: case adapter_DS9097U: in->adapter_name = "DS9097U"; break; case adapter_LINK: case adapter_LINK_10: case adapter_LINK_11: case adapter_LINK_12: case adapter_LINK_13: case adapter_LINK_14: case adapter_LINK_other: in->adapter_name = "LINK(emulate mode)"; break; default: in->adapter_name = "DS2480B based"; break; } } static GOOD_OR_BAD DS2480_reconnect(const struct parsedname * pn) { LEVEL_DEBUG("Attempting reconnect on %s",SAFESTRING(DEVICENAME(pn->selected_connection))); return DS2480_big_reset(pn->selected_connection) ; } // do the com port and configuration stuff static GOOD_OR_BAD DS2480_big_reset(struct connection_in * in) { struct port_in * pin = in->pown ; switch (pin->type) { case ct_telnet: pin->timeout.tv_sec = Globals.timeout_network ; pin->timeout.tv_usec = 0 ; return DS2480_big_reset_serial(in) ; case ct_serial: default: pin->timeout.tv_sec = Globals.timeout_serial ; pin->timeout.tv_usec = 0 ; pin->flow = flow_none ; RETURN_GOOD_IF_GOOD( DS2480_big_reset_serial(in)) ; serial_powercycle(in) ; RETURN_GOOD_IF_GOOD( DS2480_big_reset_serial(in)) ; pin->flow = flow_none ; RETURN_GOOD_IF_GOOD( DS2480_big_reset_serial(in)) ; pin->flow = flow_hard ; RETURN_GOOD_IF_GOOD( DS2480_big_reset_serial(in)) ; return gbBAD ; } } // do the com port and configuration stuff static GOOD_OR_BAD DS2480_big_reset_serial(struct connection_in * in) { BYTE reset_byte = (BYTE) ( CMD_COMM | FUNCTSEL_RESET | SPEEDSEL_STD ); // Open the com port in 9600 Baud. RETURN_BAD_IF_BAD(COM_open(in)) ; // send a break to reset the DS2480 COM_break(in); // It's in command mode now in->master.serial.mode = ds2480b_command_mode ; // send the timing byte (A reset command at 9600 baud) DS2480_write( &reset_byte, 1, in ) ; // delay to let line settle UT_delay(4); // flush the buffers DS2480_flush(in); // ignore response DS2480_slurp( in ) ; // Now set desired baud and polarity // BUS_reset will do the actual changes in->changed_bus_settings = 1 ; // Force a mode change // Send a reset again LEVEL_DEBUG("Send the initial reset to the bus master."); DS2480_reset_in(in) ; // delay to let line settle UT_delay(400); // flush the buffers DS2480_flush(in); // ignore response DS2480_slurp( in ) ; // Now set desired baud and polarity return DS2480_big_configuration(in) ; } // do the configuration stuff static GOOD_OR_BAD DS2480_big_configuration(struct connection_in * in) { BYTE single_bit = CMD_COMM | BITPOL_ONE | DS2480b_speed_byte(in) ; BYTE single_bit_response ; // Now set desired baud and polarity // BUS_reset will do the actual changes in->changed_bus_settings = 1 ; // Force a mode change // Send a reset again DS2480_reset_in(in) ; // delay to let line settle UT_delay(4); // default W1LT = 10us (write-1 low time) RETURN_BAD_IF_BAD(DS2480_configuration_write(PARMSEL_WRITE1LOW, PARMSET_Write10us, in)) ; // default DSO/WORT = 8us (data sample offset / write 0 recovery time ) RETURN_BAD_IF_BAD(DS2480_configuration_write(PARMSEL_SAMPLEOFFSET, PARMSET_SampOff8us, in)) ; // Strong pullup duration = infinite RETURN_BAD_IF_BAD(DS2480_configuration_write(PARMSEL_5VPULSE, PARMSET_infinite, in)) ; // Program pulse duration = 512usec RETURN_BAD_IF_BAD(DS2480_configuration_write(PARMSEL_12VPULSE, PARMSET_512us, in)) ; // Send a single bit // The datasheet wants this RETURN_BAD_IF_BAD(DS2480_sendback_cmd(&single_bit, &single_bit_response, 1, in)) ; /* Apparently need to reset again to get the version number properly */ return gbRESET( DS2480_reset_in(in) ) ; } // configuration of DS2480B -- parameter code is already shifted in the defines (by 4 bites) // configuration of DS2480B -- value code is already shifted in the defines (by 1 bit) static GOOD_OR_BAD DS2480_configuration_write(BYTE parameter_code, BYTE value_code, struct connection_in * in) { BYTE send_code = CMD_CONFIG | parameter_code | value_code; BYTE expected_response = CMD_CONFIG_RESPONSE | parameter_code | value_code; BYTE actual_response; RETURN_BAD_IF_BAD(DS2480_sendback_cmd(&send_code, &actual_response, 1, in)) ; if (expected_response == actual_response) { return gbGOOD; } LEVEL_DEBUG("wrong response (%.2X not %.2X)",actual_response,expected_response) ; return gbBAD; } // configuration of DS2480B -- parameter code is already shifted in the defines (by 4 bites) // configuration of DS2480B -- value code is already shifted in the defines (by 1 bit) static GOOD_OR_BAD DS2480_configuration_read(BYTE parameter_code, BYTE value_code, struct connection_in * in) { BYTE send_code = CMD_CONFIG | PARMSEL_PARMREAD | (parameter_code>>3); BYTE expected_response = CMD_CONFIG_RESPONSE | PARMSEL_PARMREAD | value_code; BYTE actual_response; RETURN_BAD_IF_BAD( DS2480_sendback_cmd(&send_code, &actual_response, 1, in)) ; if (expected_response == actual_response) { return gbGOOD; } LEVEL_DEBUG("wrong response (%.2X not %.2X)",actual_response,expected_response) ; return gbBAD; } // configuration of DS2480B -- parameter code is already shifted in the defines (by 4 bites) // configuration of DS2480B -- value code is already shifted in the defines (by 1 bit) // Set Baud rate -- can't use DS2480_configuration_code because return byte is at a different speed static void DS2480_set_baud_control(struct connection_in * in) { struct port_in * pin = in->pown ; // restrict allowable baud rates based on device capabilities COM_BaudRestrict( &(pin->baud), B9600, B19200, B57600, B115200, 0 ) ; if ( GOOD( DS2480_set_baud(in) ) ) { return ; } LEVEL_DEBUG("Failed first attempt at resetting baud rate of bus master %s",SAFESTRING(DEVICENAME(in))) ; if ( GOOD( DS2480_set_baud(in) ) ) { return ; } LEVEL_DEBUG("Failed second attempt at resetting baud rate of bus master %s",SAFESTRING(DEVICENAME(in))) ; // uh oh -- undefined state -- not sure what the bus speed is. in->reconnect_state = reconnect_error ; pin->baud = B9600 ; ++in->changed_bus_settings ; return; } static GOOD_OR_BAD DS2480_set_baud(struct connection_in * in) { BYTE value_code = 0 ; BYTE send_code ; // Find rate parameter switch ( in->pown->baud ) { case B9600: value_code = PARMSET_9600 ; break ; case B19200: value_code = PARMSET_19200 ; break ; #ifdef B57600 /* MacOSX support max 38400 in termios.h ? */ case B57600: value_code = PARMSET_57600 ; break ; #endif #ifdef B115200 /* MacOSX support max 38400 in termios.h ? */ case B115200: value_code = PARMSET_115200 ; break ; #endif default: in->pown->baud = B9600 ; value_code = PARMSET_9600 ; break ; } // Add polarity if ( in->master.serial.reverse_polarity ) { value_code |= PARMSET_REVERSE_POLARITY ; } send_code = CMD_CONFIG | PARMSEL_BAUDRATE | value_code; // Send configuration change DS2480_flush(in); UT_delay(5); // uh oh -- undefined state -- not sure what the bus speed is. RETURN_BAD_IF_BAD(DS2480_sendout_cmd(&send_code, 1, in)) ; // Change OS view of rate UT_delay(5); COM_change(in) ; UT_delay(5); DS2480_slurp(in); // Check rate RETURN_BAD_IF_BAD( DS2480_configuration_read( PARMSEL_BAUDRATE, value_code, in ) ) ; return gbGOOD ; } static BYTE DS2480b_speed_byte( struct connection_in * in ) { if ( in->overdrive ) { return SPEEDSEL_OD ; } else if ( in->flex ) { return SPEEDSEL_FLEX ; } else { return SPEEDSEL_STD ; } } //-------------------------------------------------------------------------- // Reset all of the devices on the 1-Wire Net and return the result. // // This routine will not function correctly on some // Alarm reset types of the DS1994/DS1427/DS2404 with // Rev 1,2, and 3 of the DS2480/DS2480B. static RESET_TYPE DS2480_reset(const struct parsedname *pn) { return DS2480_reset_in( pn->selected_connection ) ; } static RESET_TYPE DS2480_reset_in(struct connection_in * in) { if ( in->changed_bus_settings != 0) { in->changed_bus_settings = 0 ; DS2480_set_baud_control(in); // reset paramters } switch( DS2480_reset_once(in) ) { case BUS_RESET_OK: return BUS_RESET_OK ; case BUS_RESET_SHORT: return BUS_RESET_SHORT; case BUS_RESET_ERROR: default: { // Some kind of reset problem (not including bus short) // Try simple fixes BYTE dummy[1] ; //we don't check the pulse stop, since it's only a whim. // perhaps the DS9097U wasn't in command mode, so missed the reset // force a mode switch in->master.serial.mode = ds2480b_data_mode ; // Also make sure no power or programming pulse active DS2480_stop_pulse(dummy,in) ; // And now reset again return DS2480_reset_once(in) ; } } } static RESET_TYPE DS2480_reset_once(struct connection_in * in) { BYTE reset_byte = (BYTE) ( CMD_COMM | FUNCTSEL_RESET | DS2480b_speed_byte(in) ); BYTE reset_response ; // flush the buffers DS2480_flush(in); // send the packet // read back the 1 byte response if ( BAD(DS2480_sendback_cmd(&reset_byte, &reset_response, 1, in)) ) { return BUS_RESET_ERROR; } /* The adapter type is encoded in this response byte */ /* The known values correspond to the types in enum adapter_type */ /* Other values are assigned for adapters that don't have this hardcoded value */ in->Adapter = (reset_response & RB_CHIPID_MASK) >> 2; switch (reset_response & RB_RESET_MASK) { case RB_1WIRESHORT: return BUS_RESET_SHORT; case RB_NOPRESENCE: in->AnyDevices = anydevices_no ; return BUS_RESET_OK; case RB_PRESENCE: case RB_ALARMPRESENCE: in->AnyDevices = anydevices_yes ; // check if programming voltage available in->ProgramAvailable = ((reset_response & PARMSEL_12VPULSE) == PARMSEL_12VPULSE); DS2480_flush(in); return BUS_RESET_OK; default: return BUS_RESET_ERROR; // should never happen } } #define SERIAL_NUMBER_BITS (8*SERIAL_NUMBER_SIZE) /* search = normal and alarm */ static enum search_status DS2480_next_both(struct device_search *ds, const struct parsedname *pn) { int mismatched; BYTE sn[SERIAL_NUMBER_SIZE]; BYTE bitpairs[SERIAL_NUMBER_SIZE*2]; struct connection_in * in = pn->selected_connection ; BYTE searchon = (BYTE) ( CMD_COMM | FUNCTSEL_SEARCHON | DS2480b_speed_byte(in) ); BYTE searchoff = (BYTE) ( CMD_COMM | FUNCTSEL_SEARCHOFF | DS2480b_speed_byte(in) ); int i; if (ds->LastDevice) { return search_done; } if ( BAD( BUS_select(pn) ) ) { return search_error; } // need the reset done in BUS-select to set AnyDevices if ( in->AnyDevices == anydevices_no ) { ds->LastDevice = 1; return search_done; } // clear sn to satisfy static error checking (Coverity) memset( sn, 0, SERIAL_NUMBER_SIZE ) ; // build the command stream // call a function that may add the change mode command to the buff // check if correct mode // issue the search command // change back to command mode // search mode on // change back to data mode // set the temp Last Descrep to none mismatched = -1; // add the 16 bytes of the search memset(bitpairs, 0, SERIAL_NUMBER_SIZE*2); // set the bits in the added buffer for (i = 0; i < ds->LastDiscrepancy; i++) { // before last discrepancy UT_set2bit(bitpairs, i, UT_getbit(ds->sn, i) << 1); } // at last discrepancy if (ds->LastDiscrepancy > -1) { UT_set2bit(bitpairs, ds->LastDiscrepancy, 1 << 1); } // after last discrepancy so leave zeros // flush the buffers DS2480_flush(in); // search ON // change back to command mode // send the packet // cannot use single-bit mode with search accerator // search OFF if ( BAD(BUS_send_data(&(ds->search), 1, pn)) || BAD(DS2480_sendout_cmd(&searchon, 1, in)) || BAD( DS2480_sendback_data(bitpairs, bitpairs, SERIAL_NUMBER_SIZE*2, pn) ) || BAD(DS2480_sendout_cmd(&searchoff, 1, in)) ) { return search_error; } // interpret the bit stream for (i = 0; i < SERIAL_NUMBER_BITS; i++) { // get the SerialNum bit UT_setbit(sn, i, UT_get2bit(bitpairs, i) >> 1); // check LastDiscrepancy if (UT_get2bit(bitpairs, i) == SEARCH_BIT_ON ) { mismatched = i; } } if ( sn[0]==0xFF && sn[1]==0xFF && sn[2]==0xFF && sn[3]==0xFF && sn[4]==0xFF && sn[5]==0xFF && sn[6]==0xFF && sn[7]==0xFF ) { // special case for no alarm present return search_done ; } // CRC check if (CRC8(sn, SERIAL_NUMBER_SIZE) || (ds->LastDiscrepancy == SERIAL_NUMBER_BITS-1) || (sn[0] == 0)) { return search_error; } // successful search // check for last one if ((mismatched == ds->LastDiscrepancy) || (mismatched == -1)) { ds->LastDevice = 1; } // copy the SerialNum to the buffer memcpy(ds->sn, sn, 8); // set the count ds->LastDiscrepancy = mismatched; LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; } //-------------------------------------------------------------------------- // Send 8 bits of communication to the 1-Wire Net and verify that the // 8 bits read from the 1-Wire Net is the same (write operation). // The parameter 'byte' least significant 8 bits are used. After the // 8 bits are sent change the level of the 1-Wire net. // Delay delay msec and return to normal // /* Returns 0=good bad = -EIO */ static GOOD_OR_BAD DS2480_PowerByte(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn) { GOOD_OR_BAD ret; struct connection_in * in = pn->selected_connection ; BYTE bits = CMD_COMM | FUNCTSEL_BIT | DS2480b_speed_byte(in) ; BYTE cmd[] = { // bit 1 ((byte & 0x01) ? BITPOL_ONE : BITPOL_ZERO) | bits | PRIME5V_FALSE, // bit 2 ((byte & 0x02) ? BITPOL_ONE : BITPOL_ZERO) | bits | PRIME5V_FALSE, // bit 3 ((byte & 0x04) ? BITPOL_ONE : BITPOL_ZERO) | bits | PRIME5V_FALSE, // bit 4 ((byte & 0x08) ? BITPOL_ONE : BITPOL_ZERO) | bits | PRIME5V_FALSE, // bit 5 ((byte & 0x10) ? BITPOL_ONE : BITPOL_ZERO) | bits | PRIME5V_FALSE, // bit 6 ((byte & 0x20) ? BITPOL_ONE : BITPOL_ZERO) | bits | PRIME5V_FALSE, // bit 7 ((byte & 0x40) ? BITPOL_ONE : BITPOL_ZERO) | bits | PRIME5V_FALSE, // bit 8 ((byte & 0x80) ? BITPOL_ONE : BITPOL_ZERO) | bits | PRIME5V_TRUE, }; BYTE respbits[8]; BYTE response[1]; // flush the buffers DS2480_flush(in); // send the packet // read back the 8 byte response from sending the 5V pulse ret = DS2480_sendback_cmd(cmd, respbits, 8, in); UT_delay(delay); // return to normal level DS2480_stop_pulse(response, in); resp[0] = ((respbits[7] & 1) << 7) | ((respbits[6] & 1) << 6) | ((respbits[5] & 1) << 5) | ((respbits[4] & 1) << 4) | ((respbits[3] & 1) << 3) | ((respbits[2] & 1) << 2) | ((respbits[1] & 1) << 1) | ((respbits[0] & 1)); return ret ; } //-------------------------------------------------------------------------- // Send 1 bit of communication to the 1-Wire Net and verify that the // bit read from the 1-Wire Net is the same (write operation). // Delay delay msec and return to normal // /* Returns 0=good bad = -EIO */ static GOOD_OR_BAD DS2480_PowerBit(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn) { GOOD_OR_BAD ret; struct connection_in * in = pn->selected_connection ; BYTE bits = CMD_COMM | FUNCTSEL_BIT | DS2480b_speed_byte(in) ; BYTE cmd[] = { ((byte & 0x01) ? BITPOL_ONE : BITPOL_ZERO) | bits | PRIME5V_TRUE, }; BYTE respbits[1]; BYTE response[1]; // flush the buffers DS2480_flush(in); // send the packet // read back the 1 byte response from sending the 5V pulse ret = DS2480_sendback_cmd(cmd, respbits, 1, in); UT_delay(delay); // return to normal level DS2480_stop_pulse(response, in); resp[0] = (respbits[0] & 0x01); return ret ; } //-------------------------------------------------------------------------- // Send 1 bit of communication to the 1-Wire Net and verify that the // 8 bits read from the 1-Wire Net is the same (write operation). // /* Returns 0=good bad = -EIO */ static GOOD_OR_BAD DS2480_sendback_bits(const BYTE * databits, BYTE * respbits, const size_t len, const struct parsedname * pn) { struct connection_in * in = pn->selected_connection ; BYTE bits = CMD_COMM | FUNCTSEL_BIT | DS2480b_speed_byte(in) | PRIME5V_FALSE; size_t counter ; for ( counter=0 ; counter < len ; ++counter ) { BYTE cmd[] = { ((databits[counter] & 0x01) ? BITPOL_ONE : BITPOL_ZERO) | bits, }; // send the packet // read back the 1 byte response from sending the bit RETURN_BAD_IF_BAD( DS2480_sendback_cmd(cmd, &respbits[counter], 1, in) ) ; } return 0 ; } static void DS2480_flush( const struct connection_in * in ) { COM_flush( in ) ; } static void DS2480_slurp( struct connection_in * in ) { COM_slurp( in ) ; } static GOOD_OR_BAD DS2480_stop_pulse(BYTE * response, struct connection_in * in) { BYTE cmd[1] = { MODE_STOP_PULSE, }; // read back the 8 byte response from setting time limit return DS2480_sendback_cmd(cmd, response, 1, in); } /* Send a 12v 480usec pulse on the 1wire bus to program the EPROM */ // returns 0 if good static GOOD_OR_BAD DS2480_ProgramPulse(const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; GOOD_OR_BAD ret; BYTE cmd[] = { CMD_COMM | FUNCTSEL_CHMOD | BITPOL_12V | SPEEDSEL_PULSE, }; BYTE response_mask = 0xFC; BYTE command_resp[1]; BYTE stop_pulse[1] ; DS2480_flush(in); // send the packet // read back the 8 byte response from sending the 12V pilse ret = DS2480_sendback_cmd(cmd, command_resp, 1, in); if ( GOOD(ret) ) { UT_delay_us(520); } // return to normal level DS2480_stop_pulse(stop_pulse, in); RETURN_BAD_IF_BAD(ret) ; if ((command_resp[0] & response_mask) != (cmd[0] & response_mask)) { return gbBAD; } return gbGOOD; } // Write to the output -- works for tcp and COM static GOOD_OR_BAD DS2480_write(const BYTE * buf, const size_t size, struct connection_in * in) { switch( in->pown->type ) { case ct_telnet: return telnet_write_binary( buf, size, in) ; case ct_serial: default: return COM_write( buf, size, in ) ; } } /* Assymetric */ /* Read from DS2480 with timeout on each character */ // NOTE: from PDkit, read 1-byte at a time // NOTE: change timeout to 40msec from 10msec for LINK (emulation mode) static GOOD_OR_BAD DS2480_read(BYTE * buf, const size_t size, struct connection_in * in) { return COM_read( buf, size, in ) ; } // // DS2480_sendout_cmd // Send a command but expect no response // puts into command mode if needed. // Note most use is through DS2480_sendback_command // The only uses for this alone are the single byte search accelerators // so size checking will be done in sendback // return 0=good static GOOD_OR_BAD DS2480_sendout_cmd(const BYTE * cmd, const size_t len, struct connection_in * in) { if (in->master.serial.mode == ds2480b_command_mode ) { // already in command mode -- very easy return DS2480_write(cmd, (unsigned) len, in); } else { // need to switch to command mode // add to current string for efficiency BYTE cmd_plus[len+1] ; cmd_plus[0] = MODE_COMMAND ; memcpy( &cmd_plus[1], cmd, len ) ; // MODE_COMMAND is one of the reserved commands that does not generate a response byte // page 6 of datasheet: http://datasheets.maxim-ic.com/en/ds/DS2480B.pdf in->master.serial.mode = ds2480b_command_mode ; return DS2480_write(cmd_plus, (unsigned) len+1, in); } } // // DS2480_sendback_cmd // Send a command and return response block // puts into command mode if needed. // return 0=good static GOOD_OR_BAD DS2480_sendback_cmd(const BYTE * cmd, BYTE * resp, const size_t len, struct connection_in * in) { size_t bytes_so_far = 0 ; size_t extra_byte_for_modeshift = (in->master.serial.mode != ds2480b_command_mode) ? 1 : 0 ; while ( bytes_so_far < len ) { size_t bytes_this_segment = len - bytes_so_far ; if ( bytes_this_segment > MAX_SEND_SIZE - extra_byte_for_modeshift ) { bytes_this_segment = MAX_SEND_SIZE - extra_byte_for_modeshift ; extra_byte_for_modeshift = 0 ; } RETURN_BAD_IF_BAD( DS2480_sendout_cmd( &cmd[bytes_so_far], bytes_this_segment, in) ); RETURN_BAD_IF_BAD( DS2480_read( &resp[bytes_so_far], bytes_this_segment, in) ); bytes_so_far += bytes_this_segment ; } return gbGOOD ; } // // DS2480_sendback_data // Send data and return response block // puts into data mode if needed. // Repeat magic MODE_COMMAND byte to show true data // return 0=good static GOOD_OR_BAD DS2480_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; BYTE sendout[MAX_SEND_SIZE] ; size_t bytes_this_segment = 0 ; size_t bytes_at_segment_start = 0 ; size_t bytes_from_list = 0 ; // skip if nothing // don't even switch to data mode if ( len == 0 ) { return gbGOOD ; } // switch mode if needed if (in->master.serial.mode != ds2480b_data_mode) { // this is one of the "reserved commands" that does not generate a resonse byte // page 6 of the datasheet http://datasheets.maxim-ic.com/en/ds/DS2480B.pdf sendout[bytes_this_segment++] = MODE_DATA; // change flag to data mode in->master.serial.mode = ds2480b_data_mode; } while ( bytes_from_list < len ) { BYTE current_char = data[bytes_from_list++] ; // transfer this byte sendout[ bytes_this_segment++ ] = current_char ; // see about "doubling" if ( current_char == MODE_COMMAND ) { sendout[ bytes_this_segment++ ] = current_char ; } // Should we send off this data so far and queue up more? // need room for potentially 2 characters if ( bytes_this_segment > MAX_SEND_SIZE-2 || bytes_from_list == len ) { // write out RETURN_BAD_IF_BAD( DS2480_write(sendout, bytes_this_segment, in ) ) ; // read in // note that read and write sizes won't match because of doubled bytes and mode shift RETURN_BAD_IF_BAD( DS2480_read(&resp[bytes_at_segment_start], bytes_from_list - bytes_at_segment_start, in) ) ; // move indexes for next segment bytes_at_segment_start = bytes_from_list ; bytes_this_segment = 0 ; } } return gbGOOD ; } static void DS2480_close(struct connection_in *in) { // the standard COM_free cleans up the connection (void) in ; } owfs-3.1p5/module/owlib/src/c/ow_ds9490.c0000644000175000001440000011015412711737666014756 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* DS9490R-W USB 1-Wire master USB parameters: Vendor ID: 04FA ProductID: 2490 Dallas controller DS2490 */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" #if OW_USB /* conditional inclusion of USB */ #include "ow_usb_msg.h" #include "ow_usb_cycle.h" /* All the rest of the code sees is the DS9490_detect routine and the iroutine structure */ static RESET_TYPE DS9490_reset(const struct parsedname *pn); static void BUS_ERROR_fix(const struct parsedname *pn); static GOOD_OR_BAD DS9490_detect_single_adapter(int usb_nr, struct connection_in *in); static GOOD_OR_BAD DS9490_detect_all_adapters(struct port_in * pin_first); static GOOD_OR_BAD DS9490_detect_specific_adapter(int bus_nr, int dev_nr, struct connection_in * in) ; static GOOD_OR_BAD DS9490_reconnect(const struct parsedname *pn); static GOOD_OR_BAD DS9490_redetect_low(struct connection_in * in); static GOOD_OR_BAD DS9490_redetect_match(struct connection_in * in); static GOOD_OR_BAD DS9490_redetect_specific_adapter( struct connection_in * in) ; static void DS9490_setroutines(struct connection_in *in); static GOOD_OR_BAD DS9490_setup_adapter(struct connection_in * in) ; static enum search_status DS9490_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD DS9490_sendback_data(const BYTE * data, BYTE * resp, size_t len, const struct parsedname *pn); static GOOD_OR_BAD DS9490_HaltPulse(const struct parsedname *pn); static GOOD_OR_BAD DS9490_PowerByte(BYTE byte, BYTE * resp, UINT delay, const struct parsedname *pn); static GOOD_OR_BAD DS9490_ProgramPulse(const struct parsedname *pn); static GOOD_OR_BAD DS9490_overdrive(const struct parsedname *pn); static void SetupDiscrepancy(const struct device_search *ds, BYTE * discrepancy); static int FindDiscrepancy(BYTE * last_sn, BYTE * discrepancy_sn); static enum search_status DS9490_directory(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD DS9490_SetSpeed(const struct parsedname *pn); static void DS9490_SetFlexParameters(struct connection_in *in) ; static GOOD_OR_BAD DS9490_open_and_name( libusb_device * dev, struct connection_in *in); /* Device-specific routines */ static void DS9490_setroutines(struct connection_in *in) { in->iroutines.detect = DS9490_detect; in->iroutines.reset = DS9490_reset; in->iroutines.next_both = DS9490_next_both; in->iroutines.PowerByte = DS9490_PowerByte; in->iroutines.ProgramPulse = DS9490_ProgramPulse; in->iroutines.sendback_data = DS9490_sendback_data; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = DS9490_reconnect; in->iroutines.close = DS9490_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_default; in->bundling_length = USB_FIFO_SIZE; } #define DS2490_BULK_BUFFER_SIZE 64 //#define DS2490_DIR_GULP_ELEMENTS ((DS2490_BULK_BUFFER_SIZE/SERIAL_NUMBER_SIZE) - 1) #define DS2490_DIR_GULP_ELEMENTS (1) #define MOD_PULSE_EN 0x0000 #define MOD_SPEED_CHANGE_EN 0x0001 #define MOD_1WIRE_SPEED 0x0002 #define MOD_STRONG_PU_DURATION 0x0003 #define MOD_PULLDOWN_SLEWRATE 0x0004 #define MOD_PROG_PULSE_DURATION 0x0005 #define MOD_WRITE1_LOWTIME 0x0006 #define MOD_DSOW0_TREC 0x0007 // // Value field COMM Command options // // COMM Bits (bitwise or into COMM commands to build full value byte pairs) // Byte 1 #define COMM_TYPE 0x0008 #define COMM_SE 0x0008 #define COMM_D 0x0008 #define COMM_Z 0x0008 #define COMM_CH 0x0008 #define COMM_SM 0x0008 #define COMM_R 0x0008 #define COMM_IM 0x0001 // Byte 2 #define COMM_PS 0x4000 #define COMM_PST 0x4000 #define COMM_CIB 0x4000 #define COMM_RTS 0x4000 #define COMM_DT 0x2000 #define COMM_SPU 0x1000 #define COMM_F 0x0800 #define COMM_NTF 0x0400 #define COMM_ICP 0x0200 #define COMM_RST 0x0100 // Read Straight command, special bits #define COMM_READ_STRAIGHT_NTF 0x0008 #define COMM_READ_STRAIGHT_ICP 0x0004 #define COMM_READ_STRAIGHT_RST 0x0002 #define COMM_READ_STRAIGHT_IM 0x0001 // // Value field COMM Command options (0-F plus assorted bits) // #define COMM_ERROR_ESCAPE 0x0601 #define COMM_SET_DURATION 0x0012 #define COMM_BIT_IO 0x0020 #define COMM_PULSE 0x0030 #define COMM_1_WIRE_RESET 0x0042 #define COMM_BYTE_IO 0x0052 #define COMM_MATCH_ACCESS 0x0064 #define COMM_BLOCK_IO 0x0074 #define COMM_READ_STRAIGHT 0x0080 #define COMM_DO_RELEASE 0x6092 #define COMM_SET_PATH 0x00A2 #define COMM_WRITE_SRAM_PAGE 0x00B2 #define COMM_WRITE_EPROM 0x00C4 #define COMM_READ_CRC_PROT_PAGE 0x00D4 #define COMM_READ_REDIRECT_PAGE_CRC 0x21E4 #define COMM_SEARCH_ACCESS 0x00F4 // Mode Command Code Constants // Enable Pulse Constants #define ENABLEPULSE_PRGE 0x01 // programming pulse #define ENABLEPULSE_SPUE 0x02 // strong pull-up // Define our combinations: #define ENABLE_PROGRAM_ONLY (ENABLEPULSE_PRGE) #define ENABLE_PROGRAM_AND_PULSE (ENABLEPULSE_PRGE | ENABLEPULSE_SPUE) // 1Wire Bus Speed Setting Constants #define ONEWIREBUSSPEED_REGULAR 0x00 #define ONEWIREBUSSPEED_FLEXIBLE 0x01 #define ONEWIREBUSSPEED_OVERDRIVE 0x02 #define PARMSET_Slew15Vus 0x0 #define PARMSET_Slew2p20Vus 0x1 #define PARMSET_Slew1p65Vus 0x2 #define PARMSET_Slew1p37Vus 0x3 #define PARMSET_Slew1p10Vus 0x4 #define PARMSET_Slew0p83Vus 0x5 #define PARMSET_Slew0p70Vus 0x6 #define PARMSET_Slew0p55Vus 0x7 #define PARMSET_W1L_04us 0x0 #define PARMSET_W1L_05us 0x1 #define PARMSET_W1L_06us 0x2 #define PARMSET_W1L_07us 0x3 #define PARMSET_W1L_08us 0x4 #define PARMSET_W1L_09us 0x5 #define PARMSET_W1L_10us 0x6 #define PARMSET_W1L_11us 0x7 #define PARMSET_DS0_W0R_10us 0x0 #define PARMSET_DS0_W0R_12us 0x1 #define PARMSET_DS0_W0R_14us 0x2 #define PARMSET_DS0_W0R_16us 0x3 #define PARMSET_DS0_W0R_18us 0x4 #define PARMSET_DS0_W0R_20us 0x5 #define PARMSET_DS0_W0R_22us 0x6 #define PARMSET_DS0_W0R_24us 0x7 /* From datasheet http://datasheets.maxim-ic.com/en/ds/DS2490.pdf page 15 */ /* 480 usec = 8usec * 60 and 60(decimal) = 0x3C */ /* 480 usec is the recommended program pulse duration in the DS2406 DS2502 DS2505 datasheets */ #define PROGRAM_PULSE_DURATION_CODE 0x3C /* ------------------------------------------------------------ */ /* --- USB detection routines ----------------------------------*/ /* Main routine for detecting (and setting up) the DS2490 1-wire USB chip */ GOOD_OR_BAD DS9490_detect(struct port_in *pin) { struct connection_in * in = pin->first ; struct address_pair ap ; GOOD_OR_BAD gbResult = gbBAD; DS9490_setroutines(in); if ( in->master.usb.lusb_dev != NULL ) { // special case: exists (from scan) return DS9490_open_and_name( in->master.usb.lusb_dev, in ) ; // Note DS9490_ID_this_master needs to be called, // but the bus hasn't yet been added. // So it's done in USB_scan_for_adapters } /* uses "name" before it's cleared by connection_init */ Parse_Address( pin->init_data, &ap ) ; switch ( ap.entries ) { case 0: // Minimal specification, so use first USB device gbResult = DS9490_detect_single_adapter( 1, in) ; break ; case 1: switch( ap.first.type ) { case address_all: case address_asterix: LEVEL_DEBUG("Look for all USB adapters"); gbResult = DS9490_detect_all_adapters(pin) ; break ; case address_numeric: LEVEL_DEBUG("Look for USB adapter number %d",ap.first.number); gbResult = DS9490_detect_single_adapter( ap.first.number, in) ; break ; case address_scan: // completely change personality! gbResult = USB_monitor_detect(pin) ; break ; default: LEVEL_DEFAULT("Unclear what <%s> means in USB specification, will use first adapter.",ap.first.alpha) ; gbResult = DS9490_detect_single_adapter( 1, in) ; break ; } break ; case 2: switch( ap.first.type ) { case address_all: case address_asterix: LEVEL_DEBUG("Look for all USB adapters"); gbResult = DS9490_detect_all_adapters(pin) ; break ; case address_numeric: LEVEL_DEBUG("Look for USB adapter number %d:%d",ap.first.number,ap.second.number); gbResult = DS9490_detect_specific_adapter( ap.first.number, ap.second.number, in ) ; break ; case address_scan: // completely change personality! gbResult = USB_monitor_detect(pin) ; break ; default: LEVEL_DEFAULT("USB address <%s:%s> not in number:number format",ap.first.alpha,ap.second.alpha) ; gbResult = gbBAD ; break ; } break ; } Free_Address( &ap ) ; return gbResult; } /* Open a DS9490 -- low level code (to allow for repeats) */ static GOOD_OR_BAD DS9490_detect_single_adapter(int usb_nr, struct connection_in * in) { // discover devices libusb_device **device_list; int n_devices = libusb_get_device_list( Globals.luc, &device_list) ; int i_device ; if ( n_devices < 1 ) { LEVEL_CONNECT("Could not find a list of USB devices"); if ( n_devices<0 ) { LEVEL_DEBUG("<%s>",libusb_error_name(n_devices)); } return gbBAD ; } for ( i_device = 0 ; i_device < n_devices ; ++i_device ) { libusb_device * current = device_list[i_device] ; if ( GOOD( USB_match( current ) ) ) { --usb_nr ; if ( usb_nr > 0 ) { continue ; } if ( BAD(DS9490_open_and_name( current, in)) ) { LEVEL_DEBUG("Cannot open USB device %.d:%.d", libusb_get_device_address(current), libusb_get_bus_number(current) ); break ; } else if ( BAD(DS9490_ID_this_master(in)) ) { DS9490_close(in) ; LEVEL_DEBUG("Cannot access USB device %.d:%.d", libusb_get_device_address(current), libusb_get_bus_number(current) ); break ; } else{ libusb_free_device_list(device_list, 1); return gbGOOD ; } } } libusb_free_device_list(device_list, 1); LEVEL_CONNECT("No USB DS9490 bus master found"); return gbBAD; } /* Open a DS9490 -- low level code (to allow for repeats) */ static GOOD_OR_BAD DS9490_detect_specific_adapter(int bus_nr, int dev_nr, struct connection_in * in) { // discover devices libusb_device **device_list; int n_devices = libusb_get_device_list( Globals.luc, &device_list) ; int i_device ; if ( n_devices < 1 ) { LEVEL_CONNECT("Could not find a list of USB devices"); if ( n_devices<0 ) { LEVEL_DEBUG("<%s>",libusb_error_name(n_devices)); } return gbBAD ; } // Mark this connection as taking only this address pair. Important for reconnections. in->master.usb.specific_usb_address = 1 ; for ( i_device = 0 ; i_device < n_devices ; ++i_device ) { libusb_device * current = device_list[i_device] ; if ( GOOD( USB_match( current ) ) ) { if ( libusb_get_bus_number(current) != bus_nr ) { continue ; } if ( libusb_get_device_address(current) != dev_nr ) { continue ; } if ( BAD(DS9490_open_and_name( current, in)) ) { LEVEL_DEBUG("Cannot open USB device %.d:%.d", libusb_get_device_address(current), libusb_get_bus_number(current) ); break ; } else if ( BAD(DS9490_ID_this_master(in)) ) { DS9490_close(in) ; LEVEL_DEBUG("Cannot access USB device %.d:%.d", libusb_get_device_address(current), libusb_get_bus_number(current) ); break ; } else{ libusb_free_device_list(device_list, 1); return gbGOOD ; } } } libusb_free_device_list(device_list, 1); LEVEL_CONNECT("No USB DS9490 bus master found matching %d:%d", bus_nr,dev_nr); return gbBAD; } /* Open a DS9490 -- low level code (to allow for repeats) */ static GOOD_OR_BAD DS9490_detect_all_adapters(struct port_in * pin_first) { // discover devices struct port_in * pin = pin_first ; libusb_device **device_list; int n_devices = libusb_get_device_list( Globals.luc, &device_list) ; int i_device ; if ( n_devices < 1 ) { LEVEL_CONNECT("Could not find a list of USB devices"); if ( n_devices<0 ) { LEVEL_DEBUG("<%s>",libusb_error_name(n_devices)); } return gbBAD ; } for ( i_device = 0 ; i_device < n_devices ; ++i_device ) { libusb_device * current = device_list[i_device] ; if ( GOOD( USB_match( current ) ) ) { struct connection_in * in = pin->first ; if ( BAD(DS9490_open_and_name( current, in)) ) { LEVEL_DEBUG("Cannot open USB device %.d:%.d", libusb_get_device_address(current), libusb_get_bus_number(current) ); continue ; } else if ( BAD(DS9490_ID_this_master(in)) ) { DS9490_close(in) ; LEVEL_DEBUG("Cannot access USB device %.d:%.d", libusb_get_device_address(current), libusb_get_bus_number(current) ); continue; } else{ pin = NewPort(NULL) ; // no reason to copy anything if ( pin == NULL ) { return gbGOOD ; } // set up the new connection for the next adapter DS9490_setroutines(in); } } } libusb_free_device_list(device_list, 1); if ( pin == pin_first ) { LEVEL_CONNECT("No USB DS9490 bus masters used"); return gbBAD; } // Remove the extra connection RemovePort(pin); return gbGOOD ; } /* ------------------------------------------------------------ */ /* --- USB redetect routines -----------------------------------*/ /* When the errors stop the USB device from functioning -- close and reopen. * If it fails, re-scan the USB bus and search for the old adapter */ static GOOD_OR_BAD DS9490_reconnect(const struct parsedname *pn) { GOOD_OR_BAD ret; struct connection_in * in = pn->selected_connection ; if ( in->master.usb.specific_usb_address ) { // special case where a usb bus:dev pair was given // only connect to the same spot return DS9490_redetect_specific_adapter( in ) ; } /* Have to protect usb_find_busses() and usb_find_devices() with * a lock since libusb could crash if 2 threads call it at the same time. * It's not called until DS9490_redetect_low(), but I lock here just * to be sure DS9490_close() and DS9490_open() get one try first. */ LIBUSBLOCK; DS9490_close( in ) ; ret = DS9490_redetect_low(in) ; LIBUSBUNLOCK; if ( GOOD(ret) ) { LEVEL_DEFAULT("Found USB DS9490 bus master after USB rescan as [%s]", SAFESTRING(DEVICENAME(in))); } return ret; } /* Open a DS9490 -- low level code (to allow for repeats) */ static GOOD_OR_BAD DS9490_redetect_low(struct connection_in * in) { // discover devices libusb_device **device_list; int n_devices = libusb_get_device_list( Globals.luc, &device_list) ; int i_device ; if ( n_devices < 1 ) { LEVEL_CONNECT("Could not find a list of USB devices"); if ( n_devices<0 ) { LEVEL_DEBUG("<%s>",libusb_error_name(n_devices)); } return gbBAD; } for ( i_device = 0 ; i_device < n_devices ; ++i_device ) { libusb_device * current = device_list[i_device] ; if ( GOOD( USB_match( current ) ) ) { // try to open the DS9490 if ( BAD(DS9490_open_and_name( current, in )) ) { LEVEL_CONNECT("Cannot open USB bus master, Find next..."); continue; } if ( GOOD( DS9490_redetect_match( in ) ) ) { break ; } DS9490_close(in); } } libusb_free_device_list(device_list, 1); return (in->master.usb.lusb_handle!=NULL) ? gbGOOD : gbBAD ; } /* Open a DS9490 -- low level code (to allow for repeats) */ static GOOD_OR_BAD DS9490_redetect_specific_adapter( struct connection_in * in) { struct address_pair ap ; GOOD_OR_BAD gbResult ; Parse_Address( in->pown->init_data, &ap ) ; if ( ap.first.type != address_numeric || ap.second.type != address_numeric ) { LEVEL_DEBUG("Cannot understand the specific usb address pair to reconnect <%s>",in->pown->init_data) ; gbResult = gbBAD ; } else { /* Have to protect usb_find_busses() and usb_find_devices() with * a lock since libusb could crash if 2 threads call it at the same time. * It's not called until DS9490_redetect_low(), but I lock here just * to be sure DS9490_close() and DS9490_open() get one try first. */ LIBUSBLOCK; DS9490_close( in ) ; gbResult = DS9490_detect_specific_adapter( ap.first.number, ap.second.number, in) ; LIBUSBUNLOCK; } Free_Address( &ap ) ; return gbResult ; } /* Open a DS9490 -- low level code (to allow for repeats) */ static GOOD_OR_BAD DS9490_redetect_match( struct connection_in * in) { struct dirblob db ; BYTE sn[SERIAL_NUMBER_SIZE] ; int device_number ; LEVEL_DEBUG("Attempting reconnect on %s",SAFESTRING(DEVICENAME(in))); // Special case -- originally untagged adapter if ( in->master.usb.ds1420_address[0] == '\0' ) { LEVEL_CONNECT("Since originally untagged bus master, we will use first available slot."); return gbGOOD ; } // Generate a root directory RETURN_BAD_IF_BAD( DS9490_root_dir( &db, in ) ) ; // This adapter has no tags, so not the one we want if ( DirblobElements( &db) == 0 ) { DirblobClear( &db ) ; LEVEL_DATA("Empty directory on [%s] (Doesn't match initial scan).", SAFESTRING(DEVICENAME(in))); return gbBAD ; } // Scan directory for a match to the original tag device_number = 0 ; while ( DirblobGet( device_number, sn, &db ) == 0 ) { if (memcmp(sn, in->master.usb.ds1420_address, SERIAL_NUMBER_SIZE) == 0) { // same tag device? LEVEL_DATA("Matching device [%s].", SAFESTRING(DEVICENAME(in))); DirblobClear( &db ) ; return gbGOOD ; } ++device_number ; } // Couldn't find correct ds1420 chip on this adapter LEVEL_CONNECT("Couldn't find correct ds1420 chip on this bus master [%s] (want: " SNformat ")", SAFESTRING(DEVICENAME(in)), SNvar(in->master.usb.ds1420_address)); DirblobClear( &db ) ; return gbBAD; } /* ------------------------------------------------------------ */ /* --- USB reset routines --------------------------------------*/ /* Reset adapter and detect devices on the bus */ /* BUS locked at high level */ /* return 1=short, 0 good <0 error */ static RESET_TYPE DS9490_reset(const struct parsedname *pn) { int i; BYTE buffer[ DS9490_getstatus_BUFFER_LENGTH + 1 ]; int USpeed; struct connection_in * in = pn->selected_connection ; int readlen = 0 ; LEVEL_DEBUG("DS9490 RESET. changed %d, flex: %d", in->changed_bus_settings, in->flex) ; if (in->master.usb.lusb_dev == NULL || in->master.usb.lusb_handle == NULL) { // From Michael Markstaller: LEVEL_DEBUG("Attempting RESET on null bus") ; //FIXME! what doees it mean? no action/reconnect is even tried-> shouldn't we just drop this BM and let uscan rediscover it? DS9490 must always have an ID chip.. // Actually no, the home-brewed DS2490-based masters that people have built have no ID chip BUS_ERROR_fix(pn) ; return BUS_RESET_ERROR; } // Do we need to change settings? if (in->changed_bus_settings > 0) { // Prevent recursive loops on reset DS9490_SetSpeed(pn); // reset paramters in->changed_bus_settings = 0 ; } memset(buffer, 0, 32); // Bus timing if ( in->overdrive ) { USpeed = ONEWIREBUSSPEED_OVERDRIVE ; } else if ( in->flex ) { USpeed = ONEWIREBUSSPEED_FLEXIBLE ; } else { USpeed = ONEWIREBUSSPEED_REGULAR ; } // Send reset //FIXME: from Michael Markstaller: changed hard to flexible speed as it gets wrong somewhere, only want flexible if ( BAD( USB_Control_Msg(COMM_CMD, COMM_1_WIRE_RESET | COMM_F | COMM_IM | COMM_SE, USpeed, pn)) ) { // if ( BAD( USB_Control_Msg(COMM_CMD, COMM_1_WIRE_RESET | COMM_F | COMM_IM | COMM_SE, ONEWIREBUSSPEED_FLEXIBLE, pn)) ) { LEVEL_DATA("Reset command rejected"); BUS_ERROR_fix(pn) ; return BUS_RESET_ERROR; // fatal error... probably closed usb-handle } // Extra delay? if (in->ds2404_found && (in->overdrive == 0)) { // extra delay for alarming DS1994/DS2404 compliance UT_delay(5); } // Read response switch( DS9490_getstatus(buffer, &readlen, pn) ) { case BUS_RESET_SHORT: /* Short detected, but otherwise no bigger problem */ LEVEL_DEBUG("DS9490_Reset: SHORT"); return BUS_RESET_SHORT ; case BUS_RESET_OK: LEVEL_DEBUG("DS9490_Reset: OK"); break ; case BUS_RESET_ERROR: default: LEVEL_DEBUG("DS9490_Reset: ERROR"); BUS_ERROR_fix(pn) ; return BUS_RESET_ERROR; } //USBpowered = (buffer[8]&STATUSFLAGS_PMOD) == STATUSFLAGS_PMOD ; in->AnyDevices = anydevices_yes ; for (i = 16; i < readlen; i++) { BYTE val = buffer[i]; LEVEL_DEBUG("Reset: Status bytes[%d]: %X", i, val); if (val != ONEWIREDEVICEDETECT) { // check for NRS bit (0x01) if (val & COMMCMDERRORRESULT_NRS) { // empty bus detected, no presence pulse detected in->AnyDevices = anydevices_no; LEVEL_DATA("no presense pulse detected"); } } } return BUS_RESET_OK; } static void BUS_ERROR_fix(const struct parsedname *pn) { LEVEL_DEBUG("DS9490_Reset: ERROR -- will attempt a fix"); /* FIXME: FIXED. In ow_usb_msg.c an USB-reset was was issued: * USB_Control_Msg(CONTROL_CMD, CTL_RESET_DEVICE, 0x0000, pn) ; * So we need to setup the Adapter again * Though here is probably the wrong place, duplicated code from _setup_adaptor */ // enable both program and strong pulses if ( BAD( USB_Control_Msg(MODE_CMD, MOD_PULSE_EN, ENABLE_PROGRAM_AND_PULSE, pn)) ) { LEVEL_DATA("EnableProgram error"); } // enable speed changes if ( BAD( USB_Control_Msg(MODE_CMD, MOD_SPEED_CHANGE_EN, 1, pn)) ) { LEVEL_DATA("RESET_Error: SpeedEnable error"); } // set the strong pullup duration to infinite if ( BAD( USB_Control_Msg(COMM_CMD, COMM_SET_DURATION | COMM_IM, 0x0000, pn)) ) { LEVEL_DATA("StrongPullup error"); } // Don't set speed right now, it calls reset for infinite recursion. Just set for next pass ++ pn->selected_connection->changed_bus_settings ; } /* ------------------------------------------------------------ */ /* --- USB Directory functions --------------------------------*/ static enum search_status DS9490_next_both(struct device_search *ds, const struct parsedname *pn) { int dir_gulp_elements = (pn->ds2409_depth==0) ? DS2490_DIR_GULP_ELEMENTS : 1 ; // LOOK FOR NEXT ELEMENT ++ds->index; LEVEL_DEBUG("Index %d", ds->index); if (ds->index % dir_gulp_elements == 0) { if (ds->LastDevice) { return search_done; } switch ( DS9490_directory(ds, pn) ) { case search_done: return search_done; case search_error: return search_error; case search_good: break; } } switch ( DirblobGet(ds->index % dir_gulp_elements, ds->sn, &(ds->gulp) ) ) { case 0: LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; case -ENODEV: default: LEVEL_DEBUG("SN finished"); return search_done; } } // Read up to 7 (DS2490_DIR_GULP_ELEMENTS) at a time, and place into // a dirblob. Called from DS9490_next_both every 7 devices to fill. static enum search_status DS9490_directory(struct device_search *ds, const struct parsedname *pn) { BYTE status_buffer[ DS9490_getstatus_BUFFER_LENGTH + 1 ]; BYTE EP2_data[SERIAL_NUMBER_SIZE] ; //USB endpoint 3 buffer union { BYTE b[DS2490_BULK_BUFFER_SIZE] ; BYTE sn[DS2490_BULK_BUFFER_SIZE/SERIAL_NUMBER_SIZE][SERIAL_NUMBER_SIZE]; } EP3 ; //USB endpoint 3 buffer SIZE_OR_ERROR ret; int bytes_back; int devices_found; int device_index; int dir_gulp_elements = (pn->ds2409_depth==0) ? DS2490_DIR_GULP_ELEMENTS : 1 ; int readlen = 0 ; DirblobClear(&(ds->gulp)); if ( BAD( BUS_select(pn) ) ) { LEVEL_DEBUG("Selection problem before a directory listing") ; return search_error ; } if ( pn->selected_connection->AnyDevices == anydevices_no ) { // empty bus detected, no presence pulse detected return search_done ; } SetupDiscrepancy(ds, EP2_data); // set the search start location ret = DS9490_write(EP2_data, SERIAL_NUMBER_SIZE, pn) ; if ( ret < SERIAL_NUMBER_SIZE ) { LEVEL_DATA("bulk write problem = %d", ret); return search_error; } // Send the search request if ( BAD( USB_Control_Msg(COMM_CMD, COMM_SEARCH_ACCESS | COMM_IM | COMM_SM | COMM_F | COMM_RTS, (dir_gulp_elements << 8) | (ds->search), pn) ) ) { LEVEL_DATA("control error"); return search_error; } // read the search status if ( DS9490_getstatus(status_buffer, &readlen, pn) != BUS_RESET_OK ) { return search_error; } // test the buffer size waiting for us bytes_back = status_buffer[13]; LEVEL_DEBUG("Got %d bytes from USB search", bytes_back); if (bytes_back == 0) { /* Nothing found on the bus. Have to return something != search_good to avoid * getting stuck in loop in FS_realdir() and FS_alarmdir() * which ends when ret!=search_good */ LEVEL_DATA("ReadBufferstatus == 0"); return search_done; } else if ( bytes_back % SERIAL_NUMBER_SIZE != 0 ) { LEVEL_DATA("ReadBufferstatus size %d not a multiple of %d", bytes_back,SERIAL_NUMBER_SIZE); return search_error; } else if ( bytes_back > (dir_gulp_elements + 1) * SERIAL_NUMBER_SIZE ) { LEVEL_DATA("ReadBufferstatus size %d too large", bytes_back); return search_error; } devices_found = bytes_back / SERIAL_NUMBER_SIZE; if (devices_found > dir_gulp_elements) { devices_found = dir_gulp_elements; } // read in the buffer that holds the devices found if ((ret = DS9490_read(EP3.b, bytes_back, pn)) <= 0) { LEVEL_DATA("bulk read problem ret=%d", ret); return search_error; } // analyze each device found for (device_index = 0; device_index < devices_found; ++device_index) { /* test for CRC error */ LEVEL_DEBUG("gulp. Adding element %d:" SNformat, device_index, SNvar(EP3.sn[device_index])); if (CRC8(EP3.sn[device_index], SERIAL_NUMBER_SIZE) != 0 || EP3.sn[device_index][0] == 0) { LEVEL_DATA("CRC error"); return search_error; } } // all ok, so add the devices for (device_index = 0; device_index < devices_found; ++device_index) { DirblobAdd(EP3.sn[device_index], &(ds->gulp)); } ds->LastDiscrepancy = FindDiscrepancy(EP3.sn[devices_found-1], EP3.sn[devices_found]); ds->LastDevice = (bytes_back == devices_found * SERIAL_NUMBER_SIZE); // no more to read return search_good; } static void SetupDiscrepancy(const struct device_search *ds, BYTE * discrepancy) { int i; /** Play LastDescrepancy games with bitstream */ memcpy(discrepancy, ds->sn, SERIAL_NUMBER_SIZE); /* set buffer to zeros */ if (ds->LastDiscrepancy > -1) { UT_setbit(discrepancy, ds->LastDiscrepancy, 1); } /* This could be more efficiently done than bit-setting, but probably wouldn't make a difference */ for (i = ds->LastDiscrepancy + 1; i < 64; i++) { UT_setbit(discrepancy, i, 0); } } static int FindDiscrepancy(BYTE * last_sn, BYTE * discrepancy_sn) { int i; for (i = 63; i >= 0; i--) { if ((UT_getbit(discrepancy_sn, i) != 0) && (UT_getbit(last_sn, i) == 0)) { return i; } } return 0; } /* ------------------------------------------------------------ */ /* --- USB Open and Close --------------------------------------*/ // Open usb device, // dev already set static GOOD_OR_BAD DS9490_open_and_name( libusb_device * dev, struct connection_in *in) { if (in->master.usb.lusb_handle != NULL) { LEVEL_DEFAULT("DS9490 %s was NOT closed?", DEVICENAME(in)); return gbBAD ; } DS9490_port_setup( dev, in->pown ) ; if ( BAD( DS9490_open( in ) ) ) { STAT_ADD1_BUS(e_bus_open_errors, in); return gbBAD ; } else if ( BAD( DS9490_setup_adapter(in)) ) { LEVEL_DEFAULT("Error setting up USB DS9490 bus master at %s.", DEVICENAME(in)); DS9490_close( in ) ; return gbBAD ; } DS9490_SetFlexParameters(in); return gbGOOD ; } /* ------------------------------------------------------------ */ /* --- USB read and write --------------------------------------*/ static GOOD_OR_BAD DS9490_sendback_data(const BYTE * const_data, BYTE * resp, size_t len, const struct parsedname *pn) { size_t location = 0 ; BYTE data[len] ; // to avoid const problem memcpy( data, const_data, len ) ; while ( location < len ) { BYTE buffer[ DS9490_getstatus_BUFFER_LENGTH + 1 ]; int readlen ; size_t block = len - location ; if ( block > USB_FIFO_EACH ) { block = USB_FIFO_EACH ; } if ( DS9490_write( &data[location], block, pn) < (int) block) { LEVEL_DATA("USBsendback bulk write problem"); return gbBAD; } // COMM_BLOCK_IO | COMM_IM | COMM_F == 0x0075 readlen = block ; if (( BAD( USB_Control_Msg(COMM_CMD, COMM_BLOCK_IO | COMM_IM | COMM_F, block, pn)) ) || ( DS9490_getstatus(buffer, &readlen, pn) != BUS_RESET_OK ) // wait for len bytes ) { LEVEL_DATA("USBsendback control error"); STAT_ADD1_BUS(e_bus_errors, pn->selected_connection); return gbBAD; } if ( DS9490_read( &resp[location], block, pn) < 0) { LEVEL_DATA("USBsendback bulk read error"); return gbBAD; } location += block ; } return gbGOOD; } /* ------------------------------------------------------------ */ /* --- USB Power byte for temperature conversion ---------------*/ // Send 8 bits of communication to the 1-Wire Net and read the // 8 bits back from the 1-Wire Net. // The parameter 'byte' least significant 8 bits are used. After the // 8 bits are sent change the level of the 1-Wire net. // Delay delay msec and return to normal static GOOD_OR_BAD DS9490_PowerByte(BYTE byte, BYTE * resp, UINT delay, const struct parsedname *pn) { LEVEL_DATA("DS9490_PowerByte start"); /* This is more likely to be the correct way to handle powerbytes */ if ( BAD( USB_Control_Msg(COMM_CMD, COMM_BYTE_IO | COMM_IM | COMM_SPU, byte & 0xFF, pn)) ) { DS9490_HaltPulse(pn); return gbBAD ; } else if ( DS9490_read(resp, 1, pn) < 0) { /* Read back the result (may be the same as "byte") */ DS9490_HaltPulse(pn); return gbBAD ; } /* Delay with strong pullup */ LEVEL_DEBUG("DS9490_PowerByte DELAY:%d", delay); UT_delay(delay); DS9490_HaltPulse(pn); return gbGOOD ; } /* ------------------------------------------------------------ */ /* --- USB Program Pulse ---------------------------------------*/ static GOOD_OR_BAD DS9490_ProgramPulse(const struct parsedname *pn) { GOOD_OR_BAD ret; // set pullup to strong5 or program // set the strong pullup duration to infinite ret = USB_Control_Msg(COMM_CMD, COMM_PULSE | COMM_TYPE | COMM_IM, 0, pn); if ( GOOD(ret) ) { UT_delay_us(520); // 520 usec (480 usec would be enough) } if ( BAD(DS9490_HaltPulse(pn)) ) { LEVEL_DEBUG("Couldn't reset the program pulse level back to normal"); return gbBAD; } return ret ; } static GOOD_OR_BAD DS9490_HaltPulse(const struct parsedname *pn) { BYTE buffer[ DS9490_getstatus_BUFFER_LENGTH + 1 ]; struct timeval tv; struct timeval tvtarget; struct timeval tvlimit = { 0, 300000 } ; // 300 millisec from PDKit /ib/other/libUSB/libusbds2490.c if ( timernow( &tv ) < 0) { return gbBAD; } timeradd( &tv, &tvlimit, &tvtarget ) ; do { int readlen = -1 ; if ( BAD(USB_Control_Msg(CONTROL_CMD, CTL_HALT_EXE_IDLE, 0, pn)) ) { break; } if ( BAD(USB_Control_Msg(CONTROL_CMD, CTL_RESUME_EXE, 0, pn)) ) { break; } /* Can't wait for STATUSFLAGS_IDLE... just get first availalbe status flag */ if ( DS9490_getstatus(buffer, &readlen, pn) != BUS_RESET_OK ) { break; } // check the SPU flag if (!(buffer[8] & STATUSFLAGS_SPUA)) { return gbGOOD; } if ( timernow( &tv ) < 0) { return gbBAD; } } while ( timercmp( &tv, &tvtarget, >) ) ; LEVEL_DATA("DS9490_HaltPulse timeout"); return gbBAD; } /* ------------------------------------------------------------ */ /* --- USB Various Parameters ----------------------------------*/ static GOOD_OR_BAD DS9490_SetSpeed(const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; int ret = 0; // in case timeout value changed (via settings) -- sec -> msec in->master.usb.timeout = 1000 * Globals.timeout_usb; // Failed overdrive, switch to slow if (in->changed_bus_settings | CHANGED_USB_SPEED) { in->changed_bus_settings ^= CHANGED_USB_SPEED ; if (in->overdrive) { if ( BAD(DS9490_overdrive(pn)) ) { ++ ret; in->overdrive = 0 ; } else { LEVEL_DATA("set overdrive speed"); } } else if ( in->flex ) { if ( BAD(USB_Control_Msg(MODE_CMD, MOD_1WIRE_SPEED, ONEWIREBUSSPEED_FLEXIBLE, pn)) ) { ++ ret; } else { LEVEL_DATA("set flexible speed"); } } else { if ( BAD(USB_Control_Msg(MODE_CMD, MOD_1WIRE_SPEED, ONEWIREBUSSPEED_REGULAR, pn)) ) { ++ ret; } else { LEVEL_DATA("set regular speed"); } } } if (in->changed_bus_settings | CHANGED_USB_SLEW) { in->changed_bus_settings ^= CHANGED_USB_SLEW ; /* Slew Rate */ if ( BAD(USB_Control_Msg(MODE_CMD, MOD_PULLDOWN_SLEWRATE, in->master.usb.pulldownslewrate, pn)) ) { LEVEL_DATA("MOD_PULLDOWN_SLEWRATE error"); ++ret; } } if (in->changed_bus_settings | CHANGED_USB_LOW) { in->changed_bus_settings ^= CHANGED_USB_LOW ; /* Low Time */ if ( BAD(USB_Control_Msg(MODE_CMD, MOD_WRITE1_LOWTIME, in->master.usb.writeonelowtime, pn)) ) { LEVEL_DATA("MOD_WRITE1_LOWTIME error"); ++ret; } } if (in->changed_bus_settings | CHANGED_USB_OFFSET) { in->changed_bus_settings ^= CHANGED_USB_OFFSET ; /* DS0 Low */ if ( BAD(USB_Control_Msg(MODE_CMD, MOD_DSOW0_TREC, in->master.usb.datasampleoffset, pn)) ) { LEVEL_DATA("MOD_DS0W0 error"); ++ret; } } return ret>0 ? gbBAD : gbGOOD; } // Switch to overdrive speed -- 3 tries static GOOD_OR_BAD DS9490_overdrive(const struct parsedname *pn) { BYTE sp = _1W_OVERDRIVE_SKIP_ROM; BYTE resp = 0; int i; // we need to change speed to overdrive for (i = 0; i < 3; i++) { LEVEL_DATA("set overdrive speed. Attempt %d",i); if ( BAD( gbRESET(BUS_reset(pn)) ) ) { continue; } if ( BAD( DS9490_sendback_data(&sp, &resp, 1, pn) ) || (_1W_OVERDRIVE_SKIP_ROM != resp) ) { LEVEL_DEBUG("error setting overdrive %.2X/0x%02X", _1W_OVERDRIVE_SKIP_ROM, resp); continue; } if ( GOOD( USB_Control_Msg(MODE_CMD, MOD_1WIRE_SPEED, ONEWIREBUSSPEED_OVERDRIVE, pn)) ) { LEVEL_DEBUG("speed is now set to overdrive"); return gbGOOD; } } LEVEL_DEBUG("Error setting overdrive after 3 retries"); return gbBAD; } static GOOD_OR_BAD DS9490_setup_adapter(struct connection_in * in) { struct parsedname s_pn; struct parsedname * pn = &s_pn ; BYTE buffer[ DS9490_getstatus_BUFFER_LENGTH + 1 ]; int readlen = 0 ; FS_ParsedName_Placeholder(pn); // minimal parsename -- no destroy needed pn->selected_connection = in; // reset the device (not the 1-wire bus) if ( BAD(USB_Control_Msg(CONTROL_CMD, CTL_RESET_DEVICE, 0x0000, pn))) { LEVEL_DATA("ResetDevice error"); return gbBAD; } // set the strong pullup duration to infinite if ( BAD( USB_Control_Msg(COMM_CMD, COMM_SET_DURATION | COMM_IM, 0x0000, pn)) ) { LEVEL_DATA("StrongPullup error"); return gbBAD; } // set the 12V pullup duration to 512us if ( BAD( USB_Control_Msg(COMM_CMD, COMM_SET_DURATION | COMM_IM | COMM_TYPE, PROGRAM_PULSE_DURATION_CODE, pn)) ) { LEVEL_DATA("12VPullup error"); return gbBAD; } // enable both program and strong pulses if ( BAD( USB_Control_Msg(MODE_CMD, MOD_PULSE_EN, ENABLE_PROGRAM_AND_PULSE, pn)) ) { LEVEL_DATA("EnableProgram error"); return gbBAD; } // enable speed changes if ( BAD( USB_Control_Msg(MODE_CMD, MOD_SPEED_CHANGE_EN, 1, pn)) ) { LEVEL_DATA("SpeedEnable error"); return gbBAD; } if ( DS9490_getstatus(buffer, &readlen, pn) != BUS_RESET_OK ) { LEVEL_DATA("getstatus failed error"); return gbBAD; } return gbGOOD; } static void DS9490_SetFlexParameters(struct connection_in *in) { /* in regular and overdrive speed, slew rate is 15V/us. It's only * suitable for short 1-wire busses. Use flexible speed instead. */ // default values for bus-timing when using --altUSB if (Globals.altUSB) { in->master.usb.pulldownslewrate = PARMSET_Slew1p37Vus; in->master.usb.writeonelowtime = PARMSET_W1L_06us; in->master.usb.datasampleoffset = PARMSET_DS0_W0R_20us; } else { /* This seem to be the default value when reseting the ds2490 chip */ // Change by Michael Markstaller from datasheet in->master.usb.pulldownslewrate = PARMSET_Slew1p10Vus; // in->master.usb.pulldownslewrate = PARMSET_Slew0p83Vus; in->master.usb.writeonelowtime = PARMSET_W1L_08us; in->master.usb.datasampleoffset = PARMSET_DS0_W0R_18us; } in->changed_bus_settings |= CHANGED_USB_SLEW | CHANGED_USB_LOW | CHANGED_USB_OFFSET ; } #endif /* OW_USB */ owfs-3.1p5/module/owlib/src/c/ow_eds.c0000644000175000001440000032015512654730021014561 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_eds.h" /* ------- Prototypes ----------- */ READ_FUNCTION(FS_r_page); WRITE_FUNCTION(FS_w_page); READ_FUNCTION(FS_r_mem); WRITE_FUNCTION(FS_w_mem); READ_FUNCTION(FS_r_tag); READ_FUNCTION(FS_r_type); READ_FUNCTION(FS_r_float16); READ_FUNCTION(FS_r_i8) ; WRITE_FUNCTION(FS_w_i8) ; READ_FUNCTION(FS_r_8) ; WRITE_FUNCTION(FS_w_8) ; READ_FUNCTION(FS_r_16) ; WRITE_FUNCTION(FS_w_16) ; READ_FUNCTION(FS_r_24) ; WRITE_FUNCTION(FS_w_24) ; READ_FUNCTION(FS_r_32) ; READ_FUNCTION(FS_r_float8) ; WRITE_FUNCTION(FS_w_float8) ; READ_FUNCTION(FS_r_float24) ; WRITE_FUNCTION(FS_w_float24) ; READ_FUNCTION(FS_r_voltage) ; WRITE_FUNCTION(FS_w_voltage) ; READ_FUNCTION(FS_r_vlimit) ; WRITE_FUNCTION(FS_w_vlimit) ; READ_FUNCTION(FS_r_current) ; WRITE_FUNCTION(FS_w_current) ; READ_FUNCTION(FS_r_climit) ; WRITE_FUNCTION(FS_w_climit) ; WRITE_FUNCTION(FS_clear); /* Extensive testing of the EDS0068 threshold writing shows a delay * is needed before a written value is readable */ #define _EDS_WRITE_DELAY_msec 700 #define _EDS_WRITE_SCRATCHPAD 0x0F #define _EDS_READ_SCRATCHPAD 0xAA #define _EDS_COPY_SCRATCHPAD 0x55 #define _EDS_READ_MEMMORY_NO_CRC 0xF0 #define _EDS_READ_MEMORY_WITH_CRC 0xA5 #define _EDS_CLEAR_ALARMS 0x33 #define _EDS_PAGES 3 #define _EDS_8X_PAGES 5 #define _EDS_PAGESIZE 32 /* EDS0064 locations */ #define _EDS0064_Temp 0x22 // 16 bit float #define _EDS0064_Humidity 0x24 // 16 bit float #define _EDS0064_Dew 0x26 // 16 bit float #define _EDS0064_Humidex 0x28 // 16 bit float #define _EDS0064_Hindex 0x2A // 16 bit float #define _EDS0064_mbar 0x2C // 24 bit float #define _EDS0064_inHg 0x2F // 24 bit float #define _EDS0064_Lux 0x32 // uint24 #define _EDS0064_Alarm_state 0x3A // uint16 #define _EDS0064_Seconds_counter 0x3C // uint32 #define _EDS0064_Conditional_search 0x40 // uint16 #define _EDS0064_Temp_hi 0x42 // int8 #define _EDS0064_Temp_lo 0x43 // int8 #define _EDS0064_Hum_hi 0x44 // int8 #define _EDS0064_Hum_lo 0x45 // int8 #define _EDS0064_Dew_hi 0x46 // int8 #define _EDS0064_Dew_lo 0x47 // int8 #define _EDS0064_Hdex_hi 0x48 // int8 #define _EDS0064_Hdex_lo 0x49 // int8 #define _EDS0064_HI_hi 0x4A // int8 #define _EDS0064_HI_lo 0x4B // int8 #define _EDS0064_mbar_hi 0x4C // 24 bit float #define _EDS0064_mbar_lo 0x4F // 24 bit float #define _EDS0064_inHg_hi 0x52 // 24 bit float #define _EDS0064_inHg_lo 0x55 // 24 bit float #define _EDS0064_Lux_hi 0x58 // uint24 #define _EDS0064_Lux_lo 0x5B // uint24 #define _EDS0064_Relay_function 0x5E // byte #define _EDS0064_Relay_state 0x5F // byte /* EDS0070 locations */ #define _EDS0070_Tag 0x00 // 30 chars #define _EDS0070_ID 0x1E // uint16 #define _EDS0070_Vib_level 0x24 // uint24 #define _EDS0070_Vib_peak 0x26 // uint24 #define _EDS0070_Vib_max 0x28 // uint24 #define _EDS0070_Vib_min 0x30 // uint24 #define _EDS0070_Calibration 0x30 // uint32 //#define _EDS0070_Relay_state 0x35 // byte #define _EDS0070_Alarm_state 0x36 // byte #define _EDS0070_Seconds_counter 0x3C // uint32 #define _EDS0070_Conditional_search 0x40 // byte #define _EDS0070_Vib_hi 0x44 // 24bit float #define _EDS0070_Vib_lo 0x46 // 24bit float #define _EDS0070_Relay_function 0x5E // byte #define _EDS0070_Relay_state 0x5F // byte /* EDS0071 locations */ #define _EDS0071_Tag 0x00 // 30 chars #define _EDS0071_ID 0x1E // uint16 #define _EDS0071_Temp 0x22 // 24bit float #define _EDS0071_RTD 0x25 // 24bit float #define _EDS0071_Conversion 0x28 // uint24 #define _EDS0071_Calibration 0x30 // uint32 //#define _EDS0071_Relay_state 0x35 // byte #define _EDS0071_Alarm_state 0x36 // byte #define _EDS0071_Conversion_counter 0x38 // uint32 #define _EDS0071_Seconds_counter 0x3C // uint32 #define _EDS0071_Conditional_search 0x40 // byte #define _EDS0071_free_byte 0x41 // byte #define _EDS0071_Temp_hi 0x42 // 24bit float #define _EDS0071_Temp_lo 0x45 // 24bit float #define _EDS0071_RTD_hi 0x48 // 24bit float #define _EDS0071_RTD_lo 0x4B // 24bit float #define _EDS0071_Calibration_key 0x5C // byte #define _EDS0071_RTD_delay 0x5D // byte #define _EDS0071_Relay_function 0x5E // byte #define _EDS0071_Relay_state 0x5F // byte /* EDS0082 locations */ #define _EDS0082_Tag 0x00 // 30 chars #define _EDS0082_ID 0x1E // uint16 #define _EDS0082_Alarm_state 0x2A // byte #define _EDS0082_Seconds_counter 0x2C // uint32 #define _EDS0082_level 0x30 // uint16 * 8 #define _EDS0082_min 0x40 // uint16 * 8 #define _EDS0082_max 0x50 // uint16 * 8 #define _EDS0082_Threshold_hi 0x70 // uint16 * 16 #define _EDS0082_Threshold_lo 0x72 // uint16 * 16 #define _EDS0082_Conditional_search 0x9A // uint16 #define _EDS0082_Relay_function 0x9E // byte #define _EDS0082_Relay_state 0x9F // byte /* EDS0090 locations */ #define _EDS0090_Tag 0x00 // 30 chars #define _EDS0090_ID 0x1E // uint16 #define _EDS0090_Input_state 0x22 // byte #define _EDS0090_Latch_state 0x23 // byte #define _EDS0090_Output_state 0x24 // byte #define _EDS0090_Pulldown_state 0x25 // byte #define _EDS0090_Alarm_state 0x2A // byte #define _EDS0090_Seconds_counter 0x2C // uint32 #define _EDS0090_Pulse_counter 0x30 // uint32 * 8 #define _EDS0090_Conditional_search 0x50 // uint16 #define _EDS0090_Pulse_reset 0x54 // byte #define _EDS0090_Latch_reset 0x55 // byte #define _EDS0090_Alarm_value 0x58 // uint16 #define _EDS0090_Pulldown_value 0x5B // byte #define _EDS0090_Output_value 0x5C // byte #define _EDS0090_Relay_function 0x5E // byte #define _EDS0090_Relay_state 0x5F // byte static enum e_visibility VISIBLE_EDS0064( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0065( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0066( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0067( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0068( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0070( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0071( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0072( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0080( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0082( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0083( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0085( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EDS0090( const struct parsedname * pn ) ; //static enum e_visibility VISIBLE_EDS0091( const struct parsedname * pn ) ; //static enum e_visibility VISIBLE_EDS0092( const struct parsedname * pn ) ; #define _EDS_TAG_LENGTH 30 #define _EDS_TYPE_LENGTH 7 // struct bitfield { "alias_link", number_of_bits, shift_left, } static struct bitfield eds0064_cond_temp_hi = { "EDS0064/set_alarm/alarm_function", 1, 0, } ; static struct bitfield eds0064_cond_temp_lo = { "EDS0064/set_alarm/alarm_function", 1, 1, } ; static struct bitfield eds0064_cond_hum_hi = { "EDS0064/set_alarm/alarm_function", 1, 2, } ; static struct bitfield eds0064_cond_hum_lo = { "EDS0064/set_alarm/alarm_function", 1, 3, } ; static struct bitfield eds0064_cond_dp_hi = { "EDS0064/set_alarm/alarm_function", 1, 4, } ; static struct bitfield eds0064_cond_dp_lo = { "EDS0064/set_alarm/alarm_function", 1, 5, } ; static struct bitfield eds0064_cond_hdex_hi = { "EDS0064/set_alarm/alarm_function", 1, 6, } ; static struct bitfield eds0064_cond_hdex_lo = { "EDS0064/set_alarm/alarm_function", 1, 7, } ; static struct bitfield eds0064_cond_hindex_hi = { "EDS0064/set_alarm/alarm_function", 1, 8, } ; static struct bitfield eds0064_cond_hindex_lo = { "EDS0064/set_alarm/alarm_function", 1, 9, } ; static struct bitfield eds0064_cond_mbar_hi = { "EDS0064/set_alarm/alarm_function", 1, 10, } ; static struct bitfield eds0064_cond_mbar_lo = { "EDS0064/set_alarm/alarm_function", 1, 11, } ; static struct bitfield eds0064_cond_inHg_hi = { "EDS0064/set_alarm/alarm_function", 1, 12, } ; static struct bitfield eds0064_cond_inHg_lo = { "EDS0064/set_alarm/alarm_function", 1, 13, } ; static struct bitfield eds0064_cond_lux_hi = { "EDS0064/set_alarm/alarm_function", 1, 14, } ; static struct bitfield eds0064_cond_lux_lo = { "EDS0064/set_alarm/alarm_function", 1, 15, } ; static struct bitfield eds0064_temp_hi = { "EDS0064/alarm/state", 1, 0, } ; static struct bitfield eds0064_temp_lo = { "EDS0064/alarm/state", 1, 1, } ; static struct bitfield eds0064_hum_hi = { "EDS0064/alarm/state", 1, 2, } ; static struct bitfield eds0064_hum_lo = { "EDS0064/alarm/state", 1, 3, } ; static struct bitfield eds0064_dp_hi = { "EDS0064/alarm/state", 1, 4, } ; static struct bitfield eds0064_dp_lo = { "EDS0064/alarm/state", 1, 5, } ; static struct bitfield eds0064_hdex_hi = { "EDS0064/alarm/state", 1, 6, } ; static struct bitfield eds0064_hdex_lo = { "EDS0064/alarm/state", 1, 7, } ; static struct bitfield eds0064_hindex_hi = { "EDS0064/alarm/state", 1, 8, } ; static struct bitfield eds0064_hindex_lo = { "EDS0064/alarm/state", 1, 9, } ; static struct bitfield eds0064_mbar_hi = { "EDS0064/alarm/state", 1, 10, } ; static struct bitfield eds0064_mbar_lo = { "EDS0064/alarm/state", 1, 11, } ; static struct bitfield eds0064_inHg_hi = { "EDS0064/alarm/state", 1, 12, } ; static struct bitfield eds0064_inHg_lo = { "EDS0064/alarm/state", 1, 13, } ; static struct bitfield eds0064_lux_hi = { "EDS0064/alarm/state", 1, 14, } ; static struct bitfield eds0064_lux_lo = { "EDS0064/alarm/state", 1, 15, } ; static struct bitfield eds0064_relay_state = { "EDS0064/relay_state", 1, 0, } ; static struct bitfield eds0064_led_state = { "EDS0064/relay_state", 1, 1, } ; static struct bitfield eds0064_relay_function = { "EDS0064/relay_function", 2, 0, } ; static struct bitfield eds0064_led_function = { "EDS0064/relay_function", 2, 2, } ; // struct bitfield { "alias_link", number_of_bits, shift_left, } static struct bitfield eds0070_cond_vib_hi = { "EDS0070/set_alarm/alarm_function", 1, 2, } ; static struct bitfield eds0070_cond_vib_lo = { "EDS0070/set_alarm/alarm_function", 1, 3, } ; static struct bitfield eds0070_vib_hi = { "EDS0070/alarm/state", 1, 2, } ; static struct bitfield eds0070_vib_lo = { "EDS0070/alarm/state", 1, 3, } ; static struct bitfield eds0070_relay_state = { "EDS0070/relay_state", 1, 0, } ; static struct bitfield eds0070_led_state = { "EDS0070/relay_state", 1, 1, } ; static struct bitfield eds0070_relay_function = { "EDS0070/relay_function", 2, 0, } ; static struct bitfield eds0070_led_function = { "EDS0070/relay_function", 2, 2, } ; // struct bitfield { "alias_link", number_of_bits, shift_left, } static struct bitfield eds0071_cond_temp_hi = { "EDS0071/set_alarm/alarm_function", 1, 0, } ; static struct bitfield eds0071_cond_temp_lo = { "EDS0071/set_alarm/alarm_function", 1, 1, } ; static struct bitfield eds0071_cond_RTD_hi = { "EDS0071/set_alarm/alarm_function", 1, 2, } ; static struct bitfield eds0071_cond_RTD_lo = { "EDS0071/set_alarm/alarm_function", 1, 3, } ; static struct bitfield eds0071_temp_hi = { "EDS0071/alarm/state", 1, 0, } ; static struct bitfield eds0071_temp_lo = { "EDS0071/alarm/state", 1, 1, } ; static struct bitfield eds0071_RTD_hi = { "EDS0071/alarm/state", 1, 2, } ; static struct bitfield eds0071_RTD_lo = { "EDS0071/alarm/state", 1, 3, } ; static struct bitfield eds0071_relay_state = { "EDS0071/relay_state", 1, 0, } ; static struct bitfield eds0071_led_state = { "EDS0071/relay_state", 1, 1, } ; static struct bitfield eds0071_relay_function = { "EDS0071/relay_function", 2, 0, } ; static struct bitfield eds0071_led_function = { "EDS0071/relay_function", 2, 2, } ; // struct bitfield { "alias_link", number_of_bits, shift_left, } static struct bitfield eds0082_alarm_hi = { "EDS0082/alarm/state", 2, 0, } ; static struct bitfield eds0082_alarm_lo = { "EDS0082/alarm/state", 2, 1, } ; static struct bitfield eds0082_conditional_hi = { "EDS0082/set_alarm/alarm_function", 2, 0, } ; static struct bitfield eds0082_conditional_lo = { "EDS0082/set_alarm/alarm_function", 2, 1, } ; static struct bitfield eds0082_relay_state = { "EDS0082/relay_state", 1, 0, } ; static struct bitfield eds0082_led_state = { "EDS0082/relay_state", 1, 1, } ; static struct bitfield eds0082_relay_function = { "EDS0082/relay_function", 2, 0, } ; static struct bitfield eds0082_led_function = { "EDS0082/relay_function", 2, 2, } ; // struct bitfield { "alias_link", number_of_bits, shift_left, } static struct bitfield eds0090_cond_hi = { "EDS0090/set_alarm/alarm_function", 1, 0, } ; static struct bitfield eds0090_cond_lo = { "EDS0090/set_alarm/alarm_function", 1, 1, } ; static struct bitfield eds0090_alarm_hi = { "EDS0090/alarm/state", 1, 0, } ; static struct bitfield eds0090_alarm_lo = { "EDS0090/alarm/state", 1, 1, } ; static struct bitfield eds0090_relay_state = { "EDS0090/relay_state", 1, 0, } ; static struct bitfield eds0090_led_state = { "EDS0090/relay_state", 1, 1, } ; static struct bitfield eds0090_relay_function = { "EDS0090/relay_function", 2, 0, } ; static struct bitfield eds0090_led_function = { "EDS0090/relay_function", 2, 2, } ; /* ------- Structures ----------- */ static struct aggregate AEDS = { _EDS_PAGES, ag_numbers, ag_separate, }; static struct aggregate AEDS_8X = { _EDS_8X_PAGES, ag_numbers, ag_separate, }; static struct aggregate AEDS_82_data = { 8, ag_numbers, ag_separate, }; // 8 voltages static struct aggregate AEDS_82_limit = { 8*2, ag_numbers, ag_separate, }; // 8 voltages hi/lo static struct aggregate AEDS_82_state = { 8, ag_numbers, ag_aggregate, }; // 8 states static struct aggregate AEDS_85_data = { 4, ag_numbers, ag_separate, }; // 4 voltages static struct aggregate AEDS_85_limit = { 4*2, ag_numbers, ag_separate, }; // 4 voltages hi/lo static struct aggregate AEDS_85_state = { 4, ag_numbers, ag_aggregate, }; // 4 states static struct aggregate AEDS_90_state = { 8, ag_numbers, ag_aggregate, }; // 8 bits static struct aggregate AEDS_90_inputs = { 8, ag_numbers, ag_separate, }; // 8 inputs static struct filetype EDS[] = { F_STANDARD, {"memory", _EDS_PAGES * _EDS_PAGESIZE, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE, NO_FILETYPE_DATA, }, {"pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"pages/page", _EDS_PAGESIZE, &AEDS, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE, NO_FILETYPE_DATA, }, {"tag", _EDS_TAG_LENGTH, NON_AGGREGATE, ft_ascii, fc_stable, FS_r_tag, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"device_type", _EDS_TYPE_LENGTH, NON_AGGREGATE, ft_ascii, fc_link, FS_r_type, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"device_id", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_16, NO_WRITE_FUNCTION, VISIBLE, {.u= _EDS0071_ID,}, }, /* EDS 0064 */ {"EDS0064", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0064, NO_FILETYPE_DATA, }, {"EDS0064/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0064, {.u= _EDS0064_Temp,}, }, {"EDS0064/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0064, NO_FILETYPE_DATA, }, {"EDS0064/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0064, {.u= _EDS0064_Seconds_counter,}, }, {"EDS0064/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_function,}, }, {"EDS0064/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_state,}, }, {"EDS0064/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0064, NO_FILETYPE_DATA, }, {"EDS0064/set_alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0064, {.v= &eds0064_cond_temp_hi,}, }, {"EDS0064/set_alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0064, {.v= &eds0064_cond_temp_lo,}, }, {"EDS0064/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, INVISIBLE, {.u= _EDS0064_Conditional_search,}, }, {"EDS0064/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0064, NO_FILETYPE_DATA, }, {"EDS0064/threshold/temp_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0064, {.u= _EDS0064_Temp_hi,}, }, {"EDS0064/threshold/temp_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0064, {.u= _EDS0064_Temp_lo,}, }, {"EDS0064/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0064, NO_FILETYPE_DATA, }, {"EDS0064/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0064, NO_FILETYPE_DATA, }, {"EDS0064/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0064_Alarm_state,}, }, {"EDS0064/alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0064, {.v= &eds0064_temp_hi,}, }, {"EDS0064/alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0064, {.v= &eds0064_temp_lo,}, }, {"EDS0064/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0064, NO_FILETYPE_DATA, }, {"EDS0064/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0064, {.v= &eds0064_relay_state,}, }, {"EDS0064/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0064, {.v= &eds0064_relay_function,}, }, {"EDS0064/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0064, NO_FILETYPE_DATA, }, {"EDS0064/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0064, {.v= &eds0064_led_state,}, }, {"EDS0064/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0064, {.v= &eds0064_led_function,}, }, /* EDS 0065 */ {"EDS0065", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0065, NO_FILETYPE_DATA, }, {"EDS0065/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.u= _EDS0064_Temp,}, }, {"EDS0065/humidity", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.u= _EDS0064_Humidity,}, }, {"EDS0065/dew_point", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.u= _EDS0064_Dew,}, }, {"EDS0065/humidex", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.u= _EDS0064_Humidex,}, }, {"EDS0065/heat_index", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.u= _EDS0064_Hindex,}, }, {"EDS0065/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_function,}, }, {"EDS0065/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_state,}, }, {"EDS0065/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0065, NO_FILETYPE_DATA, }, {"EDS0065/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.u= _EDS0064_Seconds_counter,}, }, {"EDS0065/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0065, NO_FILETYPE_DATA, }, {"EDS0065/set_alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_temp_hi,}, }, {"EDS0065/set_alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_temp_lo,}, }, {"EDS0065/set_alarm/humidity_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_hum_hi,}, }, {"EDS0065/set_alarm/humidity_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_hum_lo,}, }, {"EDS0065/set_alarm/humidex_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_hdex_hi,}, }, {"EDS0065/set_alarm/humidex_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_hdex_lo,}, }, {"EDS0065/set_alarm/heat_index_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_hindex_hi,}, }, {"EDS0065/set_alarm/heat_index_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_hindex_lo,}, }, {"EDS0065/set_alarm/dew_point_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_dp_hi,}, }, {"EDS0065/set_alarm/dew_point_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_cond_dp_lo,}, }, {"EDS0065/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, INVISIBLE, {.u= _EDS0064_Conditional_search,}, }, {"EDS0065/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0065, NO_FILETYPE_DATA, }, {"EDS0065/threshold/temp_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0065, {.u= _EDS0064_Temp_hi,}, }, {"EDS0065/threshold/temp_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0065, {.u= _EDS0064_Temp_lo,}, }, {"EDS0065/threshold/humidity_hi" , PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_i8, FS_w_i8, VISIBLE_EDS0065, {.u= _EDS0064_Hum_hi,}, }, {"EDS0065/threshold/humidity_low", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_i8, FS_w_i8, VISIBLE_EDS0065, {.u= _EDS0064_Hum_lo,}, }, {"EDS0065/threshold/dew_point_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0065, {.u= _EDS0064_Dew_hi,}, }, {"EDS0065/threshold/dew_point_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0065, {.u= _EDS0064_Dew_lo,}, }, {"EDS0065/threshold/heat_index_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0065, {.u= _EDS0064_HI_hi,}, }, {"EDS0065/threshold/heat_index_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0065, {.u= _EDS0064_HI_lo,}, }, {"EDS0065/threshold/humidex_hi" , PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0065, {.u= _EDS0064_Hdex_hi,}, }, {"EDS0065/threshold/humidex_low", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0065, {.u= _EDS0064_Hdex_lo,}, }, {"EDS0065/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0065, NO_FILETYPE_DATA, }, {"EDS0065/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0065, NO_FILETYPE_DATA, }, {"EDS0065/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0064_Alarm_state,}, }, {"EDS0065/alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0071_temp_hi,}, }, {"EDS0065/alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0064_temp_lo,}, }, {"EDS0065/alarm/humidity_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0064_hum_hi,}, }, {"EDS0065/alarm/humidity_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0064_hum_lo,}, }, {"EDS0065/alarm/humidex_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0064_hdex_hi,}, }, {"EDS0065/alarm/humidex_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0064_hdex_lo,}, }, {"EDS0065/alarm/heat_index_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0064_hindex_hi,}, }, {"EDS0065/alarm/heat_index_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0064_hindex_lo,}, }, {"EDS0065/alarm/dew_point_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0064_dp_hi,}, }, {"EDS0065/alarm/dew_point_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0065, {.v= &eds0064_dp_lo,}, }, {"EDS0065/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0065, NO_FILETYPE_DATA, }, {"EDS0065/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_relay_state,}, }, {"EDS0065/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_relay_function,}, }, {"EDS0065/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0065, NO_FILETYPE_DATA, }, {"EDS0065/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_led_state,}, }, {"EDS0065/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0065, {.v= &eds0064_led_function,}, }, /* EDS 0066 */ {"EDS0066", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0066, NO_FILETYPE_DATA, }, {"EDS0066/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.u= _EDS0064_Temp,}, }, {"EDS0066/pressure", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_volatile, FS_r_float24, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.u= _EDS0064_mbar,}, }, {"EDS0066/inHg", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_float24, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.u= _EDS0064_inHg,}, }, {"EDS0066/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_function,}, }, {"EDS0066/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_state,}, }, {"EDS0066/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0066, NO_FILETYPE_DATA, }, {"EDS0066/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.u= _EDS0064_Seconds_counter,}, }, {"EDS0066/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0066, NO_FILETYPE_DATA, }, {"EDS0066/set_alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_cond_temp_hi,}, }, {"EDS0066/set_alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_cond_temp_lo,}, }, {"EDS0066/set_alarm/pressure_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_cond_mbar_hi,}, }, {"EDS0066/set_alarm/pressure_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_cond_mbar_lo,}, }, {"EDS0066/set_alarm/inHg_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_cond_inHg_hi,}, }, {"EDS0066/set_alarm/inHg_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_cond_inHg_lo,}, }, {"EDS0066/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, INVISIBLE, {.u= _EDS0064_Conditional_search,}, }, {"EDS0066/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0066, NO_FILETYPE_DATA, }, {"EDS0066/threshold/temp_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0066, {.u= _EDS0064_Temp_hi,}, }, {"EDS0066/threshold/temp_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0066, {.u= _EDS0064_Temp_lo,}, }, {"EDS0066/threshold/pressure_hi" , PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0066, {.u= _EDS0064_mbar_hi,}, }, {"EDS0066/threshold/pressure_low", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0066, {.u= _EDS0064_mbar_lo,}, }, {"EDS0066/threshold/inHg_hi" , PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0066, {.u= _EDS0064_inHg_hi,}, }, {"EDS0066/threshold/inHg_low", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0066, {.u= _EDS0064_inHg_lo,}, }, {"EDS0066/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0066, NO_FILETYPE_DATA, }, {"EDS0066/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0066, NO_FILETYPE_DATA, }, {"EDS0066/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0064_Alarm_state,}, }, {"EDS0066/alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.v= &eds0064_temp_hi,}, }, {"EDS0066/alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.v= &eds0064_temp_lo,}, }, {"EDS0066/alarm/pressure_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.v= &eds0064_mbar_hi,}, }, {"EDS0066/alarm/pressure_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.v= &eds0064_mbar_lo,}, }, {"EDS0066/alarm/inHg_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.v= &eds0064_inHg_hi,}, }, {"EDS0066/alarm/inHg_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0066, {.v= &eds0064_inHg_lo,}, }, {"EDS0066/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0066, NO_FILETYPE_DATA, }, {"EDS0066/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_relay_state,}, }, {"EDS0066/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_relay_function,}, }, {"EDS0066/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0066, NO_FILETYPE_DATA, }, {"EDS0066/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_led_state,}, }, {"EDS0066/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0066, {.v= &eds0064_led_function,}, }, /* EDS 0067 */ {"EDS0067", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0067, NO_FILETYPE_DATA, }, {"EDS0067/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0067, {.u= _EDS0064_Temp,}, }, {"EDS0067/light", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_24, NO_WRITE_FUNCTION, VISIBLE_EDS0067, {.u= _EDS0064_Lux,}, }, {"EDS0067/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_function,}, }, {"EDS0067/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_state,}, }, {"EDS0067/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0067, NO_FILETYPE_DATA, }, {"EDS0067/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0067, {.u= _EDS0064_Seconds_counter,}, }, {"EDS0067/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0067, NO_FILETYPE_DATA, }, {"EDS0067/set_alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0067, {.v= &eds0064_cond_temp_hi,}, }, {"EDS0067/set_alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0067, {.v= &eds0064_cond_temp_lo,}, }, {"EDS0067/set_alarm/light_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0067, {.v= &eds0064_cond_lux_hi,}, }, {"EDS0067/set_alarm/light_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0067, {.v= &eds0064_cond_lux_lo,}, }, {"EDS0067/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, INVISIBLE, {.u= _EDS0064_Conditional_search,}, }, {"EDS0067/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0067, NO_FILETYPE_DATA, }, {"EDS0067/threshold/temp_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0067, {.u= _EDS0064_Temp_hi,}, }, {"EDS0067/threshold/temp_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0067, {.u= _EDS0064_Temp_lo,}, }, {"EDS0067/threshold/light_hi ", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_24, FS_w_24, VISIBLE_EDS0067, {.u= _EDS0064_Lux_hi,}, }, {"EDS0067/threshold/light_low", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_24, FS_w_24, VISIBLE_EDS0067, {.u= _EDS0064_Lux_lo,}, }, {"EDS0067/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0067, NO_FILETYPE_DATA, }, {"EDS0067/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0067, NO_FILETYPE_DATA, }, {"EDS0067/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0064_Alarm_state,}, }, {"EDS0067/alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0067, {.v= &eds0064_temp_hi,}, }, {"EDS0067/alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0067, {.v= &eds0064_temp_lo,}, }, {"EDS0067/alarm/light_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0067, {.v= &eds0064_lux_hi,}, }, {"EDS0067/alarm/light_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0067, {.v= &eds0064_lux_lo,}, }, {"EDS0067/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0067, NO_FILETYPE_DATA, }, {"EDS0067/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0067, {.v= &eds0064_relay_state,}, }, {"EDS0067/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0067, {.v= &eds0064_relay_function,}, }, {"EDS0067/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0067, NO_FILETYPE_DATA, }, {"EDS0067/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0067, {.v= &eds0064_led_state,}, }, {"EDS0067/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0067, {.v= &eds0064_led_function,}, }, /* EDS 0068 */ {"EDS0068", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0068, NO_FILETYPE_DATA, }, {"EDS0068/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.u= _EDS0064_Temp,}, }, {"EDS0068/humidity", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.u= _EDS0064_Humidity,}, }, {"EDS0068/dew_point", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.u= _EDS0064_Dew,}, }, {"EDS0068/humidex", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.u= _EDS0064_Humidex,}, }, {"EDS0068/heat_index", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float16, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.u= _EDS0064_Hindex,}, }, {"EDS0068/pressure", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_volatile, FS_r_float24, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.u= _EDS0064_mbar,}, }, {"EDS0068/inHg", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_float24, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.u= _EDS0064_inHg,}, }, {"EDS0068/light", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_24, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.u= _EDS0064_Lux,}, }, {"EDS0068/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_function,}, }, {"EDS0068/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0064_Relay_state,}, }, {"EDS0068/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0068, NO_FILETYPE_DATA, }, {"EDS0068/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.u= _EDS0064_Seconds_counter,}, }, {"EDS0068/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0068, NO_FILETYPE_DATA, }, {"EDS0068/set_alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_temp_hi,}, }, {"EDS0068/set_alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_temp_lo,}, }, {"EDS0068/set_alarm/humidity_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_hum_hi,}, }, {"EDS0068/set_alarm/humidity_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_hum_lo,}, }, {"EDS0068/set_alarm/humidex_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_hdex_hi,}, }, {"EDS0068/set_alarm/humidex_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_hdex_lo,}, }, {"EDS0068/set_alarm/heat_index_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_hindex_hi,}, }, {"EDS0068/set_alarm/heat_index_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_hindex_lo,}, }, {"EDS0068/set_alarm/dew_point_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_dp_hi,}, }, {"EDS0068/set_alarm/dew_point_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_dp_lo,}, }, {"EDS0068/set_alarm/pressure_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_mbar_hi,}, }, {"EDS0068/set_alarm/pressure_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_mbar_lo,}, }, {"EDS0068/set_alarm/inHg_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_inHg_hi,}, }, {"EDS0068/set_alarm/inHg_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_inHg_lo,}, }, {"EDS0068/set_alarm/light_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_lux_hi,}, }, {"EDS0068/set_alarm/light_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_cond_lux_lo,}, }, {"EDS0068/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, INVISIBLE, {.u= _EDS0064_Conditional_search,}, }, {"EDS0068/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0068, NO_FILETYPE_DATA, }, {"EDS0068/threshold/temp_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_Temp_hi,}, }, {"EDS0068/threshold/temp_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_Temp_lo,}, }, {"EDS0068/threshold/humidity_hi" , PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_Hum_hi,}, }, {"EDS0068/threshold/humidity_low", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_Hum_lo,}, }, {"EDS0068/threshold/dew_point_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_Dew_hi,}, }, {"EDS0068/threshold/dew_point_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_Dew_lo,}, }, {"EDS0068/threshold/heat_index_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_HI_hi,}, }, {"EDS0068/threshold/heat_index_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_HI_lo,}, }, {"EDS0068/threshold/humidex_hi" , PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_Hdex_hi,}, }, {"EDS0068/threshold/humidex_low", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float8, FS_w_float8, VISIBLE_EDS0068, {.u= _EDS0064_Hdex_lo,}, }, {"EDS0068/threshold/pressure_hi" , PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0068, {.u= _EDS0064_mbar_hi,}, }, {"EDS0068/threshold/pressure_low", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0068, {.u= _EDS0064_mbar_lo,}, }, {"EDS0068/threshold/inHg_hi" , PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0068, {.u= _EDS0064_inHg_hi,}, }, {"EDS0068/threshold/inHg_low", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0068, {.u= _EDS0064_inHg_lo,}, }, {"EDS0068/threshold/light_hi" , PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_24, FS_w_24, VISIBLE_EDS0068, {.u= _EDS0064_Lux_hi,}, }, {"EDS0068/threshold/light_low", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_24, FS_w_24, VISIBLE_EDS0068, {.u= _EDS0064_Lux_lo,}, }, {"EDS0068/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0068, NO_FILETYPE_DATA, }, {"EDS0068/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0068, NO_FILETYPE_DATA, }, {"EDS0068/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0064_Alarm_state,}, }, {"EDS0068/alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0071_temp_hi,}, }, {"EDS0068/alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_temp_lo,}, }, {"EDS0068/alarm/humidity_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_hum_hi,}, }, {"EDS0068/alarm/humidity_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_hum_lo,}, }, {"EDS0068/alarm/humidex_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_hdex_hi,}, }, {"EDS0068/alarm/humidex_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_hdex_lo,}, }, {"EDS0068/alarm/heat_index_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_hindex_hi,}, }, {"EDS0068/alarm/heat_index_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_hindex_lo,}, }, {"EDS0068/alarm/dew_point_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_dp_hi,}, }, {"EDS0068/alarm/dew_point_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_dp_lo,}, }, {"EDS0068/alarm/pressure_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_mbar_hi,}, }, {"EDS0068/alarm/pressure_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_mbar_lo,}, }, {"EDS0068/alarm/inHg_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_inHg_hi,}, }, {"EDS0068/alarm/inHg_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_inHg_lo,}, }, {"EDS0068/alarm/light_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_lux_hi,}, }, {"EDS0068/alarm/light_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0068, {.v= &eds0064_lux_lo,}, }, {"EDS0068/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0068, NO_FILETYPE_DATA, }, {"EDS0068/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_relay_state,}, }, {"EDS0068/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_relay_function,}, }, {"EDS0068/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0068, NO_FILETYPE_DATA, }, {"EDS0068/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_led_state,}, }, {"EDS0068/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0068, {.v= &eds0064_led_function,}, }, /* EDS0070 */ {"EDS0070", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0070, NO_FILETYPE_DATA, }, {"EDS0070/vib_level", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, VISIBLE_EDS0070, {.u= _EDS0070_Vib_level,}, }, {"EDS0070/vib_peak", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, VISIBLE_EDS0070, {.u= _EDS0070_Vib_peak,}, }, {"EDS0070/vib_min", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, VISIBLE_EDS0070, {.u= _EDS0070_Vib_min,}, }, {"EDS0070/vib_max", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, VISIBLE_EDS0070, {.u= _EDS0070_Vib_max,}, }, {"EDS0070/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0070_Relay_function,}, }, {"EDS0070/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0070_Relay_state,}, }, {"EDS0070/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0070, NO_FILETYPE_DATA, }, {"EDS0070/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0070, {.u= _EDS0070_Seconds_counter,}, }, {"EDS0070/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0070, NO_FILETYPE_DATA, }, {"EDS0070/set_alarm/vib_hi", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0070, {.v= &eds0070_cond_vib_hi,}, }, {"EDS0070/set_alarm/vib_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0070, {.v= &eds0070_cond_vib_lo,}, }, {"EDS0070/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0070_Conditional_search,}, }, {"EDS0070/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0070, NO_FILETYPE_DATA, }, {"EDS0070/threshold/vib_hi", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0070, {.u= _EDS0070_Vib_hi,}, }, {"EDS0070/threshold/vib_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0070, {.u= _EDS0070_Vib_lo,}, }, {"EDS0070/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0070, NO_FILETYPE_DATA, }, {"EDS0070/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0070, NO_FILETYPE_DATA, }, {"EDS0070/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0070_Alarm_state,}, }, {"EDS0070/alarm/vib_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0070, {.v= &eds0070_vib_hi,}, }, {"EDS0070/alarm/vib_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0070, {.v= &eds0070_vib_lo,}, }, {"EDS0070/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0070, NO_FILETYPE_DATA, }, {"EDS0070/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0070, {.v= &eds0070_relay_state,}, }, {"EDS0070/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0070, {.v= &eds0070_relay_function,}, }, {"EDS0070/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0070, NO_FILETYPE_DATA, }, {"EDS0070/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0070, {.v= &eds0070_led_state,}, }, {"EDS0070/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0070, {.v= &eds0070_led_function,}, }, /* EDS0071 */ {"EDS0071", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0071, NO_FILETYPE_DATA, }, {"EDS0071/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float24, NO_WRITE_FUNCTION, VISIBLE_EDS0071, {.u= _EDS0071_Temp,}, }, {"EDS0071/resistance", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_float24, NO_WRITE_FUNCTION, VISIBLE_EDS0071, {.u= _EDS0071_RTD,}, }, {"EDS0071/raw", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_24, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0071_Conversion,}, }, {"EDS0071/user_byte", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_EDS0071, {.u= _EDS0071_free_byte,}, }, {"EDS0071/delay", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_EDS0071, {.u= _EDS0071_RTD_delay,}, }, {"EDS0071/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0071_Relay_function,}, }, {"EDS0071/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0071_Relay_state,}, }, {"EDS0071/calibration", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0071, NO_FILETYPE_DATA, }, {"EDS0071/calibration/constant", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0071, {.u= _EDS0071_Calibration,}, }, {"EDS0071/calibration/key", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_8, FS_w_8, VISIBLE_EDS0071, {.u= _EDS0071_Calibration_key,}, }, {"EDS0071/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0071, NO_FILETYPE_DATA, }, {"EDS0071/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0071, {.u= _EDS0071_Seconds_counter,}, }, {"EDS0071/counter/samples", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0071, {.u= _EDS0071_Conversion_counter,}, }, {"EDS0071/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0071, NO_FILETYPE_DATA, }, {"EDS0071/set_alarm/temp_hi", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0071, {.v= &eds0071_cond_temp_hi,}, }, {"EDS0071/set_alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0071, {.v= &eds0071_cond_temp_lo,}, }, {"EDS0071/set_alarm/resistance__hi", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0071, {.v= &eds0071_cond_RTD_hi,}, }, {"EDS0071/set_alarm/resistance_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0071, {.v= &eds0071_cond_RTD_lo,}, }, {"EDS0071/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0071_Conditional_search,}, }, {"EDS0071/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0071, NO_FILETYPE_DATA, }, {"EDS0071/threshold/temp_hi", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0071, {.u= _EDS0071_Temp_hi,}, }, {"EDS0071/threshold/temp_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0071, {.u= _EDS0071_Temp_lo,}, }, {"EDS0071/threshold/resistance_hi" , PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0071, {.u= _EDS0071_RTD_hi,}, }, {"EDS0071/threshold/resistance_low", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0071, {.u= _EDS0071_RTD_lo,}, }, {"EDS0071/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0071, NO_FILETYPE_DATA, }, {"EDS0071/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0071, NO_FILETYPE_DATA, }, {"EDS0071/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0071_Alarm_state,}, }, {"EDS0071/alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0071, {.v= &eds0071_temp_hi,}, }, {"EDS0071/alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0071, {.v= &eds0071_temp_lo,}, }, {"EDS0071/alarm/resistance_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0071, {.v= &eds0071_RTD_hi,}, }, {"EDS0071/alarm/resistance_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0071, {.v= &eds0071_RTD_lo,}, }, {"EDS0071/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0071, NO_FILETYPE_DATA, }, {"EDS0071/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0071, {.v= &eds0071_relay_state,}, }, {"EDS0071/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0071, {.v= &eds0071_relay_function,}, }, {"EDS0071/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0071, NO_FILETYPE_DATA, }, {"EDS0071/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0071, {.v= &eds0071_led_state,}, }, {"EDS0071/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0071, {.v= &eds0071_led_function,}, }, /* EDS0072 */ {"EDS0072", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0072, NO_FILETYPE_DATA, }, {"EDS0072/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_float24, NO_WRITE_FUNCTION, VISIBLE_EDS0072, {.u= _EDS0071_Temp,}, }, {"EDS0072/resistance", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_float24, NO_WRITE_FUNCTION, VISIBLE_EDS0072, {.u= _EDS0071_RTD,}, }, {"EDS0072/raw", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_24, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0071_Conversion,}, }, {"EDS0072/user_byte", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_EDS0072, {.u= _EDS0071_free_byte,}, }, {"EDS0072/delay", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, VISIBLE_EDS0072, {.u= _EDS0071_RTD_delay,}, }, {"EDS0072/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0071_Relay_function,}, }, {"EDS0072/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0071_Relay_state,}, }, {"EDS0072/calibration", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0072, NO_FILETYPE_DATA, }, {"EDS0072/calibration/constant", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0072, {.u= _EDS0071_Calibration,}, }, {"EDS0072/calibration/key", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_8, FS_w_8, VISIBLE_EDS0072, {.u= _EDS0071_Calibration_key,}, }, {"EDS0072/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0072, NO_FILETYPE_DATA, }, {"EDS0072/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0072, {.u= _EDS0071_Seconds_counter,}, }, {"EDS0072/counter/samples", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0072, {.u= _EDS0071_Conversion_counter,}, }, {"EDS0072/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0072, NO_FILETYPE_DATA, }, {"EDS0072/set_alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0072, {.v= &eds0071_cond_temp_hi,}, }, {"EDS0072/set_alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0072, {.v= &eds0071_cond_temp_lo,}, }, {"EDS0072/set_alarm/RTD_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0072, {.v= &eds0071_cond_RTD_hi,}, }, {"EDS0072/set_alarm/RTD_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0072, {.v= &eds0071_cond_RTD_lo,}, }, {"EDS0072/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0071_Conditional_search,}, }, {"EDS0072/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0072, NO_FILETYPE_DATA, }, {"EDS0072/threshold/temp_hi" , PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0072, {.u= _EDS0071_Temp_hi,}, }, {"EDS0072/threshold/temp_low", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0072, {.u= _EDS0071_Temp_lo,}, }, {"EDS0072/threshold/resistance_hi" , PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0072, {.u= _EDS0071_RTD_hi,}, }, {"EDS0072/threshold/resistance_low", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_float24, FS_w_float24, VISIBLE_EDS0072, {.u= _EDS0071_RTD_lo,}, }, {"EDS0072/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0072, NO_FILETYPE_DATA, }, {"EDS0072/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0072, NO_FILETYPE_DATA, }, {"EDS0072/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0071_Alarm_state,}, }, {"EDS0072/alarm/temp_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0072, {.v= &eds0071_temp_hi,}, }, {"EDS0072/alarm/temp_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0072, {.v= &eds0071_temp_lo,}, }, {"EDS0072/alarm/RTD_hi" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0072, {.v= &eds0071_RTD_hi,}, }, {"EDS0072/alarm/RTD_low", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, NO_WRITE_FUNCTION, VISIBLE_EDS0072, {.v= &eds0071_RTD_lo,}, }, {"EDS0072/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0072, NO_FILETYPE_DATA, }, {"EDS0072/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0072, {.v= &eds0071_relay_state,}, }, {"EDS0072/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0072, {.v= &eds0071_relay_function,}, }, {"EDS0072/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0072, NO_FILETYPE_DATA, }, {"EDS0072/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0072, {.v= &eds0071_led_state,}, }, {"EDS0072/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0072, {.v= &eds0071_led_function,}, }, /* EDS0080 */ {"EDS0080", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/memory", _EDS_8X_PAGES * _EDS_PAGESIZE, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/pages/page", _EDS_PAGESIZE, &AEDS_8X, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/current", PROPERTY_LENGTH_FLOAT, &AEDS_82_data, ft_float, fc_volatile, FS_r_current, NO_WRITE_FUNCTION, VISIBLE_EDS0080, {.u= _EDS0082_level,}, }, {"EDS0080/min_current", PROPERTY_LENGTH_FLOAT, &AEDS_82_data, ft_float, fc_volatile, FS_r_current, NO_WRITE_FUNCTION, VISIBLE_EDS0080, {.u= _EDS0082_min,}, }, {"EDS0080/max_current", PROPERTY_LENGTH_FLOAT, &AEDS_82_data, ft_float, fc_volatile, FS_r_current, NO_WRITE_FUNCTION, VISIBLE_EDS0080, {.u= _EDS0082_max,}, }, {"EDS0080/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0082_Relay_function,}, }, {"EDS0080/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0082_Relay_state,}, }, {"EDS0080/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0080, {.u= _EDS0082_Seconds_counter,}, }, {"EDS0080/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/set_alarm/current_hi", PROPERTY_LENGTH_BITFIELD, &AEDS_82_state, ft_bitfield, fc_volatile, FS_r_bit_array, FS_w_bit_array, VISIBLE_EDS0080, {.v= &eds0082_conditional_hi,}, }, {"EDS0080/set_alarm/current_low", PROPERTY_LENGTH_BITFIELD, &AEDS_82_state, ft_bitfield, fc_volatile, FS_r_bit_array, FS_w_bit_array, VISIBLE_EDS0080, {.v= &eds0082_conditional_lo,}, }, {"EDS0080/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, INVISIBLE, {.u= _EDS0082_Conditional_search,}, }, {"EDS0080/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/threshold/current_hi" , PROPERTY_LENGTH_FLOAT, &AEDS_82_limit, ft_float, fc_stable, FS_r_climit, FS_w_climit, VISIBLE_EDS0080, {.u= _EDS0082_Threshold_hi,}, }, {"EDS0080/threshold/current_low", PROPERTY_LENGTH_FLOAT, &AEDS_82_limit, ft_float, fc_stable, FS_r_climit, FS_w_climit, VISIBLE_EDS0080, {.u= _EDS0082_Threshold_lo,}, }, {"EDS0080/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0082_Alarm_state,}, }, {"EDS0080/alarm/current_hi", PROPERTY_LENGTH_BITFIELD, &AEDS_82_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0080, {.v= &eds0082_alarm_hi,}, }, {"EDS0080/alarm/current_low", PROPERTY_LENGTH_BITFIELD, &AEDS_82_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0080, {.v= &eds0082_alarm_lo,}, }, {"EDS0080/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0080, {.v= &eds0082_relay_state,}, }, {"EDS0080/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0080, {.v= &eds0082_relay_function,}, }, {"EDS0080/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0080, NO_FILETYPE_DATA, }, {"EDS0080/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0080, {.v= &eds0082_led_state,}, }, {"EDS0080/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0080, {.v= &eds0082_led_function,}, }, /* EDS0082 */ {"EDS0082", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/memory", _EDS_8X_PAGES * _EDS_PAGESIZE, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/pages/page", _EDS_PAGESIZE, &AEDS_8X, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/volts", PROPERTY_LENGTH_FLOAT, &AEDS_82_data, ft_float, fc_volatile, FS_r_voltage, NO_WRITE_FUNCTION, VISIBLE_EDS0082, {.u= _EDS0082_level,}, }, {"EDS0082/min_volts", PROPERTY_LENGTH_FLOAT, &AEDS_82_data, ft_float, fc_volatile, FS_r_voltage, NO_WRITE_FUNCTION, VISIBLE_EDS0082, {.u= _EDS0082_min,}, }, {"EDS0082/max_volts", PROPERTY_LENGTH_FLOAT, &AEDS_82_data, ft_float, fc_volatile, FS_r_voltage, NO_WRITE_FUNCTION, VISIBLE_EDS0082, {.u= _EDS0082_max,}, }, {"EDS0082/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0082_Relay_function,}, }, {"EDS0082/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0082_Relay_state,}, }, {"EDS0082/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0082, {.u= _EDS0082_Seconds_counter,}, }, {"EDS0082/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/set_alarm/volts_hi", PROPERTY_LENGTH_BITFIELD, &AEDS_82_state, ft_bitfield, fc_volatile, FS_r_bit_array, FS_w_bit_array, VISIBLE_EDS0082, {.v= &eds0082_conditional_hi,}, }, {"EDS0082/set_alarm/volts_low", PROPERTY_LENGTH_BITFIELD, &AEDS_82_state, ft_bitfield, fc_volatile, FS_r_bit_array, FS_w_bit_array, VISIBLE_EDS0082, {.v= &eds0082_conditional_lo,}, }, {"EDS0082/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, INVISIBLE, {.u= _EDS0082_Conditional_search,}, }, {"EDS0082/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/threshold/volts_hi" , PROPERTY_LENGTH_FLOAT, &AEDS_82_limit, ft_float, fc_stable, FS_r_vlimit, FS_w_vlimit, VISIBLE_EDS0082, {.u= _EDS0082_Threshold_hi,}, }, {"EDS0082/threshold/volts_low", PROPERTY_LENGTH_FLOAT, &AEDS_82_limit, ft_float, fc_stable, FS_r_vlimit, FS_w_vlimit, VISIBLE_EDS0082, {.u= _EDS0082_Threshold_lo,}, }, {"EDS0082/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0082_Alarm_state,}, }, {"EDS0082/alarm/volts_hi", PROPERTY_LENGTH_BITFIELD, &AEDS_82_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0082, {.v= &eds0082_alarm_hi,}, }, {"EDS0082/alarm/volts_low", PROPERTY_LENGTH_BITFIELD, &AEDS_82_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0082, {.v= &eds0082_alarm_lo,}, }, {"EDS0082/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0082, {.v= &eds0082_relay_state,}, }, {"EDS0082/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0082, {.v= &eds0082_relay_function,}, }, {"EDS0082/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0082, NO_FILETYPE_DATA, }, {"EDS0082/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0082, {.v= &eds0082_led_state,}, }, {"EDS0082/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0082, {.v= &eds0082_led_function,}, }, /* EDS0083 */ {"EDS0083", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/memory", _EDS_8X_PAGES * _EDS_PAGESIZE, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/pages/page", _EDS_PAGESIZE, &AEDS_8X, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/current", PROPERTY_LENGTH_FLOAT, &AEDS_85_data, ft_float, fc_volatile, FS_r_current, NO_WRITE_FUNCTION, VISIBLE_EDS0083, {.u= _EDS0082_level,}, }, {"EDS0083/min_current", PROPERTY_LENGTH_FLOAT, &AEDS_85_data, ft_float, fc_volatile, FS_r_current, NO_WRITE_FUNCTION, VISIBLE_EDS0083, {.u= _EDS0082_min,}, }, {"EDS0083/max_current", PROPERTY_LENGTH_FLOAT, &AEDS_85_data, ft_float, fc_volatile, FS_r_current, NO_WRITE_FUNCTION, VISIBLE_EDS0083, {.u= _EDS0082_max,}, }, {"EDS0083/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0082_Relay_function,}, }, {"EDS0083/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0082_Relay_state,}, }, {"EDS0083/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0083, {.u= _EDS0082_Seconds_counter,}, }, {"EDS0083/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/set_alarm/current_hi", PROPERTY_LENGTH_BITFIELD, &AEDS_85_state, ft_bitfield, fc_volatile, FS_r_bit_array, FS_w_bit_array, VISIBLE_EDS0083, {.v= &eds0082_conditional_hi,}, }, {"EDS0083/set_alarm/current_low", PROPERTY_LENGTH_BITFIELD, &AEDS_85_state, ft_bitfield, fc_volatile, FS_r_bit_array, FS_w_bit_array, VISIBLE_EDS0083, {.v= &eds0082_conditional_lo,}, }, {"EDS0083/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, INVISIBLE, {.u= _EDS0082_Conditional_search,}, }, {"EDS0083/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/threshold/current_hi" , PROPERTY_LENGTH_FLOAT, &AEDS_85_limit, ft_float, fc_stable, FS_r_climit, FS_w_climit, VISIBLE_EDS0083, {.u= _EDS0082_Threshold_hi,}, }, {"EDS0083/threshold/current_low", PROPERTY_LENGTH_FLOAT, &AEDS_85_limit, ft_float, fc_stable, FS_r_climit, FS_w_climit, VISIBLE_EDS0083, {.u= _EDS0082_Threshold_lo,}, }, {"EDS0083/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0082_Alarm_state,}, }, {"EDS0083/alarm/current_hi", PROPERTY_LENGTH_BITFIELD, &AEDS_85_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0083, {.v= &eds0082_alarm_hi,}, }, {"EDS0083/alarm/current_low", PROPERTY_LENGTH_BITFIELD, &AEDS_85_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0083, {.v= &eds0082_alarm_lo,}, }, {"EDS0083/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0083, {.v= &eds0082_relay_state,}, }, {"EDS0083/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0083, {.v= &eds0082_relay_function,}, }, {"EDS0083/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0083, NO_FILETYPE_DATA, }, {"EDS0083/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0083, {.v= &eds0082_led_state,}, }, {"EDS0083/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0083, {.v= &eds0082_led_function,}, }, /* EDS0085 */ {"EDS0085", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/memory", _EDS_8X_PAGES * _EDS_PAGESIZE, NON_AGGREGATE, ft_binary, fc_link, FS_r_mem, FS_w_mem, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/pages", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/pages/page", _EDS_PAGESIZE, &AEDS_8X, ft_binary, fc_page, FS_r_page, FS_w_page, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/volts", PROPERTY_LENGTH_FLOAT, &AEDS_85_data, ft_float, fc_volatile, FS_r_voltage, NO_WRITE_FUNCTION, VISIBLE_EDS0085, {.u= _EDS0082_level,}, }, {"EDS0085/min_volts", PROPERTY_LENGTH_FLOAT, &AEDS_85_data, ft_float, fc_volatile, FS_r_voltage, NO_WRITE_FUNCTION, VISIBLE_EDS0085, {.u= _EDS0082_min,}, }, {"EDS0085/max_volts", PROPERTY_LENGTH_FLOAT, &AEDS_85_data, ft_float, fc_volatile, FS_r_voltage, NO_WRITE_FUNCTION, VISIBLE_EDS0085, {.u= _EDS0082_max,}, }, {"EDS0085/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0082_Relay_function,}, }, {"EDS0085/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0082_Relay_state,}, }, {"EDS0085/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0085, {.u= _EDS0082_Seconds_counter,}, }, {"EDS0085/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/set_alarm/volts_hi", PROPERTY_LENGTH_BITFIELD, &AEDS_85_state, ft_bitfield, fc_volatile, FS_r_bit_array, FS_w_bit_array, VISIBLE_EDS0085, {.v= &eds0082_conditional_hi,}, }, {"EDS0085/set_alarm/volts_low", PROPERTY_LENGTH_BITFIELD, &AEDS_85_state, ft_bitfield, fc_volatile, FS_r_bit_array, FS_w_bit_array, VISIBLE_EDS0085, {.v= &eds0082_conditional_lo,}, }, {"EDS0085/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, FS_w_16, INVISIBLE, {.u= _EDS0082_Conditional_search,}, }, {"EDS0085/threshold", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/threshold/volts_hi" , PROPERTY_LENGTH_FLOAT, &AEDS_85_limit, ft_float, fc_stable, FS_r_vlimit, FS_w_vlimit, VISIBLE_EDS0085, {.u= _EDS0082_Threshold_hi,}, }, {"EDS0085/threshold/volts_low", PROPERTY_LENGTH_FLOAT, &AEDS_85_limit, ft_float, fc_stable, FS_r_vlimit, FS_w_vlimit, VISIBLE_EDS0085, {.u= _EDS0082_Threshold_lo,}, }, {"EDS0085/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0082_Alarm_state,}, }, {"EDS0085/alarm/volts_hi", PROPERTY_LENGTH_BITFIELD, &AEDS_85_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0085, {.v= &eds0082_alarm_hi,}, }, {"EDS0085/alarm/volts_low", PROPERTY_LENGTH_BITFIELD, &AEDS_85_state, ft_bitfield, fc_volatile, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0085, {.v= &eds0082_alarm_lo,}, }, {"EDS0085/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0085, {.v= &eds0082_relay_state,}, }, {"EDS0085/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0085, {.v= &eds0082_relay_function,}, }, {"EDS0085/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0085, NO_FILETYPE_DATA, }, {"EDS0085/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0085, {.v= &eds0082_led_state,}, }, {"EDS0085/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0085, {.v= &eds0082_led_function,}, }, /* EDS0090 */ {"EDS0090", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0090, NO_FILETYPE_DATA, }, {"EDS0090/input", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_stable, FS_r_8, NO_WRITE_FUNCTION, VISIBLE_EDS0090, {.u= _EDS0090_Input_state,}, }, {"EDS0090/relay_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0090_Relay_function,}, }, {"EDS0090/relay_state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0090_Relay_state,}, }, {"EDS0090/counter", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0090, NO_FILETYPE_DATA, }, {"EDS0090/counter/seconds", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_second, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0090, {.u= _EDS0090_Seconds_counter,}, }, {"EDS0090/counter/pulses", PROPERTY_LENGTH_UNSIGNED, &AEDS_90_inputs, ft_unsigned, fc_volatile, FS_r_32, NO_WRITE_FUNCTION, VISIBLE_EDS0090, {.u= _EDS0090_Pulse_counter,}, }, {"EDS0090/counter/reset", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_volatile, FS_r_8, FS_w_8, VISIBLE_EDS0090, {.u= _EDS0090_Pulse_reset,}, }, {"EDS0090/output", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0090, NO_FILETYPE_DATA, }, {"EDS0090/output/set", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_volatile, FS_r_8, FS_w_8 , VISIBLE_EDS0090, {.u= _EDS0090_Output_value,}, }, {"EDS0090/output/off", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_volatile, FS_r_8, NO_WRITE_FUNCTION, VISIBLE_EDS0090, {.u= _EDS0090_Output_value,}, }, {"EDS0090/output/reset", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_volatile, FS_r_8, FS_w_8, VISIBLE_EDS0090, {.u= _EDS0090_Latch_reset,}, }, {"EDS0090/latch", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0090, NO_FILETYPE_DATA, }, {"EDS0090/latch/state", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_volatile, FS_r_8, NO_WRITE_FUNCTION, VISIBLE_EDS0090, {.u= _EDS0090_Latch_state,}, }, {"EDS0090/latch/reset", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_volatile, FS_r_8, FS_w_8, VISIBLE_EDS0090, {.u= _EDS0090_Latch_reset,}, }, {"EDS0090/alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0090, NO_FILETYPE_DATA, }, {"EDS0090/alarm/clear", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_clear, VISIBLE_EDS0090, NO_FILETYPE_DATA, }, {"EDS0090/alarm/state", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_16, NO_WRITE_FUNCTION, INVISIBLE, {.u= _EDS0090_Alarm_state,}, }, {"EDS0090/alarm/hi", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_link, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0090, {.v= &eds0090_alarm_hi,}, }, {"EDS0090/alarm/low", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_link, FS_r_bit_array, NO_WRITE_FUNCTION, VISIBLE_EDS0090, {.v= &eds0090_alarm_lo,}, }, {"EDS0090/set_alarm", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0090, NO_FILETYPE_DATA, }, {"EDS0090/set_alarm/alarm_function", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_8, FS_w_8, INVISIBLE, {.u= _EDS0090_Conditional_search,}, }, {"EDS0090/set_alarm/hi" , PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0090, {.v= &eds0090_cond_hi,}, }, {"EDS0090/set_alarm/low", PROPERTY_LENGTH_BITFIELD, &AEDS_90_state, ft_bitfield, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0090, {.v= &eds0090_cond_lo,}, }, {"EDS0090/relay", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0090, NO_FILETYPE_DATA, }, {"EDS0090/relay/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0090, {.v= &eds0090_relay_state,}, }, {"EDS0090/relay/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0090, {.v= &eds0090_relay_function,}, }, {"EDS0090/LED", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EDS0090, NO_FILETYPE_DATA, }, {"EDS0090/LED/state", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0090, {.v= &eds0090_led_state,}, }, {"EDS0090/LED/control", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_link, FS_r_bitfield, FS_w_bitfield, VISIBLE_EDS0090, {.v= &eds0090_led_function,}, }, }; DeviceEntryExtended(7E, EDS, DEV_temp | DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); /* ------- Functions ------------ */ static GOOD_OR_BAD OW_r_withoffset( BYTE * data, int bytes, struct parsedname * pn ) ; static ZERO_OR_ERROR OW_w_withoffset( BYTE * data, int bytes, struct parsedname * pn ) ; static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) ; static GOOD_OR_BAD OW_w_mem_crc(BYTE * data, size_t size, off_t offset, struct parsedname *pn) ; static GOOD_OR_BAD OW_r_mem_small(BYTE * data, size_t size, off_t offset, struct parsedname * pn); static int VISIBLE_EDS( const struct parsedname * pn ) ; static GOOD_OR_BAD OW_clear( struct parsedname * pn) ; /* finds the visibility value (0x0071 ...) either cached, or computed via the device_id (then cached) */ static int VISIBLE_EDS( const struct parsedname * pn ) { int device_id = -1 ; LEVEL_DEBUG("Checking visibility of %s",SAFESTRING(pn->path)) ; if ( BAD( GetVisibilityCache( &device_id, pn ) ) ) { struct one_wire_query * owq = OWQ_create_from_path(pn->path) ; // for read if ( owq != NULL) { UINT U_device_id ; if ( FS_r_sibling_U( &U_device_id, "device_id", owq ) == 0 ) { device_id = U_device_id ; SetVisibilityCache( device_id, pn ) ; } OWQ_destroy(owq) ; } } return device_id ; } #define VISIBLE_FN(id) static enum e_visibility VISIBLE_EDS##id( const struct parsedname * pn ){\ return ( VISIBLE_EDS(pn) == 0x##id ) ? visible_now : visible_not_now ; } VISIBLE_FN(0064) ; VISIBLE_FN(0065) ; VISIBLE_FN(0066) ; VISIBLE_FN(0067) ; VISIBLE_FN(0068) ; VISIBLE_FN(0070) ; VISIBLE_FN(0071) ; VISIBLE_FN(0072) ; VISIBLE_FN(0080) ; //VISIBLE_FN(0081) ; VISIBLE_FN(0082) ; VISIBLE_FN(0083) ; VISIBLE_FN(0085) ; VISIBLE_FN(0090) ; //VISIBLE_FN(0091) ; //VISIBLE_FN(0092) ; static ZERO_OR_ERROR FS_r_tag(struct one_wire_query *owq) { return FS_r_mem(owq) ; } static ZERO_OR_ERROR FS_clear(struct one_wire_query *owq) { if ( OWQ_Y(owq) != 0 ) { RETURN_ERROR_IF_BAD( OW_clear( PN(owq) ) ) ; } return 0 ; } static ZERO_OR_ERROR FS_r_type(struct one_wire_query *owq) { UINT id ; ASCII typ[_EDS_TYPE_LENGTH+1] ; RETURN_ERROR_IF_BAD( FS_r_sibling_U( &id, "device_id", owq ) ) ; UCLIBCLOCK ; snprintf(typ,sizeof(typ),"EDS%.4X",id); UCLIBCUNLOCK ; return OWQ_format_output_offset_and_size_z(typ,owq); } /* 8 bit float */ static ZERO_OR_ERROR FS_r_float8(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 8/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); OWQ_F(owq) = (_FLOAT) ((int8_t) (data[0] )) ; return 0 ; } /* 16 bit float in DS18B20 format */ static ZERO_OR_ERROR FS_r_float16(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 16/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); OWQ_F(owq) = (_FLOAT) ((int16_t) ((data[1] << 8) | data[0] )) * .0625 ; return 0 ; } /* 24 bit float with resolution 1/2048th */ static ZERO_OR_ERROR FS_r_float24(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 24/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); // use 32 bit with 0 for lowest byte OWQ_F(owq) = (_FLOAT) ((int32_t) ((data[2] << 24) | (data[1] << 16) | ( data[0] << 8 ) )) / ( 2048.*256.) ; return 0 ; } /* write a 24 bit value from a register stored in filetype.data */ /* write as a signed float with resolution 1/2048th */ static ZERO_OR_ERROR FS_w_float24(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 24/8 ; BYTE data[bytes] ; int32_t big = 256. * 2048. * OWQ_F(owq) ; data[0] = (big>>8) & 0xFF ; data[1] = (big>>16) & 0xFF ; data[2] = (big>>24) & 0xFF ; return OW_w_withoffset( data, bytes, pn ) ; } static ZERO_OR_ERROR FS_r_mem(struct one_wire_query *owq) { size_t pagesize = 32; return GB_to_Z_OR_E(COMMON_OWQ_readwrite_paged(owq, 0, pagesize, COMMON_read_memory_F0)) ; } static ZERO_OR_ERROR FS_r_page(struct one_wire_query *owq) { return COMMON_offset_process( FS_r_mem, owq, OWQ_pn(owq).extension*_EDS_PAGESIZE) ; } static ZERO_OR_ERROR FS_w_mem(struct one_wire_query *owq) { size_t size = OWQ_size(owq) ; off_t start = OWQ_offset(owq) ; BYTE * position = (BYTE *)OWQ_buffer(owq) ; size_t write_size = _EDS_PAGESIZE - (start % _EDS_PAGESIZE) ; while ( size > 0 ) { if ( write_size > size ) { write_size = size ; } RETURN_ERROR_IF_BAD( OW_w_mem(position, write_size, start, PN(owq)) ) ; position += write_size ; start += write_size ; size -= write_size ; write_size = _EDS_PAGESIZE ; } return 0; } static ZERO_OR_ERROR FS_w_page(struct one_wire_query *owq) { return COMMON_offset_process( FS_w_mem, owq, OWQ_pn(owq).extension*_EDS_PAGESIZE) ; } /* read a signed 8 bit value from a register stored in filetype.data plus extension */ static ZERO_OR_ERROR FS_r_i8(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 8/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); OWQ_I(owq) = (int8_t) data[0] ; return 0 ; } /* write a signed 8 bit value from a register stored in filetype.data plus extension */ static ZERO_OR_ERROR FS_w_i8(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 8/8 ; BYTE data[bytes] ; data[0] = BYTE_MASK( OWQ_I(owq) ) ; return OW_w_withoffset( data, bytes, pn ) ; } /* read an 8 bit value from a register stored in filetype.data plus extension */ static ZERO_OR_ERROR FS_r_8(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 8/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); OWQ_U(owq) = data[0] ; return 0 ; } /* write an 8 bit value from a register stored in filetype.data plus extension */ static ZERO_OR_ERROR FS_w_8(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 8/8 ; BYTE data[bytes] ; data[0] = BYTE_MASK( OWQ_U(owq) ) ; return OW_w_withoffset( data, bytes, pn ) ; } /* read a 16 bit value from a register stored in filetype.data */ static ZERO_OR_ERROR FS_r_16(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 16/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); OWQ_U(owq) = UT_int16(data) ; return 0 ; } /* write a 24 bit value from a register stored in filetype.data */ static ZERO_OR_ERROR FS_w_24(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 24/8 ; BYTE data[bytes] ; UT_uint16_to_bytes( OWQ_U(owq), data ) ; return OW_w_withoffset( data, bytes, pn ) ; } static ZERO_OR_ERROR FS_r_voltage(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 16/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); OWQ_F(owq) = (data[0]+256*data[1]) / 2048. ; return 0 ; } static ZERO_OR_ERROR FS_r_current(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 16/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); OWQ_F(owq) = (data[0]+256*data[1]) / 2048. / 1000.; // read in A not mA return 0 ; } static ZERO_OR_ERROR FS_r_vlimit(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int extension = pn->extension ; ZERO_OR_ERROR zoe ; // reset extension to "doubled size" (for the hi/lo pairs) pn->extension = 2 * extension ; zoe = FS_r_voltage( owq) ; // read as integer (16 bits) including index and address // restore extension (probably not really needed) pn->extension = extension ; return zoe ; } static ZERO_OR_ERROR FS_r_climit(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int extension = pn->extension ; ZERO_OR_ERROR zoe ; // reset extension to "doubled size" (for the hi/lo pairs) pn->extension = 2 * extension ; zoe = FS_r_current( owq) ; // read as integer (16 bits) including index and address // restore extension (probably not really needed) pn->extension = extension ; return zoe ; } static ZERO_OR_ERROR FS_w_voltage(struct one_wire_query *owq) { OWQ_U(owq) = OWQ_F(owq) * 2048 ; return FS_w_16(owq) ; } static ZERO_OR_ERROR FS_w_current(struct one_wire_query *owq) { OWQ_U(owq) = OWQ_F(owq) * 2048 * 1000 ; // in A not mA return FS_w_16(owq) ; } static ZERO_OR_ERROR FS_w_vlimit(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int extension = pn->extension ; ZERO_OR_ERROR zoe ; // reset extension to "doubled size" (for the hi/lo pairs) pn->extension = 2 * extension ; zoe = FS_w_voltage( owq) ; // write as integer (16 bits) including index and address // restore extension (probably not really needed) pn->extension = extension ; return zoe ; } static ZERO_OR_ERROR FS_w_climit(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int extension = pn->extension ; ZERO_OR_ERROR zoe ; // reset extension to "doubled size" (for the hi/lo pairs) pn->extension = 2 * extension ; zoe = FS_w_current( owq) ; // write as integer (16 bits) including index and address // restore extension (probably not really needed) pn->extension = extension ; return zoe ; } /* read a 24 bit value from a register stored in filetype.data */ static ZERO_OR_ERROR FS_r_24(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 24/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); OWQ_U(owq) = UT_int24(data) ; return 0 ; } /* write a 16 bit value from a register stored in filetype.data */ static ZERO_OR_ERROR FS_w_16(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 16/8 ; BYTE data[bytes] ; UT_uint16_to_bytes( OWQ_U(owq), data ) ; return OW_w_withoffset( data, bytes, pn ) ; } /* read a 32 bit value from a register stored in filetype.data */ static ZERO_OR_ERROR FS_r_32(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; int bytes = 32/8 ; BYTE data[bytes] ; RETURN_ERROR_IF_BAD( OW_r_withoffset(data, bytes, pn ) ); OWQ_U(owq) = UT_int32(data) ; return 0 ; } /* write an 8 bit value from a register stored in filetype.data */ /* write as a signed float*/ static ZERO_OR_ERROR FS_w_float8(struct one_wire_query *owq) { int8_t val = OWQ_F(owq) ; OWQ_I(owq) = val ; return FS_w_8(owq) ; } /* read a memory area (including extension offset) into a buffer */ static GOOD_OR_BAD OW_r_withoffset( BYTE * data, int bytes, struct parsedname * pn ) { switch (pn->extension) { case EXTENSION_BYTE: case EXTENSION_ALL: // No real extension return OW_r_mem_small(data, bytes, pn->selected_filetype->data.u, pn ) ; default: return OW_r_mem_small(data, bytes, pn->selected_filetype->data.u + bytes * pn->extension, pn ) ; } } /* write a memory area (including extension offset) from a buffer */ static ZERO_OR_ERROR OW_w_withoffset( BYTE * data, int bytes, struct parsedname * pn ) { switch (pn->extension) { case EXTENSION_BYTE: case EXTENSION_ALL: // No real extension return GB_to_Z_OR_E(OW_w_mem(data, bytes, pn->selected_filetype->data.u, pn ) ) ; default: return GB_to_Z_OR_E(OW_w_mem(data, bytes, pn->selected_filetype->data.u + bytes * pn->extension, pn ) ) ; } } static GOOD_OR_BAD OW_w_mem(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[3 + 1 + _EDS_PAGESIZE + 2] = { _EDS_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; struct transaction_log twrite[] = { TRXN_START, TRXN_WRITE(p, 3 + size), TRXN_END, }; struct transaction_log tread[] = { TRXN_START, TRXN_WRITE1(p), TRXN_READ( &p[1], 3 + size), TRXN_COMPARE(&p[4], data, size), TRXN_END, }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_DELAY(_EDS_WRITE_DELAY_msec), TRXN_END, }; // use different scheme for write that goes to page end (use CRC) if ( ( (offset + size) & 0x1F) == 0 ) { /* to end of page */ return OW_w_mem_crc( data, size, offset, pn ) ; } /* Copy to scratchpad */ memcpy(&p[3], data, size); RETURN_BAD_IF_BAD(BUS_transaction(twrite, pn)) ; /* Re-read scratchpad and compare */ /* Note: location of data has now shifted down a byte for E/S register */ p[0] = _EDS_READ_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(tread, pn)) ; /* write Scratchpad to SRAM */ p[0] = _EDS_COPY_SCRATCHPAD; return BUS_transaction(tcopy, pn) ; } // write to end of page (size is appropriate) static GOOD_OR_BAD OW_w_mem_crc(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE p[3 + 1 + _EDS_PAGESIZE + 2] = { _EDS_WRITE_SCRATCHPAD, LOW_HIGH_ADDRESS(offset), }; struct transaction_log twrite[] = { TRXN_START, TRXN_WR_CRC16(p, 3 + size, 0), TRXN_END, }; struct transaction_log tread[] = { TRXN_START, TRXN_WR_CRC16(p, 1, 3 + size), TRXN_COMPARE(&p[4], data, size), TRXN_END, }; struct transaction_log tcopy[] = { TRXN_START, TRXN_WRITE(p, 4), TRXN_DELAY(_EDS_WRITE_DELAY_msec), TRXN_END, }; /* Copy to scratchpad -- use CRC16 */ memcpy(&p[3], data, size); RETURN_BAD_IF_BAD(BUS_transaction(twrite, pn)) ; /* Re-read scratchpad and compare */ /* Note: location of data has now shifted down a byte for E/S register */ p[0] = _EDS_READ_SCRATCHPAD; RETURN_BAD_IF_BAD(BUS_transaction(tread, pn)) ; /* write Scratchpad to SRAM */ p[0] = _EDS_COPY_SCRATCHPAD; return BUS_transaction(tcopy, pn) ; } /* Read a few bytes within a page */ static GOOD_OR_BAD OW_r_mem_small(BYTE * data, size_t size, off_t offset, struct parsedname * pn) { BYTE p[3] = { _EDS_READ_MEMMORY_NO_CRC, LOW_HIGH_ADDRESS(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(p), TRXN_READ( data, size), TRXN_END, }; return BUS_transaction(t, pn); } /* Clear alarms */ static GOOD_OR_BAD OW_clear( struct parsedname * pn) { BYTE p[1] = { _EDS_CLEAR_ALARMS }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(p), TRXN_END, }; return BUS_transaction(t, pn); } owfs-3.1p5/module/owlib/src/c/ow_eeef.c0000644000175000001440000007534312654730021014720 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_eeef.h" #include /* ------- Prototypes ----------- */ /* Hobby boards UVI and colleagues */ READ_FUNCTION(FS_version); READ_FUNCTION(FS_localtype); READ_FUNCTION(FS_r_sensor); READ_FUNCTION(FS_r_moist); WRITE_FUNCTION(FS_w_moist); READ_FUNCTION(FS_r_leaf); WRITE_FUNCTION(FS_w_leaf); READ_FUNCTION(FS_r_cal); WRITE_FUNCTION(FS_w_cal); READ_FUNCTION(FS_r_raw); READ_FUNCTION(FS_r_hub_config); WRITE_FUNCTION(FS_w_hub_config); READ_FUNCTION(FS_r_channels); WRITE_FUNCTION(FS_w_channels); READ_FUNCTION(FS_short); READ_FUNCTION(FS_r_multitemp) ; READ_FUNCTION(FS_r_variable); WRITE_FUNCTION(FS_w_variable); static enum e_visibility VISIBLE_EF_UVI( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EF_MOISTURE( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EF_HUB( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EF_BAROMETER( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EF_HUMIDITY( const struct parsedname * pn ) ; static enum e_visibility VISIBLE_EF_MULTITEMP( const struct parsedname * pn ) ; enum e_EF_type { eft_UVI = 1, eft_MOI = 2, eft_LOG = 3, eft_SNF = 4, eft_HUB = 5, eft_BAR = 6, eft_HUM = 7, eft_TMP = 9, } ; enum e_cal_type { cal_min , cal_max , } ; #define _EEEF_BLANK 0x00 #define _EEEF_READ_VERSION 0x11 #define _EEEF_READ_TYPE 0x12 #define _EEEF_GET_TEMPERATURE 0x21 #define _EEEF_SET_TEMPERATURE_OFFSET 0x22 #define _EEEF_GET_TEMPERATURE_OFFSET 0x23 #define _EEEF_GET_UVI 0x24 #define _EEEF_SET_UVI_OFFSET 0x25 #define _EEEF_GET_UVI_OFFSET 0x26 #define _EEEF_SET_IN_CASE 0x27 #define _EEEF_GET_IN_CASE 0x28 #define _EEEF_GET_POLLING_FREQUENCY 0x14 #define _EEEF_SET_POLLING_FREQUENCY 0x94 #define _EEEF_GET_AVAILABLE_POLLING_FREQUENCIES 0x15 #define _EEEF_GET_LOCATION 0x16 #define _EEEF_SET_LOCATION 0x96 #define _EEEF_GET_CONFIG 0x61 #define _EEEF_SET_CONFIG 0xE1 #define _EEEF_REBOOT 0xF1 #define _EEEF_RESET_TO_FACTORY_DEFAULTS 0xF7 #define _EEEF_READ_SENSOR 0x21 #define _EEEF_SET_LEAF_OLD 0x22 #define _EEEF_SET_LEAF_NEW 0xA2 #define _EEEF_GET_LEAF_OLD 0x23 #define _EEEF_GET_LEAF_NEW 0x22 #define _EEEF_SET_LEAF_MAX_OLD 0x24 #define _EEEF_SET_LEAF_MAX_NEW 0xA3 #define _EEEF_GET_LEAF_MAX_OLD 0x25 #define _EEEF_GET_LEAF_MAX_NEW 0x23 #define _EEEF_SET_LEAF_MIN_OLD 0x26 #define _EEEF_SET_LEAF_MIN_NEW 0xA4 #define _EEEF_GET_LEAF_MIN_OLD 0x27 #define _EEEF_GET_LEAF_MIN_NEW 0x24 #define _EEEF_GET_LEAF_RAW_OLD 0x31 #define _EEEF_GET_LEAF_RAW_NEW 0x31 #define _EEEF_HUB_SET_CHANNELS 0x21 #define _EEEF_HUB_GET_CHANNELS_ACTIVE 0x22 #define _EEEF_HUB_GET_CHANNELS_SHORTED 0x23 #define _EEEF_HUB_SET_CONFIG 0x60 #define _EEEF_HUB_GET_CONFIG 0x61 #define _EEEF_HUB_SINGLE_CHANNEL_BIT 0x02 #define _EEEF_HUB_SET_CHANNEL_BIT 0x10 #define _EEEF_HUB_SET_CHANNEL_MASK 0x0F #define _EEEF_HB_TEMPERATURE_C 0x40 #define _EEEF_GET_KPA 0x22 #define _EEEF_GET_PRESSURE_ALTITUDE 0x24 #define _EEEF_SET_ALTITUDE 0xA6 #define _EEEF_GET_ALTITUDE 0x26 #define _EEEF_GET_TC_HUMIDITY 0x21 #define _EEEF_GET_RAW_HUMIDITY 0x22 #define _EEEF_GET_TC_HUMIDITY_OFFSET 0x24 #define _EEEF_SET_TC_HUMIDITY_OFFSET 0xA4 #define _EEEF_GET_TEMPERATURE_IN_C 0x21 #define _EEEF_GET_TEMPERATURE_IN_F 0x22 struct location_pair { BYTE read ; BYTE write ; int size ; enum var_type { vt_unsigned, vt_signed, vt_location, vt_command, vt_ee_temperature, vt_temperature, vt_pressure, vt_humidity, vt_uvi, vt_incase, } type ; } ; struct location_pair lp_type_number = { _EEEF_READ_TYPE, _EEEF_BLANK, 1, vt_unsigned, } ; struct location_pair lp_version_number = { _EEEF_READ_VERSION, _EEEF_BLANK, 2, vt_unsigned, } ; struct location_pair lp_config = { _EEEF_GET_CONFIG, _EEEF_SET_CONFIG, 1, vt_unsigned, } ; struct location_pair lp_polling = { _EEEF_GET_POLLING_FREQUENCY, _EEEF_SET_POLLING_FREQUENCY, 1, vt_unsigned, } ; struct location_pair lp_available_polling = { _EEEF_GET_AVAILABLE_POLLING_FREQUENCIES, _EEEF_BLANK, 1, vt_unsigned, } ; struct location_pair lp_factory = { _EEEF_BLANK, _EEEF_RESET_TO_FACTORY_DEFAULTS, 0, vt_command, } ; struct location_pair lp_reboot = { _EEEF_BLANK, _EEEF_REBOOT, 0, vt_command, } ; struct location_pair lp_hb_temperature = { _EEEF_HB_TEMPERATURE_C, _EEEF_BLANK, 2, vt_temperature, } ; struct location_pair lp_ee_temperature = { _EEEF_GET_TEMPERATURE, _EEEF_BLANK, 2, vt_ee_temperature, } ; struct location_pair lp_ee_temperature_offset = { _EEEF_GET_TEMPERATURE_OFFSET, _EEEF_SET_TEMPERATURE_OFFSET, 2, vt_ee_temperature, } ; struct location_pair lp_uvi = { _EEEF_GET_UVI, _EEEF_BLANK, 1, vt_uvi, } ; struct location_pair lp_uvi_offset = { _EEEF_GET_UVI_OFFSET, _EEEF_SET_UVI_OFFSET, 1, vt_uvi, } ; struct location_pair lp_incase = { _EEEF_GET_IN_CASE, _EEEF_SET_IN_CASE, 1, vt_incase, } ; struct location_pair lp_pressure = { _EEEF_GET_KPA, _EEEF_BLANK, 2, vt_pressure, } ; struct location_pair lp_pressurealtitude = { _EEEF_GET_PRESSURE_ALTITUDE, _EEEF_BLANK, 2, vt_signed, } ; struct location_pair lp_altitude = { _EEEF_GET_ALTITUDE, _EEEF_SET_ALTITUDE, 2, vt_signed, } ; struct location_pair lp_raw_humidity = { _EEEF_GET_RAW_HUMIDITY, _EEEF_BLANK, 2, vt_humidity, } ; struct location_pair lp_tc_humidity = { _EEEF_GET_TC_HUMIDITY, _EEEF_BLANK, 2, vt_humidity, } ; struct location_pair lp_tc_humidity_offset = { _EEEF_GET_TC_HUMIDITY_OFFSET, _EEEF_SET_TC_HUMIDITY_OFFSET, 2, vt_humidity, } ; #define _EEEF_LOCATION_LENGTH 21 struct location_pair lp_location = { _EEEF_GET_LOCATION, _EEEF_SET_LOCATION, _EEEF_LOCATION_LENGTH, vt_location, } ; #define _EEEF_version_length 7 /* ------- Structures ----------- */ static struct filetype HobbyBoards_EE[] = { F_STANDARD_NO_TYPE, {"temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_UVI, {.v=&lp_ee_temperature,}, }, {"temperature_offset", PROPERTY_LENGTH_TEMPGAP, NON_AGGREGATE, ft_tempgap, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_UVI, {.v=&lp_ee_temperature_offset}, }, {"version", _EEEF_version_length, NON_AGGREGATE, ft_ascii, fc_stable, FS_version, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"version_number", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, NO_WRITE_FUNCTION, INVISIBLE, {.v=&lp_version_number}, }, {"type_number", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE, {.v=&lp_type_number}, }, {"type", PROPERTY_LENGTH_TYPE, NON_AGGREGATE, ft_ascii, fc_link, FS_localtype, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"UVI", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EF_UVI, NO_FILETYPE_DATA, }, {"UVI/UVI", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_UVI, {.v=&lp_uvi}, }, {"UVI/UVI_offset", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_UVI, {.v=&lp_uvi_offset}, }, {"UVI/in_case", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_UVI, {.v=&lp_incase}, }, }; DeviceEntry(EE, HobbyBoards_EE, NO_GENERIC_READ, NO_GENERIC_WRITE); static struct aggregate AMOIST = { 4, ag_numbers, ag_aggregate, }; static struct aggregate AHUB = { 4, ag_numbers, ag_aggregate, }; static struct aggregate ATMP = { 6, ag_numbers, ag_aggregate, }; static struct filetype HobbyBoards_EF[] = { F_STANDARD_NO_TYPE, {"version", _EEEF_version_length, NON_AGGREGATE, ft_ascii, fc_link, FS_version, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"version_number", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, NO_WRITE_FUNCTION, INVISIBLE, {.v=&lp_version_number}, }, {"type_number", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE, {.v=&lp_type_number}, }, {"type", PROPERTY_LENGTH_TYPE, NON_AGGREGATE, ft_ascii, fc_link, FS_localtype, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"moisture", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EF_MOISTURE, NO_FILETYPE_DATA, }, {"moisture/sensor", PROPERTY_LENGTH_INTEGER, &AMOIST, ft_integer, fc_volatile, FS_r_sensor, NO_WRITE_FUNCTION, VISIBLE_EF_MOISTURE, NO_FILETYPE_DATA, }, {"moisture/is_moisture", PROPERTY_LENGTH_BITFIELD, &AMOIST, ft_bitfield, fc_stable, FS_r_moist, FS_w_moist, VISIBLE_EF_MOISTURE, NO_FILETYPE_DATA, }, {"moisture/is_leaf", PROPERTY_LENGTH_BITFIELD, &AMOIST, ft_bitfield, fc_link, FS_r_leaf, FS_w_leaf, VISIBLE_EF_MOISTURE, NO_FILETYPE_DATA, }, {"moisture/calibrate", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EF_MOISTURE, NO_FILETYPE_DATA, }, {"moisture/calibrate/min", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_cal, FS_w_cal, VISIBLE_EF_MOISTURE, {.i=cal_min,}, }, {"moisture/calibrate/max", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_cal, FS_w_cal, VISIBLE_EF_MOISTURE, {.i=cal_max,}, }, {"moisture/calibrate/raw", PROPERTY_LENGTH_UNSIGNED, &AMOIST, ft_unsigned, fc_volatile, FS_r_raw, NO_WRITE_FUNCTION, VISIBLE_EF_MOISTURE, NO_FILETYPE_DATA, }, {"humidity", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EF_HUMIDITY, NO_FILETYPE_DATA, }, {"humidity/polling_frequency", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_HUMIDITY, {.v=&lp_polling, }, } , {"humidity/polling_available", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_HUMIDITY, {.v=&lp_available_polling, }, } , {"humidity/location", _EEEF_LOCATION_LENGTH, NON_AGGREGATE, ft_ascii, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_HUMIDITY, {.v=&lp_location,}, } , {"humidity/config", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_HUMIDITY, {.v=&lp_config, }, } , {"humidity/reboot", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_w_variable, VISIBLE_EF_HUMIDITY, {.v=&lp_reboot,}, } , {"humidity/reset", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_w_variable, VISIBLE_EF_HUMIDITY, {.v=&lp_factory,}, } , {"humidity/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_HUMIDITY, {.v=&lp_hb_temperature,}, } , {"humidity/humidity_raw", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_HUMIDITY, {.v=&lp_raw_humidity,}, } , {"humidity/humidity_corrected", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_HUMIDITY, {.v=&lp_tc_humidity,}, } , {"humidity/humidity_offset", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_volatile, FS_r_variable, FS_w_variable, VISIBLE_EF_HUMIDITY, {.v=&lp_tc_humidity_offset,}, } , {"barometer", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EF_BAROMETER, NO_FILETYPE_DATA, }, {"barometer/polling_frequency", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_BAROMETER, {.v=&lp_polling, }, } , {"barometer/polling_available", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_BAROMETER, {.v=&lp_available_polling, }, } , {"barometer/location", _EEEF_LOCATION_LENGTH, NON_AGGREGATE, ft_ascii, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_BAROMETER, {.v=&lp_location,}, } , {"barometer/config", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_BAROMETER, {.v=&lp_config, }, } , {"barometer/reboot", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_w_variable, VISIBLE_EF_BAROMETER, {.v=&lp_reboot,}, } , {"barometer/reset", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_w_variable, VISIBLE_EF_BAROMETER, {.v=&lp_factory,}, } , {"barometer/temperature", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_volatile, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_BAROMETER, {.v=&lp_hb_temperature,}, } , {"barometer/pressure", PROPERTY_LENGTH_PRESSURE, NON_AGGREGATE, ft_pressure, fc_volatile, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_BAROMETER, {.v=&lp_pressure,}, } , {"barometer/pressure_altitude", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_volatile, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_BAROMETER, {.v=&lp_pressurealtitude,}, } , {"barometer/altitude", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_volatile, FS_r_variable, FS_w_variable, VISIBLE_EF_BAROMETER, {.v=&lp_altitude,}, } , {"multitemp", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EF_MULTITEMP, NO_FILETYPE_DATA, }, {"multitemp/polling_frequency", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_MULTITEMP, {.v=&lp_polling, }, } , {"multitemp/polling_available", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_MULTITEMP, {.v=&lp_available_polling, }, } , {"multitemp/location", _EEEF_LOCATION_LENGTH, NON_AGGREGATE, ft_ascii, fc_stable, FS_r_variable, FS_w_variable, VISIBLE_EF_MULTITEMP, {.v=&lp_location,}, } , {"multitemp/config", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_stable, FS_r_variable, NO_WRITE_FUNCTION, VISIBLE_EF_MULTITEMP, {.v=&lp_config, }, } , {"multitemp/reboot", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_w_variable, VISIBLE_EF_MULTITEMP, {.v=&lp_reboot,}, } , {"multitemp/reset", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_w_variable, VISIBLE_EF_MULTITEMP, {.v=&lp_factory,}, } , {"multitemp/temperature", PROPERTY_LENGTH_TEMP, &ATMP, ft_temperature, fc_volatile, FS_r_multitemp, NO_WRITE_FUNCTION, VISIBLE_EF_MULTITEMP, NO_FILETYPE_DATA, } , {"hub", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_EF_HUB, NO_FILETYPE_DATA, }, {"hub/config", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_hub_config, FS_w_hub_config, INVISIBLE, NO_FILETYPE_DATA, }, {"hub/branch", PROPERTY_LENGTH_BITFIELD, &AHUB, ft_bitfield, fc_stable, FS_r_channels, FS_w_channels, VISIBLE_EF_HUB, NO_FILETYPE_DATA, }, {"hub/short", PROPERTY_LENGTH_BITFIELD, &AHUB, ft_bitfield, fc_stable, FS_short, NO_WRITE_FUNCTION, VISIBLE_EF_HUB, NO_FILETYPE_DATA, }, }; DeviceEntry(EF, HobbyBoards_EF, NO_GENERIC_READ, NO_GENERIC_WRITE); /* Internal properties */ Make_SlaveSpecificTag(VER, fc_stable); // version #define EFversion(maj,min) (maj*256+min) static enum e_EF_type VISIBLE_EF( const struct parsedname * pn ) ; /* finds the visibility value (0x0071 ...) either cached, or computed via the device_id (then cached) */ static enum e_EF_type VISIBLE_EF( const struct parsedname * pn ) { int eft = -1 ; LEVEL_DEBUG("Checking visibility of %s",SAFESTRING(pn->path)) ; if ( BAD( GetVisibilityCache( &eft, pn ) ) ) { struct one_wire_query * owq = OWQ_create_from_path(pn->path) ; // for read if ( owq != NULL) { UINT U_eft ; if ( FS_r_sibling_U( &U_eft, "type_number", owq ) == 0 ) { eft = U_eft ; SetVisibilityCache( eft, pn ) ; } OWQ_destroy(owq) ; } } return (enum e_EF_type) eft ; } static enum e_visibility VISIBLE_EF_UVI( const struct parsedname * pn ) { switch ( VISIBLE_EF(pn) ) { case eft_UVI: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_EF_MOISTURE( const struct parsedname * pn ) { switch ( VISIBLE_EF(pn) ) { case eft_MOI: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_EF_BAROMETER( const struct parsedname * pn ) { switch ( VISIBLE_EF(pn) ) { case eft_BAR: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_EF_HUMIDITY( const struct parsedname * pn ) { switch ( VISIBLE_EF(pn) ) { case eft_HUM: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_EF_HUB( const struct parsedname * pn ) { switch ( VISIBLE_EF(pn) ) { case eft_HUB: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_EF_MULTITEMP( const struct parsedname * pn ) { switch ( VISIBLE_EF(pn) ) { case eft_TMP: return visible_now ; default: return visible_not_now ; } } /* ------- Functions ------------ */ /* prototypes */ static GOOD_OR_BAD OW_read(BYTE command, BYTE * bytes, size_t size, struct parsedname * pn) ; static GOOD_OR_BAD OW_write(BYTE command, BYTE * bytes, size_t size, struct parsedname * pn); static GOOD_OR_BAD OW_r_doubles( BYTE command, UINT * dubs, int elements, struct parsedname * pn ) ; static GOOD_OR_BAD OW_w_doubles( BYTE command, UINT * dubs, int elements, struct parsedname * pn ) ; #ifdef HAVE_LRINT #define Roundoff(x) (UINT) lrint(x) #else #define Roundoff(x) (UINT) (x+.49) #endif // returns major/minor as 2 hex bytes (ascii) static ZERO_OR_ERROR FS_version(struct one_wire_query *owq) { char v[_EEEF_version_length]; BYTE major, minor ; int ret_size ; UINT version_number ; if ( FS_r_sibling_U( &version_number, "version_number", owq ) != 0 ) { return -EINVAL ; } minor = version_number & 0xFF ; major = (version_number>>8) & 0xFF ; UCLIBCLOCK; ret_size = snprintf(v,_EEEF_version_length,"%u.%u",major,minor); UCLIBCUNLOCK; return OWQ_format_output_offset_and_size(v, ret_size, owq); } static ZERO_OR_ERROR FS_localtype(struct one_wire_query *owq) { UINT type_number ; if ( FS_r_sibling_U( &type_number, "type_number", owq ) != 0 ) { return -EINVAL ; } switch ((enum e_EF_type) type_number) { case eft_UVI: return OWQ_format_output_offset_and_size_z("HB_UVI_METER", owq) ; case eft_MOI: return OWQ_format_output_offset_and_size_z("HB_MOISTURE_METER", owq) ; case eft_LOG: return OWQ_format_output_offset_and_size_z("HB_MOISTURE_METER_DATALOGGER", owq) ; case eft_SNF: return OWQ_format_output_offset_and_size_z("HB_SNIFFER", owq) ; case eft_HUB: return OWQ_format_output_offset_and_size_z("HB_HUB", owq) ; case eft_TMP: return OWQ_format_output_offset_and_size_z("HB_MULTITEMP", owq) ; default: return FS_type(owq); } } static ZERO_OR_ERROR FS_r_sensor(struct one_wire_query *owq) { BYTE w[4] ; RETURN_ERROR_IF_BAD( OW_read( _EEEF_READ_SENSOR, w, 4, PN(owq) ) ) ; OWQ_array_I(owq, 0) = (uint8_t) w[0] ; OWQ_array_I(owq, 1) = (uint8_t) w[1] ; OWQ_array_I(owq, 2) = (uint8_t) w[2] ; OWQ_array_I(owq, 3) = (uint8_t) w[3] ; return 0 ; } static ZERO_OR_ERROR FS_r_multitemp(struct one_wire_query *owq) { int bytes = 6 * 2 ; // 6 2-byte words, little endian in deci-degrees BYTE t[bytes] ; RETURN_ERROR_IF_BAD( OW_read( _EEEF_GET_TEMPERATURE_IN_C, t, bytes, PN(owq) ) ) ; OWQ_array_F(owq, 0) = ( (_FLOAT) (UT_int16( &t[ 0] )) ) / 10. ; OWQ_array_F(owq, 1) = ( (_FLOAT) (UT_int16( &t[ 2] )) ) / 10. ; OWQ_array_F(owq, 2) = ( (_FLOAT) (UT_int16( &t[ 4] )) ) / 10. ; OWQ_array_F(owq, 3) = ( (_FLOAT) (UT_int16( &t[ 6] )) ) / 10. ; OWQ_array_F(owq, 4) = ( (_FLOAT) (UT_int16( &t[ 8] )) ) / 10. ; OWQ_array_F(owq, 5) = ( (_FLOAT) (UT_int16( &t[10] )) ) / 10. ; return 0 ; } // bitfield for each channel // 0 = watermark moisture sensor // 1 = leaf wetness sensor static ZERO_OR_ERROR FS_r_moist(struct one_wire_query *owq) { BYTE moist ; BYTE cmd ; UINT version ; struct parsedname * pn = PN(owq) ; if ( BAD( Cache_Get_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn) ) ) { if ( FS_r_sibling_U( &version, "version_number", owq ) != 0 ) { return -EINVAL ; } Cache_Add_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn) ; } cmd = ( version>=EFversion(1,80) ) ? _EEEF_GET_LEAF_NEW : _EEEF_GET_LEAF_OLD ; if ( BAD( OW_read( cmd, &moist, 1, pn ) ) ) { return -EINVAL ; } OWQ_U(owq) = (~moist) & 0x0F ; return 0 ; } static ZERO_OR_ERROR FS_w_moist(struct one_wire_query *owq) { BYTE moist = (~OWQ_U(owq)) & 0x0F ; BYTE cmd ; UINT version ; struct parsedname * pn = PN(owq) ; if ( BAD( Cache_Get_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn) ) ) { if ( FS_r_sibling_U( &version, "version_number", owq ) != 0 ) { return -EINVAL ; } Cache_Add_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn); } cmd = ( version>=EFversion(1,80) ) ? _EEEF_SET_LEAF_NEW : _EEEF_SET_LEAF_OLD ; return GB_to_Z_OR_E( OW_write( cmd, &moist, 1, pn)) ; } static ZERO_OR_ERROR FS_r_leaf(struct one_wire_query *owq) { UINT moist ; if ( FS_r_sibling_U( &moist, "moisture/is_moisture.BYTE", owq ) != 0 ) { return -EINVAL ; } OWQ_U(owq) = (~moist) & 0x0F ; return 0 ; } static ZERO_OR_ERROR FS_w_leaf(struct one_wire_query *owq) { UINT moist = (~OWQ_U(owq)) & 0x0F ; return FS_w_sibling_U( moist, "moisture/is_moisture.BYTE", owq ) ; } static ZERO_OR_ERROR FS_r_cal(struct one_wire_query *owq) { BYTE cmd ; UINT version ; struct parsedname * pn = PN(owq) ; if ( BAD( Cache_Get_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn) ) ) { if ( FS_r_sibling_U( &version, "version_number", owq ) != 0 ) { return -EINVAL ; } Cache_Add_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn); } switch( (enum e_cal_type) PN(owq)->selected_filetype->data.i ) { case cal_min: cmd = ( version>=EFversion(1,80) ) ? _EEEF_GET_LEAF_MIN_NEW : _EEEF_GET_LEAF_MIN_OLD ; break ; case cal_max: cmd = ( version>=EFversion(1,80) ) ? _EEEF_GET_LEAF_MAX_NEW : _EEEF_GET_LEAF_MAX_OLD ; break ; default: return -EINVAL ; } return GB_to_Z_OR_E( OW_r_doubles( cmd, &OWQ_U(owq), 1, pn)) ; } static ZERO_OR_ERROR FS_r_variable(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; struct filetype * ft = pn->selected_filetype ; struct location_pair * lp = ( struct location_pair *) ft->data.v ; BYTE cmd = lp->read ; int size = lp->size ; BYTE data[size+1] ; enum var_type vt = lp->type ; // clear buffer memset( data, 0, size+1 ) ; // valid command? if ( cmd == _EEEF_BLANK ) { return -EINVAL ; } // read data RETURN_ERROR_IF_BAD( OW_read( cmd, data, size, pn ) ) ; switch( vt ) { case vt_unsigned: switch ( size ) { case 1: OWQ_U(owq) = UT_uint8( data ) ; break ; case 2: OWQ_U(owq) = UT_uint16( data ) ; break ; case 4: OWQ_U(owq) = UT_uint32( data ) ; break ; default: return -EINVAL ; } break ; case vt_signed: switch ( size ) { case 1: OWQ_I(owq) = UT_int8( data ) ; break ; case 2: OWQ_I(owq) = UT_int16( data ) ; break ; case 4: OWQ_I(owq) = UT_int32( data ) ; break ; default: return -EINVAL ; } break ; case vt_location: return OWQ_format_output_offset_and_size_z( (ASCII*)data, owq); case vt_humidity: // to percent OWQ_F(owq) = ( (_FLOAT) (UT_int16(data)) ) * 0.01 ; break ; case vt_temperature: OWQ_F(owq) = ( (_FLOAT) (UT_int16(data)) ) * 0.1 ; break ; case vt_uvi: if ( data[0] == 0xFF ) { // error flag return -EINVAL ; } OWQ_F(owq) = ( (_FLOAT) (UT_int16(data)) ) * 0.1 ; break ; case vt_ee_temperature: OWQ_F(owq) = ( (_FLOAT) (UT_int16(data)) ) * 0.5 ; break ; case vt_pressure: // kPa to mbar OWQ_F(owq) = ( (_FLOAT) (UT_int16(data)) ) * 10.0 ; break ; case vt_incase: OWQ_Y(owq) = (data[0]!=0x00) ; break ; case vt_command: default: break ; } return 0 ; } static ZERO_OR_ERROR FS_w_variable(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; struct filetype * ft = pn->selected_filetype ; struct location_pair * lp = ( struct location_pair *) ft->data.v ; BYTE cmd = lp->read ; int size = lp->size ; BYTE data[size+1] ; enum var_type vt = lp->type ; // clear buffer memset( data, 0, size+1 ); // valid command? if ( cmd == _EEEF_BLANK ) { return -EINVAL ; } switch( vt ) { case vt_signed: case vt_unsigned: switch ( size ) { case 1: UT_uint8_to_bytes( OWQ_U(owq), data ) ; break ; case 2: UT_uint16_to_bytes( OWQ_U(owq), data ) ; break ; case 4: UT_uint32_to_bytes( OWQ_U(owq), data ) ; break ; default: return -EINVAL ; } break ; case vt_location: { int len = size ; if ( len > _EEEF_LOCATION_LENGTH-1 ) { len = _EEEF_LOCATION_LENGTH-1 ; } memcpy( data, OWQ_buffer(owq), len ) ; } break ; case vt_command: if ( ! OWQ_Y(owq) ) { return 0 ; } break ; case vt_uvi: UT_uint8_to_bytes( Roundoff(OWQ_F(owq) * 10.0), data ) ; break ; case vt_humidity: UT_uint16_to_bytes( Roundoff(OWQ_F(owq) * 100.0), data ) ; break ; case vt_ee_temperature: UT_uint16_to_bytes( Roundoff(OWQ_F(owq) * 2.), data ) ; break ; case vt_incase: data[0] = OWQ_Y(owq) ? 0xFF : 0x00 ; break ; case vt_temperature: case vt_pressure: return -EINVAL ; } // write data return GB_to_Z_OR_E( OW_write( cmd, data, size, pn ) ) ; } static ZERO_OR_ERROR FS_w_cal(struct one_wire_query *owq) { BYTE cmd ; UINT version ; struct parsedname * pn = PN(owq) ; if ( BAD( Cache_Get_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn) ) ) { if ( FS_r_sibling_U( &version, "version_number", owq ) != 0 ) { return -EINVAL ; } Cache_Add_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn); } switch( (enum e_cal_type) PN(owq)->selected_filetype->data.i ) { case cal_min: cmd = ( version>=EFversion(1,80) ) ? _EEEF_SET_LEAF_MIN_NEW : _EEEF_SET_LEAF_MIN_OLD ; break ; case cal_max: cmd = ( version>=EFversion(1,80) ) ? _EEEF_SET_LEAF_MAX_NEW : _EEEF_SET_LEAF_MAX_OLD ; break ; default: return -EINVAL ; } return GB_to_Z_OR_E( OW_w_doubles( cmd, &OWQ_U(owq), 1, pn)) ; } static ZERO_OR_ERROR FS_r_raw(struct one_wire_query *owq) { UINT raw[4] ; BYTE cmd ; UINT version ; struct parsedname * pn = PN(owq) ; if ( BAD( Cache_Get_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn) ) ) { if ( FS_r_sibling_U( &version, "version_number", owq ) != 0 ) { return -EINVAL ; } Cache_Add_SlaveSpecific( &version, sizeof(UINT), SlaveSpecificTag(VER), pn); } cmd = ( version>=EFversion(1,80) ) ? _EEEF_GET_LEAF_RAW_NEW : _EEEF_GET_LEAF_RAW_OLD ; if ( BAD( OW_r_doubles( cmd, raw, 4, pn ) ) ) { return -EINVAL ; } OWQ_array_U(owq,0) = raw[0] ; OWQ_array_U(owq,1) = raw[1] ; OWQ_array_U(owq,2) = raw[2] ; OWQ_array_U(owq,3) = raw[3] ; return 0 ; } static ZERO_OR_ERROR FS_r_hub_config(struct one_wire_query *owq) { BYTE config ; if ( BAD( OW_read( _EEEF_HUB_GET_CONFIG, &config, 1, PN(owq) ) ) ) { return -EINVAL ; } OWQ_U(owq) = config ; return 0 ; } static ZERO_OR_ERROR FS_w_hub_config(struct one_wire_query *owq) { BYTE config = OWQ_U(owq) ; return GB_to_Z_OR_E( OW_write(_EEEF_HUB_SET_CONFIG, &config, 1, PN(owq))) ; } static ZERO_OR_ERROR FS_r_channels(struct one_wire_query *owq) { BYTE channels ; if ( BAD( OW_read( _EEEF_HUB_GET_CHANNELS_ACTIVE, &channels, 1, PN(owq) ) ) ) { return -EINVAL ; } OWQ_U(owq) = channels ; return 0 ; } static ZERO_OR_ERROR FS_w_channels(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; BYTE channels = OWQ_U(owq) & _EEEF_HUB_SET_CHANNEL_MASK ; UINT config ; // Take out of single channel mode if needed // Only if more than one channel selected switch ( channels & 0x0F ) { case 0x00: case 0x01: case 0x02: case 0x04: case 0x08: // single channel (or none), leave single channels mode alone break ; default: if ( FS_r_sibling_U( &config, "hub/config", owq ) != 0 ) { LEVEL_DEBUG("Could not read Hub configuration"); return -EINVAL ; } if ( config & _EEEF_HUB_SINGLE_CHANNEL_BIT ) { // need to clean single channel if ( FS_w_sibling_U( config & ~_EEEF_HUB_SINGLE_CHANNEL_BIT, "hub/config", owq ) != 0 ) { LEVEL_DEBUG("Could not write Hub configuration"); return -EINVAL ; } } break ; } // Clear directory cache Cache_Del_Dir( pn ) ; // Set channels channels |= _EEEF_HUB_SET_CHANNEL_BIT ; RETURN_ERROR_IF_BAD( OW_write(_EEEF_HUB_SET_CHANNELS, &channels, 1, pn) ) ; // Clear channels channels = ~channels ; RETURN_ERROR_IF_BAD( OW_write(_EEEF_HUB_SET_CHANNELS, &channels, 1, pn) ) ; return 0 ; } static ZERO_OR_ERROR FS_short(struct one_wire_query *owq) { BYTE channels ; if ( BAD( OW_read( _EEEF_HUB_GET_CHANNELS_SHORTED, &channels, 1, PN(owq) ) ) ) { return -EINVAL ; } OWQ_U(owq) = channels ; return 0 ; } /* Make a change to handle bus master not ready */ static GOOD_OR_BAD OW_read(BYTE command, BYTE * bytes, size_t size, struct parsedname * pn) { int retries ; BYTE c[] = { command,} ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(c), TRXN_READ(bytes,size), TRXN_END, }; for ( retries = 0 ; retries < 10 ; ++ retries ) { RETURN_BAD_IF_BAD( BUS_transaction(t, pn) ) ; if ( bytes[0] != 0xFF ) { break ; } LEVEL_DEBUG("Slave "SNformat" apparently not ready to read %d bytes",SNvar(pn->sn),size) ; } // Maybe that's a real value? return gbGOOD ; } static GOOD_OR_BAD OW_write(BYTE command, BYTE * bytes, size_t size, struct parsedname * pn) { BYTE c[] = { command, } ; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(c), TRXN_WRITE(bytes,size), TRXN_END, }; return BUS_transaction(t, pn) ; } static GOOD_OR_BAD OW_r_doubles( BYTE command, UINT * dubs, int elements, struct parsedname * pn ) { size_t size = 2 * elements ; BYTE data[size] ; int counter ; RETURN_BAD_IF_BAD( OW_read( command, data, size, pn ) ) ; for ( counter = 0 ; counter < elements ; ++counter ) { dubs[counter] = data[2*counter] + 256 * data[2*counter+1] ; } return gbGOOD ; } static GOOD_OR_BAD OW_w_doubles( BYTE command, UINT * dubs, int elements, struct parsedname * pn ) { size_t size = 2 * elements ; BYTE data[size] ; int counter ; for ( counter = 0 ; counter < elements ; ++counter ) { data[2*counter] = BYTE_MASK( dubs[counter] ) ; data[2*counter+1] = BYTE_MASK( dubs[counter]>>8 ) ; } return OW_write( command, data, size, pn ) ; } owfs-3.1p5/module/owlib/src/c/ow_elabnet.c0000644000175000001440000005133212654730021015416 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server */ /* New interface from Dirk Opfer * Code written by Dirk Opfer with minor changes for inclusion * * Basically it's a serial bus master with an ascii interface * Electrically thit's a multichannel adapter with more flexibility durring active power mode * so it can on other channels while temperature measurements ("conversion") is occurring * */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" #define MAX_PBM_VERSION_LENGTH 36 #define MAX_SERIAL 8 #define PBM_FIFO_SIZE LINK_FIFO_SIZE static RESET_TYPE PBM_reset(const struct parsedname *pn); static enum search_status PBM_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD PBM_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD PBM_sendback_bits(const BYTE * databits, BYTE * respbits, const size_t size, const struct parsedname *pn); static GOOD_OR_BAD PBM_PowerByte(const BYTE data, BYTE * resp, const UINT delay, const struct parsedname *pn); static GOOD_OR_BAD PBM_PowerBit(const BYTE data, BYTE * resp, const UINT delay, const struct parsedname *pn); static GOOD_OR_BAD PBM_reconnect( const struct parsedname *pn ) ; static void PBM_close(struct connection_in *in) ; static void PBM_setroutines(struct connection_in *in); static RESET_TYPE PBM_reset_in(struct connection_in * in); static GOOD_OR_BAD PBM_detect_serial(struct connection_in * in) ; static GOOD_OR_BAD PBM_version(struct connection_in * in, char* type_string); static void PBM_set_baud(struct connection_in * in) ; static GOOD_OR_BAD PBM_read(BYTE * buf, size_t size, struct connection_in * in); static GOOD_OR_BAD PBM_read_true_length(BYTE * buf, size_t size, struct connection_in *in) ; static GOOD_OR_BAD PBM_write(const BYTE * buf, size_t size, struct connection_in *in); static GOOD_OR_BAD PBM_directory(struct device_search *ds, struct connection_in * in); static GOOD_OR_BAD PBM_search_type(struct device_search *ds, struct connection_in * in) ; static GOOD_OR_BAD PBM_readback_data( BYTE * resp, const size_t size, struct connection_in * in); static void PBM_flush( struct connection_in * in ) ; static void PBM_slurp(struct connection_in *in); static void PBM_setroutines(struct connection_in *in) { in->iroutines.detect = PBM_detect; in->iroutines.reset = PBM_reset; in->iroutines.next_both = PBM_next_both; in->iroutines.PowerByte = PBM_PowerByte; in->iroutines.PowerBit = PBM_PowerBit; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = PBM_sendback_data; in->iroutines.sendback_bits = PBM_sendback_bits; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = PBM_reconnect; in->iroutines.close = PBM_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_no2409path | ADAP_FLAG_no2404delay | ADAP_FLAG_unlock_during_delay; in->bundling_length = PBM_FIFO_SIZE; } #define PBM_string(x) ((BYTE *)(x)) // bus locking done at a higher level GOOD_OR_BAD PBM_detect(struct port_in *pin) { struct connection_in * in = pin->first ; /* By definition, this is the head adapter on this port */ in->master.pbm.head = in ; if (pin->init_data == NULL) { // requires input string LEVEL_DEFAULT("PBM busmaster requires port name"); return gbBAD; } COM_set_standard( in ) ; // standard COM port settings switch( pin->type ) { case ct_serial: pin->baud = B9600 ; pin->flow = flow_first ; RETURN_GOOD_IF_GOOD( PBM_detect_serial(in) ) ; LEVEL_DEBUG("Second attempt at serial PBM setup"); pin->flow = flow_second ; RETURN_GOOD_IF_GOOD( PBM_detect_serial(in) ) ; LEVEL_DEBUG("Third attempt at serial PBM setup"); pin->flow = flow_first ; RETURN_GOOD_IF_GOOD( PBM_detect_serial(in) ) ; LEVEL_DEBUG("Fourth attempt at serial PBM setup"); pin->flow = flow_second ; RETURN_GOOD_IF_GOOD( PBM_detect_serial(in) ) ; break ; default: return gbBAD ; } return gbBAD ; } static GOOD_OR_BAD PBM_detect_serial(struct connection_in * in) { int i; static char *name[] = { "PBM(0)", "PBM(1)", "PBM(2)"}; char tmp[MAX_PBM_VERSION_LENGTH+1]; char * search; struct port_in * pin = in->pown ; unsigned int serial_number = 0; unsigned int majorvers = 0, minorvers = 0; size_t actual_size; /* Set up low-level routines */ PBM_setroutines(in); pin->timeout.tv_sec = Globals.timeout_serial ; pin->timeout.tv_usec = 0 ; /* Open the com port */ RETURN_BAD_IF_BAD(COM_open(in)) ; //COM_break( in ) ; LEVEL_DEBUG("Slurp in initial bytes"); PBM_slurp( in ) ; UT_delay(100) ; // based on http://morpheus.wcf.net/phpbb2/viewtopic.php?t=89&sid=3ab680415917a0ebb1ef020bdc6903ad PBM_slurp( in ) ; if ( BAD( PBM_version(in, tmp) )) { COM_close(in) ; LEVEL_DEFAULT("PBM detection error"); return gbBAD; } search = strchr(tmp, '['); if (search) { sscanf(search+1, "%d", &serial_number); } pin->baud = B115200; PBM_set_baud(in); /* read more info from device */ if ( BAD( PBM_write(PBM_string("i"), 1, in) ) ) { COM_close(in) ; LEVEL_DEFAULT("PBM detection error"); return gbBAD; } /* read the version string */ /* 1W PBM (3 Port) [xxxxxxxx]*/ LEVEL_DEBUG("Checking PBM advanced infos"); actual_size = COM_read_with_timeout(PBM_string((tmp)), sizeof(tmp), in); if ( actual_size <= 0) { LEVEL_DEBUG("No answer from device!!!"); return gbBAD; } PBM_slurp( in ) ; sscanf(tmp, "Version:%d.%d;", &majorvers, &minorvers); LEVEL_DEBUG("Adding child ports version"); in->adapter_name = name[0]; in->Adapter = adapter_pbm; in->master.pbm.channel = 0; in->master.pbm.serial_number = serial_number; in->master.pbm.version = (majorvers<<16) | minorvers; for (i = 1; i < 3; ++i) { LEVEL_DEBUG("Trying to add PBM port: %d",i); struct connection_in * added = AddtoPort(in->pown); LEVEL_DEBUG("Success adding PBM port: %d",i); if (added == NO_CONNECTION) { return gbBAD; } added->adapter_name = name[i]; added->master.pbm.channel = i; } return gbGOOD; } static GOOD_OR_BAD PBM_version(struct connection_in * in, char* type_string) { char version_string[MAX_PBM_VERSION_LENGTH+1] = {0}; if ( BAD( PBM_write(PBM_string(" "), 1, in) ) ) { LEVEL_DEFAULT("PBM version string cannot be requested"); return gbBAD ; } /* read the version string */ /* 1W BM (3 Port) [xxxxxxxx]*/ LEVEL_DEBUG("Checking PBM version"); if ( BAD(PBM_read(PBM_string((version_string)), 26, in)) ) { LEVEL_DEBUG("No answer from PBM!"); return gbBAD; } if (type_string) strcpy(type_string, version_string); return gbGOOD; } static GOOD_OR_BAD PBM_reconnect( const struct parsedname *pn ) { struct connection_in * in = pn->selected_connection ; struct port_in * pin = in->pown ; COM_close(in->master.pbm.head ) ; pin->baud = B9600; RETURN_BAD_IF_BAD( COM_open(in->master.pbm.head ) ) ; if ( BAD( PBM_version(in, NULL) )) { COM_close(in) ; LEVEL_DEFAULT("PBM: detection error"); return gbBAD; } pin->baud = B115200; PBM_set_baud(in); return gbGOOD; } static void PBM_set_baud(struct connection_in * in) { struct port_in * pin = in->pown ; char * speed_code ; if ( pin->type == ct_telnet ) { // telnet pinned at 115200 return ; } LEVEL_DEBUG("PBM baud set to %d" ,COM_BaudRate(pin->baud)); COM_BaudRestrict( &(pin->baud), B9600, B19200, B38400, B57600, B115200, B230400 ) ; LEVEL_DEBUG("PBM baud checked, now %d",COM_BaudRate(pin->baud)); // Find rate parameter switch ( pin->baud ) { case B9600: COM_break(in) ; PBM_flush(in); return ; case B19200: speed_code = "," ; break ; case B38400: speed_code = "`" ; break ; #ifdef B57600 /* MacOSX support max 38400 in termios.h ? */ case B57600: speed_code = "^" ; break ; #endif case B115200: speed_code = "=" ; break ; case B230400: speed_code = "$" ; break ; default: LEVEL_DEBUG("PBM: Unrecognized baud rate"); return ; } LEVEL_DEBUG("PBM change baud string <%s>",speed_code); PBM_flush(in); if ( BAD( PBM_write(PBM_string(speed_code), 1, in) ) ) { LEVEL_DEBUG("PBM change baud error -- will return to 9600"); pin->baud = B9600 ; ++in->changed_bus_settings ; return ; } // Send configuration change PBM_flush(in); // Change OS view of rate UT_delay(5); COM_change(in) ; UT_delay(5); PBM_slurp(in); return ; } static void PBM_flush( struct connection_in * in ) { COM_flush(in->master.pbm.head) ; } static GOOD_OR_BAD PBM_SelectChannel(struct connection_in * in) { BYTE buf[2+in->CRLF_size] ; char resp[1+in->CRLF_size]; buf[0] = 'c'; //select port buf[1] = '1' + in->channel; LEVEL_DEBUG("PBM channel: %d",in->channel); RETURN_BAD_IF_BAD(PBM_write(buf, 2, in) ); RETURN_BAD_IF_BAD(PBM_read(PBM_string(resp), 1, in)); return gbGOOD ; } static RESET_TYPE PBM_reset(const struct parsedname *pn) { return PBM_reset_in(pn->selected_connection); } static RESET_TYPE PBM_reset_in(struct connection_in * in) { BYTE resp[1+in->CRLF_size]; if (in->changed_bus_settings > 0) { --in->changed_bus_settings ; PBM_set_baud(in); // reset paramters } else { PBM_flush(in); } if ( BAD(PBM_SelectChannel(in)) ) { return BUS_RESET_ERROR ; }; if ( BAD(PBM_write(PBM_string("r"), 1, in) || BAD( PBM_read(resp, 1, in))) ) { LEVEL_DEBUG("Error resetting PBM device"); PBM_slurp(in); return BUS_RESET_ERROR; } switch (resp[0]) { case 'P': in->AnyDevices = anydevices_yes; return BUS_RESET_OK; case 'N': in->AnyDevices = anydevices_no; return BUS_RESET_OK; case 'S': return BUS_RESET_SHORT; default: LEVEL_DEBUG("Unknown PBM response %c", resp[0]); PBM_slurp(in); return BUS_RESET_ERROR; } } static enum search_status PBM_next_both(struct device_search *ds, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; //Special case for DS2409 hub, use low-level code if ( pn->ds2409_depth>0 ) { return search_error ; } if (ds->LastDevice) { return search_done; } if (ds->index == -1) { if ( BAD(PBM_directory(ds, in)) ) { return search_error; } } // LOOK FOR NEXT ELEMENT ++ds->index; LEVEL_DEBUG("PBM slave index %d", ds->index); switch ( DirblobGet(ds->index, ds->sn, &(ds->gulp) ) ) { case 0: LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; case -ENODEV: default: ds->LastDevice = 1; LEVEL_DEBUG("SN finished"); return search_done; } } static void PBM_slurp(struct connection_in *in) { COM_slurp(in->master.pbm.head); } static GOOD_OR_BAD PBM_read(BYTE * buf, size_t size, struct connection_in *in) { return PBM_read_true_length( buf, size+in->CRLF_size, in) ; } static GOOD_OR_BAD PBM_read_true_length(BYTE * buf, size_t size, struct connection_in *in) { return COM_read( buf, size, in->master.pbm.head ) ; } // Write a string to the serial port // return 0=good, // -EIO = error //Special processing for the remote hub (add 0x0A) static GOOD_OR_BAD PBM_write(const BYTE * buf, size_t size, struct connection_in *in) { return COM_write( buf, size, in->master.pbm.head ) ; } static GOOD_OR_BAD PBM_search_type(struct device_search *ds, struct connection_in * in) { char resp[3+in->CRLF_size]; int response_length ; response_length = 2 ; //Depending on the search type, the PBM search function //needs to be selected //tEC -- Conditional searching //tF0 -- Normal searching RETURN_BAD_IF_BAD(PBM_SelectChannel(in)); // Send the configuration command and check response if (ds->search == _1W_CONDITIONAL_SEARCH_ROM) { RETURN_BAD_IF_BAD(PBM_write(PBM_string("tEC"), 3, in)) ; RETURN_BAD_IF_BAD(PBM_read(PBM_string(resp), response_length, in)) ; if (strstr(resp, "EC") == NULL) { LEVEL_DEBUG("PBM did not change to conditional search"); return gbBAD; } LEVEL_DEBUG("PBM set for conditional search"); } else { RETURN_BAD_IF_BAD( PBM_write(PBM_string("tF0"), 3, in)); RETURN_BAD_IF_BAD(PBM_read(PBM_string(resp), response_length, in)); if (strstr(resp, "F0") == NULL) { LEVEL_DEBUG("PBM did not change to normal search"); return gbBAD; } LEVEL_DEBUG("PBM set for normal search"); } return gbGOOD ; } /************************************************************************/ /* */ /* PBM_directory: searches the Directory stores it in a dirblob */ /* & stores in in a dirblob object depending if it */ /* Supports conditional searches of the bus for */ /* /alarm directory */ /* */ /* Only called for the first element, everything else comes from dirblob*/ /* returns 0 even if no elements, errors only on communication errors */ /* */ /************************************************************************/ #define DEVICE_LENGTH 16 #define COMMA_LENGTH 1 #define PLUS_LENGTH 1 static GOOD_OR_BAD PBM_directory(struct device_search *ds, struct connection_in * in) { char resp[DEVICE_LENGTH+COMMA_LENGTH+PLUS_LENGTH+in->CRLF_size]; DirblobClear( &(ds->gulp) ); // Send the configuration command and check response RETURN_BAD_IF_BAD( PBM_search_type( ds, in )) ; LEVEL_DEBUG("PBM channel: %d",in->channel); // send the first search RETURN_BAD_IF_BAD(PBM_write(PBM_string("f"), 1, in)) ; //One needs to check the first character returned. //If nothing is found, the link will timeout rather then have a quick //return. This happens when looking at the alarm directory and //there are no alarms pending //So we grab the first character and check it. If not an E leave it //in the resp buffer and get the rest of the response from the PBM //device RETURN_BAD_IF_BAD(PBM_read(PBM_string(resp), 1, in)) ; switch (resp[0]) { case 'E': LEVEL_DEBUG("PBM returned E: No devices in alarm"); // pass through case 'N': // remove extra 2 bytes LEVEL_DEBUG("PBM returned E or N: Empty bus"); if (ds->search != _1W_CONDITIONAL_SEARCH_ROM) { in->AnyDevices = anydevices_no; } return gbGOOD ; default: break ; } if ( BAD(PBM_read(PBM_string(&resp[1+in->CRLF_size]), DEVICE_LENGTH+COMMA_LENGTH+PLUS_LENGTH-1-in->CRLF_size, in)) ) { return gbBAD; } // Check if we should start scanning switch (resp[0]) { case '*': case '-': case '+': if (ds->search != _1W_CONDITIONAL_SEARCH_ROM) { in->AnyDevices = anydevices_yes; } break; default: LEVEL_DEBUG("PBM_search unrecognized case"); return gbBAD; } /* Join the loop after the first query -- subsequent handled differently */ while ((resp[0] == '+') || (resp[0] == '-') || (resp[0] == '*')) { BYTE sn[SERIAL_NUMBER_SIZE]; sn[7] = string2num(&resp[2]); sn[6] = string2num(&resp[4]); sn[5] = string2num(&resp[6]); sn[4] = string2num(&resp[8]); sn[3] = string2num(&resp[10]); sn[2] = string2num(&resp[12]); sn[1] = string2num(&resp[14]); sn[0] = string2num(&resp[16]); LEVEL_DEBUG("SN found: " SNformat, SNvar(sn)); // CRC check if (CRC8(sn, SERIAL_NUMBER_SIZE) || (sn[0] == 0x00)) { LEVEL_DEBUG("BAD family or CRC8"); return gbBAD; } DirblobAdd(sn, &(ds->gulp) ); switch (resp[0]) { case '+': // get next element if ( BAD(PBM_write(PBM_string("n"), 1, in))) { return gbBAD; } if ( BAD(PBM_read(PBM_string((resp)), DEVICE_LENGTH+COMMA_LENGTH+PLUS_LENGTH, in)) ) { return gbBAD; } break; case '-': return gbGOOD; case '*': // More devices detected return gbGOOD; default: break; } } return gbGOOD; } static void PBM_close(struct connection_in *in) { // the standard COM_free routine cleans up the connection (void) in ; } static GOOD_OR_BAD PBM_PowerByte(const BYTE data, BYTE * resp, const UINT delay, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; ASCII buf[3] = "pxx"; BYTE respond[2+in->CRLF_size] ; num2string(&buf[1], data); RETURN_BAD_IF_BAD(PBM_SelectChannel(in)); RETURN_BAD_IF_BAD(PBM_write(PBM_string(buf), 3, in) ) ; // flush the buffers RETURN_BAD_IF_BAD(PBM_write(PBM_string("\r"), 1, in) ) ; RETURN_BAD_IF_BAD( PBM_readback_data( PBM_string(respond), 2, in) ) ; resp[0] = string2num((const ASCII *) respond); /* Release port mutex to give others a chance to access buses on the same port */ PORTUNLOCKIN(in); /* delay */ UT_delay(delay); /* lock port mutex again, caller expects locked port */ // now need to relock for further work in transaction CHANNELUNLOCKIN(in); // have to release channel, too BUSLOCKIN(in); return gbGOOD ; } // _sendback_bits // Send data and return response block // return 0=good static GOOD_OR_BAD PBM_PowerBit(const BYTE data, BYTE * resp, const UINT delay, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; BYTE buf[2+1+1+in->CRLF_size] ; buf[0] = '~'; //put in power bit mode buf[1] = data ? '1' : '0' ; // send to PBM (wait for final CR) RETURN_BAD_IF_BAD(PBM_SelectChannel(in)); RETURN_BAD_IF_BAD(PBM_write(buf, 2, in) ) ; /* Release port mutex to give others a chance to access buses on the same port */ PORTUNLOCKIN(in); // delay UT_delay(delay); /* lock port mutex again, caller expects locked port */ CHANNELUNLOCKIN(in); // have to release channel, too BUSLOCKIN(in); // // take out of power bit mode RETURN_BAD_IF_BAD(PBM_write(PBM_string("\r"), 1, in) ) ; // read back RETURN_BAD_IF_BAD( PBM_readback_data(buf, 1, in) ) ; // place data (converted back to hex) in resp resp[0] = (buf[0]=='0') ? 0x00 : 0xFF ; return gbGOOD; } // _sendback_data // Send data and return response block // return 0=good #define PBM_SEND_SIZE 32 static GOOD_OR_BAD PBM_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; size_t left = size; size_t location = 0 ; BYTE buf[1+PBM_SEND_SIZE*2+1+1+in->CRLF_size] ; if (size == 0) { return gbGOOD; } RETURN_BAD_IF_BAD(PBM_SelectChannel(in)); //Debug_Bytes( "PBM sendback send", data, size) ; while (left > 0) { // Loop through taking only 32 bytes at a time size_t this_length = (left > PBM_SEND_SIZE) ? PBM_SEND_SIZE : left; size_t this_length2 = 2 * this_length ; // doubled for switch from hex to ascii buf[0] = 'b'; //put in byte mode bytes2string((char *) &buf[1], &data[location], this_length); // load in data as ascii data buf[1+this_length2] = '\r'; // take out of byte mode // send to PBM RETURN_BAD_IF_BAD(PBM_write(buf, 1+this_length2+1, in) ) ; // read back RETURN_BAD_IF_BAD( PBM_readback_data(buf, this_length2, in) ) ; // place data (converted back to hex) in resp string2bytes((char *) buf, &resp[location], this_length); left -= this_length; location += this_length ; } //Debug_Bytes( "PBM sendback get", resp, size) ; return gbGOOD; } // _sendback_bits // Send data and return response block // return 0=good static GOOD_OR_BAD PBM_sendback_bits(const BYTE * databits, BYTE * respbits, const size_t size, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; size_t left = size; size_t location = 0 ; BYTE buf[1+PBM_SEND_SIZE+1+1+in->CRLF_size] ; if (size == 0) { return gbGOOD; } RETURN_BAD_IF_BAD(PBM_SelectChannel(in)); Debug_Bytes( "PBM sendback bits send", databits, size) ; while (left > 0) { // Loop through taking only 32 bytes at a time size_t this_length = (left > PBM_SEND_SIZE) ? PBM_SEND_SIZE : left; size_t i ; buf[0] = 'j'; //put in bit mode for ( i=0 ; ipown ; pin->timeout.tv_sec = tout / 1000; pin->timeout.tv_usec = 1000 * (tout % 1000); /* write string */ if (size && BAD( PBM_write(PBM_string(tx), size, in) ) ) { LEVEL_DEFAULT("PBM: error sending cmd"); return 0; } actual_size = COM_read_with_timeout(PBM_string((rx)), rxsize, in); if ( actual_size <= 0) { LEVEL_DEBUG("PBM: no answer from device!"); } PBM_slurp( in ) ; pin->timeout.tv_sec = Globals.timeout_serial ; pin->timeout.tv_usec = 0 ; return actual_size; } owfs-3.1p5/module/owlib/src/c/ow_enet_discover.c0000644000175000001440000002235512654730021016640 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ENET2 (OW-SERVER-ENET-2) discovery code */ /* Basically udp broadcast of "D" to port 30303 */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #ifdef HAVE_ARPA_INET_H #include #endif #include "jsmn.h" static GOOD_OR_BAD ENET_response( FILE_DESCRIPTOR_OR_ERROR file_descriptor, int multiple, struct enet_list * elist, struct addrinfo *now ) ; static void Setup_ENET_hint( struct addrinfo * hint ) ; static GOOD_OR_BAD send_ENET_discover( FILE_DESCRIPTOR_OR_ERROR file_descriptor, struct addrinfo *now ) ; static GOOD_OR_BAD set_ENET_broadcast( FILE_DESCRIPTOR_OR_ERROR file_descriptor ) ; static GOOD_OR_BAD Get_ENET_response( int multiple, struct enet_list * elist, struct addrinfo *now ) ; static void parse_ENET_response( char * response_buffer, int * found_version, char * found_ip, char * found_port ) ; /* from http://stackoverflow.com/questions/337422/how-to-udp-broadcast-with-c-in-linux */ static void Setup_ENET_hint( struct addrinfo * hint ) { memset(hint, 0, sizeof(struct addrinfo)); #ifdef AI_NUMERICSERV hint->ai_flags = AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV; #else hint->ai_flags = AI_CANONNAME | AI_NUMERICHOST; #endif hint->ai_family = AF_INET; // hint->ai_socktype = SOCK_DGRAM | SOCK_CLOEXEC ; // udp hint->ai_socktype = SOCK_DGRAM ; // udp hint->ai_protocol = 0; } #define RESPONSE_BUFFER_LENGTH 512 static GOOD_OR_BAD send_ENET_discover( FILE_DESCRIPTOR_OR_ERROR file_descriptor, struct addrinfo *now ) { char * message = "D"; if (sendto(file_descriptor, message, strlen(message), 0, now->ai_addr, now->ai_addrlen) < 0) { ERROR_CONNECT("Trouble sending broadcast message"); return gbBAD ; } return gbGOOD ; } static GOOD_OR_BAD set_ENET_broadcast( FILE_DESCRIPTOR_OR_ERROR file_descriptor ) { int broadcastEnable=1; if (setsockopt(file_descriptor, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable)) == -1) { ERROR_DEBUG("Cannot set socket option for broadcast."); return gbBAD ; } return gbGOOD ; } // maximun number of JSON tokens #define jsmnTOKnum 50 #define ENET_PARAM_SIZE 100 static void parse_ENET_response( char * response_buffer, int * found_version, char * found_ip, char * found_port ) { // use jsmn JSON parsing code jsmn_parser parser ; jsmntok_t tokens[jsmnTOKnum] ; int token_index ; enum { jsp_key, jsp_value, jsp_version, jsp_ip, jsp_port } jsp_string = jsp_key ; jsmn_init( &parser ) ; switch ( jsmn_parse( &parser, response_buffer, tokens, jsmnTOKnum ) ) { case JSMN_ERROR_NOMEM: LEVEL_DEBUG("Not enough JSON tokens were provided"); break ; case JSMN_ERROR_INVAL: LEVEL_DEBUG("Invalid character inside JSON string"); break ; case JSMN_ERROR_PART: LEVEL_DEBUG("The string is not a full JSON packet, more bytes expected"); break ; case JSMN_SUCCESS: break ; } //printf("PARSED tokens=%d\n",parser.toknext); for ( token_index = 0 ; token_index < parser.toknext ; ++token_index ) { int length = tokens[token_index].end - tokens[token_index].start ; char * tok_start = &response_buffer[tokens[token_index].start] ; char temp_null = tok_start[length] ; tok_start[length] = '\0' ; // null terminate temporarily // printf("Type %d Start %d End %d Size %d Length %d\n",tokens[token_index].type, tokens[token_index].start, tokens[token_index].end, tokens[token_index].size, length ) ; switch ( tokens[token_index].type ) { case JSMN_PRIMITIVE: //printf("Primative "); jsp_string = jsp_key ; // expect a key next break ; case JSMN_OBJECT: //printf("Object "); jsp_string = jsp_key ; // expect a key next break ; case JSMN_ARRAY: //printf("Array "); jsp_string = jsp_key ; // expect a key next break ; case JSMN_STRING: switch ( jsp_string ) { case jsp_key: // see if this is a special (interesting) key //printf("Key <%s>\n",tok_start); if ( strcmp( "IP", tok_start ) == 0 ) { //printf("IP match\n"); jsp_string = jsp_ip ; // IP address next } else if ( strcmp( "TCPIntfPort", tok_start ) == 0 ) { //printf("PORT match\n"); jsp_string = jsp_port ; // telnet port next } else if ( strcmp( "Product", tok_start ) == 0 ) { //printf("Product match\n"); jsp_string = jsp_version ; // telnet port next } else { //printf("No match\n"); jsp_string = jsp_value ; // value follows key (but not an interesting one) } break ; case jsp_value: //printf("Value <%s>\n",tok_start); jsp_string = jsp_key ; // new key follow value break ; case jsp_ip: //printf("IP <%s>\n",tok_start); jsp_string = jsp_key ; // new key follow value if ( ENET_PARAM_SIZE > length ) { strcpy( found_ip, tok_start ) ; } break ; case jsp_port: //printf("Port <%s>\n",tok_start); jsp_string = jsp_key ; // new key follow value if ( ENET_PARAM_SIZE > length ) { strcpy( found_port, tok_start ) ; } break ; case jsp_version: //printf("Product <%s>\n",tok_start); jsp_string = jsp_key ; // new key follow value if ( strstr( tok_start, "v2" ) != NULL ) { found_version[0] = 2 ; } else { found_version[0] = 1 ; } break ; } break ; } tok_start[length] = temp_null ; // restore char } } static GOOD_OR_BAD Get_ENET_response( int multiple, struct enet_list * elist, struct addrinfo *now ) { FILE_DESCRIPTOR_OR_ERROR file_descriptor; GOOD_OR_BAD resp ; file_descriptor = socket(now->ai_family, now->ai_socktype, now->ai_protocol) ; if ( FILE_DESCRIPTOR_NOT_VALID(file_descriptor) ) { ERROR_DEBUG("Cannot get socket file descriptor for broadcast."); return gbBAD; } resp = ENET_response( file_descriptor, multiple, elist, now ) ; Test_and_Close( & file_descriptor ) ; return resp ; } void Find_ENET_all( struct enet_list * elist ) { struct addrinfo *ai; struct addrinfo hint; struct addrinfo *now; int getaddr_error ; Setup_ENET_hint( &hint ) ; if ((getaddr_error = getaddrinfo("255.255.255.255", "30303", &hint, &ai))) { LEVEL_CONNECT("Couldn't set up ENET broadcast message %s", gai_strerror(getaddr_error)); return; } for (now = ai; now; now = now->ai_next) { if ( Get_ENET_response( 1, elist, now ) ) { continue ; } } freeaddrinfo(ai); } static GOOD_OR_BAD ENET_response( FILE_DESCRIPTOR_OR_ERROR file_descriptor, int multiple, struct enet_list * elist, struct addrinfo *now ) { struct timeval tv = { 2, 0 }; char response_buffer[RESPONSE_BUFFER_LENGTH] ; int at_least_one = 0 ; struct sockaddr_in from ; socklen_t fromlen = sizeof(struct sockaddr_in) ; if ( multiple ) { RETURN_BAD_IF_BAD( set_ENET_broadcast( file_descriptor ) ) ; } RETURN_BAD_IF_BAD( send_ENET_discover( file_descriptor, now ) ) ; /* now read */ do { ssize_t response = udp_read(file_descriptor, response_buffer, RESPONSE_BUFFER_LENGTH-1, &tv, &from, &fromlen) ; char enet_ip[ENET_PARAM_SIZE] ; char enet_port[ENET_PARAM_SIZE] ; int enet_version = 0 ; if ( response < 0 ) { if ( at_least_one == 0 ) { LEVEL_CONNECT("ENET response timeout"); } break ; } at_least_one = 1 ; response_buffer[response] = '\0' ; // null terminated string enet_ip[0] = '\0' ; enet_port[0] = '\0' ; parse_ENET_response( response_buffer, &enet_version, enet_ip, enet_port ) ; enet_list_add( enet_ip, enet_port, enet_version, elist ) ; //printf( "------- %d bytes from ENET\n%*s\n", (int)response, (int)response, response_buffer ) ; //printf(" IP=%s PORT=%s Version=%d\n", enet_ip, enet_port, enet_version ) ; if ( multiple == 0 ) { return gbGOOD ; } } while (1) ; return gbBAD ; } void Find_ENET_Specific( char * addr, struct enet_list * elist ) { struct addrinfo *ai; struct addrinfo hint; struct addrinfo *now; int getaddr_error ; Setup_ENET_hint( &hint ) ; if ((getaddr_error = getaddrinfo(addr, "30303", &hint, &ai))) { LEVEL_CONNECT("Couldn't set up ENET broadcast message %s", gai_strerror(getaddr_error)); return; } for (now = ai; now; now = now->ai_next) { if ( Get_ENET_response( 0, elist, now ) ) { continue ; } } freeaddrinfo(ai); } void enet_list_init( struct enet_list * elist ) { elist->members = 0 ; elist->head = NULL ; } void enet_list_kill( struct enet_list * elist ) { while ( elist->head ) { struct enet_member * head = elist->head ; elist->head = head->next ; owfree( head ) ; --elist->members ; } } void enet_list_add( char * ip, char * port, int version, struct enet_list * elist ) { struct enet_member * new = (struct enet_member *) owmalloc( sizeof( struct enet_member ) + 2 + strlen( ip ) + strlen( port ) ) ; if ( new == NULL ) { return ; } if ( strcmp( port, "0" ) == 0 ) { LEVEL_CALL("ENET at %s has 1-wire telnet access disabled.\n--> Use the Web configuration http://%s '1-Wire Setup'",ip,ip) ; owfree( new ) ; return ; } new->version = version ; strcpy( new->name, ip ) ; strcat( new->name, ":" ) ; strcat( new->name, port ) ; new->next = elist->head ; ++elist->members ; elist->head = new ; } owfs-3.1p5/module/owlib/src/c/ow_enet_monitor.c0000644000175000001440000001210512654730021016501 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" static void ENET_monitor_close(struct connection_in *in); static GOOD_OR_BAD ENET_monitor_in_use(const struct port_in * pin) ; static void ENET_scan_for_adapters(void) ; static void * ENET_monitor_loop( void * v ); /* Device-specific functions */ GOOD_OR_BAD ENET_monitor_detect(struct port_in *pin) { struct connection_in * in = pin->first ; struct address_pair ap ; pthread_t thread ; /* init_data has form "scan" or "scan:15" (15 seconds) */ Parse_Address( pin->init_data, &ap ) ; in->master.enet_monitor.enet_scan_interval = DEFAULT_ENET_SCAN_INTERVAL ; switch ( ap.entries ) { case 0: in->master.enet_monitor.enet_scan_interval = DEFAULT_ENET_SCAN_INTERVAL ; break ; case 1: switch( ap.first.type ) { case address_numeric: in->master.enet_monitor.enet_scan_interval = ap.first.number ; break ; default: in->master.enet_monitor.enet_scan_interval = DEFAULT_ENET_SCAN_INTERVAL ; break ; } break ; case 2: switch( ap.second.type ) { case address_numeric: in->master.enet_monitor.enet_scan_interval = ap.second.number ; break ; default: in->master.enet_monitor.enet_scan_interval = DEFAULT_ENET_SCAN_INTERVAL ; break ; } break ; } Free_Address( &ap ) ; pin->type = ct_none ; // Device name will not be init_data copy SAFEFREE(DEVICENAME(in)) ; DEVICENAME(in) = owstrdup("ENET bus monitor") ; pin->file_descriptor = FILE_DESCRIPTOR_BAD; in->iroutines.detect = ENET_monitor_detect; in->Adapter = adapter_enet_monitor; in->iroutines.reset = NO_RESET_ROUTINE; in->iroutines.next_both = NO_NEXT_BOTH_ROUTINE; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = NO_SENDBACKDATA_ROUTINE; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE ; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = ENET_monitor_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_sham; in->adapter_name = "ENET scan"; pin->busmode = bus_enet_monitor ; // repeat since can come via usb=scan Init_Pipe( in->master.enet_monitor.shutdown_pipe ) ; if ( pipe( in->master.enet_monitor.shutdown_pipe ) != 0 ) { ERROR_DEFAULT("Cannot allocate a shutdown pipe. The program shutdown may be messy"); Init_Pipe( in->master.enet_monitor.shutdown_pipe ) ; } if ( BAD( ENET_monitor_in_use(pin) ) ) { LEVEL_CONNECT("Second call for ENET scanning ignored") ; return gbBAD ; } if ( pthread_create(&thread, DEFAULT_THREAD_ATTR, ENET_monitor_loop, (void *) in) != 0 ) { ERROR_CALL("Cannot create the ENET monitoring program thread"); return gbBAD ; } return gbGOOD ; } static GOOD_OR_BAD ENET_monitor_in_use(const struct port_in * pin) { struct port_in * p_index = Inbound_Control.head_port ; while ( p_index != NULL ) { if ( p_index->busmode == bus_enet_monitor ) { if ( pin != p_index ) { return gbBAD ; } } p_index = p_index->next ; } return gbGOOD; // not found in the current inbound list } static void ENET_monitor_close(struct connection_in *in) { if ( FILE_DESCRIPTOR_VALID( in->master.enet_monitor.shutdown_pipe[fd_pipe_write] ) ) { ignore_result = write( in->master.enet_monitor.shutdown_pipe[fd_pipe_write],"X",1) ; //dummy payload } Test_and_Close_Pipe(in->master.enet_monitor.shutdown_pipe) ; } static void * ENET_monitor_loop( void * v ) { struct connection_in * in = v ; FILE_DESCRIPTOR_OR_ERROR file_descriptor = in->master.enet_monitor.shutdown_pipe[fd_pipe_read] ; DETACH_THREAD; do { fd_set readset; struct timeval tv = { in->master.enet_monitor.enet_scan_interval, 0, }; /* Initialize readset */ FD_ZERO(&readset); if ( FILE_DESCRIPTOR_VALID( file_descriptor ) ) { FD_SET(file_descriptor, &readset); } ENET_scan_for_adapters() ; if ( select( file_descriptor+1, &readset, NULL, NULL, &tv ) != 0 ) { break ; // don't scan any more -- perhaps a close? } } while (1) ; return VOID_RETURN ; } static void ENET_scan_for_adapters(void) { struct enet_list elist ; struct enet_member * em ; MONITOR_RLOCK ; LEVEL_DEBUG("ENET SCAN!"); enet_list_init( &elist ) ; Find_ENET_all( &elist ) ; em = elist.head ; if ( em == NULL ) { } else { while ( em != NULL ) { struct port_in * pnew = AllocPort( NULL ) ; if ( pnew == NULL ) { break ; } if ( GOOD(OWServer_Enet_setup( em->name, em->version, pnew )) ) { // Add the device, but no need to check for bad match Add_InFlight( NULL, pnew ) ; } em = em->next ; } } enet_list_kill( &elist ) ; MONITOR_RUNLOCK ; } owfs-3.1p5/module/owlib/src/c/ow_eprom_write.c0000644000175000001440000000462512654730021016343 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Changes 7/2004 Extensive improvements based on input from Serg Oskin */ #include #include "owfs_config.h" #include "ow_standard.h" /* ------- Prototypes ----------- */ static GOOD_OR_BAD COMMON_write_eprom_mem(const BYTE * data, size_t size, off_t offset, const struct parsedname *pn); static GOOD_OR_BAD OW_write_eprom_byte(BYTE code, BYTE data, off_t offset, const struct parsedname *pn); #define _1W_WRITE_MEMORY 0x0F #define _1W_WRITE_STATUS 0x55 // use owq instead of components ZERO_OR_ERROR COMMON_write_eprom_mem_owq(struct one_wire_query * owq) { return GB_to_Z_OR_E(COMMON_write_eprom_mem( OWQ_explode(owq))); } static GOOD_OR_BAD COMMON_write_eprom_mem(const BYTE * data, size_t size, off_t offset, const struct parsedname *pn) { int byte_number; for (byte_number = 0; byte_number < (int) size; ++byte_number) { RETURN_BAD_IF_BAD( OW_write_eprom_byte(_1W_WRITE_MEMORY, data[byte_number], offset + byte_number, pn) ) ; } return gbGOOD; } static GOOD_OR_BAD OW_write_eprom_byte(BYTE code, BYTE data, off_t offset, const struct parsedname *pn) { BYTE p[6] = { code, LOW_HIGH_ADDRESS(offset), data, }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 4, 0), TRXN_PROGRAM, TRXN_END, }; return BUS_transaction(t, pn) ; } owfs-3.1p5/module/owlib/src/c/ow_etherweather.c0000644000175000001440000002000012654730021016457 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* Written by Jacob Potter 2007 for the "EtherWeather": It started out as a school-related project, then grew into a hobby/for-fun thing, and now I'm polishing it off to be able to sell. The main components are an AVR microcontroller and Ethernet chip; I wrote all the interface and application code (using the uIP TCP/IP stack). I'm planning to keep the firmware closed, but the communication protocols and support code will all be open. The system listens on a TCP socket and acts as a low-level bus master (reset/bit/byte, strong pullup, and search acceleration), so it should be able to talk to any device supported by the code talking to it. Besides waiting for connections from PC-side software such as OWFS, it can also periodically connect to a remote system over the Internet to receive commands, and I've written some code to handle that as well. At the moment, I've built a few prototypes and am waiting for the next round of components and boards to come in. The majority of the software (firmware w/DHCP, bootloader, OWFS patch, and service daemon/Web interface) is working, although not polished off yet. The board is 2" x 3", runs off of 7-9v DC, and should cost around $50 (assembled/programmed, but without case and power supply). */ /* Alfille 2014: * Etherweather seems to never have taken off commercially. * Use this as a reference driver */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #define EtherWeather_COMMAND_RESET 'R' #define EtherWeather_COMMAND_ACCEL 'A' #define EtherWeather_COMMAND_BYTES 'B' #define EtherWeather_COMMAND_BITS 'b' #define EtherWeather_COMMAND_POWER 'P' static RESET_TYPE EtherWeather_reset(const struct parsedname *pn) ; static int EtherWeather_command(struct connection_in *in, char command, int datalen, const BYTE * idata, BYTE * odata) ; static void EtherWeather_close(struct connection_in *in); static GOOD_OR_BAD EtherWeather_PowerByte(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn); static enum search_status EtherWeather_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD EtherWeather_sendback_bits(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn); static GOOD_OR_BAD EtherWeather_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn); static void EtherWeather_setroutines(struct connection_in *in); static int EtherWeather_command(struct connection_in *in, char command, int datalen, const BYTE * idata, BYTE * odata) { struct port_in * pin = in->pown ; BYTE *packet; // The packet's length field includes the command byte. packet = owmalloc(datalen + 2); if ( packet== NULL ) { return -ENOMEM ; } packet[0] = datalen + 1; packet[1] = command; memcpy( &packet[2], idata, datalen); pin->timeout.tv_sec = 0 ; pin->timeout.tv_usec = 200000 ; if ( BAD(COM_write( packet, datalen+2, in) ) ) { ERROR_CONNECT("Trouble writing data to EtherWeather: %s", SAFESTRING(DEVICENAME(in))); STAT_ADD1_BUS(e_bus_write_errors, in); owfree(packet) ; return -EIO ; } // Allow extra time for powered bytes if (command == 'P') { pin->timeout.tv_sec += 2 ; } // Read the response header if ( BAD(COM_read( packet, 2, in )) ) { LEVEL_CONNECT("header read error"); owfree(packet); return -EIO; } // Make sure it was echoed properly if (packet[0] != (datalen + 1) || packet[1] != command) { LEVEL_CONNECT("invalid header"); owfree(packet); return -EIO; } // Then read any data if (datalen > 0) { if ( BAD(COM_read( odata, datalen, in )) ) { LEVEL_CONNECT("data read error"); owfree(packet); return -EIO; } } owfree(packet); return 0; } static GOOD_OR_BAD EtherWeather_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { if (EtherWeather_command(pn->selected_connection, EtherWeather_COMMAND_BYTES, size, data, resp)) { return gbBAD; } return gbGOOD; } static GOOD_OR_BAD EtherWeather_sendback_bits(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { if (EtherWeather_command(pn->selected_connection, EtherWeather_COMMAND_BITS, size, data, resp)) { return gbBAD; } return gbGOOD; } static enum search_status EtherWeather_next_both(struct device_search *ds, const struct parsedname *pn) { BYTE sendbuf[9]; // if the last call was not the last one if (ds->LastDevice) { return search_done; } if ( BAD( BUS_select(pn) ) ) { return search_error ; } memcpy(sendbuf, ds->sn, SERIAL_NUMBER_SIZE); if (ds->LastDiscrepancy == -1) { sendbuf[8] = 0x40; } else { sendbuf[8] = ds->LastDiscrepancy; } if (ds->search == 0xEC) { sendbuf[8] |= 0x80; } if (EtherWeather_command(pn->selected_connection, EtherWeather_COMMAND_ACCEL, 9, sendbuf, sendbuf)) { return search_error; } if (sendbuf[8] == 0xFF) { /* No devices */ return search_done; } memcpy(ds->sn, sendbuf, 8); if (CRC8(ds->sn, 8) || (ds->sn[0] == 0)) { /* Bus error */ return search_error; } /* 0xFE indicates no discrepancies */ ds->LastDiscrepancy = sendbuf[8]; if (ds->LastDiscrepancy == 0xFE) { ds->LastDiscrepancy = -1; } ds->LastDevice = (sendbuf[8] == 0xFE); LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; } static GOOD_OR_BAD EtherWeather_PowerByte(const BYTE byte, BYTE * resp, const UINT delay, const struct parsedname *pn) { BYTE pbbuf[2]; /* PowerByte command specifies delay in 500ms ticks, not milliseconds */ pbbuf[0] = (delay + 499) / 500; pbbuf[1] = byte; LEVEL_DEBUG("SPU: %d %d", pbbuf[0], pbbuf[1]); if (EtherWeather_command(pn->selected_connection, EtherWeather_COMMAND_POWER, 2, pbbuf, pbbuf)) { return gbBAD; } *resp = pbbuf[1]; return gbGOOD; } static void EtherWeather_close(struct connection_in *in) { // the standard COM-free cleans up the connection (void) in ; } static RESET_TYPE EtherWeather_reset(const struct parsedname *pn) { if (EtherWeather_command(pn->selected_connection, EtherWeather_COMMAND_RESET, 0, NULL, NULL)) { return BUS_RESET_ERROR; } return BUS_RESET_OK; } static void EtherWeather_setroutines(struct connection_in *in) { in->iroutines.detect = EtherWeather_detect; in->iroutines.reset = EtherWeather_reset; in->iroutines.next_both = EtherWeather_next_both; in->iroutines.PowerByte = EtherWeather_PowerByte; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = EtherWeather_sendback_data; in->iroutines.sendback_bits = EtherWeather_sendback_bits; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = EtherWeather_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_overdrive | ADAP_FLAG_dirgulp | ADAP_FLAG_no2409path | ADAP_FLAG_no2404delay ; } GOOD_OR_BAD EtherWeather_detect(struct port_in *pin) { struct connection_in * in = pin->first ; struct parsedname pn; FS_ParsedName_Placeholder(&pn); // minimal parsename -- no destroy needed pn.selected_connection = in; LEVEL_CONNECT("Connecting to EtherWeather"); /* Set up low-level routines */ EtherWeather_setroutines(in); if (pin->init_data == NULL) { LEVEL_DEFAULT("Etherweather bus master requires a port name"); return gbBAD; } pin->type = ct_tcp ; RETURN_BAD_IF_BAD( COM_open(in) ) ; /* TODO: probe version, and confirm that it's actually an EtherWeather */ LEVEL_CONNECT("Connected to EtherWeather at %s", DEVICENAME(in)); in->Adapter = adapter_EtherWeather; in->adapter_name = "EtherWeather"; pin->busmode = bus_etherweather; return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_example_slave.c0000644000175000001440000002025212654730021016626 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* Example slave -- 1-wire slave example to show developers how to write support for a new 1-wire device */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ // Example_slave /* Notes for a new slave device -- what files to change A. Property functions: 1. Create this file with READ_FUNCTION and WRITE_FUNCTION for the different properties 2. Create the filetype struct for each property 3. Create the DeviceEntry or DeviceEntryExtended struct 4. Write all the appropriate property functions 5. Add any visibility functions if needed 6. Add this file and the header file to the CVS B. Header 1. Create a similarly named header file in ../include 2. Protect inclusion with #ifdef / #define / #endif 3. Link the DeviceHeader* to the include file C. Makefile and include 1. Add this file to Makefile.am 2. Add the header to ../include/Makefile.am 3. Add the header file to ../include/devices.h D. Device tree 1. Add the appropriate entry to the device tree in * ow_tree.c * SUMMARY: * create the slave_support file (this one) and the (simple) header file * add references to the slave in ow_tree.c ow_devices.h and both Makefile.am * Add the files the the CVS repository */ #include #include "owfs_config.h" #include "ow_example_slave.h" /* ------- Prototypes ----------- */ /* Here are the functions that perform the tasks of the listed properties * Unually there is on function for each read and write task, but there is * a data field that can be used to distinguish similar tasks and pool the code * * The functions get the onw_wire_query structure that contains buffers for data or results * and the parsedname structure that contains information on the name, serial number, * extra data and extension * * sometimes it makes sense to have an internal (hidden) field that corresponds better * to the devices registers, and different "linked" properties that access the register * for presentation */ /* Example slave */ READ_FUNCTION(FS_r_read_number); READ_FUNCTION(FS_r_read_bits); READ_FUNCTION(FS_r_is_index_prime); READ_FUNCTION(FS_r_extension_characters); /* ------- Structures ----------- */ /* Here are the "aggregate" structures * For properties that have an extension * e.g. PIO.A PIO.B * one set of functions can be used to manage the data * * There are several aggregate types: * 1. aggregate -- a single internal value is access on the slave, but it's also addressable separately * And example would be an 8-bit register that corresponds to 8 pio pins. Read set and cleared * together by the chip, but owfs can use then separately or as a single entity * e.g. DS2408 PIO pins * 2. separate -- a set of values that have similar structure, but are treated separately internally * owfs can pretend they are individual or unified * e.g. DS2450 voltage readings * 3. sparse -- the "extension" the value after the dot, isn't really an index, but rather a field that can * be used in the property processing. Perhaps a memory location or a parameter setting * An example could be a baud rate or parity setting. * Clearly there is no "ALL" since the range of the extension is essentially unknown and unlimitted. */ static struct aggregate AExample_bits = { 8, ag_numbers, ag_aggregate, }; static struct aggregate AExample_prime = { 0, ag_numbers, ag_sparse, }; static struct aggregate AExample_chars = { 0, ag_letters, ag_sparse, }; static struct filetype Example_slave[] = { F_STANDARD, {"read_number", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_stable, FS_r_read_number, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"bits", PROPERTY_LENGTH_BITFIELD, &AExample_bits, ft_bitfield, fc_stable, FS_r_read_bits, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"is_index_prime", PROPERTY_LENGTH_YESNO, &AExample_prime, ft_yesno, fc_volatile, FS_r_is_index_prime, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"extension_characters", PROPERTY_LENGTH_UNSIGNED, &AExample_chars, ft_unsigned, fc_volatile, FS_r_extension_characters, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; DeviceEntryExtended(DD, Example_slave, DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _EXAMPLE_SLAVE_DEFAULT_VALUE 42 /* ------- Functions ------------ */ /* Simple number read */ static ZERO_OR_ERROR FS_r_read_number(struct one_wire_query *owq) { // Simple function that returns an integer. // More usual case would be to send instructions to the slave over the 1-wire bus // and return the (interpreted) result. OWQ_I(owq) = _EXAMPLE_SLAVE_DEFAULT_VALUE ; // OWQ structure holds the result. the format (integer in this case) comes from a // property field (ft_integer in this case) return 0; // no error } /* Simple bitfield */ static ZERO_OR_ERROR FS_r_read_bits(struct one_wire_query *owq) { // Simple function that returns a bitfield. // This means it's an array of bits and can be accessed as // bit list: bits.ALL // unsigned number: bits.BYTE // or individual bits: bits.0, ... bits.7 // Note that all this handling is done at a higher level // All we need to do here is return a single unsigned number OWQ_U(owq) = _EXAMPLE_SLAVE_DEFAULT_VALUE ; // OWQ structure holds the result. the format (integer in this case) comes from a // property field (ft_integer in this case) return 0; // no error } /* Sparse numeric indexes */ static ZERO_OR_ERROR FS_r_is_index_prime(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; // Get the parsename reference int array_index ; // array index // Here we'll use the index as a number (integer) and test whether the number is prime // The index is not an array index. // There is no pre-defined number of elements // There is no ".ALL" function available // The index string was parsed and converted to a number, but // no bounds checking was done (unlike a normal array). array_index = pn->extension ; // Prime number test // pick off negatives, 0, 1, 2, evens // Then test by dividing by odds up to square root if ( array_index < 1 ) { return -EINVAL ; } else if ( array_index == 1 ) { OWQ_Y(owq) = 1 ; // 1 is prime } else if ( array_index == 2 ) { OWQ_Y(owq) = 1 ; // 2 is prime } else if ( array_index % 2 == 0 ) { OWQ_Y(owq) = 0 ; // even is not prime } else { int idiv = 1 ; // test devisor OWQ_Y(owq) = 1 ; // assume prime do { idiv += 2 ; // still odd if ( array_index % idiv == 0 ) { OWQ_Y(owq) = 0 ; // non-prime break ; } } while ( idiv < (array_index/idiv) ) ; } return 0; } // Number of characters in extension index static ZERO_OR_ERROR FS_r_extension_characters(struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; // Get the parsename reference // This is another sparse array -- no ALL or max element // Even more, it is really a hash array -- the index is text. // We can use the text however we want. // Unlike normal arrays, any parsing and bounds checking is up to us. if ( pn->sparse_name == NULL ) { return -EINVAL ; } // In this case, just return the string length OWQ_U(owq) = strlen( pn->sparse_name ) ; return 0; } owfs-3.1p5/module/owlib/src/c/ow_exec.c0000644000175000001440000000550612654730021014732 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" /* Utility functions to copy arguements and restart the program */ /* Save the original command line args */ void ArgCopy( int argc, char * argv[] ) { Globals.argc = 0 ; // default bad value if ( argc > 0 ) { Globals.argv = owcalloc( argc+1, sizeof( char * ) ) ; if ( Globals.argv != NULL ) { int i ; Globals.argc = argc ; for ( i=0 ; i 0 ) { int i ; for ( i=0 ; ifunc)(sre->data) ; } break ; default: // All the other routines use the standard loop // and standard stopper InterruptListening() ; break ; } // Close sockets FreeOutAll() ; // wait to settle down sleep( Globals.restart_seconds ) ; } static void RestartProgram( void * v ) { int argc = Globals.argc ; char * argv[argc+1] ; int i ; /* Copy arguements before cleaning up */ for ( i=0 ; i <= argc ; ++i ) { argv[i] = NULL ; if ( Globals.argv[i] != NULL ) { argv[i] = strdup( Globals.argv[i] ) ; } } // Close sockets StopProgram( v ) ; /* Execute fresh version */ errno = 0 ; execvp( argv[0], argv ) ; Globals.exitmode = exit_normal ; fprintf(stderr,"Could not rerun %s. %s Exit\n",argv[0],strerror(errno)); exit(0) ; } /* Restart program -- configuration file changed, presumably */ void ReExecute( void * v ) { LEVEL_CALL( "Restarting %s",Globals.argv[0] ) ; switch( Globals.inet_type ) { case inet_launchd: LEVEL_CALL("Will close %s and let the operating system (launchd) restart",Globals.argv[0] ) ; exit(0) ; case inet_systemd: LEVEL_CALL("Will close %s and let the operating system (systemd) restart",Globals.argv[0] ) ; exit(0) ; default: RestartProgram(v) ; } } owfs-3.1p5/module/owlib/src/c/ow_exit.c0000644000175000001440000000353412654730021014756 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" void ow_exit(int exit_code) { LEVEL_DEBUG("Exit code = %d", exit_code); if (IS_MAINTHREAD) { switch ( Globals.exitmode ) { case exit_normal: LibClose(); break ; case exit_exec: sleep( 2 * Globals.restart_seconds ) ; // wait for RestartProgram() to do it's work break ; case exit_early: break ; } } #ifdef __UCLIBC__ /* Process never die on WRT54G router with uClibc if exit() is used */ _exit(exit_code); #else exit(exit_code); #endif } void exit_handler(int signo, siginfo_t * info, void *context) { (void) context; if (info) { LEVEL_DEBUG ("Signal=%d, errno %d, code %d, pid=%ld, Threads: this=%lu main=%lu", signo, info->si_errno, info->si_code, (long int) info->si_pid, pthread_self(), main_threadid); } else { LEVEL_DEBUG("Signal=%d, Threads: this=%lu, main=%lu", signo, pthread_self(), main_threadid); } if (StateInfo.shutting_down) { LEVEL_DEBUG("exit_handler: shutdown already in progress. signo=%d, self=%lu, main=%lu", signo, pthread_self(), main_threadid); } else { StateInfo.shutting_down = 1; if (info != NULL) { if (SI_FROMUSER(info)) { LEVEL_DEBUG("Kill signal from user"); } if (SI_FROMKERNEL(info)) { LEVEL_DEBUG("Kill signal from system"); } } if (!IS_MAINTHREAD) { LEVEL_DEBUG("Kill from main thread: %lu this=%lu Signal=%d", main_threadid, pthread_self(), signo); pthread_kill(main_threadid, signo); } else { LEVEL_DEBUG("Ignore kill from this thread. main=%lu this=%lu Signal=%d", main_threadid, pthread_self(), signo); } } } owfs-3.1p5/module/owlib/src/c/ow_external.c0000644000175000001440000000327212654730021015626 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" #include "ow_external.h" static void External_setroutines(struct connection_in *in); /* External program link * Use programs instead of 1-wire slave * The initial setup is in ow_parse_external.c * Reads and writes are in ow_read_external.c and ow_write_external.c * and ___ in ow_fi9nd_external.c * */ static void External_setroutines(struct connection_in *in) { in->iroutines.detect = External_detect; in->iroutines.reset = NO_RESET_ROUTINE ; in->iroutines.next_both = NO_NEXT_BOTH_ROUTINE; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = NO_SENDBACKDATA_ROUTINE ; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = NO_SELECT_ROUTINE ; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = NO_CLOSE_ROUTINE; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = 0 ; in->bundling_length = 1; } GOOD_OR_BAD External_detect(struct port_in *pin) { struct connection_in * in = pin->first ; External_setroutines(in); in->Adapter = adapter_external; in->adapter_name = "External"; return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_find_external.c0000644000175000001440000000372112654730021016625 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_external.h" int sensor_compare( const void * a , const void * b ) { const struct sensor_node * na = a ; const struct sensor_node * nb = b ; return strcmp( na->name, nb->name ) ; } struct sensor_node * Find_External_Sensor( char * sensor ) { struct sensor_node sense_key = { .name = sensor, } ; // find sensor node struct { struct sensor_node * key ; char other[0] ; } * opaque = tfind( (void *) (&sense_key), &sensor_tree, sensor_compare ) ; return opaque==NULL ? NULL : opaque->key ; } int property_compare( const void * a , const void * b ) { const struct property_node * na = a ; const struct property_node * nb = b ; int c = strcmp( na->family, nb->family ) ; if ( c==0 ) { return strcmp( na->property, nb->property ) ; } return c ; } struct property_node * Find_External_Property( char * family, char * property ) { struct property_node property_key = { .family = family , .property = property , } ; // find property node struct { struct property_node * key ; char other[0] ; } * opaque = tfind( (void *) (&property_key), &property_tree, property_compare ) ; return opaque==NULL ? NULL : opaque->key ; } int family_compare( const void * a , const void * b ) { const struct family_node * na = a ; const struct family_node * nb = b ; return strcmp( na->family, nb->family ) ; } struct family_node * Find_External_Family( char * family ) { struct family_node family_key = { .family = family, } ; // find family node struct { struct family_node * key ; char other[0] ; } * opaque = tfind( (void *) (&family_key), &family_tree, family_compare ) ; return opaque==NULL ? NULL : opaque->key ; } owfs-3.1p5/module/owlib/src/c/ow_fs_address.c0000644000175000001440000000377312654730021016127 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_standard.h" /* ------- Prototypes ------------ */ /* ------- Functions ------------ */ ZERO_OR_ERROR FS_address(struct one_wire_query *owq) { ASCII ad[SERIAL_NUMBER_SIZE*2]; struct parsedname *pn = PN(owq); bytes2string(ad, pn->sn, SERIAL_NUMBER_SIZE); return OWQ_format_output_offset_and_size(ad, SERIAL_NUMBER_SIZE*2, owq); } ZERO_OR_ERROR FS_r_address(struct one_wire_query *owq) { int sn_index, ad_index; ASCII ad[SERIAL_NUMBER_SIZE*2]; struct parsedname *pn = PN(owq); for (sn_index = SERIAL_NUMBER_SIZE-1, ad_index = 0; sn_index >= 0; --sn_index, ad_index += 2) { num2string(&ad[ad_index], pn->sn[sn_index]); } return OWQ_format_output_offset_and_size(ad, SERIAL_NUMBER_SIZE*2, owq); } owfs-3.1p5/module/owlib/src/c/ow_fs_alias.c0000644000175000001440000000251612654730021015565 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_standard.h" /* ------- Prototypes ------------ */ /* ------- Functions ------------ */ ZERO_OR_ERROR FS_r_alias(struct one_wire_query *owq) { BYTE * sn = OWQ_pn(owq).sn ; ASCII * alias_name = Cache_Get_Alias( sn ) ; if ( alias_name != NULL ) { ZERO_OR_ERROR zoe = OWQ_format_output_offset_and_size_z(alias_name, owq); LEVEL_DEBUG("Found alias %s for "SNformat,alias_name,SNvar(sn)); owfree( alias_name ) ; return zoe; } LEVEL_DEBUG("Didn't find alias %s for "SNformat,alias_name,SNvar(sn)); return OWQ_format_output_offset_and_size_z("", owq); } ZERO_OR_ERROR FS_w_alias(struct one_wire_query *owq) { size_t size = OWQ_size(owq) ; ASCII * alias_name = owmalloc( size+1 ) ; GOOD_OR_BAD gob ; if ( alias_name == NULL ) { return -ENOMEM ; } // make a slightly larger buffer and add a null terminator memset( alias_name, 0, size+1 ) ; memcpy( alias_name, OWQ_buffer(owq), size ) ; gob = Test_and_Add_Alias( alias_name, OWQ_pn(owq).sn ) ; owfree( alias_name ) ; return GOOD(gob) ? 0 : -EINVAL ; } owfs-3.1p5/module/owlib/src/c/ow_fs_code.c0000644000175000001440000000312112654730021015377 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_standard.h" /* ------- Prototypes ------------ */ /* ------- Functions ------------ */ ZERO_OR_ERROR FS_code(struct one_wire_query *owq) { ASCII code[2]; struct parsedname *pn = PN(owq); num2string(code, pn->sn[0]); return OWQ_format_output_offset_and_size(code, 2, owq); } owfs-3.1p5/module/owlib/src/c/ow_fs_crc8.c0000644000175000001440000000311612654730021015330 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_standard.h" /* ------- Prototypes ------------ */ /* ------- Functions ------------ */ ZERO_OR_ERROR FS_crc8(struct one_wire_query *owq) { ASCII crc[2]; struct parsedname *pn = PN(owq); num2string(crc, pn->sn[7]); return OWQ_format_output_offset_and_size(crc, 2, owq); } owfs-3.1p5/module/owlib/src/c/ow_fs_id.c0000644000175000001440000000361312654730021015067 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_standard.h" /* ------- Prototypes ------------ */ /* ------- Functions ------------ */ ZERO_OR_ERROR FS_ID(struct one_wire_query *owq) { ASCII id[12]; struct parsedname *pn = PN(owq); bytes2string(id, &(pn->sn[1]), 6); return OWQ_format_output_offset_and_size(id, 12, owq); } ZERO_OR_ERROR FS_r_ID(struct one_wire_query *owq) { int sn_index, id_index; ASCII id[12]; struct parsedname *pn = PN(owq); for (sn_index = 6, id_index = 0; sn_index > 0; --sn_index, id_index += 2) { num2string(&id[id_index], pn->sn[sn_index]); } return OWQ_format_output_offset_and_size(id, 12, owq); } owfs-3.1p5/module/owlib/src/c/ow_fs_type.c0000644000175000001440000000316312654730021015454 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_standard.h" #include "ow_counters.h" #include "ow_connection.h" /* ------- Prototypes ------------ */ /* ------- Functions ------------ */ ZERO_OR_ERROR FS_type(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); return OWQ_format_output_offset_and_size_z(pn->selected_device->readable_name, owq); } owfs-3.1p5/module/owlib/src/c/ow_getbit.c0000644000175000001440000000226212654730021015260 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" /* Set and get a bit from a binary buffer */ /* Robin Gilks discovered that this is not endian-safe for setting bits in integers * so see UT_getbit_U and UT_getbit_U * */ int UT_getbit(const BYTE * buf, int loc) { // devide location by 8 to get byte return (((buf[loc >> 3]) >> (loc & 0x7)) & 0x01); } void UT_setbit(BYTE * buf, int loc, int bit) { if (bit) { buf[loc >> 3] |= 0x01 << (loc & 0x7); } else { buf[loc >> 3] &= ~(0x01 << (loc & 0x7)); } } int UT_get2bit(const BYTE * buf, int loc) { return (((buf[loc >> 2]) >> ((loc & 0x3) << 1)) & 0x03); } void UT_set2bit(BYTE * buf, int loc, int bits) { BYTE *p = &buf[loc >> 2]; switch (loc & 3) { case 0: *p = (*p & 0xFC) | bits; return; case 1: *p = (*p & 0xF3) | (bits << 2); return; case 2: *p = (*p & 0xCF) | (bits << 4); return; case 3: *p = (*p & 0x3F) | (bits << 6); return; } } owfs-3.1p5/module/owlib/src/c/ow_getbit_U.c0000644000175000001440000000164412654730021015547 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" // #define UT_getbit(buf, loc) ( ( (buf)[(loc)>>3]>>((loc)&0x7) ) &0x01 ) /* Set and get a bit withing an unsigned integer */ /* Robin Gilks discovered that UT_getbit and UT_setbit are not * endian-safe for setting bits in integers * so see UT_getbit_U and UT_getbit_U * */ int UT_getbit_U( UINT U, int loc) { // get 'loc' bit from lsb return ( (U >> loc) & 0x01); } void UT_setbit_U( UINT * U, int loc, int bit) { if (bit) { // set the bit (ignore what was there before) U[0] |= ( 1 << loc ); } else if ( UT_getbit_U( U[0], loc ) ) { // need to clear the bit U[0] ^= ( 1 << loc ); } } owfs-3.1p5/module/owlib/src/c/ow_ha5.c0000644000175000001440000005324112654730021014462 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" //static void byteprint( const BYTE * b, int size ) ; GOOD_OR_BAD HA5_detect_parsed(struct address_pair *ap, struct connection_in *in); static RESET_TYPE HA5_reset(const struct parsedname *pn); static RESET_TYPE HA5_reset_in(struct connection_in * in) ; static RESET_TYPE HA5_reset_wrapped(struct connection_in * in) ; static enum search_status HA5_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD HA5_sendback_part(char cmd, const BYTE * data, BYTE * resp, const size_t size, struct connection_in * in) ; static GOOD_OR_BAD HA5_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD HA5_select_and_sendback(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static void HA5_setroutines(struct connection_in *in); static void HA5_close(struct connection_in *in); static GOOD_OR_BAD HA5_reconnect( const struct parsedname *pn ) ; static enum search_status HA5_directory(struct device_search *ds,const struct parsedname *pn); static GOOD_OR_BAD HA5_select( const struct parsedname * pn ) ; static GOOD_OR_BAD HA5_select_wrapped( const struct parsedname * pn ) ; static GOOD_OR_BAD HA5_resync( struct connection_in * in ) ; static GOOD_OR_BAD HA5_channel_list( char * alpha_string, struct connection_in * initial_in ) ; static GOOD_OR_BAD HA5_test_channel( struct connection_in * in ) ; static GOOD_OR_BAD TestChecksum( unsigned char * check_string, int length ) ; static GOOD_OR_BAD HA5_checksum_support( struct connection_in * in ) ; static GOOD_OR_BAD HA5_find_channel( struct connection_in * in ) ; static void HA5_slurp( struct connection_in *in) ; static void HA5_flush( struct connection_in *in) ; static GOOD_OR_BAD HA5_read( BYTE * data, size_t length, struct connection_in *in) ; static GOOD_OR_BAD HA5_write( char command, char * raw_string, int length, struct connection_in * in ) ; static GOOD_OR_BAD HA5_sendback_bits(const BYTE * outbits, BYTE * inbits, const size_t length, const struct parsedname *pn) ; static GOOD_OR_BAD HA5_bit( BYTE send, BYTE * receive, struct connection_in * in ) ; #define CR_char (0x0D) static void HA5_setroutines(struct connection_in *in) { in->iroutines.detect = HA5_detect; in->iroutines.reset = HA5_reset; in->iroutines.next_both = HA5_next_both; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = HA5_sendback_data; in->iroutines.sendback_bits = HA5_sendback_bits; in->iroutines.select = HA5_select ; in->iroutines.select_and_sendback = HA5_select_and_sendback; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = HA5_reconnect; in->iroutines.close = HA5_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_dirgulp | ADAP_FLAG_bundle | ADAP_FLAG_dir_auto_reset | ADAP_FLAG_no2404delay | ADAP_FLAG_presence_from_dirblob ; in->bundling_length = HA5_FIFO_SIZE; } GOOD_OR_BAD HA5_detect(struct port_in *pin) { struct connection_in * in = pin->first ; struct address_pair ap ; GOOD_OR_BAD gbResult ; // default /* Set up low-level routines */ HA5_setroutines(in); /* By definition, this is the head adapter on this port */ in->master.ha5.head = in ; // Poison current "Address" for adapter memset( in->remembered_sn, 0x00, SERIAL_NUMBER_SIZE ) ; if (pin->init_data == NULL) { LEVEL_DEFAULT("HA5 bus master requires port name"); return gbBAD; } COM_set_standard( in ) ; // standard COM port settings // 9600 isn't valid for the HA5, so we can tell that this value was actually selected if ( Globals.baud != B9600 ) { pin->baud = Globals.baud ; } else { pin->baud = B115200 ; // works at this fast rate } // allowable speeds COM_BaudRestrict( &(pin->baud), B1200, B19200, B38400, B115200, 0 ) ; Parse_Address( DEVICENAME(in), &ap ) ; gbResult = HA5_detect_parsed( &ap, in) ; Free_Address( &ap ) ; if ( GOOD( gbResult ) ) { HA5_slurp(in) ; HA5_reset_in(in) ; } return gbResult ; } // Detect now that the name has been parsed GOOD_OR_BAD HA5_detect_parsed(struct address_pair *ap, struct connection_in *in) { char * channel_list = NULL ; // Create name (ip:port or /dev/tty) and optional channel list switch (in->pown->type) { case ct_telnet: // address:port:channel_list if ( ap->first.type != address_none ) { // IP address exists strcpy(DEVICENAME(in), ap->first.alpha) ; // subset so will fit if ( ap->second.type != address_none ) { // Add :port strcat(DEVICENAME(in), ":") ; // subset so will fit strcat(DEVICENAME(in), ap->second.alpha) ; // subset so will fit } } else if ( ap->second.type != address_none ) { // just :port strcpy(DEVICENAME(in), ap->second.alpha) ; // subset so will fit } else { // No tcp address or port specified return gbBAD ; } switch ( ap->third.type ) { case address_all: channel_list = "abcdefghijklmnopqrstuvwxyz" ; break ; case address_alpha: // Channel specified channel_list = ap->third.alpha ; break ; default: channel_list = NULL ; } break ; case ct_serial: default: // device:channel_list if ( ap->first.type != address_none ) { // device address exists strcpy(DEVICENAME(in), ap->first.alpha) ; // subset so will fit } else { // No serial port specified return gbBAD ; } switch ( ap->second.type ) { case address_all: channel_list = "abcdefghijklmnopqrstuvwxyz" ; break ; case address_alpha: // Channel specified channel_list = ap->second.alpha ; break ; default: channel_list = NULL ; } break ; } if ( BAD(COM_open(in->master.ha5.head )) ) { // Cannot open serial port return gbBAD ; } in->master.ha5.checksum = 1 ; in->Adapter = adapter_HA5 ; in->adapter_name = "HA5"; /* Find the channels */ if ( channel_list == NULL ) { // scan for channel if ( BAD( HA5_find_channel(in) ) ) { RETURN_BAD_IF_BAD( serial_powercycle(in) ) ; return HA5_find_channel(in) ; } } else { // A list of channels if ( BAD( HA5_channel_list( channel_list, in ) ) ) { RETURN_BAD_IF_BAD( serial_powercycle(in) ) ; return HA5_channel_list( channel_list, in ) ; } } return gbGOOD ; } static GOOD_OR_BAD HA5_channel_list( char * alpha_string, struct connection_in * initial_in ) { char * current_char ; int first_time = 1 ; // work-around for new USB com port struct connection_in * current_in = initial_in ; for ( current_char = alpha_string ; current_char[0]!= '\0' ; ++ current_char ) { char c = current_char[0]; if ( !isalpha( (int) c ) ) { LEVEL_DEBUG("Urecognized HA5 channel <%c>",c) ; continue ; } current_in->master.ha5.channel = tolower( (int) c ) ; LEVEL_DEBUG("Looking for HA5 adapter on %s:%c", DEVICENAME(current_in), current_in->master.ha5.channel ) ; if ( GOOD( HA5_test_channel(current_in)) || ( first_time && GOOD( HA5_test_channel(current_in)) ) ) { // work around for new USB serial port that seems to need a repeat test first_time = 0 ; LEVEL_CONNECT("HA5 bus master FOUND on port %s at channel %c", DEVICENAME(current_in), current_in->master.ha5.channel ) ; current_in = AddtoPort( initial_in->pown ) ; // point to newer space for next candidate if ( current_in == NO_CONNECTION ) { break ; } continue ; } LEVEL_CONNECT("HA5 bus master NOT FOUND on port %s at channel %c", DEVICENAME(current_in), c ) ; } // Now see if we've added any adapters if ( current_in == initial_in ) { LEVEL_CONNECT("No HA5 adapters found in channel(s): %s",SAFESTRING(alpha_string) ); return gbBAD ; } if ( current_in != NO_CONNECTION ) { // Remove last addition, it is blank RemoveIn( current_in ) ; } return gbGOOD ; } /* Find the HA5 channel (since none specified) */ /* Arbitrarily assign it to "a" if none found */ static GOOD_OR_BAD HA5_find_channel( struct connection_in * in ) { char test_chars[] = "aabcdefghijklmnopqrstuvwxyz" ; // note 'a' is repeated char * c ; for ( c = test_chars ; c[0] != '\0' ; ++c ) { // test char set in->master.ha5.channel = c[0] ; LEVEL_DEBUG("Looking for HA5 adapter on %s:%c", DEVICENAME(in), in->master.ha5.channel ) ; if ( GOOD( HA5_test_channel(in)) ) { LEVEL_CONNECT("HA5 bus master FOUND on port %s at channel %c", DEVICENAME(in), in->master.ha5.channel ) ; return gbGOOD ; } } LEVEL_DEBUG("HA5 bus master NOT FOUND on port %s", DEVICENAME(in) ) ; in->master.ha5.channel = '\0' ; return gbBAD; } static GOOD_OR_BAD HA5_write( char command, char * raw_string, int length, struct connection_in * in ) { int i ; unsigned int sum = 0 ; BYTE mod_buffer[length+5] ; // add the channel mod_buffer[0] = in->master.ha5.channel ; // Add the HA5 command mod_buffer[1] = command ; // Copy the string if ( length > 0 ) { memcpy( &mod_buffer[2], raw_string, length ) ; } // Compute a simple checksum for ( i=0 ; i mod_buffer[length+4] = CR_char ; // Write full string to the HA5 if ( BAD(COM_write( mod_buffer, length+5, in->master.ha5.head )) ) { LEVEL_DEBUG("Error with sending HA5 block") ; return gbBAD ; } return gbGOOD ; } static GOOD_OR_BAD HA5_read( BYTE * data, size_t length, struct connection_in * in) { return COM_read( data, length, in->master.ha5.head ) ; } static GOOD_OR_BAD TestChecksum( unsigned char * check_string, int length ) { int i ; unsigned char sum = 0 ; for ( i=0 ; iselected_connection ; RETURN_BAD_IF_BAD(serial_powercycle(in->master.ha5.head)) ; return HA5_test_channel( in ) ; } // test char already set static GOOD_OR_BAD HA5_test_channel( struct connection_in * in ) { HA5_slurp(in) ; RETURN_BAD_IF_BAD( HA5_checksum_support(in) ) ; if ( HA5_reset_wrapped( in ) == BUS_RESET_OK ) { return gbGOOD ; } LEVEL_DEBUG("Succeed despite bad reset"); return gbGOOD ; } static void HA5_slurp( struct connection_in * in ) { COM_slurp( in->master.ha5.head ) ; } static void HA5_flush( struct connection_in * in ) { COM_flush( in->master.ha5.head ) ; } // test char already set static GOOD_OR_BAD HA5_checksum_support( struct connection_in * in ) { BYTE resp[3] = { 'X', 'X', 'X', } ; // write a BYTE and see if any response (device present) // and then see if a checksum is included in the response if ( BAD(HA5_write( 'W', "01FF", 4, in)) ) { LEVEL_DEBUG("Error sending Bit"); return gbBAD; } if ( BAD(HA5_read(resp, 3, in)) ) { LEVEL_DEBUG("Error reading bit response"); return gbBAD; } if ( resp[2] == 0x0D ) { in->master.ha5.checksum = 0 ; LEVEL_DETAIL("HA5 %s in NON-CHECKSUM mode",SAFESTRING(DEVICENAME(in))); return gbGOOD ; } else if ( resp[2] == 'X' ) { // nothing actually read return gbBAD ; } resp[0] = 'X' ; resp[1] = 'X' ; if ( BAD(HA5_read(resp, 2, in)) ) { LEVEL_DEBUG("Error reading Bit checksum"); return gbBAD; } if ( resp[1] != 0x0D ) { LEVEL_DEBUG("Bad response"); return gbBAD ; } in->master.ha5.checksum = 1 ; LEVEL_DETAIL("HA5 %s in CHECKSUM mode",SAFESTRING(DEVICENAME(in))); return gbGOOD ; } static RESET_TYPE HA5_reset(const struct parsedname *pn) { return HA5_reset_in( pn->selected_connection ) ; } static RESET_TYPE HA5_reset_in( struct connection_in * in ) { return HA5_reset_wrapped(in) ; } static RESET_TYPE HA5_reset_wrapped( struct connection_in * in ) { BYTE resp[2] = { 'X', 'X', } ; if ( BAD(HA5_write( 'R', "", 0, in)) ) { LEVEL_DEBUG("Error sending HA5 reset"); return BUS_RESET_ERROR; } // For some reason, the HA5 doesn't use a checksum for RESET response. if ( BAD(HA5_read(resp, 2, in)) ) { LEVEL_DEBUG("Error reading HA5 reset"); return BUS_RESET_ERROR; } switch( resp[0] ) { case 'P': in->AnyDevices = anydevices_yes ; return BUS_RESET_OK; case 'N': in->AnyDevices = anydevices_no ; return BUS_RESET_OK; default: LEVEL_DEBUG("Error HA5 reset bad response %c (0x%.2X)", resp[0], resp[0]); return BUS_RESET_ERROR; } } static enum search_status HA5_next_both(struct device_search *ds, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; if (ds->LastDevice) { return search_done; } HA5_flush(in); if (ds->index == -1) { if ( HA5_directory(ds, pn) != search_good ) { return search_error; } } // LOOK FOR NEXT ELEMENT ++ds->index; LEVEL_DEBUG("Index %d", ds->index); switch ( DirblobGet(ds->index, ds->sn, &(ds->gulp) ) ) { case 0: LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; case -ENODEV: default: ds->LastDevice = 1; LEVEL_DEBUG("SN finished"); return search_done; } } /************************************************************************/ /* HA5_directory: searches the Directory stores it in a dirblob */ /* & stores in in a dirblob object depending if it */ /* Supports conditional searches of the bus for */ /* /alarm branch */ /* */ /* Only called for the first element, everything else comes from dirblob */ /* returns 0 even if no elements, errors only on communication errors */ /************************************************************************/ static enum search_status HA5_directory(struct device_search *ds, const struct parsedname *pn) { unsigned char resp[20]; struct connection_in * in = pn->selected_connection ; DirblobClear( &(ds->gulp) ); //Depending on the search type, the HA5 search function //needs to be selected //tEC -- Conditional searching //tF0 -- Normal searching // Send the configuration command and check response if ( BAD(HA5_write( (ds->search == _1W_CONDITIONAL_SEARCH_ROM) ? 'C' : 'S', ",FF", 3, in)) ) { HA5_resync(in) ; return search_error ; } if ( BAD(HA5_read(resp, 1, in)) ) { HA5_resync(in) ; return search_error ; } while ( resp[0] != CR_char ) { BYTE sn[SERIAL_NUMBER_SIZE]; char wrap_char ; //One needs to check the first character returned. //If nothing is found, the ha5 will timeout rather then have a quick //return. This happens when looking at the alarm directory and //there are no alarms pending //So we grab the first character and check it. If not an E leave it //in the resp buffer and get the rest of the response from the HA5 //device if ( in->master.ha5.checksum ) { if ( BAD(HA5_read(&resp[1], 19, in)) ) { HA5_resync(in) ; return search_error ; } if ( resp[18]!=CR_char ) { HA5_resync(in) ; return search_error ; } wrap_char = resp[19] ; if ( BAD( TestChecksum( resp, 16 )) ) { HA5_resync(in) ; return search_error ; } } else { if ( BAD(HA5_read(&resp[1], 17, in)) ) { HA5_resync(in) ; return search_error ; } if ( resp[16]!=CR_char ) { HA5_resync(in) ; return search_error ; } wrap_char = resp[17] ; } sn[7] = string2num((char *)&resp[0]); sn[6] = string2num((char *)&resp[2]); sn[5] = string2num((char *)&resp[4]); sn[4] = string2num((char *)&resp[6]); sn[3] = string2num((char *)&resp[8]); sn[2] = string2num((char *)&resp[10]); sn[1] = string2num((char *)&resp[12]); sn[0] = string2num((char *)&resp[14]); // Set as current "Address" for adapter memcpy( in->remembered_sn, sn, SERIAL_NUMBER_SIZE ) ; LEVEL_DEBUG("SN found: " SNformat, SNvar(sn)); // CRC check if (CRC8(sn, 8) || (sn[0] == 0)) { /* A minor "error" and should perhaps only return -1 */ /* to avoid reconnect */ LEVEL_DEBUG("sn = %s", sn); HA5_resync(in) ; return search_error ; } DirblobAdd(sn, &(ds->gulp) ); resp[0] = wrap_char ; } return search_good ; } static GOOD_OR_BAD HA5_resync( struct connection_in * in ) { HA5_flush(in->master.ha5.head ); HA5_reset_wrapped(in); HA5_flush(in->master.ha5.head ); // Poison current "Address" for adapter memset( in->remembered_sn, 0, SERIAL_NUMBER_SIZE ) ; // so won't match return gbBAD ; } static GOOD_OR_BAD HA5_select( const struct parsedname * pn ) { if ( (pn->selected_device==NO_DEVICE) || (pn->selected_device==DeviceThermostat) ) { RETURN_BAD_IF_BAD( gbRESET( HA5_reset_in(pn->selected_connection) ) ) ; } return HA5_select_wrapped(pn) ; } static GOOD_OR_BAD HA5_select_wrapped( const struct parsedname * pn ) { struct connection_in * in = pn->selected_connection ; char send_address[16] ; unsigned char resp_address[19] ; num2string( &send_address[ 0], pn->sn[7] ) ; num2string( &send_address[ 2], pn->sn[6] ) ; num2string( &send_address[ 4], pn->sn[5] ) ; num2string( &send_address[ 6], pn->sn[4] ) ; num2string( &send_address[ 8], pn->sn[3] ) ; num2string( &send_address[10], pn->sn[2] ) ; num2string( &send_address[12], pn->sn[1] ) ; num2string( &send_address[14], pn->sn[0] ) ; if ( BAD(HA5_write( 'A', send_address, 16, in)) ) { LEVEL_DEBUG("Error sending HA5 A-ddress") ; return HA5_resync(in) ; } if ( in->master.ha5.checksum ) { if ( BAD(HA5_read(resp_address,19,in)) ) { LEVEL_DEBUG("Error with reading HA5 select") ; return HA5_resync(in) ; } if ( BAD(TestChecksum( resp_address, 16)) ) { LEVEL_DEBUG("HA5 select checksum error") ; return HA5_resync(in) ; } } else { if ( BAD(HA5_read(resp_address,17,in)) ) { LEVEL_DEBUG("Error with reading HA5 select") ; return HA5_resync(in) ; } } if ( memcmp( resp_address, send_address, 16) ) { LEVEL_DEBUG("Error with HA5 select response") ; return HA5_resync(in) ; } // Set as current "Address" for adapter memcpy( in->remembered_sn, pn->sn, SERIAL_NUMBER_SIZE) ; return gbGOOD ; } // Send data and return response block -- up to 32 bytes static GOOD_OR_BAD HA5_sendback_part(char cmd, const BYTE * data, BYTE * resp, const size_t size, struct connection_in * in) { char send_data[2+2*size] ; unsigned char get_data[32*2+3] ; num2string( &send_data[0], size ) ; bytes2string( &send_data[2], data, size) ; if ( BAD(HA5_write( cmd, send_data, 2+2*size, in)) ) { LEVEL_DEBUG("Error with sending HA5 block") ; HA5_resync(in) ; return gbBAD ; } if ( in->master.ha5.checksum ) { if ( BAD(HA5_read( get_data, size*2+3, in)) ) { LEVEL_DEBUG("Error with reading HA5 block") ; HA5_resync(in) ; return gbBAD ; } if ( BAD(TestChecksum( get_data, size*2)) ) { LEVEL_DEBUG("HA5 block read checksum error") ; HA5_resync(in) ; return gbBAD ; } } else { if ( BAD(HA5_read( get_data, size*2+1, in)) ) { LEVEL_DEBUG("Error with reading HA5 block") ; HA5_resync(in) ; return gbBAD ; } } string2bytes( (char *)get_data, resp, size) ; return gbGOOD ; } static GOOD_OR_BAD HA5_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { int left; struct connection_in * in = pn->selected_connection ; for ( left=size ; left>0 ; left -= 32 ) { size_t pass_start = size - left ; size_t pass_size = (left>32)?32:left ; RETURN_BAD_IF_BAD( HA5_sendback_part( 'W', &data[pass_start], &resp[pass_start], pass_size, in ) ) ; } return gbGOOD; } static GOOD_OR_BAD HA5_select_and_sendback(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; int left; char block_cmd ; if ( memcmp( pn->sn, in->remembered_sn, SERIAL_NUMBER_SIZE ) ) { // Need a formal change of device RETURN_BAD_IF_BAD( HA5_select(pn) ) ; block_cmd = 'W' ; } else { // Same device block_cmd = 'J' ; } for ( left=size ; left>0 ; left -= 32 ) { GOOD_OR_BAD ret ; size_t pass_start = size - left ; size_t pass_size = (left>32)?32:left ; ret = HA5_sendback_part( block_cmd, &data[pass_start], &resp[pass_start], pass_size, in ) ; block_cmd = 'W' ; // for next pass RETURN_BAD_IF_BAD( ret ) ; } return gbGOOD; } /********************************************************/ /* HA5_sendback_bits -- bit-mode communication */ /********************************************************/ static GOOD_OR_BAD HA5_sendback_bits(const BYTE * outbits, BYTE * inbits, const size_t length, const struct parsedname *pn) { size_t counter ; struct connection_in * in = pn->selected_connection ; for ( counter = 0 ; counter < length ; ++counter ) { RETURN_BAD_IF_BAD( HA5_bit( outbits[counter], &inbits[counter], in ) ) ; } return gbGOOD; } static GOOD_OR_BAD HA5_bit( BYTE outbit, BYTE * inbit, struct connection_in * in ) { BYTE resp[1] = { 'X', } ; if ( BAD(HA5_write( 'B', outbit ? "1" : "0" , 1, in)) ) { LEVEL_DEBUG("Error sending HA5 bit"); return gbBAD; } // For some reason, the HA5 doesn't use a checksum for BIT response. if ( BAD(HA5_read(resp, 2, in)) ) { LEVEL_DEBUG("Error reading HA5 bit"); return gbBAD; } switch ( resp[0] ) { case '0': inbit[0] = 0 ; return gbGOOD ; case '1': inbit[0] = 1 ; return gbGOOD ; default: LEVEL_DEBUG("Unclear HA5 bit response \'%c\'",resp[0]); return gbBAD ; } } /********************************************************/ /* HA5_close -- clean local resources before */ /* closing the serial port */ /********************************************************/ static void HA5_close(struct connection_in *in) { if ( in->master.ha5.head == in ) { } else { in->pown->state = cs_virgin ; } } owfs-3.1p5/module/owlib/src/c/ow_ha7.c0000644000175000001440000003167612711737666014514 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" struct toHA7 { ASCII *command; ASCII lock[10]; ASCII conditional[1]; ASCII address[16]; const BYTE *data; size_t length; }; //static void byteprint( const BYTE * b, int size ) ; static GOOD_OR_BAD HA7_write(const ASCII * msg, size_t size, struct connection_in *in); static void toHA7init(struct toHA7 *ha7); static void setHA7address(struct toHA7 *ha7, const BYTE * sn); static GOOD_OR_BAD HA7_toHA7( const struct toHA7 *ha7, struct connection_in *in); static GOOD_OR_BAD HA7_read( struct memblob *mb, struct connection_in * in ); static RESET_TYPE HA7_reset(const struct parsedname *pn); static enum search_status HA7_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD HA7_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD HA7_select_and_sendback(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD HA7_sendback_block(const BYTE * data, BYTE * resp, const size_t size, int also_address, const struct parsedname *pn); static GOOD_OR_BAD HA7_select(const struct parsedname *pn); static void HA7_setroutines(struct connection_in *in); static void HA7_close(struct connection_in *in); static GOOD_OR_BAD HA7_directory( struct device_search *ds, const struct parsedname *pn); static void HA7_setroutines(struct connection_in *in) { in->iroutines.detect = HA7_detect; in->iroutines.reset = HA7_reset; in->iroutines.next_both = HA7_next_both; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.select_and_sendback = HA7_select_and_sendback; in->iroutines.sendback_data = HA7_sendback_data; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = HA7_select; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = HA7_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_dirgulp | ADAP_FLAG_bundle | ADAP_FLAG_dir_auto_reset | ADAP_FLAG_no2404delay ; in->bundling_length = HA7_FIFO_SIZE; // arbitrary number } GOOD_OR_BAD HA7_detect(struct port_in *pin) { struct connection_in * in = pin->first ; struct parsedname pn; struct toHA7 ha7; FS_ParsedName_Placeholder(&pn); // minimal parsename -- no destroy needed pn.selected_connection = in; /* Set up low-level routines */ HA7_setroutines(in); in->master.ha7.locked = 0; if (pin->init_data == NULL) { return gbBAD; } pin->type = ct_tcp ; pin->timeout.tv_sec = Globals.timeout_ha7 ; pin->timeout.tv_usec = 0 ; RETURN_BAD_IF_BAD( COM_open(in) ) ; in->Adapter = adapter_HA7NET; toHA7init(&ha7); ha7.command = "ReleaseLock"; if (GOOD( HA7_toHA7( &ha7, in)) ) { struct memblob mb; if ( GOOD( HA7_read( &mb, in )) ) { in->adapter_name = "HA7Net"; pin->busmode = bus_ha7net; in->AnyDevices = anydevices_yes; MemblobClear(&mb); return gbGOOD; } } serial_powercycle(in) ; if (GOOD( HA7_toHA7( &ha7, in)) ) { struct memblob mb; if ( GOOD( HA7_read( &mb, in )) ) { in->adapter_name = "HA7Net"; pin->busmode = bus_ha7net; in->AnyDevices = anydevices_yes; MemblobClear(&mb); return gbGOOD; } } COM_close(in) ; return gbBAD; } static RESET_TYPE HA7_reset(const struct parsedname *pn) { struct toHA7 ha7; struct connection_in * in = pn->selected_connection ; toHA7init(&ha7); ha7.command = "Reset"; if ( BAD(HA7_toHA7( &ha7, in)) ) { LEVEL_DEBUG("Trouble sending reset command"); return BUS_RESET_ERROR; } else { RESET_TYPE ret = BUS_RESET_OK; struct memblob mb; if ( BAD(HA7_read( &mb, in )) ) { LEVEL_DEBUG("Trouble with reset command response"); ret = BUS_RESET_ERROR; } MemblobClear(&mb); return ret; } } static GOOD_OR_BAD HA7_directory( struct device_search *ds, const struct parsedname *pn) { GOOD_OR_BAD ret = gbGOOD; struct toHA7 ha7; struct memblob mb; struct connection_in * in = pn->selected_connection ; DirblobClear(&(ds->gulp)); toHA7init(&ha7); ha7.command = "Search"; if ( ds->search == _1W_CONDITIONAL_SEARCH_ROM) { ha7.conditional[0] = '1'; } if ( BAD(HA7_toHA7( &ha7, in)) ) { ret = gbBAD; } else if ( BAD(HA7_read( &mb, in )) ) { STAT_ADD1_BUS(e_bus_read_errors, in); ret = gbBAD; } else { BYTE sn[SERIAL_NUMBER_SIZE]; ASCII *p = (ASCII *) MemblobData(&mb); while ((p = strstr(p, "gulp)); } MemblobClear(&mb); } return ret; } static enum search_status HA7_next_both(struct device_search *ds, const struct parsedname *pn) { if (ds->LastDevice) { return search_done; } if (++(ds->index) == 0) { if ( BAD(HA7_directory( ds, pn )) ) { return search_error; } } switch ( DirblobGet(ds->index, ds->sn, &(ds->gulp) ) ) { case 0: LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; case -ENODEV: default: ds->LastDevice = 1; LEVEL_DEBUG("SN finished"); return search_done; } } #define HA7_READ_BUFFER_LENGTH 2000 static GOOD_OR_BAD HA7_read( struct memblob *mb, struct connection_in * in ) { struct port_in * pin = in->pown ; ASCII readin_area[HA7_READ_BUFFER_LENGTH + 1]; ASCII *start; ssize_t read_size; MemblobInit(mb, HA7_READ_BUFFER_LENGTH); pin->timeout.tv_sec = 2 ; pin->timeout.tv_usec = 0 ; // Read first block of data from HA7 read_size = COM_read_with_timeout( (BYTE*) readin_area, HA7_READ_BUFFER_LENGTH, in) ; if ( read_size <= 0 ) { LEVEL_CONNECT("Read error"); return gbBAD; } // make sure null terminated (allocated extra byte in readin_area to always have room) readin_area[read_size] = '\0'; // Look for happy response if (strncmp("HTTP/1.1 200 OK", readin_area, 15)) { //Bad HTTP return code ASCII *p = strchr(&readin_area[15], '\n'); if (p == NULL) { p = &readin_area[15 + 32]; } LEVEL_DATA("response problem:%.*s", p - readin_area - 15, &readin_area[15]); return gbBAD; } // Look for "" if ((start = strstr(readin_area, "")) == NULL) { LEVEL_DATA("response: No HTTP body to parse"); MemblobClear(mb); return gbBAD; } // HTML body found, dump header if (MemblobAdd((BYTE *) start, read_size - (start - readin_area), mb)) { MemblobClear(mb); return gbBAD; } // loop through reading in HA7_READ_BUFFER_LENGTH blocks while (read_size == HA7_READ_BUFFER_LENGTH) { // full read, so presume more waiting read_size = COM_read_with_timeout( (BYTE*) readin_area, HA7_READ_BUFFER_LENGTH, in) ; if (read_size <= 0) { LEVEL_DATA("Couldn't get rest of HA7 data (err=%d)", read_size); MemblobClear(mb); return gbBAD; } else if (MemblobAdd((BYTE *) readin_area, read_size, mb)) { MemblobClear(mb); return gbBAD; } } // Add trailing null if (MemblobAdd((BYTE *) "", 1, mb)) { MemblobClear(mb); return gbBAD; } LEVEL_DEBUG("Successful read of data"); //printf("READ FROM HA7:\n%s\n",MemblobData(mb)); return gbGOOD; } static GOOD_OR_BAD HA7_write( const ASCII * msg, size_t length, struct connection_in *in ) { return COM_write( (const BYTE *) msg, length, in) ; } static GOOD_OR_BAD HA7_toHA7( const struct toHA7 *ha7, struct connection_in *in) { int first = 1; int probable_length; char *full_command; LEVEL_DEBUG ("To HA7 command=%s address=%.16s conditional=%.1s lock=%.10s", SAFESTRING(ha7->command), SAFESTRING(ha7->address), SAFESTRING(ha7->conditional), SAFESTRING(ha7->lock)); if (ha7->command == NULL) { return gbBAD; } probable_length = 11 + strlen(ha7->command) + 5 + ((ha7->address[0]) ? 1 + 8 + 16 : 0) + ((ha7->conditional[0]) ? 1 + 12 + 1 : 0) + ((ha7->data) ? 1 + 5 + ha7->length * 2 : 0) + ((ha7->lock[0]) ? 1 + 7 + 10 : 0) + 11 + 1; full_command = owmalloc(probable_length); if (full_command == NULL) { return gbBAD; } memset(full_command, 0, probable_length); strcpy(full_command, "GET /1Wire/"); strcat(full_command, ha7->command); strcat(full_command, ".html"); if (ha7->address[0]) { strcat(full_command, "?" ); // first (if exists) strcat(full_command, "Address="); strcat(full_command, ha7->address); first = 0; } if (ha7->conditional[0]) { strcat(full_command, first ? "?" : "&"); strcat(full_command, "Conditional="); strcat(full_command, ha7->conditional); first = 0; } if (ha7->data) { strcat(full_command, first ? "?" : "&"); strcat(full_command, "Data="); bytes2string(&full_command[strlen(full_command)], ha7->data, ha7->length); } if (ha7->lock[0]) { strcat(full_command, first ? "?" : "&"); strcat(full_command, "LockID="); strcat(full_command, ha7->lock); } strcat(full_command, " HTTP/1.0\n\n"); LEVEL_DEBUG("To HA7 %s", full_command); if ( BAD( COM_open(in) ) ) { // force reopen owfree(full_command); return gbBAD ; } if ( BAD( HA7_write( full_command, probable_length, in) ) ) { owfree(full_command); return gbBAD ; } owfree(full_command); return gbGOOD; } // Reset, select, and read/write data /* return 0=good sendout_data, readin */ static GOOD_OR_BAD HA7_select_and_sendback(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { size_t location = 0; int also_address = 1; while (location < size) { size_t block = size - location; if (block > 32) { block = 32; } // Don't add address (that's the "0") RETURN_BAD_IF_BAD(HA7_sendback_block(&data[location], &resp[location], block, also_address, pn)) ; location += block; also_address = 0; //for subsequent blocks } return gbGOOD ; } // Send data and return response block /* return 0=good sendout_data, readin */ #define HA7_CONSERVATIVE_LENGTH 32 static GOOD_OR_BAD HA7_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { size_t location = 0; while (location < size) { size_t block = size - location; if (block > HA7_CONSERVATIVE_LENGTH) { block = HA7_CONSERVATIVE_LENGTH; } // Don't add address (that's the "0") RETURN_BAD_IF_BAD(HA7_sendback_block(&data[location], &resp[location], block, 0, pn)) ; location += block; } return gbGOOD; } // HA7 only allows WriteBlock of 32 bytes // This routine assumes that larger writes have already been broken up static GOOD_OR_BAD HA7_sendback_block(const BYTE * data, BYTE * resp, const size_t size, int also_address, const struct parsedname *pn) { struct memblob mb; struct toHA7 ha7; GOOD_OR_BAD ret = gbBAD; struct connection_in * in = pn->selected_connection ; toHA7init(&ha7); ha7.command = "WriteBlock"; ha7.data = data; ha7.length = size; if (also_address) { setHA7address(&ha7, pn->sn); } if ( GOOD( HA7_toHA7( &ha7, in)) ) { if ( GOOD( HA7_read( &mb, in )) ) { ASCII *p = (ASCII *) MemblobData(&mb); if ((p = strstr(p, "= size << 1) { string2bytes(p, resp, size); ret = gbGOOD; } } MemblobClear(&mb); } else { STAT_ADD1_BUS(e_bus_read_errors, in); } return ret ; } return gbGOOD; } static void setHA7address(struct toHA7 *ha7, const BYTE * sn) { num2string(&(ha7->address[0]), sn[7]); num2string(&(ha7->address[2]), sn[6]); num2string(&(ha7->address[4]), sn[5]); num2string(&(ha7->address[6]), sn[4]); num2string(&(ha7->address[8]), sn[3]); num2string(&(ha7->address[10]), sn[2]); num2string(&(ha7->address[12]), sn[1]); num2string(&(ha7->address[14]), sn[0]); } static GOOD_OR_BAD HA7_select(const struct parsedname *pn) { GOOD_OR_BAD ret = gbBAD; struct connection_in * in = pn->selected_connection ; if (pn->selected_device) { struct toHA7 ha7; toHA7init(&ha7); ha7.command = "AddressDevice"; setHA7address(&ha7, pn->sn); if ( GOOD( HA7_toHA7( &ha7, in)) ) { struct memblob mb; if ( GOOD( HA7_read( &mb, in )) ) { MemblobClear(&mb); ret = gbGOOD; } } } else { return HA7_reset(pn)==BUS_RESET_OK ? gbGOOD : gbBAD ; } return ret; } static void HA7_close(struct connection_in *in) { // that standard COM_free cleans up the connection (void) in ; } static void toHA7init(struct toHA7 *ha7) { memset(ha7, 0, sizeof(struct toHA7)); } owfs-3.1p5/module/owlib/src/c/ow_ha7e.c0000644000175000001440000002472112654730021014632 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ // regex #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" //static void byteprint( const BYTE * b, int size ) ; static RESET_TYPE HA7E_reset(const struct parsedname *pn); static enum search_status HA7E_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD HA7E_sendback_part(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) ; static GOOD_OR_BAD HA7E_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static void HA7E_setroutines(struct connection_in *in); static void HA7E_close(struct connection_in *in); static GOOD_OR_BAD HA7E_directory( struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD HA7E_select( const struct parsedname * pn ) ; static GOOD_OR_BAD HA7E_resync( const struct parsedname * pn ) ; static void HA7E_powerdown(struct connection_in * in) ; static void HA7E_setroutines(struct connection_in *in) { in->iroutines.detect = HA7E_detect; in->iroutines.reset = HA7E_reset; in->iroutines.next_both = HA7E_next_both; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = HA7E_sendback_data; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = HA7E_select ; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE ; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = HA7E_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_dirgulp | ADAP_FLAG_bundle | ADAP_FLAG_dir_auto_reset | ADAP_FLAG_no2404delay ; in->bundling_length = HA7E_FIFO_SIZE; } GOOD_OR_BAD HA7E_detect(struct port_in *pin) { struct connection_in * in = pin->first ; struct parsedname pn; FS_ParsedName_Placeholder(&pn); // minimal parsename -- no destroy needed pn.selected_connection = in; /* Set up low-level routines */ HA7E_setroutines(in); // Poison current "Address" for adapter memset( in->remembered_sn, 0x00, SERIAL_NUMBER_SIZE ) ; if (pin->init_data == NULL) { LEVEL_DEFAULT("HA7E bus master requires port name"); return gbBAD; } /* Open the com port */ COM_set_standard( in ) ; // standard COM port settings RETURN_BAD_IF_BAD(COM_open(in)) ; COM_slurp(in) ; if ( GOOD( gbRESET( HA7E_reset(&pn) ) ) ) { in->Adapter = adapter_HA7E ; in->adapter_name = "HA7E/S"; return gbGOOD; } if ( GOOD( serial_powercycle(in) ) ) { COM_slurp(in) ; if ( GOOD( gbRESET( HA7E_reset(&pn) ) ) ) { in->Adapter = adapter_HA7E ; in->adapter_name = "HA7E/S"; return gbGOOD; } } pin->flow = flow_second; // flow control RETURN_BAD_IF_BAD(COM_change(in)) ; COM_slurp(in) ; if ( GOOD( gbRESET( HA7E_reset(&pn) ) ) ) { in->Adapter = adapter_HA7E ; in->adapter_name = "HA7E/S"; return gbGOOD; } LEVEL_DEFAULT("Error in HA7E detection: can't perform RESET"); return gbBAD; } static RESET_TYPE HA7E_reset(const struct parsedname *pn) { BYTE resp[1]; COM_flush(pn->selected_connection); if ( BAD(COM_write((BYTE*)"R", 1, pn->selected_connection)) ) { LEVEL_DEBUG("Error sending HA7E reset"); return BUS_RESET_ERROR; } if ( BAD(COM_read(resp, 1, pn->selected_connection)) ) { LEVEL_DEBUG("Error reading HA7E reset"); return BUS_RESET_ERROR; } if (resp[0]!=0x0D) { LEVEL_DEBUG("Error HA7E reset bad "); return BUS_RESET_ERROR; } return BUS_RESET_OK; } static enum search_status HA7E_next_both(struct device_search *ds, const struct parsedname *pn) { if (ds->LastDevice) { return search_done; } COM_flush(pn->selected_connection); if (ds->index == -1) { if ( BAD( HA7E_directory(ds, pn) ) ) { return search_error; } } // LOOK FOR NEXT ELEMENT ++ds->index; LEVEL_DEBUG("Index %d", ds->index); switch ( DirblobGet(ds->index, ds->sn, &(ds->gulp)) ) { case 0: LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; case -ENODEV: default: ds->LastDevice = 1; LEVEL_DEBUG("SN finished"); return search_done; } } /************************************************************************/ /* HA7E_directory: searches the Directory stores it in a dirblob */ /* & stores in in a dirblob object depending if it */ /* Supports conditional searches of the bus for */ /* /alarm directory */ /* */ /* Only called for the first element, everything else comes from dirblob */ /* returns 0 even if no elements, errors only on communication errors */ /************************************************************************/ static GOOD_OR_BAD HA7E_directory(struct device_search *ds, const struct parsedname *pn) { char resp[17]; BYTE sn[SERIAL_NUMBER_SIZE]; char *first, *next, *current ; DirblobClear( &(ds->gulp) ); //Depending on the search type, the HA7E search function //needs to be selected //tEC -- Conditional searching //tF0 -- Normal searching // Send the configuration command and check response if (ds->search == _1W_CONDITIONAL_SEARCH_ROM) { first = "C" ; next = "c" ; } else { first = "S" ; next = "s" ; } current = first ; while (1) { if ( BAD(COM_write((BYTE*)current, 1, pn->selected_connection)) ) { return HA7E_resync(pn) ; } current = next ; // set up for next pass //One needs to check the first character returned. //If nothing is found, the ha7e will timeout rather then have a quick //return. This happens when looking at the alarm directory and //there are no alarms pending //So we grab the first character and check it. If not an E leave it //in the resp buffer and get the rest of the response from the HA7E //device if ( BAD(COM_read((BYTE*)resp, 1, pn->selected_connection)) ) { return HA7E_resync(pn) ; } if ( resp[0] == 0x0D ) { return gbGOOD ; // end of list } if ( BAD(COM_read((BYTE*)&resp[1], 16, pn->selected_connection)) ) { return HA7E_resync(pn) ; } sn[7] = string2num(&resp[0]); sn[6] = string2num(&resp[2]); sn[5] = string2num(&resp[4]); sn[4] = string2num(&resp[6]); sn[3] = string2num(&resp[8]); sn[2] = string2num(&resp[10]); sn[1] = string2num(&resp[12]); sn[0] = string2num(&resp[14]); // Set as current "Address" for adapter memcpy( pn->selected_connection->remembered_sn, sn, SERIAL_NUMBER_SIZE) ; LEVEL_DEBUG("SN found: " SNformat, SNvar(sn)); if ( resp[16]!=0x0D ) { return HA7E_resync(pn) ; } // CRC check if (CRC8(sn, SERIAL_NUMBER_SIZE) || (sn[0] == 0)) { /* A minor "error" and should perhaps only return -1 */ /* to avoid reconnect */ LEVEL_DEBUG("sn = %s", sn); return HA7E_resync(pn) ; } DirblobAdd(sn, &(ds->gulp) ); } } static GOOD_OR_BAD HA7E_resync( const struct parsedname * pn ) { COM_flush(pn->selected_connection); HA7E_reset(pn); COM_flush(pn->selected_connection); // Poison current "Address" for adapter memset( pn->selected_connection->remembered_sn, 0, SERIAL_NUMBER_SIZE ) ; // so won't match return gbBAD ; } static GOOD_OR_BAD HA7E_select( const struct parsedname * pn ) { char send_address[18] ; char resp_address[17] ; if ( (pn->selected_device==NO_DEVICE) || (pn->selected_device==DeviceThermostat) ) { return gbRESET( HA7E_reset(pn) ) ; } send_address[0] = 'A' ; num2string( &send_address[ 1], pn->sn[7] ) ; num2string( &send_address[ 3], pn->sn[6] ) ; num2string( &send_address[ 5], pn->sn[5] ) ; num2string( &send_address[ 7], pn->sn[4] ) ; num2string( &send_address[ 9], pn->sn[3] ) ; num2string( &send_address[11], pn->sn[2] ) ; num2string( &send_address[13], pn->sn[1] ) ; num2string( &send_address[15], pn->sn[0] ) ; send_address[17] = 0x0D; if ( memcmp( pn->sn, pn->selected_connection->remembered_sn, SERIAL_NUMBER_SIZE ) ) { if ( BAD(COM_write((BYTE*)send_address,18,pn->selected_connection)) ) { LEVEL_DEBUG("Error with sending HA7E A-ddress") ; return HA7E_resync(pn) ; } } else { if ( BAD(COM_write((BYTE*)"M",1,pn->selected_connection)) ) { LEVEL_DEBUG("Error with sending HA7E M-atch") ; return HA7E_resync(pn) ; } } if ( BAD(COM_read((BYTE*)resp_address,17,pn->selected_connection)) ) { LEVEL_DEBUG("Error with reading HA7E select") ; return HA7E_resync(pn) ; } if ( memcmp( &resp_address[0],&send_address[1],17) ) { LEVEL_DEBUG("Error with HA7E select response") ; return HA7E_resync(pn) ; } // Set as current "Address" for adapter memcpy( pn->selected_connection->remembered_sn, pn->sn, SERIAL_NUMBER_SIZE) ; return gbGOOD ; } // Send data and return response block -- up to 32 bytes static GOOD_OR_BAD HA7E_sendback_part(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { char send_data[1+2+32*2+1] ; char get_data[32*2+1] ; send_data[0] = 'W' ; num2string( &send_data[1], size ) ; bytes2string(&send_data[3], data, size) ; send_data[3+2*size] = 0x0D ; if ( BAD(COM_write((BYTE*)send_data,size*2+4,pn->selected_connection)) ) { LEVEL_DEBUG("Error with sending HA7E block") ; HA7E_resync(pn) ; return gbBAD ; } if ( BAD(COM_read((BYTE*)get_data,size*2+1,pn->selected_connection)) ) { LEVEL_DEBUG("Error with reading HA7E block") ; HA7E_resync(pn) ; return gbBAD ; } string2bytes(get_data, resp, size) ; return gbGOOD ; } static GOOD_OR_BAD HA7E_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { int left; for ( left=size ; left>0 ; left -= 32 ) { size_t pass_start = size - left ; size_t pass_size = (left>32)?32:left ; RETURN_BAD_IF_BAD( HA7E_sendback_part( &data[pass_start], &resp[pass_start], pass_size, pn ) ) ; } return gbGOOD; } /********************************************************/ /* HA7E_close ** clean local resources before */ /* closing the serial port */ /* */ /********************************************************/ static void HA7E_close(struct connection_in *in) { HA7E_powerdown(in) ; COM_close(in); } static void HA7E_powerdown(struct connection_in * in) { struct parsedname pn; FS_ParsedName_Placeholder(&pn); // minimal parsename -- no destroy needed pn.selected_connection = in; COM_write((BYTE*)"P", 1, in) ; COM_slurp(in) ; } owfs-3.1p5/module/owlib/src/c/ow_fake.c0000644000175000001440000002360712654730021014716 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_codes.h" /* All the remaining_device_list of the program sees is the Fake_detect and the entry in iroutines */ static RESET_TYPE Fake_reset(const struct parsedname *pn); static GOOD_OR_BAD Fake_ProgramPulse(const struct parsedname *pn); static GOOD_OR_BAD Fake_sendback_bits(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static void Fake_close(struct connection_in *in); static enum search_status Fake_next_both(struct device_search *ds, const struct parsedname *pn); static const ASCII *namefind(const char *name); static void Fake_setroutines(struct connection_in *in); static GOOD_OR_BAD Fake_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static void GetNextByte( const ASCII ** strpointer, BYTE default_byte, BYTE * sn ) ; static void GetDeviceName(const ASCII ** strpointer, struct connection_in * in) ; static void GetDefaultDeviceName(BYTE * dn, const BYTE * sn, const struct connection_in * in) ; static void GetAllDeviceNames( struct port_in * pin ) ; static void SetConninData( int indx, const char * type, struct port_in *pin ) ; static void Fake_setroutines(struct connection_in *in) { in->iroutines.detect = Fake_detect; in->iroutines.reset = Fake_reset; in->iroutines.next_both = Fake_next_both; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = Fake_ProgramPulse; in->iroutines.sendback_data = Fake_sendback_data; in->iroutines.sendback_bits = Fake_sendback_bits; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = Fake_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_no2409path | ADAP_FLAG_presence_from_dirblob | ADAP_FLAG_no2404delay ; DirblobInit( &(in->master.fake.main) ); DirblobInit( &(in->master.fake.alarm) ); } static GOOD_OR_BAD Fake_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn) { (void) pn; (void) data; (void) resp; (void) len; return gbGOOD; } static void GetNextByte( const ASCII ** strpointer, BYTE default_byte, BYTE * sn ) { if ( (*strpointer)[0] == '.' ) { ++*strpointer ; } if ( isxdigit((*strpointer)[0]) && isxdigit((*strpointer)[1]) ) { *sn = string2num(*strpointer) ; *strpointer += 2 ; } else { *sn = default_byte ; } } // set up default device ID static void GetDefaultDeviceName(BYTE * dn, const BYTE * sn, const struct connection_in * in) { switch (get_busmode(in)) { case bus_tester: // "bus number" dn[1] = BYTE_MASK(in->master.tester.index >> 0) ; dn[2] = BYTE_MASK(in->master.tester.index >> 8) ; // repeat family code dn[3] = sn[0] ; // family code complement dn[4] = BYTE_INVERSE(sn[0]) ; // "device" number dn[5] = BYTE_MASK(DirblobElements(&(in->master.fake.main)) >> 0) ; dn[6] = BYTE_MASK(DirblobElements(&(in->master.fake.main)) >> 8) ; break ; case bus_fake: case bus_mock: default: // only for compiler warning dn[1] = BYTE_MASK(rand()) ; dn[2] = BYTE_MASK(rand()) ; dn[3] = BYTE_MASK(rand()) ; dn[4] = BYTE_MASK(rand()) ; dn[5] = BYTE_MASK(rand()) ; dn[6] = BYTE_MASK(rand()) ; break ; } } static void GetDeviceName(const ASCII ** strpointer, struct connection_in * in) { BYTE sn[SERIAL_NUMBER_SIZE] ; BYTE dn[SERIAL_NUMBER_SIZE] ; if ( isxdigit((*strpointer)[0]) && isxdigit((*strpointer)[1]) ) { // family code specified sn[0] = string2num(*strpointer); *strpointer += 2; GetDefaultDeviceName( dn, sn, in ) ; // Choice of default or specified ID GetNextByte(strpointer,dn[1],&sn[1]); GetNextByte(strpointer,dn[2],&sn[2]); GetNextByte(strpointer,dn[3],&sn[3]); GetNextByte(strpointer,dn[4],&sn[4]); GetNextByte(strpointer,dn[5],&sn[5]); GetNextByte(strpointer,dn[6],&sn[6]); } else { const ASCII * name_to_familycode = namefind((*strpointer)) ; if ( name_to_familycode != NULL) { // device name specified (e.g. DS2401) sn[0] = string2num(name_to_familycode); GetDefaultDeviceName( dn, sn, in ) ; sn[1] = dn[1] ; sn[2] = dn[2] ; sn[3] = dn[3] ; sn[4] = dn[4] ; sn[5] = dn[5] ; sn[6] = dn[6] ; } else { // Bad device name LEVEL_DEFAULT("Device %d <%s> not recognized for %s %d -- ignored",DirblobElements(&(in->master.fake.main))+1,*strpointer,in->adapter_name,in->master.fake.index); return ; } } sn[SERIAL_NUMBER_SIZE-1] = CRC8compute(sn, SERIAL_NUMBER_SIZE-1, 0); DirblobAdd(sn, &(in->master.fake.main)); // Ignore bad return } static void GetAllDeviceNames( struct port_in * pin ) { struct connection_in * in = pin->first ; ASCII * remaining_device_list = owstrdup( pin->init_data ) ; ASCII * remember_location = remaining_device_list ; while (remaining_device_list != NULL) { const ASCII *current_device_start; for (current_device_start = strsep(&remaining_device_list, " ,"); current_device_start[0] != '\0'; ++current_device_start) { // note that strsep updates "remaining_device_list" pointer if (current_device_start[0] != ' ' && current_device_start[0] != ',') { break; } } GetDeviceName( ¤t_device_start, in ) ; } SAFEFREE( remember_location ) ; in->AnyDevices = (DirblobElements(&(in->master.fake.main)) > 0) ? anydevices_yes : anydevices_no ; } static void SetConninData( int indx, const char * type, struct port_in *pin ) { struct connection_in * in = pin->first ; char name[20] ; pin->file_descriptor = indx; pin->type = ct_none ; in->master.fake.index = indx; in->master.fake.templow = Globals.templow; in->master.fake.temphigh = Globals.temphigh; LEVEL_CONNECT("Setting up %s Bus Master (%d)", type, indx); UCLIBCLOCK ; snprintf(name, 18, "%s.%d", type, indx); UCLIBCUNLOCK ; GetAllDeviceNames( pin ) ; // Device name and init_data diverge now SAFEFREE(DEVICENAME(in)) ; DEVICENAME(in) = owstrdup(name); } /* Device-specific functions */ /* Since this is simulated bus master, it's creation cannot fail */ /* in->name starts with a list of devices which is destructovely parsed and freed */ /* in->name end with a name-index format */ GOOD_OR_BAD Fake_detect(struct port_in *pin) { struct connection_in * in = pin->first ; Fake_setroutines(in); // set up close, reconnect, reset, ... in->iroutines.detect = Fake_detect; in->adapter_name = "Simulated-Random"; in->Adapter = adapter_fake; SetConninData( Inbound_Control.next_fake++, "fake", pin ); return gbGOOD; } /* Device-specific functions */ /* Since this is simulated bus master, it's creation cannot fail */ /* in->name starts with a list of devices which is destructovely parsed and freed */ /* in->name end with a name-index format */ GOOD_OR_BAD Mock_detect(struct port_in *pin) { struct connection_in * in = pin->first ; Fake_setroutines(in); // set up close, reconnect, reset, ... in->iroutines.detect = Mock_detect; in->adapter_name = "Simulated-Mock"; in->Adapter = adapter_mock; SetConninData( Inbound_Control.next_mock++, "mock", pin ); return gbGOOD; } /* Device-specific functions */ /* Since this is simulated bus master, it's creation cannot fail */ /* in->name starts with a list of devices which is destructovely parsed and freed */ /* in->name end with a name-index format */ GOOD_OR_BAD Tester_detect(struct port_in *pin) { struct connection_in * in = pin->first ; Fake_setroutines(in); // set up close, reconnect, reset, ... in->iroutines.detect = Tester_detect; in->adapter_name = "Simulated-Computed"; in->Adapter = adapter_tester; SetConninData( Inbound_Control.next_tester++, "tester", pin ); return gbGOOD; } static RESET_TYPE Fake_reset(const struct parsedname *pn) { (void) pn; return BUS_RESET_OK; } static GOOD_OR_BAD Fake_ProgramPulse(const struct parsedname *pn) { (void) pn; return gbGOOD; } static GOOD_OR_BAD Fake_sendback_bits(const BYTE * data, BYTE * resp, const size_t length, const struct parsedname *pn) { (void) pn; (void) data; (void) resp; (void) length; return gbGOOD; } static void Fake_close(struct connection_in *in) { DirblobClear( &(in->master.fake.main) ); DirblobClear( &(in->master.fake.alarm) ); } static enum search_status Fake_next_both(struct device_search *ds, const struct parsedname *pn) { if (ds->search == _1W_CONDITIONAL_SEARCH_ROM) { // alarm not supported ds->LastDevice = 1; return search_done; } if (DirblobGet(++ds->index, ds->sn, &(pn->selected_connection->master.fake.main))) { ds->LastDevice = 1; return search_done; } return search_good; } /* Need to lock struct global_namefind_struct since twalk requires global data -- can't pass void pointer */ /* Except all *_detect routines are done sequentially, not concurrently */ struct { const ASCII *readable_name; const ASCII *ret; } global_namefind_struct; static void Namefindaction(const void *nodep, const VISIT which, const int depth) { const struct device *p = *(struct device * const *) nodep; (void) depth; //printf("Comparing %s|%s with %s\n",p->name ,p->code , Namefindname ) ; switch (which) { case leaf: case postorder: if (strcasecmp(p->readable_name, global_namefind_struct.readable_name) == 0 || strcasecmp(p->family_code, global_namefind_struct.readable_name) == 0) { global_namefind_struct.ret = p->family_code; } case preorder: case endorder: break; } } static const ASCII *namefind(const char *name) { const ASCII *ret; NAMEFINDLOCK; global_namefind_struct.readable_name = name; global_namefind_struct.ret = NULL; twalk(Tree[ePN_real], Namefindaction); ret = global_namefind_struct.ret; NAMEFINDUNLOCK; return ret; } owfs-3.1p5/module/owlib/src/c/ow_fakeread.c0000644000175000001440000001000512654730021015536 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor $ID: $ */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" /* ------- Prototypes ----------- */ static ZERO_OR_ERROR FS_read_fake_single(struct one_wire_query *owq); static ZERO_OR_ERROR FS_read_fake_array(struct one_wire_query *owq); /* ---------------------------------------------- */ /* Filesystem callback functions */ /* ---------------------------------------------- */ #define Random (((_FLOAT)rand())/RAND_MAX) #define Random_y (rand()&0x01) #define Random_t (Random*100) #define Random_d (NOW_TIME*(1-.1*Random)) #define Random_i (rand()&0xFF) #define Random_u (rand()&0xFF) #define Random_b (rand()&0xFF) #define Random_a ('a'+(rand() % (26))) #define Random_f (100.*Random) ZERO_OR_ERROR FS_read_fake(struct one_wire_query *owq) { switch (OWQ_pn(owq).extension) { case EXTENSION_ALL: if (OWQ_offset(owq)) { return 0; } if (OWQ_size(owq) < FullFileLength(PN(owq))) { return -ERANGE; } return FS_read_fake_array(owq); case EXTENSION_BYTE: /* bitfield */ default: return FS_read_fake_single(owq); } } static ZERO_OR_ERROR FS_read_fake_single(struct one_wire_query *owq) { enum { type_a, type_b } format_type = type_a; // assume ascii switch (OWQ_pn(owq).selected_filetype->format) { case ft_integer: OWQ_I(owq) = Random_i; break; case ft_yesno: OWQ_Y(owq) = Random_y; break; case ft_bitfield: if (OWQ_pn(owq).extension == EXTENSION_BYTE) { OWQ_U(owq) = Random_u; } else { OWQ_Y(owq) = Random_y; } break; case ft_unsigned: OWQ_U(owq) = Random_u; break; case ft_temperature: { _FLOAT low = OWQ_pn(owq).selected_connection->master.fake.templow ; _FLOAT high = OWQ_pn(owq).selected_connection->master.fake.temphigh ; OWQ_F(owq) = low + (high-low)*Random_f/100.; } break; case ft_tempgap: case ft_pressure: case ft_float: OWQ_F(owq) = Random_f; break; case ft_date: OWQ_D(owq) = Random_d; break; case ft_binary: format_type = type_b; // binary // fall through case ft_vascii: case ft_alias: case ft_ascii: { size_t i; size_t length = FileLength(PN(owq)); ASCII random_chars[length]; for (i = 0; i < length; ++i) { random_chars[i] = (format_type == type_a) ? Random_a : Random_b; } return OWQ_format_output_offset_and_size(random_chars, length, owq); } case ft_directory: case ft_subdir: case ft_unknown: return -ENOENT; } return 0; // put data as string into buffer and return length } /* Read each array element independently, but return as one long string */ /* called when pn->extension==EXTENSION_ALL and pn->selected_filetype->ag->combined==ag_separate */ static ZERO_OR_ERROR FS_read_fake_array(struct one_wire_query *owq) { size_t elements = OWQ_pn(owq).selected_filetype->ag->elements; size_t extension; size_t entry_length = FileLength(PN(owq)); for (extension = 0; extension < elements; ++extension) { struct one_wire_query * owq_single = OWQ_create_separate( extension, owq ) ; if ( owq_single == NO_ONE_WIRE_QUERY ) { return -ENOMEM ; } switch (OWQ_pn(owq).selected_filetype->format) { case ft_integer: case ft_yesno: case ft_bitfield: case ft_unsigned: case ft_pressure: case ft_temperature: case ft_tempgap: case ft_float: case ft_date: break; case ft_vascii: case ft_alias: case ft_ascii: case ft_binary: OWQ_assign_read_buffer(&OWQ_buffer(owq)[extension * entry_length],entry_length,0,owq_single) ; break; case ft_directory: case ft_subdir: case ft_unknown: OWQ_destroy(owq_single) ; return -ENOENT; } if (FS_read_fake_single(owq_single)) { OWQ_destroy(owq_single) ; return -EINVAL; } memcpy(&OWQ_array(owq)[extension], &OWQ_val(owq_single), sizeof(union value_object)); OWQ_destroy(owq_single) ; } return 0; } owfs-3.1p5/module/owlib/src/c/ow_filelength.c0000644000175000001440000000367112654730021016130 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" /* Length of a property element */ /* based on property type in most cases, except ascii and binary, which are explicitly sized */ size_t FileLength(const struct parsedname *pn) { if (pn->type == ePN_structure) { return PROPERTY_LENGTH_STRUCTURE; /* longest seem to be /1wire/structure/0F/memory.ALL (28 bytes) so far... */ } /* directory ? */ if (IsDir(pn)) { return PROPERTY_LENGTH_DIRECTORY; } switch (pn->selected_filetype->format) { case ft_yesno: return PROPERTY_LENGTH_YESNO; case ft_integer: return PROPERTY_LENGTH_INTEGER; case ft_unsigned: return PROPERTY_LENGTH_UNSIGNED; case ft_float: return PROPERTY_LENGTH_FLOAT; case ft_pressure: return PROPERTY_LENGTH_PRESSURE; case ft_temperature: return PROPERTY_LENGTH_TEMP; case ft_tempgap: return PROPERTY_LENGTH_TEMPGAP; case ft_date: return PROPERTY_LENGTH_DATE; case ft_bitfield: return (pn->extension == EXTENSION_BYTE) ? PROPERTY_LENGTH_UNSIGNED : PROPERTY_LENGTH_YESNO; case ft_vascii: // not used anymore here... case ft_alias: case ft_ascii: case ft_binary: default: return pn->selected_filetype->suglen; } } /* Length of file based on filetype and extension */ size_t FullFileLength(const struct parsedname * pn) { size_t entry_length = FileLength(pn); if (pn->type == ePN_structure) { return entry_length; } else if (pn->extension != EXTENSION_ALL) { return entry_length; } else { size_t elements = pn->selected_filetype->ag->elements; if (pn->selected_filetype->format == ft_binary) { return entry_length * elements; } else { // add room for commas return (entry_length + 1) * elements - 1; } } } owfs-3.1p5/module/owlib/src/c/ow_fstat.c0000644000175000001440000000704712654730021015131 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" ZERO_OR_ERROR FS_fstat(const char *path, struct stat *stbuf) { struct parsedname pn; ZERO_OR_ERROR ret = 0; LEVEL_CALL("path=%s", SAFESTRING(path)); /* Bad path */ if (FS_ParsedName(path, &pn) != 0 ) { return -ENOENT; } ret = FS_fstat_postparse(stbuf, &pn); FS_ParsedName_destroy(&pn); return ret; } /* Fstat with parsedname already done */ ZERO_OR_ERROR FS_fstat_postparse(struct stat *stbuf, const struct parsedname *pn) { memset(stbuf, 0, sizeof(struct stat)); LEVEL_CALL("ATTRIBUTES path=%s", SAFESTRING(pn->path)); if (KnownBus(pn) && pn->known_bus == NULL) { /* check for presence of first in-device at least since FS_ParsedName * doesn't do it yet. */ return -ENOENT; } else if (pn->selected_device == NO_DEVICE) { /* root directory */ int nr = 0; //printf("FS_fstat root\n"); stbuf->st_mode = S_IFDIR | 0755; stbuf->st_nlink = 2; // plus number of sub-directories nr = -1; // make it 1 /* If calculating NSUB is hard, the filesystem can set st_nlink of directories to 1, and find will still work. This is not documented behavior of find, and it's not clear whether this is intended or just by accident. But for example the NTFS filesysem relies on this, so it's unlikely that this "feature" will go away. */ stbuf->st_nlink += nr; FSTATLOCK; stbuf->st_atime = stbuf->st_ctime = stbuf->st_mtime = StateInfo.start_time; FSTATUNLOCK; stbuf->st_size = 4096 ; // Common directory size return 0; } else if (pn->selected_filetype == NO_FILETYPE) { int nr = 0; //printf("FS_fstat pn.selected_filetype == NULL (1-wire device)\n"); stbuf->st_mode = S_IFDIR | 0777; stbuf->st_nlink = 2; // plus number of sub-directories nr = -1; // make it 1 //printf("FS_fstat seem to be %d entries (%d dirs) in device\n", pn.selected_device->nft, nr); stbuf->st_nlink += nr; FSTATLOCK; stbuf->st_atime = stbuf->st_ctime = stbuf->st_mtime = StateInfo.dir_time; FSTATUNLOCK; stbuf->st_size = 4096 ; // Common directory size return 0; } else if (pn->selected_filetype->format == ft_directory || pn->selected_filetype->format == ft_subdir) { /* other directory */ int nr = 0; stbuf->st_mode = S_IFDIR | 0777; stbuf->st_nlink = 2; // plus number of sub-directories nr = -1; // make it 1 stbuf->st_nlink += nr; FSTATLOCK; stbuf->st_atime = stbuf->st_ctime = stbuf->st_mtime = StateInfo.dir_time; FSTATUNLOCK; stbuf->st_size = 4096 ; // Common directory size return 0; } else { /* known 1-wire filetype */ stbuf->st_mode = S_IFREG; if (pn->selected_filetype->read != NO_READ_FUNCTION) { stbuf->st_mode |= 0444; } if (!Globals.readonly && (pn->selected_filetype->write != NO_WRITE_FUNCTION)) { stbuf->st_mode |= 0222; } stbuf->st_nlink = 1; switch (pn->selected_filetype->change) { case fc_volatile: case fc_second: case fc_statistic: stbuf->st_atime = stbuf->st_ctime = stbuf->st_mtime = NOW_TIME; break; case fc_stable: FSTATLOCK; stbuf->st_atime = stbuf->st_ctime = stbuf->st_mtime = StateInfo.dir_time; FSTATUNLOCK; break; default: stbuf->st_atime = stbuf->st_ctime = stbuf->st_mtime = StateInfo.start_time; break; } stbuf->st_size = FullFileLength(pn); return 0; } } owfs-3.1p5/module/owlib/src/c/ow_ftdi.c0000644000175000001440000003533712756345235014755 00000000000000/* OWFS -- One-Wire filesystem ow_ftdi: low-level communication routines for FTDI-based adapters Copyright 2014-2016 Johan Ström Released under GPLv2 for inclusion in the OWFS project. This file implements a serial layer for use with FTDI-based USB serial adapters. It should be usable as an in-place replacement for any ports with type ct_serial, given that the actual device can be reached through a FTDI chip (which is accessible). The main benifit of using this rather than accessing through a regular ttyUSB/cuaU device is that it will tweak the FTDI chip's latency timer. Since 1W transactions often use single character reads, the default setting inflicts a 16ms delay on every single read operation. With this layer we bring that down to (max) 1ms. This is (mostly) called from ow_com* routines, when the underlying port_in type is ct_ftdi. Please note that this is only a serial layer, for interacting with FTDI serial adapter chips. Generally, there is no way to know WHAT is conneted a given chip. Thus, ut is *not* possible to write a "scan for any FTDI 1wire device" feature, unless the device has a unique VID/PID. The owftdi_open method assumes that the device arg is prefixed with "ftdi:". The following args can be used to identify a specific port: ftdi:d: path of bus and device-node (e.g. "003/001") within usb device tree (usually at /proc/bus/usb/) ftdi:i:: first device with given vendor and product id, ids can be decimal, octal (preceded by "0") or hex (preceded by "0x") ftdi:i::: as above with index being the number of the device (starting with 0) if there are more than one ftdi:s::: first device with given vendor id, product id and serial string The strings are passed to libftdi as a "descriptor". An additional format is supported, for certain bus types. ftdi: This only works if there is a pre-defined VID/PID for the bus type used. Currently, this is only valid for the VID/PID found on the LinkUSB (i.e. bus_link). Note that those VID/PID's are the default for any FT232R device, and in no way exclusive to LinkUSB. */ #include #include "owfs_config.h" #include "ow_connection.h" #if OW_FTDI //#define BENCH #define FTDI_LINKUSB_VID 0x0403 #define FTDI_LINKUSB_PID 0x6001 #include #include #include #include "ow_ftdi.h" static inline int min(int a, int b) { return (a > b) ? b : a; } static inline int max(int a, int b) { return (a > b) ? a : b; } #define FTDIC(in) ((in)->master.link.ftdic) static GOOD_OR_BAD owftdi_open_device(struct connection_in *in, const char *description) ; static GOOD_OR_BAD owftdi_open_device_specific(struct connection_in *in, int vid, int pid, const char *serial) ; static GOOD_OR_BAD owftdi_opened(struct connection_in *in) ; #define owftdi_configure_baud(in) owftdi_configure_baud0(in, COM_BaudRate((in)->pown->baud)) static GOOD_OR_BAD owftdi_configure_baud0(struct connection_in *in, int baud) ; static GOOD_OR_BAD owftdi_configure_bits(struct connection_in *in, enum ftdi_break_type break_) ; static GOOD_OR_BAD owftdi_configure_dtrrts(struct connection_in *in, int value) ; GOOD_OR_BAD owftdi_open( struct connection_in * in ) { GOOD_OR_BAD gbResult; const char* arg = in->pown->init_data; const char* target = arg+5; assert(arg); assert(strstr(arg, "ftdi:") == arg); if(strlen(target) < 2) { LEVEL_DEFAULT("Invalid ftdi target string"); return gbBAD ; } char c0 = target[0]; char c1 = target[1]; const char* serial = NULL; if(c0 != 'd' && c0 != 'i' && c0 != 's' && c1 != ':') { // Assume plain serial; only works with known device-types serial = target; } if(FTDIC(in)) { LEVEL_DEFAULT("FTDI interface %s was NOT closed?", DEVICENAME(in)); return gbBAD ; } if(!(FTDIC(in) = ftdi_new())) { LEVEL_DEFAULT("Failed to get FTDI context"); return gbBAD ; } if(serial) { switch(in->pown->busmode) { case bus_link: gbResult = owftdi_open_device_specific(in, FTDI_LINKUSB_VID, FTDI_LINKUSB_PID, serial); if(GOOD(gbResult)) in->adapter_name = "LinkUSB"; break; default: LEVEL_DEFAULT( "Cannot use ftdi: with this device (%d), please use full format", in->pown->busmode); gbResult = gbBAD; break; } }else{ gbResult = owftdi_open_device(in, target); } if(GOOD(gbResult)) { gbResult = owftdi_change(in); } if(BAD(gbResult)) { ftdi_free(FTDIC(in)); FTDIC(in) = NULL; } else { in->pown->state = cs_deflowered; } return gbResult; } void owftdi_free( struct connection_in *in ) { if(!FTDIC(in)) { assert(in->pown->file_descriptor == FILE_DESCRIPTOR_BAD); return ; } // Best effort, port might not be open, only context ftdi_usb_close(FTDIC(in)); ftdi_free(FTDIC(in)); FTDIC(in) = NULL; in->pown->state = cs_virgin; // TODO: Cleaner? in->pown->file_descriptor = FILE_DESCRIPTOR_BAD; } void owftdi_close( struct connection_in * in ) { owftdi_free(in); } void owftdi_flush( const struct connection_in *in ) { if(!FTDIC(in)) { LEVEL_DEFAULT("Cannot flush FTDI interface %s, not open", DEVICENAME(in)); return; } ftdi_usb_purge_tx_buffer(FTDIC(in)); ftdi_usb_purge_rx_buffer(FTDIC(in)); } void owftdi_break ( struct connection_in *in ) { assert (FTDIC(in)); // Wait a bit, ensuring any pending writes get through. usleep(100000); /* tcsendbreak manpage: * linux: 0.25-0.5s * freebsd: "four tenths of a second" * * break for 0.4s here as well */ LEVEL_DEBUG("Sending FTDI break.."); owftdi_configure_bits(in, BREAK_ON); usleep(400000); owftdi_configure_bits(in, BREAK_OFF); } static GOOD_OR_BAD owftdi_open_device(struct connection_in *in, const char *description) { int ret = ftdi_usb_open_string(FTDIC(in), description); if(ret != 0) { ERROR_CONNECT("Failed to open FTDI device with description '%s': %d = %s", description, ret, ftdi_get_error_string(FTDIC(in))); return gbBAD; } return owftdi_opened(in); } static GOOD_OR_BAD owftdi_open_device_specific(struct connection_in *in, int vid, int pid, const char *serial) { int ret = ftdi_usb_open_desc(FTDIC(in), vid, pid, NULL, serial); if(ret != 0) { ERROR_CONNECT("Failed to open FTDI device with vid/pid 0x%x/0%x and serial '%s': %d = %s", vid, pid, serial, ret, ftdi_get_error_string(FTDIC(in))); return gbBAD; } return owftdi_opened(in); } static GOOD_OR_BAD owftdi_opened(struct connection_in *in) { int ret; /* Set DTR and RTS high. This is normally done by the OS when using the * generic serial interface. We must do it manually, or we will not be able to * communicate with the LinkUSB after boot/re-plug. * * Unfortunately, this can not be used to power-cycle the LinkUSB, it seems.. */ RETURN_BAD_IF_BAD(owftdi_configure_dtrrts(in, 1)); // Set latency timer to 1ms; improves response speed alot if((ret = ftdi_set_latency_timer(FTDIC(in), 1)) != 0) { ERROR_CONNECT("Failed to set FTDI latency timer: %d = %s", ret, ftdi_get_error_string(FTDIC(in))); return gbBAD; } // Fake a file_descriptor, so we can pass FILE_DESCRIPTOR_NOT_VALID check in // COM_read, COM_test // TODO: Cleaner? in->pown->file_descriptor = 999; return gbGOOD; } static GOOD_OR_BAD owftdi_configure_baud0(struct connection_in *in, int baud) { int ret; if((ret = ftdi_set_baudrate(FTDIC(in), baud)) != 0) { ERROR_CONNECT("Failed to set FTDI baud rate to %d: %d = %s", baud, ret, ftdi_get_error_string(FTDIC(in))); return gbBAD; } return gbGOOD; } static GOOD_OR_BAD owftdi_configure_bits(struct connection_in *in, enum ftdi_break_type break_) { struct port_in * pin = in->pown ; enum ftdi_bits_type bits; enum ftdi_stopbits_type stop; enum ftdi_parity_type parity; int ret; switch (pin->bits) { case 7: bits = BITS_7; break ; case 8: default: bits = BITS_8; break ; } switch (pin->parity) { case parity_none: default: parity = NONE; break ; case parity_even: parity = EVEN; break ; case parity_odd: parity = ODD; break ; case parity_mark: parity = MARK; break ; } // stop bits switch (pin->stop) { case stop_1: default: stop = STOP_BIT_1; break ; case stop_15: stop = STOP_BIT_15; break; case stop_2: stop = STOP_BIT_2; break ; } if((ret = ftdi_set_line_property2(FTDIC(in), bits, stop, parity, break_)) != 0) { ERROR_CONNECT("Failed to set FTDI bit-configuration: %d = %s", ret, ftdi_get_error_string(FTDIC(in))); return gbBAD; } return gbGOOD; } static GOOD_OR_BAD owftdi_configure_flow(struct connection_in *in) { struct port_in * pin = in->pown ; int flow; int ret; switch( pin->flow ) { case flow_hard: flow = SIO_RTS_CTS_HS; break ; case flow_none: flow = SIO_DISABLE_FLOW_CTRL; break ; case flow_soft: default: LEVEL_DEBUG("Unsupported COM port flow control"); return gbBAD ; } if((ret = ftdi_setflowctrl(FTDIC(in), flow)) != 0) { ERROR_CONNECT("Failed to set FTDI flow-control: %d = %s", ret, ftdi_get_error_string(FTDIC(in))); return gbBAD; } return gbGOOD; } static GOOD_OR_BAD owftdi_configure_dtrrts(struct connection_in *in, int value) { int ret = ftdi_setdtr_rts(FTDIC(in), value, value); if(ret != 0) { ERROR_CONNECT("Failed to set FTDI DTR/RTS high, %d: %s", ret, ftdi_get_error_string(FTDIC(in))); return gbBAD; } return gbGOOD; } GOOD_OR_BAD owftdi_change(struct connection_in *in) { RETURN_BAD_IF_BAD(owftdi_configure_baud(in)); RETURN_BAD_IF_BAD(owftdi_configure_bits(in, BREAK_OFF)); RETURN_BAD_IF_BAD(owftdi_configure_flow(in)); return gbGOOD; } SIZE_OR_ERROR owftdi_read(BYTE * data, size_t requested_size, struct connection_in *in) { struct port_in * pin = in->pown ; struct timeval tv_start; size_t chars_read = 0, to_be_read = requested_size; int retries = 0; time_t timeout; #ifdef BENCH struct timeval tv_end, tv_timing; #endif /* Configure USB *block transfer* timeout, this is not wait-for-any-data timeout * which we must implement manually below. */ timeout = pin->timeout.tv_sec * 1000 + pin->timeout.tv_usec/1000; FTDIC(in)->usb_read_timeout = timeout; /* ftdi_read_data will loop internally and read until requested_size has been filled, * or at least filled from whats available in the FTDI buffer. * The FTDI buffer is however one step away from the LINK, a RX buffer is inbetween. * A copy operation from the RX buffer to the FTDI buffer is done only when it's full, * or when the "latency timer" kicks in. We thus have to keep reading from the FTDI * buffer for a while. * * With our latency timer of 1ms, we will have a empty read after 1ms. However, in most * cases we actuall DO get data in time! */ LEVEL_DEBUG("attempt %zu bytes Time: "TVformat, requested_size, TVvar(&(pin->timeout))); gettimeofday(&tv_start, NULL); while(to_be_read> 0) { int ret = ftdi_read_data(FTDIC(in), &data[chars_read], to_be_read); if(ret < 0) { LEVEL_DATA("FTDI read failed: %d = %s", ret, ftdi_get_error_string(FTDIC(in))); STAT_ADD1(NET_read_errors); owftdi_close(in); return -EINVAL; } if(ret == 0) { // No data there yet... Sleep a bit and wait for more struct timeval tv_cur; time_t timeleft; gettimeofday(&tv_cur, NULL); timeleft = timeout*1000L - ((tv_cur.tv_sec - tv_start.tv_sec)*1000000L + (tv_cur.tv_usec - tv_start.tv_usec)); #if 0 LEVEL_DEBUG("No data available, delaying a bit (%"PRIu64"ms left, retrie %d)", timeleft/1000L, retries ); #endif if(timeleft < 0) { LEVEL_CONNECT("TIMEOUT after %d bytes", requested_size - to_be_read); // XXX: Stats here is not in tcp_read? STAT_ADD1_BUS(e_bus_timeouts, in); return -EAGAIN; } /* In <= 1ms, the latency timer will trigger a copy of the RX buffer * to the USB bus. When that time has come, we can try to read again. * Do it a bit quicker to get smaller latency. * Testing shows that we usually get our data within one or two loops * in normal situations, so this isn't really heavy busyloading. */ usleep(min(timeleft, (retries < 10) ? 200 : 1000)); retries++; continue; } TrafficIn("read", &data[chars_read], ret, in) ; to_be_read -= ret; chars_read += ret; } #ifdef BENCH gettimeofday(&tv_end, NULL); timersub(&tv_end, &tv_start, &tv_timing); LEVEL_DEBUG("ftdi_read, read %d bytes. %d read-loops=%.6fus, actual= %d", requested_size, retries, ((uint64_t)(tv_timing.tv_sec*1000000L) + (double)(tv_timing.tv_usec)), chars_read ); #endif LEVEL_DEBUG("ftdi_read: %d - %d = %d (%d retries)", (int)requested_size, (int) to_be_read, (int) (requested_size-to_be_read), retries) ; return chars_read; } GOOD_OR_BAD owftdi_write_once( const BYTE * data, size_t length, struct connection_in *in) { // Mimics COM_write_once FTDIC(in)->usb_write_timeout = Globals.timeout_serial * 1000; // XXX why not pin->timeout? TrafficOut("write", data, length, in); int ret = ftdi_write_data(FTDIC(in), data, (int)length); if(ret < 0) { ERROR_CONNECT("FTDI write to %s failed: %d = %s", SAFESTRING(DEVICENAME(in)), ret, ftdi_get_error_string(FTDIC(in))); STAT_ADD1_BUS(e_bus_write_errors, in); owftdi_close(in); return gbBAD; } LEVEL_DEBUG("ftdi_write: %zu = actual %d", length, ret) ; return gbGOOD; } /* slurp up any pending chars -- used at the start to clear the com buffer */ void owftdi_slurp(struct connection_in *in, uint64_t usec) { int ret; BYTE data[1]; /* This function is implemented similar to read; it must do repeated * ftdi_read_data calls, or we might miss to slurp critical data, * and the state machine will become confused. * * First purge any data in rx buffer, then do some subsequent reads. */ ret = ftdi_usb_purge_rx_buffer(FTDIC(in)); if(ret != 0) { ERROR_CONNECT("Failed to purge rx buffers on FTDI device, %d: %s", ret, ftdi_get_error_string(FTDIC(in))); } // Allow for at least 2 rounds of latency timeouts.. or we seem to miss \n in 19200 sometimes.. usec = max(usec, 2*1000); // USB block transfer timeout int prev_timeout = FTDIC(in)->usb_read_timeout; struct timeval tv_start; FTDIC(in)->usb_read_timeout = usec/1000; gettimeofday(&tv_start, NULL); while(1) { ret = ftdi_read_data(FTDIC(in), data, 1); #if 0 LEVEL_DEBUG("ftdi_slurp read ret %d, %s ", ret, ftdi_get_error_string(FTDIC(in))); #endif if(ret < 1) { // No data there yet... Sleep a bit and wait for more struct timeval tv_cur; time_t timeleft; gettimeofday(&tv_cur, NULL); timeleft = usec - ((tv_cur.tv_sec - tv_start.tv_sec)*1000000L + (tv_cur.tv_usec - tv_start.tv_usec)); if(timeleft < 0) { #if 0 LEVEL_DEBUG("ftdi_slurp timeout, timeleft=%d ", timeleft); #endif break; } usleep(min(timeleft, 200)); continue; } TrafficIn("slurp", data, 1, in); } FTDIC(in)->usb_read_timeout = prev_timeout; } #endif /* OW_FTDI */ owfs-3.1p5/module/owlib/src/c/ow_generic_read.c0000644000175000001440000000260712654730021016414 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_generic_read.h" /* ------- Prototypes ----------- */ /* static ZERO_OR_ERROR UnpagedRead( struct generic_read * gread, struct one_wire_query *owq ) { size_t size = OWQ_size(owq) ; BYTE * p = owmalloc( 3+size ); struct transaction_log t[] = { TRXN_START, TRXN_READ( p, 3+size ) , TRXN_END, } ; if ( p==NULL ) { return -ENOMEM ; } p[0] = gread->command ; p[1] = BYTE_MASK(OWQ_offset(owq)) ; p[2] = BYTE_MASK(OWQ_offset(owq)>>8) ; if ( BAD( BUS_transaction(t,PN(owq)) ) ) { owfree(p) ; return -EINVAL ; } memcpy( OWQ_buffer(owq), &p[3], size ) ; owfree(p) ; return 0 ; } */ ZERO_OR_ERROR Generic_Read( struct one_wire_query *owq) { struct parsedname * pn = PN(owq) ; struct generic_read * gread ; if ( pn==NO_PARSEDNAME && pn->selected_device==NO_DEVICE) { return -ENOTSUP ; } gread = pn->selected_device->g_read ; if ( gread==NO_GENERIC_READ ) { return -ENOTSUP ; } switch ( gread->addressing_type) { case rat_not_supported: return -ENOTSUP ; case rat_2byte: case rat_1byte: case rat_page: case rat_complement: default: return 0 ; } } owfs-3.1p5/module/owlib/src/c/ow_get.c0000644000175000001440000000704312654730021014563 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ // regex /* ow_interate.c */ /* routines to split reads and writes if longer than page */ #include #include "owfs_config.h" #include "ow.h" /* Get a value, returning a copy of the contents in *buffer (which must be free-ed elsewhere) return length of string, or <0 for error *buffer will be returned as NULL on error */ /* Get a directory, returning a copy of the contents in *buffer (which must be free-ed elsewhere) return length of string, or <0 for error *buffer will be returned as NULL on error */ static void getdircallback( void * v, const struct parsedname * const pn_entry ) { struct charblob * cb = v ; const char * buf = FS_DirName(pn_entry) ; CharblobAdd( buf, strlen(buf), cb ) ; if ( IsDir(pn_entry) ) { CharblobAddChar( '/', cb ) ; } } static int getdir( struct charblob * cb, struct one_wire_query * owq ) { int ret = 0; if ( (ret = FS_dir( getdircallback, cb, PN(owq) )) != 0 ) { CharblobClear( cb ) ; } else if ( CharblobLength(cb) == 0 ) { CharblobAddChar( '\0', cb) ; } return ret; } static char * copy_buffer( char * data, int size ) { char * data_copy = NULL ; // default if ( size < 0 ) { return NULL ; } data_copy = malloc( size+1 ) ; // cannot use owmalloc since this buffer cleanup is handled by the calling program. if ( data_copy == NULL ) { return NULL ; } memcpy( data_copy, data, size ) ; data_copy[size] = '\0' ; // null end char return data_copy ; } SIZE_OR_ERROR FS_get(const char *path, char **return_buffer, size_t * buffer_length) { SIZE_OR_ERROR size = 0 ; /* current buffer string length */ OWQ_allocate_struct_and_pointer( owq ) ; /* Check the parameters */ if (return_buffer == NULL) { // No buffer supplied for read result. return -EINVAL; } if (path == NULL) { path = "/"; } *return_buffer = NULL; // default return string on error if ( BAD( OWQ_create(path, owq) ) ) { /* Can we parse the input string */ return -ENOENT; } // Check for known type. if ( (PN(owq)->selected_filetype) != NO_FILETYPE ) { // local owlib knows the type. if ( IsDir( PN(owq) ) ) { /* A directory of some kind */ struct charblob cb ; CharblobInit(&cb) ; getdir( &cb, owq ) ; size = CharblobLength(&cb) ; *return_buffer = copy_buffer( CharblobData(&cb), size ) ; CharblobClear(&cb) ; } else { /* A regular file -- so read */ if ( GOOD(OWQ_allocate_read_buffer(owq)) ) { // make the space in the buffer size = FS_read_postparse(owq) ; *return_buffer = copy_buffer( OWQ_buffer(owq), size ) ; } } } else { // local owlib doesn't know the type. struct charblob cb ; CharblobInit(&cb) ; // Try directory first. if (getdir( &cb, owq ) != -ENOTDIR) { // Is a directory. size = CharblobLength(&cb) ; *return_buffer = copy_buffer( CharblobData(&cb), size ) ; } else { // Is not a directory. Try file. if ( GOOD(OWQ_allocate_read_buffer(owq)) ) { // make the space in the buffer size = FS_read_postparse(owq) ; *return_buffer = copy_buffer( OWQ_buffer(owq), size ) ; } } CharblobClear(&cb) ; } // the buffer is allocated by getdir or getval OWQ_destroy(owq); /* Check the parameters */ if (*return_buffer == NULL) { // error return -EINVAL; } if ( buffer_length != NULL ) { // return buffer length as well *buffer_length = size ; } return size ; } owfs-3.1p5/module/owlib/src/c/ow_help.c0000644000175000001440000002613412654730021014736 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_opt -- owlib specific command line options processing */ #include #include "owfs_config.h" #include "ow.h" void ow_help_general(void) { switch (Globals.program_type) { case program_type_filesystem: printf("Syntax: %s [options] device mountpoint\n", SAFESTRING(Globals.argv[0])); break; case program_type_httpd: case program_type_server: case program_type_external: printf("Syntax: %s [options] device clientport\n", SAFESTRING(Globals.argv[0])); break; case program_type_ftpd: default: printf("Syntax: %s [options] device\n", SAFESTRING(Globals.argv[0])); break; } printf("\n" "Help resources:\n" " %s --help This page\n" " %s --help=device Bus master device options\n" " %s --help=error List of error return codes\n" " %s --help=program Program services (mountpoint, port)\n" " %s --help=cache Cache and communication timing\n" " %s --help=job Job control and debugging\n" " %s --help=temperature Temperature scale and device format options\n" "\n" " man %s man page for this program\n" " and man pages for individual 1-wire devices e.g. 'man DS2409'\n", SAFESTRING(Globals.argv[0]), SAFESTRING(Globals.argv[0]), SAFESTRING(Globals.argv[0]), SAFESTRING(Globals.argv[0]), SAFESTRING(Globals.argv[0]), SAFESTRING(Globals.argv[0]), SAFESTRING(Globals.argv[0]), SAFESTRING(Globals.argv[0]) ); } void ow_help_job(void) { printf("Job Control and Information Help\n" "\n" " Information\n" " --error_level n Choose verbosity of error/debugging reports 0=low 9=high\n" " --error_print n Where debug info is placed 0-mixed 1-syslog 2-console\n" " --debug Shortcut for --error_level=9 --foreground\n" " --detail=10.1231234566,12 Detail debugging for particular slaves\n" " --traffic --notraffic show/no_show bus traffic\n" " --locks --nolocks show/no_show mutex locking\n" " -V --version Program and library versions\n" "\n" " Control\n" " --foreground\n" " --background\n" " --pid_file name file to store pid number (for control scripts)\n" "\n" " Configuration\n" " -c --configuration filename\n" " file to use as additional source of configuration\n" "\n" " Alias\n" " -a --alias filename\n" " file containing device to friendly_name pairs\n" " --unaliased No substitution of alias names in return data\n" " --aliased Substitute alias names in return (Default action)\n" "\n" " Permission\n" " -r --readonly Don't allow writing to 1-wire devices\n" " -w --write Allow writing to 1-wire\n" " --safemode Even more restrictive: readonly, no uncached, ...\n" "\n" ); } void ow_help_temperature(void) { printf("Temperature and Display Help\n" "\n" " 1-wire address format (for display, all will be accepted for input)\n" " f (family code) = 2 hex digits\n" " i (ID) = 12 hex digits\n" " c (crc8) = 2 hex digits\n" " -f --format f[.]i[[.]c]\n" "\n" " Temperature scale\n" " -C --Celsius Celsius(default) temperature scale\n" " -F --Fahrenheit Fahrenheit temperature scale\n" " -K --Kelvin Kelvin temperature scale\n" " -R --Rankine Rankine temperature scale\n" "\n" " Pressure scale\n" " --atm --mbar --inHg --mmHg --Pa --psi (mbar is the default)\n" "\n" " --trim remove extra spaces from numerical values\n" ); } void ow_help_cache(void) { printf("Cache and Timing Help\n" "\n" " Caching (temporary storage of data in program memory for efficiency)\n" " --uncached Implicit /uncached in all requests\n" " --cached Explicit /uncached needed. (Default action)\n" " --cache_size n Size in bytes of max cache memory. 0 for no limit.\n" "\n" " Cache timing [default] (in seconds)\n" " --timeout_volatile [%3d] Expiration time for changing data (e.g. temperature)\n" " --timeout_stable [%3d] Expiration time for stable data (e.g. temperature limit)\n" " --timeout_directory [%3d] Expiration of directory lists\n" " --timeout_presence [%3d] Expiration of known 1-wire device location\n" " \n" " Communication timing [default] (in seconds)\n" " --timeout_serial [%3d] Timeout for serial port\n" " --timeout_usb [%3d] Timeout for USB transaction\n" " --timeout_network [%3d] Timeout for each network transaction\n" " --timeout_server [%3d] Timeout for first server connection\n" " --timeout_ftp [%3d] Timeout for FTP session\n" " --timeout_ha7 [%3d] Timeout for HA7Net bus master\n" " --timeout_w1 [%3d] Timeout for w1 kernel netlink\n" , Globals.timeout_volatile , Globals.timeout_stable , Globals.timeout_directory , Globals.timeout_presence , Globals.timeout_serial , Globals.timeout_usb , Globals.timeout_network , Globals.timeout_server , Globals.timeout_ftp , Globals.timeout_ha7 , Globals.timeout_w1 ); } void ow_help_error(void) { int return_code ; printf("Error return codes Help\n"); for ( return_code=0 ; return_code < N_RETURN_CODES ; ++return_code ) { printf("%3d. %s\n",return_code,return_code_strings[return_code]); } } void ow_help_program(void) { printf("Program-Specific Help\n" "\n" " owfs (FUSE-based filesystem)\n" " -m --mountpoint path Where to mount virtual 1-wire file system\n" " --fuse_open_opt args Special arguments to pass to FUSE (Quoted and escaped)\n" " --allow_other Allow other users to see owfs file system\n" " needs /etc/fuse.conf setting\n" "\n" " owhttpd (web server)\n" " -p --port [ip:]port TCP address and port number for access\n" " --zero Announce service via zeroconf\n" " --announce name Name for service given in zeroconf broadcast\n" " --nozero Don't announce service via zeroconf\n" "\n" " owserver (OWFS server)\n" " -p --port [ip:]port TCP address and port number for access\n" "\n" " Development tests (owserver only)\n" " --pingcrazy Add lots of keep-alive messages to the owserver protocol\n" " --no_dirall DIRALL fails, drops back to older DIR (individual entries)\n" " --no_get GET fails, drops back to DIRALL and READ\n" " --no_persistence persistent connections refused, drops back to non-persistent\n" "\n" " owftpd (ftp server)\n" " -p --port [ip:]port TCP address and port number for access\n" " has default port 22 (root only)\n" " --zero Announce service via zeroconf\n" " --announce name Name for service given in zeroconf broadcast\n" " --nozero Don't announce service via zeroconf\n" "\n" ); } void ow_help_device(void) { printf("Device Help\n" " More than one device (1-wire bus master) can be specified. All will be used.\n" "\n" " Serial devices (dev is port name, e.g. /dev/ttyS0)\n" " -d dev DS9097U or DS9097 bus master (or LINK in emulation mode)\n" " --8bit Open 8bit (instead of 6) serial-port with DS9097\n" " --baud=1200|9600|19200|38400|57600|115200 Speed of communication to bus master\n" " --serial_flextime | --serial_regulartime (timing adjustments for DS2480B)\n" " --straight_polarity | --reverse_polarity (for DS2480B based bus master)\n" " --LINK=dev Serial LINK bus master (non-emulation)\n" " --pbm=dev Power Bus Master (PBM) with serial address\n" " --HA3=dev Serial HA3 bus master\n" " --HA4B=dev Serial HA4B bus master\n" " --HA5=dev:ah Serial HA5 bus master Channel a and h ( of a-z))\n" " --HA7E=dev Serial HA7E bus master\n" " --HA7S=dev Serial HA7S bus master\n" " --checksum | --no_checksum for HA5\n" " --hard | --no_hard Hardware flow control for serial line\n" "\n" " i2c devices\n" " -d dev DS2482-x00 bus master (dev is /dev/i2c-0)\n" " --i2c=dev DS2482-x00 bus master (dev is /dev/i2c-0)\n" " --i2c=dev:0 DS2482-x00 bus master address 0 of 0-7\n" " --i2c=ALL:ALL DS2482-x00 bus master ALL is wildcard\n" " --ActivePullUp | --no_ActivePullUp See datasheet on APU\n" " --PresencePulseMasking | --no_PresencePulseMasking See datasheet on PPM\n" "\n" "USB\n" " -u --USB DS9490R or PuceBaboon bus master\n" " -uall --USB=all Find and use all DS9490-type bus masters\n" " -u3:4 --USB=3:4 Specific USB location (bus 3, device 4)\n" " -uscan --USB=scan[:n] Keep looking for new USB adapters (every n seconds; default 10)\n" " -d /dev/ttyUSB0 ECLO USB bus master\n" " --link /dev/ttyUSB0 Link-USB\n" " --masterhub=/dev/ttyUSB0 Link-USB\n" " --altUSB Change some settings for DS9490 bus master (especially for AAG and DS2423)\n" " --usb_flextime | --usb_regulartime Needed for Louis Swart's LCD module\n" "\n" " Network (address is form [ip:]port, ip DNS name or n.n.n.n, port is port number)\n" " -s address owserver\n" " --LINK=address LINK-HUB-E network LINK\n" " --HA7NET=address HA7NET bus master\n" " --HA7NET HA7NET bus master address auto-discovered\n" " --ENET=address OWServer-Enet or ENET2 bus master\n" " --ENET OWServer-Enet or ENET2 automatically discovered\n" " --masterhub=address Hobby Boards Master Hub ethernet or wireless\n" // " --ENET=scan Keep looking for ENET or ENET2 bus masters\n" " --etherweather=address EtherWeather\n" " --autoserver Find owserver using zeroconf\n" "\n" " Simulated\n" " --fake=list List of devices to simulate (random ID, random data)\n" " use family codes in hex\n" " e.g. 1F,10,21 for DS2409,DS18S20,DS1921\n" " --tester=list List of devices to simulate (non-random ID, non-random data)\n" " --temperature_low=0.0 --temperature_high=100.0 temperature range for fake readings\n" "\n" " Linux Kernel Device\n" " --w1 Scan for kernel-managed bus masters\n" "\n" " Synthesized (FPGA) based device\n" " --DS1WM address Synthesizable 1-Wire BusMaster (address is base register location)\n" " --K1WM address,channels Kistler precision sensors\n" "\n" " --external Allow external scripts to be called\n" " --no_external Do not allow external scripts to be called\n" "\n" " 1-wire device selection\n" " --one-device Only single device on bus, use ROM SKIP command\n"); } void FS_help(const char *arg) { printf("1-WIRE access programs by Paul H Alfille and others.\n" "\n"); if (arg) { switch (arg[0]) { case 'd': case 'D': ow_help_device(); break; case 'e': case 'E': ow_help_error(); break; case 'p': case 'P': ow_help_program(); break; case 'j': case 'J': ow_help_job(); break; case 'c': case 'C': ow_help_cache(); break; case 't': case 'T': ow_help_temperature(); break; default: ow_help_general(); } } else { ow_help_general(); } printf("\n" "Copyright 2003-8 GPLv2 by Paul Alfille. See http://www.owfs.org for support, downloads\n"); } owfs-3.1p5/module/owlib/src/c/ow_inotify.c0000644000175000001440000000420712654730021015464 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" /* Code for monitoring the configuration files * using inotify * Linux uses this * kevent used in OSX and BSD * */ #ifdef WE_HAVE_INOTIFY static int config_monitor_num_files = 0 ; static FILE_DESCRIPTOR_OR_ERROR inotify_fd ; void Config_Monitor_Add( const char * filename ) { if ( config_monitor_num_files == 0 ) { // first time inotify_fd = inotify_init() ; if ( FILE_DESCRIPTOR_NOT_VALID( inotify_fd ) ) { LEVEL_DEBUG( "Trouble creating inotify queue" ) ; return ; } } if ( inotify_add_watch( inotify_fd, filename, IN_MODIFY | IN_CREATE ) >= 0 ) { LEVEL_DEBUG("Added %s to the watch list", filename ) ; ++ config_monitor_num_files ; } else { LEVEL_DEBUG( "Couldn't add %s to the inotify watch list", filename ) ; } } static void Config_Monitor_Block( void ) { // OS specific code int buffer_len = 100 ; char buffer[buffer_len] ; while ( read( inotify_fd, buffer, buffer_len ) < 0 ) { LEVEL_DEBUG("Error reading inotify events" ) ; } LEVEL_DEBUG( "Configuration file change -- time to resurrect" ) ; } // Thread that waits for forfig change and then restarts the program static void * Config_Monitor_Watchthread( void * v) { DETACH_THREAD ; // Blocking call until a config change detected Config_Monitor_Block() ; LEVEL_DEBUG("Configuration file change detected. Will restart %s",Globals.argv[0]); // Restart the program ReExecute(v) ; return v ; } static void Config_Monitor_Makethread( void * v ) { pthread_t thread ; if ( pthread_create( &thread, DEFAULT_THREAD_ATTR, Config_Monitor_Watchthread, v ) != 0 ) { LEVEL_DEBUG( "Could not create Configuration monitoring thread" ) ; } } void Config_Monitor_Watch( void * v) { if ( config_monitor_num_files > 0 ) { Config_Monitor_Makethread(v) ; } else { LEVEL_DEBUG("No configuration files to monitor" ) ; } } #endif /* WE_HAVE_INOTIFY */ owfs-3.1p5/module/owlib/src/c/ow_interface.c0000644000175000001440000006620012654730021015744 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* interface is data and control of bus master */ #include #include "owfs_config.h" #include "ow.h" #include "ow_interface.h" #include "ow_connection.h" /* ------- Prototypes ----------- */ /* Statistics reporting */ READ_FUNCTION(FS_name); READ_FUNCTION(FS_port); READ_FUNCTION(FS_version); READ_FUNCTION(FS_r_channel); READ_FUNCTION(FS_r_yesno); WRITE_FUNCTION(FS_w_yesno); READ_FUNCTION(FS_r_reconnect); WRITE_FUNCTION(FS_w_reconnect); READ_FUNCTION(FS_r_pulldownslewrate); WRITE_FUNCTION(FS_w_pulldownslewrate); READ_FUNCTION(FS_r_writeonelowtime); WRITE_FUNCTION(FS_w_writeonelowtime); READ_FUNCTION(FS_r_datasampleoffset); WRITE_FUNCTION(FS_w_datasampleoffset); READ_FUNCTION(FS_r_APU); WRITE_FUNCTION(FS_w_APU); READ_FUNCTION(FS_r_PPM); WRITE_FUNCTION(FS_w_PPM); READ_FUNCTION(FS_r_baud); WRITE_FUNCTION(FS_w_baud); READ_FUNCTION(FS_r_templimit); WRITE_FUNCTION(FS_w_templimit); //#define DEBUG_DS2490 #ifdef DEBUG_DS2490 READ_FUNCTION(FS_r_ds2490status); #endif /* Statistics reporting */ READ_FUNCTION(FS_stat_p); READ_FUNCTION(FS_bustime); READ_FUNCTION(FS_elapsed); #if OW_USB int DS9490_getstatus(BYTE * buffer, int readlen, const struct parsedname *pn); #endif /* Elabnet functions */ READ_FUNCTION(FS_r_PBM_version); READ_FUNCTION(FS_r_PBM_serial); READ_FUNCTION(FS_r_PBM_channel); READ_FUNCTION(FS_r_PBM_features); READ_FUNCTION(FS_w_PBM_activationcode); /* Link AUX functions */ READ_FUNCTION(FS_w_LINK_aux); READ_FUNCTION(FS_r_LINK_aux); static enum e_visibility VISIBLE_DS2482( const struct parsedname * pn ) { switch ( get_busmode(pn->selected_connection) ) { case bus_i2c: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_DS9490( const struct parsedname * pn ) { switch ( get_busmode(pn->selected_connection) ) { case bus_usb: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_DS2480B( const struct parsedname * pn ) { switch ( get_busmode(pn->selected_connection) ) { case bus_serial: case bus_xport: case bus_pbm: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_LINK( const struct parsedname * pn ) { switch ( get_busmode(pn->selected_connection) ) { case bus_link: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_HA5( const struct parsedname * pn ) { switch ( get_busmode(pn->selected_connection) ) { case bus_ha5: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_PBM( const struct parsedname * pn ) { switch ( get_busmode(pn->selected_connection) ) { case bus_pbm: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_DS1WM( const struct parsedname * pn ) { switch ( get_busmode(pn->selected_connection) ) { case bus_ds1wm: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_K1WM( const struct parsedname * pn ) { switch ( get_busmode(pn->selected_connection) ) { case bus_k1wm: return visible_now ; default: return visible_not_now ; } } static enum e_visibility VISIBLE_PSEUDO( const struct parsedname * pn ) { switch ( get_busmode(pn->selected_connection) ) { case bus_fake: case bus_tester: case bus_mock: return visible_now ; default: return visible_not_now ; } } /* -------- Structures ---------- */ /* Rare PUBLIC aggregate structure to allow changing the number of adapters */ static struct filetype interface_settings[] = { {"name", 128, NON_AGGREGATE, ft_vascii, fc_static, FS_name, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"address", 512, NON_AGGREGATE, ft_vascii, fc_static, FS_port, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"overdrive", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE, {.s=offsetof(struct connection_in,overdrive),}, }, {"version", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_version, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"ds2404_found", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE, {.s=offsetof(struct connection_in,ds2404_found),}, }, {"reconnect", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_reconnect, FS_w_reconnect, VISIBLE, NO_FILETYPE_DATA, }, {"usb", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_DS9490, NO_FILETYPE_DATA, }, #ifdef DEBUG_DS2490 {"usb/ds2490status", 128, NON_AGGREGATE, ft_vascii, fc_static, FS_r_ds2490status, NO_WRITE_FUNCTION, VISIBLE_DS9490, NO_FILETYPE_DATA, }, #endif {"usb/pulldownslewrate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_pulldownslewrate, FS_w_pulldownslewrate, VISIBLE_DS9490, NO_FILETYPE_DATA, }, {"usb/writeonelowtime", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_writeonelowtime, FS_w_writeonelowtime, VISIBLE_DS9490, NO_FILETYPE_DATA, }, {"usb/datasampleoffset", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_datasampleoffset, FS_w_datasampleoffset, VISIBLE_DS9490, NO_FILETYPE_DATA, }, {"usb/flexible_timing", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE_DS9490, {.s=offsetof(struct connection_in,flex),}, }, {"serial", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_DS2480B, NO_FILETYPE_DATA, }, {"serial/reverse_polarity", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE_DS2480B, {.s=offsetof(struct connection_in,master.serial.reverse_polarity),}, }, {"serial/baudrate", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_baud, FS_w_baud, VISIBLE_DS2480B, NO_FILETYPE_DATA, }, {"serial/flexible_timing", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE_DS2480B, {.s=offsetof(struct connection_in,flex),}, }, /* Link/LinkUSB AUX line control */ {"link", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_LINK, NO_FILETYPE_DATA, }, {"link/auxctrl", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_w_LINK_aux, VISIBLE_LINK, NO_FILETYPE_DATA, }, {"link/auxsense", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_LINK_aux, NO_WRITE_FUNCTION, VISIBLE_LINK, NO_FILETYPE_DATA, }, {"ha5", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_HA5, NO_FILETYPE_DATA, }, {"ha5/checksum", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE_HA5, {.s=offsetof(struct connection_in,master.ha5.checksum), }, }, {"ha5/channel", 1, NON_AGGREGATE, ft_ascii, fc_static, FS_r_channel, NO_WRITE_FUNCTION, VISIBLE_HA5, NO_FILETYPE_DATA, }, /* Elabnet PBM */ {"PBM", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_PBM, NO_FILETYPE_DATA, }, {"PBM/port", 1, NON_AGGREGATE, ft_ascii, fc_static, FS_r_PBM_channel, NO_WRITE_FUNCTION, VISIBLE_PBM, NO_FILETYPE_DATA, }, {"PBM/firmware_version", 64, NON_AGGREGATE, ft_ascii, fc_static, FS_r_PBM_version, NO_WRITE_FUNCTION, VISIBLE_PBM, NO_FILETYPE_DATA, }, {"PBM/serial", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_PBM_serial, NO_WRITE_FUNCTION, VISIBLE_PBM, NO_FILETYPE_DATA, }, {"PBM/features", 256, NON_AGGREGATE, ft_ascii, fc_static, FS_r_PBM_features, NO_WRITE_FUNCTION, VISIBLE_PBM, NO_FILETYPE_DATA, }, {"PBM/activation_code", 128, NON_AGGREGATE, ft_ascii, fc_static, NO_READ_FUNCTION, FS_w_PBM_activationcode, VISIBLE_PBM, NO_FILETYPE_DATA, }, {"DS1WM", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_DS1WM, NO_FILETYPE_DATA, }, {"DS1WM/long_line_mode", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE_DS1WM, {.s=offsetof(struct connection_in,master.ds1wm.longline),}, }, {"DS1WM/pulse_presence_mask", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE_DS1WM, {.s=offsetof(struct connection_in,master.ds1wm.presence_mask),}, }, {"K1WM", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_K1WM, NO_FILETYPE_DATA, }, {"K1WM/long_line_mode", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE_K1WM, {.s=offsetof(struct connection_in,master.ds1wm.longline),}, }, {"K1WM/pulse_presence_mask", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE_K1WM, {.s=offsetof(struct connection_in,master.ds1wm.presence_mask),}, }, {"i2c", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_DS2482, NO_FILETYPE_DATA, }, {"i2c/ActivePullUp", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_APU, FS_w_APU, VISIBLE_DS2482, NO_FILETYPE_DATA, }, {"i2c/PulsePresenceMask", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_PPM, FS_w_PPM, VISIBLE_DS2482, NO_FILETYPE_DATA, }, {"simulated", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE_PSEUDO, NO_FILETYPE_DATA, }, {"simulated/templow", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE_PSEUDO, {.i=1}, }, {"simulated/temphigh", PROPERTY_LENGTH_TEMP, NON_AGGREGATE, ft_temperature, fc_stable, FS_r_templimit, FS_w_templimit, VISIBLE_PSEUDO, {.i=0}, }, }; struct device d_interface_settings = { "settings", "settings", ePN_interface, COUNT_OF_FILETYPES(interface_settings), interface_settings, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct filetype interface_statistics[] = { {"elapsed_time", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_elapsed, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"bus_time", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_statistic, FS_bustime, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"reconnects", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_reconnects}, }, {"reconnect_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_reconnect_errors}, }, {"locks", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_locks}, }, {"unlocks", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_unlocks}, }, {"errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_errors}, }, {"resets", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_resets}, }, {"program_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_program_errors}, }, {"pullup_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_pullup_errors}, }, {"reset_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_reset_errors}, }, {"shorts", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_short_errors}, }, {"read_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_read_errors}, }, {"write_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_write_errors}, }, {"open_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_open_errors}, }, {"close_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_close_errors}, }, {"detect_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_detect_errors}, }, {"select_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_select_errors}, }, {"status_errors", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_status_errors}, }, {"timeouts", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_timeouts}, }, {"search_errors", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"search_errors/error_pass_1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_search_errors1}, }, {"search_errors/error_pass_2", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_search_errors2}, }, {"search_errors/error_pass_3", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_search_errors3}, }, {"overdrive", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"overdrive/attempts", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_try_overdrive}, }, {"overdrive/failures", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat_p, NO_WRITE_FUNCTION, VISIBLE, {.i=e_bus_failed_overdrive}, }, }; struct device d_interface_statistics = { "statistics", "statistics", 0, COUNT_OF_FILETYPES(interface_statistics), interface_statistics, NO_GENERIC_READ, NO_GENERIC_WRITE }; /* ------- Functions ------------ */ /* Just some tests to support reconnection */ static ZERO_OR_ERROR FS_r_reconnect(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); OWQ_Y(owq) = (pn->selected_connection->reconnect_state == reconnect_error); return 0; } /* Just some tests to support reconnection */ static ZERO_OR_ERROR FS_w_reconnect(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); pn->selected_connection->reconnect_state = OWQ_Y(owq) ? reconnect_error : reconnect_ok ; return 0; } /* DS2482 APU setting */ #define DS2482_REG_CFG_APU 0x01 static ZERO_OR_ERROR FS_r_APU(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); switch ( get_busmode(pn->selected_connection) ) { case bus_i2c: OWQ_Y(owq) = ( (pn->selected_connection->master.i2c.configreg & DS2482_REG_CFG_APU) != 0x00 ) ; return 0; default: return -ENOTSUP ; } } static ZERO_OR_ERROR FS_w_APU(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); switch ( get_busmode(pn->selected_connection) ) { case bus_i2c: if ( OWQ_Y(owq) ) { pn->selected_connection->master.i2c.configreg |= DS2482_REG_CFG_APU ; } else { pn->selected_connection->master.i2c.configreg &= ~DS2482_REG_CFG_APU ; } break ; default: break ; } return 0 ; } static ZERO_OR_ERROR FS_r_yesno( struct one_wire_query * owq ) { struct parsedname * pn = PN(owq) ; struct connection_in * in = pn->selected_connection ; struct filetype * ft = pn->selected_filetype ; size_t struct_offset = ft->data.s ; char * in_loc = (void *) in ; int * p_yes_no = (int *)(in_loc + struct_offset) ; switch( (ft->visible)(pn) ) { case visible_not_now: case visible_never: return -ENOTSUP ; default: break ; } OWQ_Y(owq) = p_yes_no[0] ; return 0 ; } static ZERO_OR_ERROR FS_w_yesno( struct one_wire_query * owq ) { struct parsedname * pn = PN(owq) ; struct connection_in * in = pn->selected_connection ; struct filetype * ft = pn->selected_filetype ; size_t struct_offset = ft->data.s ; char * in_loc = (void *) in ; int * p_yes_no = (int *)(in_loc + struct_offset) ; switch( (ft->visible)(pn) ) { case visible_not_now: case visible_never: return -ENOTSUP ; default: break ; } p_yes_no[0] = OWQ_Y(owq) ; in->changed_bus_settings |= CHANGED_USB_SPEED ; return 0 ; } /* fake adapter temperature limits */ static ZERO_OR_ERROR FS_r_templimit(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); switch ( get_busmode(pn->selected_connection) ) { case bus_fake: case bus_mock: case bus_tester: OWQ_F(owq) = pn->selected_filetype->data.i ? pn->selected_connection->master.fake.templow : pn->selected_connection->master.fake.temphigh; return 0; default: return -ENOTSUP ; } } static ZERO_OR_ERROR FS_w_templimit(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); switch ( get_busmode(pn->selected_connection) ) { case bus_fake: case bus_mock: case bus_tester: if (pn->selected_filetype->data.i) { pn->selected_connection->master.fake.templow = OWQ_F(owq); } else { pn->selected_connection->master.fake.temphigh = OWQ_F(owq); } return 0; default: break ; } return 0 ; } /* Serial baud rate */ static ZERO_OR_ERROR FS_r_baud(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; switch ( get_busmode(in) ) { case bus_serial: case bus_link: case bus_masterhub: case bus_ha5: case bus_ha7e: case bus_pbm: OWQ_U(owq) = COM_BaudRate( in->pown->baud ) ; return 0; default: return -ENOTSUP ; } } static ZERO_OR_ERROR FS_w_baud(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; switch ( get_busmode(in) ) { case bus_serial: case bus_link: case bus_masterhub: case bus_pbm: in->pown->baud = COM_MakeBaud( (speed_t) OWQ_U(owq) ) ; ++in->changed_bus_settings ; break ; default: break ; } return 0 ; } /* DS2482 PPM setting */ #define DS2482_REG_CFG_PPM 0x02 static ZERO_OR_ERROR FS_r_PPM(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; switch ( get_busmode(in) ) { case bus_i2c: OWQ_Y(owq) = ( (in->master.i2c.configreg & DS2482_REG_CFG_PPM) != 0x00 ) ; return 0; default: return -ENOTSUP ; } } static ZERO_OR_ERROR FS_w_PPM(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; switch ( get_busmode(in) ) { case bus_i2c: if ( OWQ_Y(owq) ) { in->master.i2c.configreg |= DS2482_REG_CFG_PPM ; } else { in->master.i2c.configreg &= ~DS2482_REG_CFG_PPM ; } break ; default: break ; } return 0 ; } /* For HA5 channel -- a single letter */ static ZERO_OR_ERROR FS_r_channel(struct one_wire_query *owq) { return OWQ_format_output_offset_and_size( (char *) &(PN(owq)->selected_connection->master.ha5.channel), 1, owq); } /* For PBM channel -- a single letter */ static ZERO_OR_ERROR FS_r_PBM_channel(struct one_wire_query *owq) { char port = PN(owq)->selected_connection->master.pbm.channel + '1'; return OWQ_format_output_offset_and_size(&port, 1, owq); } /* PBM Firmware version */ static ZERO_OR_ERROR FS_r_PBM_version(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; int majorvers = in->master.pbm.version >> 16; int minorvers = in->master.pbm.version & 0xffff; char res[64]; res[0] = '\0'; sprintf(res, "%d.%3.3d", majorvers, minorvers); return OWQ_format_output_offset_and_size_z(res, owq); } SIZE_OR_ERROR PBM_SendCMD(const BYTE * tx, size_t size, BYTE * rx, size_t rxsize, struct connection_in * in, int tout); /* List available features */ static ZERO_OR_ERROR FS_r_PBM_features(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; char res[256] = {0}; const BYTE cmd_listlics[] = "ks\n"; // some "magic" numbers -- 3 must be command length // 500 meaning is unclear. PBM_SendCMD(cmd_listlics, 3, (BYTE *) res, sizeof(res), in, 500); return OWQ_format_output_offset_and_size_z(res, owq); } /* Add new license into device */ ZERO_OR_ERROR FS_w_PBM_activationcode(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; size_t size = OWQ_size(owq) ; BYTE * cmd_string = owmalloc( size+5 ) ; if ( cmd_string == NULL ) { return -ENOMEM ; } cmd_string[0] = 'k'; cmd_string[1] = 'a'; memcpy(&cmd_string[2], OWQ_buffer(owq), size ) ; cmd_string[size+2] = '\r'; // Writes from and to cmd_string PBM_SendCMD(cmd_string, size + 3, cmd_string, size + 3, in, 500); owfree(cmd_string) ; return 0; } /* Read serialnumber */ static ZERO_OR_ERROR FS_r_PBM_serial(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; OWQ_U(owq) = in->master.pbm.serial_number; return 0 ; } /* Link/LinkUSB Aux line control */ // from ow_link.c GOOD_OR_BAD LINK_aux_write(int level, struct connection_in * in) ; GOOD_OR_BAD LINK_aux_read(int *level_out, struct connection_in * in) ; static ZERO_OR_ERROR FS_r_LINK_aux(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; int level; RETURN_ERROR_IF_BAD(LINK_aux_read(&level, in)); OWQ_Y(owq) = level; return OWQ_parse_output(owq); } static ZERO_OR_ERROR FS_w_LINK_aux(struct one_wire_query *owq) { struct connection_in * in = PN(owq)->selected_connection ; int level = OWQ_Y(owq) ; return GB_to_Z_OR_E(LINK_aux_write(level, in)); } #ifdef DEBUG_DS2490 static ZERO_OR_ERROR FS_r_ds2490status(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); char res[256]; char buffer[ DS9490_getstatus_BUFFER_LENGTH + 1 ]; int ret; res[0] = '\0'; if (get_busmode(pn->selected_connection) == bus_usb) { #if OW_USB ret = DS9490_getstatus(buffer, 0, PN(owq)); if (ret < 0) { sprintf(res, "DS9490_getstatus failed: %d\n", ret); } else { sprintf(res, "%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7], buffer[8], buffer[9], buffer[10], buffer[11], buffer[12], buffer[13], buffer[14], buffer[15]); } /* uchar EnableFlags; uchar OneWireSpeed; uchar StrongPullUpDuration; uchar ProgPulseDuration; uchar PullDownSlewRate; uchar Write1LowTime; uchar DSOW0RecoveryTime; uchar Reserved1; uchar StatusFlags; uchar CurrentCommCmd1; uchar CurrentCommCmd2; uchar CommBufferStatus; // Buffer for COMM commands uchar WriteBufferStatus; // Buffer we write to uchar ReadBufferStatus; // Buffer we read from */ #endif } return OWQ_format_output_offset_and_size_z(res, owq); } #endif /* * Value is between 0 and 7. * Default value is 3. * * PARMSET_Slew15Vus 0x0 * PARMSET_Slew2p20Vus 0x1 * PARMSET_Slew1p65Vus 0x2 * PARMSET_Slew1p37Vus 0x3 (default with altUSB) * PARMSET_Slew1p10Vus 0x4 * PARMSET_Slew0p83Vus 0x5 (default without altUSB) * PARMSET_Slew0p70Vus 0x6 * PARMSET_Slew0p55Vus 0x7 */ static ZERO_OR_ERROR FS_r_pulldownslewrate(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if (get_busmode(pn->selected_connection) != bus_usb) { return -ENOTSUP; #if OW_USB } else { OWQ_U(owq) = pn->selected_connection->master.usb.pulldownslewrate; #endif /* OW_USB */ } return 0; } static ZERO_OR_ERROR FS_w_pulldownslewrate(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if (get_busmode(pn->selected_connection) != bus_usb) { return -ENOTSUP; } #if OW_USB if (OWQ_U(owq) > 7) { return -ENOTSUP; } pn->selected_connection->master.usb.pulldownslewrate = OWQ_U(owq); pn->selected_connection->changed_bus_settings |= CHANGED_USB_SLEW ; // force a reset LEVEL_DEBUG("Set slewrate to %d", pn->selected_connection->master.usb.pulldownslewrate); #endif /* OW_USB */ return 0; } /* * Value is between 8 and 15, which represents 8us and 15us. * Default value is 10us. (with altUSB) * Default value is 12us. (without altUSB) */ static ZERO_OR_ERROR FS_r_writeonelowtime(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if (get_busmode(pn->selected_connection) != bus_usb) { OWQ_U(owq) = 10; #if OW_USB } else { OWQ_U(owq) = pn->selected_connection->master.usb.writeonelowtime + 8; #endif /* OW_USB */ } return 0; } static ZERO_OR_ERROR FS_w_writeonelowtime(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if (get_busmode(pn->selected_connection) != bus_usb) { return -ENOTSUP; } #if OW_USB if ((OWQ_U(owq) < 8) || (OWQ_U(owq) > 15)) { return -ENOTSUP; } pn->selected_connection->master.usb.writeonelowtime = OWQ_U(owq) - 8; pn->selected_connection->changed_bus_settings |= CHANGED_USB_LOW ; // force a reset #endif /* OW_USB */ return 0; } /* * Value is between 3 and 10, which represents 3us and 10us. * Default value is 8us. (with altUSB) * Default value is 7us. (without altUSB) */ static ZERO_OR_ERROR FS_r_datasampleoffset(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if (get_busmode(pn->selected_connection) != bus_usb) { OWQ_U(owq) = 8; #if OW_USB } else { OWQ_U(owq) = pn->selected_connection->master.usb.datasampleoffset + 3; #endif /* OW_USB */ } return 0; } static ZERO_OR_ERROR FS_w_datasampleoffset(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if (get_busmode(pn->selected_connection) != bus_usb){ return -ENOTSUP; } #if OW_USB if ((OWQ_U(owq) < 3) || (OWQ_U(owq) > 10)) { return -ENOTSUP; } pn->selected_connection->master.usb.datasampleoffset = OWQ_U(owq) - 3; pn->selected_connection->changed_bus_settings |= CHANGED_USB_OFFSET; // force a reset #endif /* OW_USB */ return 0; } /* special check, -remote file length won't match local sizes */ static ZERO_OR_ERROR FS_name(struct one_wire_query *owq) { char *name = ""; struct parsedname *pn = PN(owq); //printf("NAME %d=%s\n",pn->selected_connection->index,pn->selected_connection->adapter_name); if (pn->selected_connection->adapter_name) { name = pn->selected_connection->adapter_name; } return OWQ_format_output_offset_and_size_z(name, owq); } /* special check, -remote file length won't match local sizes */ static ZERO_OR_ERROR FS_port(struct one_wire_query *owq) { return OWQ_format_output_offset_and_size_z( SAFESTRING( DEVICENAME(PN(owq)->selected_connection)), owq); } /* special check, -remote file length won't match local sizes */ static ZERO_OR_ERROR FS_version(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); OWQ_U(owq) = pn->selected_connection->Adapter; return 0; } static ZERO_OR_ERROR FS_stat_p(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); OWQ_U(owq) = pn->selected_connection->bus_stat[pn->selected_filetype->data.i]; return 0; } static ZERO_OR_ERROR FS_bustime(struct one_wire_query *owq) { OWQ_F(owq) = TVfloat( &(PN(owq)->selected_connection->bus_time) ) ; return 0; } static ZERO_OR_ERROR FS_elapsed(struct one_wire_query *owq) { OWQ_U(owq) = NOW_TIME - StateInfo.start_time; return 0; } owfs-3.1p5/module/owlib/src/c/ow_iterate.c0000644000175000001440000000432412654730021015440 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_interate.c */ /* routines to split reads and writes if longer than page */ #include #include "owfs_config.h" #include "ow.h" GOOD_OR_BAD COMMON_readwrite_paged(struct one_wire_query *owq, size_t page, size_t pagelen, GOOD_OR_BAD (*readwritefunc) (BYTE *, size_t, off_t, struct parsedname *)) { size_t size = OWQ_size(owq); off_t offset = OWQ_offset(owq) + pagelen * page; BYTE *buffer_position = (BYTE *) OWQ_buffer(owq); struct parsedname *pn = PN(owq); /* successive pages, will start at page start */ OWQ_length(owq) = size; while (size > 0) { size_t thispage = pagelen - (offset % pagelen); if (thispage > size) { thispage = size; } RETURN_BAD_IF_BAD( readwritefunc(buffer_position, thispage, offset, pn) ) ; buffer_position += thispage; size -= thispage; offset += thispage; } return gbGOOD; } // The same as COMMON_readwrite_paged above except the results are nicely placed in the OWQ buffers with sizes and offsets. GOOD_OR_BAD COMMON_OWQ_readwrite_paged(struct one_wire_query *owq, size_t page, size_t pagelen, GOOD_OR_BAD (*readwritefunc) (struct one_wire_query *, size_t, size_t)) { size_t size = OWQ_size(owq); off_t offset = OWQ_offset(owq) + pagelen * page; struct parsedname *pn = PN(owq); OWQ_allocate_struct_and_pointer(owq_page); /* holds a pointer to a position in owq's buffer */ OWQ_create_temporary(owq_page, OWQ_buffer(owq), size, offset, pn); /* successive pages, will start at page start */ OWQ_length(owq) = size; while (size > 0) { size_t thispage = pagelen - (offset % pagelen); if (thispage > size) { thispage = size; } OWQ_size(owq_page) = thispage; if (readwritefunc(owq_page, 0, pagelen)) { LEVEL_DEBUG("error at offset %ld", (long) offset); return gbBAD; } OWQ_buffer(owq_page) += thispage; size -= thispage; offset += thispage; // This is permitted (changing OWQ_offset and not restoring) since owq_page is a scratch var OWQ_offset(owq_page) = offset; } return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_launchd.c0000644000175000001440000000275112654730021015423 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_launchd.h" /* Test launchd existence * Sets up the connection_out as well * */ #ifdef HAVE_LAUNCH_ACTIVATE_SOCKET static void Launchd_out( int * fds, size_t fd_count ) { size_t i ; for ( i=0 ; i < fd_count ; ++ i ) { struct connection_out *out = NewOut(); if (out == NULL) { LEVEL_DEBUG("Memory error -- can't create a launchd structure"); break ; } out->file_descriptor = fds[i] ; LEVEL_DEBUG("Found a launchd file descriptor at %d",out->file_descriptor); out->name = owstrdup("launchd"); out->inet_type = inet_launchd ; } } #endif /* HAVE_LAUNCH_ACTIVATE_SOCKET */ void Setup_Launchd( void ) { #ifdef HAVE_LAUNCH_ACTIVATE_SOCKET int * fds ; size_t fd_count ; switch ( launch_activate_socket( "Listeners", & fds , & fd_count ) ) { case 0: Launchd_out( fds, fd_count ) ; Globals.inet_type = inet_launchd ; free( fds ) ; break ; case ESRCH: LEVEL_DEBUG("Not started by the launchd daemon -- use command line for ports"); break ; case ENOENT: LEVEL_CALL("No sockets specified in the launchd plist"); break ; default: LEVEL_DEBUG("Launchd error"); break ; } #endif /* HAVE_LAUNCH_ACTIVATE_SOCKET */ } owfs-3.1p5/module/owlib/src/c/ow_k1wm.c0000644000175000001440000004471212654730021014667 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* This is the busmaster code for the DS1WM * The "Synthesizable 1-wire Bus MAster" adapter from Dallas Maxim * * Out technique is a little dangerous -- direct memory access to the registers * We use /dev/mem although writing a UIO kernel module is also a possibility * Obviously we'll nee root access * */ /* Based on a device used by Kistler Corporation * and tested in-house by Martin Rapavy * * That testing also covers the DS1WM * */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_global.h" #include // DS1WM Registers #define DS1WM_COMMAND_REGISTER 0 #define DS1WM_TXRX_BUFFER 1 #define DS1WM_INTERRUPT_REGISTER 2 #define DS1WM_INTERRUPT_ENABLE_REGISTER 3 #define DS1WM_CLOCK_DEVISOR_REGISTER 4 #define K1WM_CHANNEL_SELECT_REGISTER DS1WM_CLOCK_DEVISOR_REGISTER #define DS1WM_CONTROL_REGISTER 5 // Access register via mmap-ed memory #define DS1WM_register(in, off) (((uint8_t *) (in->master.ds1wm.mm))[(in->master.ds1wm.base)+off]) // Register access macros #define DS1WM_command(in) DS1WM_register(in,DS1WM_COMMAND_REGISTER) #define DS1WM_txrx(in) DS1WM_register(in,DS1WM_TXRX_BUFFER) #define DS1WM_interrupt(in) DS1WM_register(in,DS1WM_INTERRUPT_REGISTER) #define DS1WM_enable(in) DS1WM_register(in,DS1WM_INTERRUPT_ENABLE_REGISTER) #define DS1WM_clock(in) DS1WM_register(in,DS1WM_CLOCK_DEVISOR_REGISTER) #define K1WM_channel(in) DS1WM_register(in,K1WM_CHANNEL_SELECT_REGISTER) #define DS1WM_control(in) DS1WM_register(in,DS1WM_CONTROL_REGISTER) enum e_DS1WM_command { e_ds1wm_1wr=0, e_ds1wm_sra, e_ds1wm_fow, e_ds1wm_ow_in, } ; enum e_DS1WM_int { e_ds1wm_pd=0, e_ds1wm_pdr, e_ds1wm_tbe, e_ds1wm_temt, e_ds1wm_rbf, e_ds1wm_rsrf, e_ds1wm_ow_short, e_ds1wm_ow_low, } ; enum e_DS1WM_enable { e_ds1wm_epd=0, e_ds1wm_ias, e_ds1wm_etbe, e_ds1wm_etmt, e_ds1wm_erbf, e_ds1wm_ersf, e_ds1wm_eowsh, e_ds1wm_eowl } ; enum e_DS1WM_control { e_ds1wm_llm=0, e_ds1wm_ppm, e_ds1wm_en_fow, e_ds1wm_stpen, e_ds1wm_stp_sply, e_ds1wm_bit_ctl, e_ds1wm_od } ; static RESET_TYPE K1WM_reset(const struct parsedname *pn); static enum search_status K1WM_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD K1WM_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD K1WM_reconnect(const struct parsedname * pn); static void K1WM_close(struct connection_in *in) ; static void K1WM_setroutines(struct connection_in *in); static GOOD_OR_BAD K1WM_setup( struct connection_in * in ); static RESET_TYPE K1WM_wait_for_reset( struct connection_in * in ); static GOOD_OR_BAD K1WM_wait_for_read( const struct connection_in * in ); static GOOD_OR_BAD K1WM_wait_for_write( const struct connection_in * in ); static GOOD_OR_BAD K1WM_wait_for_byte( const struct connection_in * in ); static GOOD_OR_BAD K1WM_sendback_byte(const BYTE * data, BYTE * resp, const struct connection_in * in ) ; static GOOD_OR_BAD read_device_map_offset(const char *device_name, off_t *offset); static GOOD_OR_BAD read_device_map_size(const char *device_name, size_t *size); static GOOD_OR_BAD K1WM_select_channel(const struct connection_in * in, uint8_t channel); static GOOD_OR_BAD K1WM_create_channels(struct connection_in *head, int channels_count); static void K1WM_setroutines(struct connection_in *in) { in->iroutines.detect = K1WM_detect; in->iroutines.reset = K1WM_reset; in->iroutines.next_both = K1WM_next_both; // K1WM doesn't have strong pull-up support in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.PowerBit = NO_POWERBIT_ROUTINE; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = K1WM_sendback_data; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = K1WM_reconnect ; in->iroutines.close = K1WM_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_default; in->bundling_length = UART_FIFO_SIZE; } // Search defines #define SEARCH_BIT_ON 0x01 /* Setup DS1WM bus master structure */ // bus locking at a higher level GOOD_OR_BAD K1WM_detect(struct port_in *pin) { struct connection_in * in = pin->first ; long long int prebase ; unsigned int prechannels_count; void * mm ; FILE_DESCRIPTOR_OR_ERROR mem_fd ; const char * mem_device = "/dev/uio0"; if (pin->init_data == NULL) { LEVEL_DEFAULT("K1WM needs a memory location"); return gbBAD; } in->Adapter = adapter_k1wm ; in->master.ds1wm.longline = 0 ; // longline timing // in->master.ds1wm.frequency = 0 ; // unused in k1wm in->master.ds1wm.presence_mask = 1 ; // pulse presence mask in->master.ds1wm.active_channel = 0; in->master.ds1wm.channels_count = 1; int param_count = sscanf( pin->init_data, "%lli,%u", &prebase, &prechannels_count); if ( param_count < 1 || param_count > 2) { LEVEL_DEFAULT("K1WM: Could not interpret <%s> as a memory address:channel_count pair", pin->init_data ) ; return gbBAD ; } in->master.ds1wm.channels_count = prechannels_count ; in->master.ds1wm.base = prebase ; // convert types long long int -> off_t if ( in->master.ds1wm.base == 0 ) { LEVEL_DEFAULT("K1WM: Illegal address 0x0000 from <%s>", pin->init_data ) ; return gbBAD ; } LEVEL_DEBUG("K1WM at address %p",(void *)in->master.ds1wm.base); LEVEL_DEBUG("K1WM channels: %u",in->master.ds1wm.channels_count); read_device_map_size(mem_device, &(in->master.ds1wm.mm_size)); read_device_map_offset(mem_device, &(in->master.ds1wm.page_start)); // open /dev/uio0 mem_fd = open( mem_device, O_RDWR | O_SYNC ) ; if ( FILE_DESCRIPTOR_NOT_VALID(mem_fd) ) { LEVEL_DEFAULT("K1WM: Cannot open memory directly -- permissions problem?"); return gbBAD ; } mm = mmap( NULL, in->master.ds1wm.mm_size, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, in->master.ds1wm.page_start ); close(mem_fd) ; // no longer needed if ( mm == MAP_FAILED ) { LEVEL_DEFAULT("K1WM: Cannot map memory") ; return gbBAD ; } in->master.ds1wm.mm = mm ; /* Set up low-level routines */ K1WM_setroutines(in); // Add channels K1WM_create_channels(in, in->master.ds1wm.channels_count); return K1WM_setup(in) ; } // set control pins and frequency for defauts and global settings static GOOD_OR_BAD K1WM_setup( struct connection_in * in ) { uint8_t control_register = DS1WM_control(in) ; LEVEL_DEBUG("[%s] control_register before setup: 0x%x", __FUNCTION__, control_register); // Set to channel K1WM_channel(in) = in->master.ds1wm.active_channel ; // set some defaults: UT_setbit( &control_register, e_ds1wm_ppm, in->master.ds1wm.presence_mask ) ; // pulse presence masked UT_setbit( &control_register, e_ds1wm_en_fow, 0 ) ; // no bit banging UT_setbit( &control_register, e_ds1wm_stpen, 0 ) ; // strong pullup not supported in K1WM UT_setbit( &control_register, e_ds1wm_stp_sply, 0 ) ; // not in strong pullup state, too in->master.ds1wm.byte_mode = 1 ; // default UT_setbit( &control_register, e_ds1wm_bit_ctl, 0 ) ; // byte mode UT_setbit( &control_register, e_ds1wm_od, in->overdrive ) ; // not overdrive UT_setbit( &control_register, e_ds1wm_llm, in->master.ds1wm.longline ) ; // set long line flag DS1WM_control(in) = control_register ; LEVEL_DEBUG("[%s] control_register after setup: 0x%x", __FUNCTION__, DS1WM_control(in)); if ( DS1WM_control(in) != control_register ) { return gbBAD ; } return gbGOOD ; } static GOOD_OR_BAD K1WM_reconnect(const struct parsedname * pn) { LEVEL_DEBUG("Attempting reconnect on %s",SAFESTRING(DEVICENAME(pn->selected_connection))); return K1WM_setup(pn->selected_connection) ; } //-------------------------------------------------------------------------- // Reset all of the devices on the 1-Wire Net and return the result. // // This routine will not function correctly on some // Alarm reset types of the DS1994/DS1427/DS2404 with // Rev 1,2, and 3 of the DS2480/DS2480B. static RESET_TYPE K1WM_reset(const struct parsedname * pn) { LEVEL_DEBUG("[%s] BUS reset", __FUNCTION__); struct connection_in * in = pn->selected_connection ; if ( in->changed_bus_settings != 0) { in->changed_bus_settings = 0 ; K1WM_setup(in); // reset paramters } // select channel K1WM_select_channel(in, in->master.ds1wm.active_channel); // read interrupt register to clear all bits (void) DS1WM_interrupt(in); UT_setbit( &DS1WM_command(in), e_ds1wm_1wr, 1 ) ; switch( K1WM_wait_for_reset(in) ) { case BUS_RESET_SHORT: return BUS_RESET_SHORT ; case BUS_RESET_OK: return BUS_RESET_OK ; default: return K1WM_wait_for_reset(in) ; } } #define SERIAL_NUMBER_BITS (8*SERIAL_NUMBER_SIZE) /* search = normal and alarm */ static enum search_status K1WM_next_both(struct device_search *ds, const struct parsedname *pn) { LEVEL_DEBUG("[%s] BUS search", __FUNCTION__); int mismatched; BYTE sn[SERIAL_NUMBER_SIZE]; BYTE bitpairs[SERIAL_NUMBER_SIZE*2]; BYTE dummy ; struct connection_in * in = pn->selected_connection ; int i; LEVEL_DEBUG("[%s] ds->LastDevice == true ?", __FUNCTION__); if (ds->LastDevice) { LEVEL_DEBUG("[%s] ds->LastDevice == true -> search_done", __FUNCTION__); return search_done; } LEVEL_DEBUG("[%s] BUS_select failed ?", __FUNCTION__); if ( BAD( BUS_select(pn) ) ) { LEVEL_DEBUG("[%s] BUS_select failed -> search_error", __FUNCTION__); return search_error; } // Standard SEARCH ROM using SRA // need the reset done in BUS-select to set AnyDevices if ( in->AnyDevices == anydevices_no ) { LEVEL_DEBUG("[%s] in->AnyDevices == anydevices_no -> search_done", __FUNCTION__); ds->LastDevice = 1; return search_done; } // clear sn to satisfy static error checking (Coverity) memset( sn, 0, SERIAL_NUMBER_SIZE ) ; // build the command stream // call a function that may add the change mode command to the buff // check if correct mode // issue the search command // change back to command mode // search mode on // change back to data mode // set the temp Last Descrep to none mismatched = -1; // add the 16 bytes of the search memset(bitpairs, 0, SERIAL_NUMBER_SIZE*2); LEVEL_DEBUG("[%s] ds->LastDiscrepancy == %i", __FUNCTION__, ds->LastDiscrepancy); // set the bits in the added buffer for (i = 0; i < ds->LastDiscrepancy; i++) { // before last discrepancy UT_set2bit(bitpairs, i, UT_getbit(ds->sn, i) << 1); } // at last discrepancy if (ds->LastDiscrepancy > -1) { UT_set2bit(bitpairs, ds->LastDiscrepancy, 1 << 1); } // after last discrepancy so leave zeros // search ON // Send search rom or conditional search byte if ( BAD( K1WM_sendback_byte(&(ds->search), &dummy, in) ) ) { LEVEL_DEBUG("[%s] Sending SearchROM/SearchByte '0x%x' failed -> search_error", __FUNCTION__, ds->search); return search_error; } // Set search accelerator UT_setbit( &DS1WM_command(in), e_ds1wm_sra, 1 ) ; // send the packet // cannot use single-bit mode with search accerator // search OFF if ( BAD( K1WM_sendback_data(bitpairs, bitpairs, SERIAL_NUMBER_SIZE*2, pn) ) ) { LEVEL_DEBUG("[%s] Sending the packet (bitpairs) failed -> search_error", __FUNCTION__); return search_error; } // Turn off search accelerator UT_setbit( &DS1WM_command(in), e_ds1wm_sra, 0 ) ; // interpret the bit stream for (i = 0; i < SERIAL_NUMBER_BITS; i++) { // get the SerialNum bit UT_setbit(sn, i, UT_get2bit(bitpairs, i) >> 1); // check LastDiscrepancy if (UT_get2bit(bitpairs, i) == SEARCH_BIT_ON ) { mismatched = i; } } if ( sn[0]==0xFF && sn[1]==0xFF && sn[2]==0xFF && sn[3]==0xFF && sn[4]==0xFF && sn[5]==0xFF && sn[6]==0xFF && sn[7]==0xFF ) { // special case for no alarm present LEVEL_DEBUG("[%s] sn == 0xFFFFFFFFFFFFFFFF -> search_error", __FUNCTION__); return search_done ; } // CRC check if (CRC8(sn, SERIAL_NUMBER_SIZE) || (ds->LastDiscrepancy == SERIAL_NUMBER_BITS-1) || (sn[0] == 0)) { LEVEL_DEBUG("[%s] CRC check failed -> search_error", __FUNCTION__); return search_error; } // successful search // check for last one if ((mismatched == ds->LastDiscrepancy) || (mismatched == -1)) { ds->LastDevice = 1; } // copy the SerialNum to the buffer memcpy(ds->sn, sn, 8); // set the count ds->LastDiscrepancy = mismatched; LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; } static GOOD_OR_BAD K1WM_sendback_byte(const BYTE * data, BYTE * resp, const struct connection_in * in ) { LEVEL_DEBUG("[%s] sending byte: 0x%x", __FUNCTION__, data[0]); RETURN_BAD_IF_BAD( K1WM_wait_for_write(in) ) ; DS1WM_txrx(in) = data[0] ; RETURN_BAD_IF_BAD( K1WM_wait_for_read(in) ) ; resp[0] = DS1WM_txrx(in) ; LEVEL_DEBUG("[%s] received byte: 0x%x", __FUNCTION__, resp[0]); return gbGOOD ; } // // sendback_data // Send data and return response block static GOOD_OR_BAD K1WM_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn) { LEVEL_DEBUG("[%s]", __FUNCTION__); struct connection_in * in = pn->selected_connection ; size_t i ; K1WM_select_channel(in, in->master.ds1wm.active_channel); for (i=0 ; imaster.ds1wm.mm, in->master.ds1wm.mm_size ); } // wait for reset static GOOD_OR_BAD K1WM_wait_for_byte( const struct connection_in * in ) { int bits = in->master.ds1wm.byte_mode ? 8 : 1 ; long int t_slot = in->overdrive ? 15000 : 86000 ; // nsec struct timespec t = { 0, t_slot*bits, }; if ( nanosleep( & t, NULL ) != 0 ) { return gbBAD ; } return gbGOOD ; } // Wait max time needed for reset static RESET_TYPE K1WM_wait_for_reset( struct connection_in * in ) { LEVEL_DEBUG("[%s]", __FUNCTION__); long int t_reset = in->overdrive ? (74000+63000) : (636000+626000) ; // nsec uint8_t interrupt ; struct timespec t = { 0, t_reset, } ; if ( nanosleep( & t, NULL ) != 0 ) { return gbBAD ; } interrupt = DS1WM_interrupt(in) ; if ( UT_getbit( &interrupt, e_ds1wm_pd ) == 0 ) { LEVEL_DEBUG("[%s] presence_detect bit == 0", __FUNCTION__); return BUS_RESET_ERROR ; } if ( UT_getbit( &interrupt, e_ds1wm_ow_short ) == 1 ) { LEVEL_DEBUG("[%s] short bit == 1", __FUNCTION__); return BUS_RESET_SHORT ; } in->AnyDevices = ( UT_getbit( &interrupt, e_ds1wm_pdr ) == 0 ) ? anydevices_yes : anydevices_no ; LEVEL_DEBUG("[%s] in->AnyDevices == %i", __FUNCTION__, in->AnyDevices); return BUS_RESET_OK ; } static GOOD_OR_BAD K1WM_wait_for_read( const struct connection_in * in ) { int i ; if ( UT_getbit( &DS1WM_interrupt(in), e_ds1wm_rbf ) == 1 ) { return gbGOOD ; } for ( i=0 ; i < 5 ; ++i ) { RETURN_BAD_IF_BAD( K1WM_wait_for_byte(in) ) ; if ( UT_getbit( &DS1WM_interrupt(in), e_ds1wm_rbf ) == 1 ) { return gbGOOD ; } } return gbBAD ; } static GOOD_OR_BAD K1WM_wait_for_write( const struct connection_in * in ) { int i ; if ( UT_getbit( &DS1WM_interrupt(in), e_ds1wm_tbe ) == 1 ) { return gbGOOD ; } for ( i=0 ; i < 5 ; ++i ) { RETURN_BAD_IF_BAD( K1WM_wait_for_byte(in) ) ; if ( UT_getbit( &DS1WM_interrupt(in), e_ds1wm_tbe ) == 1 ) { return gbGOOD ; } } return gbBAD ; } static GOOD_OR_BAD read_device_map_offset(const char *device_name, off_t *offset) { const unsigned char path_length = 100; FILE* file; unsigned int preoffset; // Get device filename (e.g. uio0) const char *uio_filename = strrchr(device_name, '/'); if (uio_filename == NULL) { return gbBAD; } // Offset parameter file path char uio_map_offset_file[path_length]; snprintf(uio_map_offset_file, path_length, "/sys/class/uio/%s/maps/map0/offset", uio_filename); // Read offset parameter file = fopen(uio_map_offset_file, "r"); if (file == NULL) { return gbBAD; } if (fscanf(file, "%x", &preoffset) != 1) { fclose(file); return gbBAD; } fclose(file); *offset = preoffset; LEVEL_DEBUG("[%s] map offset: 0x%x", __FUNCTION__, preoffset); LEVEL_DEBUG("[%s] map offset: 0x%x", __FUNCTION__, *offset); return gbGOOD; } static GOOD_OR_BAD read_device_map_size(const char *device_name, size_t *size) { const unsigned char path_length = 100; unsigned int usize ; FILE* file; // Get device filename (e.g. uio0) const char *uio_filename = strrchr(device_name, '/'); if (uio_filename == NULL) { return gbBAD; } // Size parameter file path char uio_map_size_file[path_length]; snprintf(uio_map_size_file, path_length, "/sys/class/uio/%s/maps/map0/size", uio_filename); // Read size parameter file = fopen(uio_map_size_file, "r"); if (file == NULL) { return gbBAD; } if (fscanf(file, "%x", &usize) != 1){ fclose(file); return gbBAD; } *size = usize ; fclose(file); LEVEL_DEBUG("[%s] map size: 0x%x", __FUNCTION__, *size); return gbGOOD; } static GOOD_OR_BAD K1WM_select_channel(const struct connection_in * in, uint8_t channel) { LEVEL_DEBUG("[%s] Selecting channel %u", __FUNCTION__, channel); // in K1WM clock register is used as output multiplexer register K1WM_channel(in) = channel; return K1WM_channel(in) == channel ? gbGOOD : gbBAD; } static GOOD_OR_BAD K1WM_create_channels(struct connection_in *head, int channels_count) { int i; static char *channel_names[] = { "K1WM(0)", "K1WM(1)", "K1WM(2)", "K1WM(3)", "K1WM(4)", "K1WM(5)", "K1WM(6)", "K1WM(7)", "K1WM(8)", "K1WM(9)", "K1WM(10)", "K1WM(11)", "K1WM(12)", "K1WM(13)", "K1WM(14)", "K1WM(15)", "K1WM(16)", "K1WM(17)", "K1WM(18)", "K1WM(19)", "K1WM(20)", "K1WM(21)", "K1WM(22)", "K1WM(23)", "K1WM(24)", "K1WM(25)", "K1WM(26)", "K1WM(27)", "K1WM(28)", "K1WM(29)", "K1WM(30)", "K1WM(31)", "K1WM(32)", "K1WM(33)", "K1WM(34)", "K1WM(35)", "K1WM(36)", "K1WM(37)", "K1WM(38)", "K1WM(39)", "K1WM(40)", "K1WM(41)", "K1WM(42)", "K1WM(43)", "K1WM(44)", "K1WM(45)", "K1WM(46)", "K1WM(47)", "K1WM(48)", "K1WM(49)", "K1WM(50)", "K1WM(51)", "K1WM(52)", "K1WM(53)", "K1WM(54)", "K1WM(55)", "K1WM(56)", "K1WM(57)", "K1WM(58)", "K1WM(59)", "K1WM(60)", "K1WM(61)", "K1WM(62)", "K1WM(63)" }; head->master.ds1wm.active_channel = 0; head->adapter_name = channel_names[0] ; for (i = 1; i < channels_count; ++i) { struct connection_in * added = AddtoPort(head->pown); if (added == NO_CONNECTION) { return gbBAD; } added->master.ds1wm.active_channel = i; added->adapter_name = channel_names[i] ; } return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_kevent.c0000644000175000001440000000500612654730021015275 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" /* Code for monitoring the configuration files * using kevent * used in OSX and BSD * Linux uses inotify instead * */ #ifdef WE_HAVE_KEVENT static int config_monitor_num_files = 0 ; // keep track static int kq ; // kqueue void Config_Monitor_Add( const char * filename ) { FILE_DESCRIPTOR_OR_ERROR fd ; struct kevent ke ; if ( config_monitor_num_files == 0 ) { // first one kq = kqueue() ; if ( kq < 0 ) { LEVEL_DEBUG("Could not create a kevent queue (kqueue)" ) ; return ; } } #if defined(O_EVTONLY) fd = open( filename, O_EVTONLY ) ; #else // O_EVTONLY not available on FreeBSD fd = open( filename, O_RDONLY) ; #endif if ( FILE_DESCRIPTOR_NOT_VALID( fd ) ) { LEVEL_DEBUG("Can't open %s for monitoring", filename ) ; return ; } EV_SET( &ke, fd, EVFILT_VNODE, EV_ADD, NOTE_DELETE|NOTE_WRITE|NOTE_EXTEND|NOTE_RENAME, 0, NULL ) ; if ( kevent( kq, &ke, 1, NULL, 0, NULL ) != 0 ) { LEVEL_DEBUG("Couldn't add %s to kqueue for monitoring",filename ) ; } else { ++ config_monitor_num_files ; LEVEL_DEBUG("Added %s to kqueue", filename ) ; } } static void Config_Monitor_Block( void ) { // OS specific code struct kevent ke ; // kevent should block until an event while( kevent( kq, NULL, 0, &ke, 1, NULL ) < 1 ) { LEVEL_DEBUG("kevent loop (shouldn't happen!)" ) ; } // fall though -- event happened, time to resurrect LEVEL_DEBUG("Configuration file change -- time to resurrect"); } // Thread that waits for forfig change and then restarts the program static void * Config_Monitor_Watchthread( void * v) { DETACH_THREAD ; // Blocking call until a config change detected Config_Monitor_Block() ; LEVEL_DEBUG("Configuration file change detected. Will restart %s",Globals.argv[0]); // Restart the program ReExecute(v) ; return v ; } static void Config_Monitor_Makethread( void * v ) { pthread_t thread ; if ( pthread_create( &thread, DEFAULT_THREAD_ATTR, Config_Monitor_Watchthread, v ) != 0 ) { LEVEL_DEBUG( "Could not create Configuration monitoring thread" ) ; } } void Config_Monitor_Watch( void * v) { if ( config_monitor_num_files > 0 ) { Config_Monitor_Makethread(v) ; } else { LEVEL_DEBUG("No configuration files to monitor" ) ; } } #endif /* WE_HAVE_KEVENT */ owfs-3.1p5/module/owlib/src/c/ow_lcd.c0000644000175000001440000004254312654730021014552 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_lcd.h" /* ------- Prototypes ----------- */ /* LCD display */ READ_FUNCTION(FS_r_version); READ_FUNCTION(FS_r_counters); READ_FUNCTION(FS_r_gpio); WRITE_FUNCTION(FS_w_gpio); READ_FUNCTION(FS_r_data); WRITE_FUNCTION(FS_w_data); READ_FUNCTION(FS_r_memory); WRITE_FUNCTION(FS_w_memory); READ_FUNCTION(FS_r_register); WRITE_FUNCTION(FS_w_register); WRITE_FUNCTION(FS_simple_command); READ_FUNCTION(FS_r_cum); WRITE_FUNCTION(FS_w_cum); WRITE_FUNCTION(FS_w_screenX); WRITE_FUNCTION(FS_w_lineX); /* ------- Device Constants ----- */ #define _LCD_COMMAND_POWER_OFF 0x05 #define _LCD_COMMAND_POWER_ON 0x03 #define _LCD_COMMAND_BACKLIGHT_OFF 0x07 #define _LCD_COMMAND_BACKLIGHT_ON 0x08 #define _LCD_COMMAND_REGISTER_TO_SCRATCH 0x11 #define _LCD_COMMAND_REGISTER_WRITE_BYTE 0x10 #define _LCD_COMMAND_DATA_TO_SCRATCH 0x13 #define _LCD_COMMAND_DATA_WRITE_BYTE 0x12 #define _LCD_COMMAND_SCRATCHPAD_READ 0xBE #define _LCD_COMMAND_SCRATCHPAD_WRITE 0x4E #define _LCD_COMMAND_PRINT_FROM_SCRATCH 0x48 #define _LCD_COMMAND_EEPROM_READ_TO_SCRATCH 0x37 #define _LCD_COMMAND_EEPROM_WRITE_FROM_SCRATCH 0x39 #define _LCD_COMMAND_GPIO_READ_TO_SCRATCH 0x22 #define _LCD_COMMAND_GPIO_WRITE_BYTE 0x21 #define _LCD_COMMAND_COUNTER_READ_TO_SCRATCH 0x23 #define _LCD_COMMAND_LCD_CLEAR 0x49 #define _LCD_COMMAND_VERSION_READ_TO_SCRATCH 0x41 #define _LCD_PAGE_SIZE 16 #define PACK_ON_OFF(on,off) (((unsigned int)((BYTE)(on))<<8) | ((unsigned int)((BYTE)(off)))) #define UNPACK_ON(u) ((BYTE)((u)>>8)) #define UNPACK_OFF(u) ((BYTE)((u)&0xFF)) /* ------- Structures ----------- */ static struct aggregate ALCD = { 4, ag_numbers, ag_aggregate, }; static struct aggregate ALCD_L16 = { 4, ag_numbers, ag_separate, }; static struct aggregate ALCD_L20 = { 4, ag_numbers, ag_separate, }; static struct aggregate ALCD_L40 = { 2, ag_numbers, ag_separate, }; static struct filetype LCD[] = { F_STANDARD, {"memory", 112, NON_AGGREGATE, ft_binary, fc_stable, FS_r_memory, FS_w_memory, VISIBLE, NO_FILETYPE_DATA, }, {"LCDon", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_simple_command, VISIBLE, {.u=PACK_ON_OFF(_LCD_COMMAND_POWER_ON, _LCD_COMMAND_POWER_OFF)}, }, {"backlight", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_stable, NO_READ_FUNCTION, FS_simple_command, VISIBLE, {.u=PACK_ON_OFF(_LCD_COMMAND_BACKLIGHT_ON, _LCD_COMMAND_BACKLIGHT_OFF)}, }, {"version", _LCD_PAGE_SIZE, NON_AGGREGATE, ft_ascii, fc_stable, FS_r_version, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"gpio", PROPERTY_LENGTH_BITFIELD, &ALCD, ft_bitfield, fc_volatile, FS_r_gpio, FS_w_gpio, VISIBLE, NO_FILETYPE_DATA, }, {"register", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_register, FS_w_register, VISIBLE, NO_FILETYPE_DATA, }, {"data", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_volatile, FS_r_data, FS_w_data, VISIBLE, NO_FILETYPE_DATA, }, {"counters", PROPERTY_LENGTH_UNSIGNED, &ALCD, ft_unsigned, fc_volatile, FS_r_counters, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"cumulative", PROPERTY_LENGTH_UNSIGNED, &ALCD, ft_unsigned, fc_volatile, FS_r_cum, FS_w_cum, VISIBLE, NO_FILETYPE_DATA, }, {"screen16", 128, NON_AGGREGATE, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_w_screenX, VISIBLE, {.i=16}, }, {"screen20", 128, NON_AGGREGATE, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_w_screenX, VISIBLE, {.i=20}, }, {"screen40", 128, NON_AGGREGATE, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_w_screenX, VISIBLE, {.i=40}, }, {"line16", 16, &ALCD_L16, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_w_lineX, VISIBLE, {.i=16}, }, {"line20", 20, &ALCD_L20, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_w_lineX, VISIBLE, {.i=20}, }, {"line40", 40, &ALCD_L40, ft_ascii, fc_stable, NO_READ_FUNCTION, FS_w_lineX, VISIBLE, {.i=40}, }, }; DeviceEntryExtended(FF, LCD, DEV_alarm, NO_GENERIC_READ, NO_GENERIC_WRITE); /* ------- Functions ------------ */ /* LCD by L. Swart */ static GOOD_OR_BAD OW_r_scratch(BYTE * data, int length, const struct parsedname *pn); static GOOD_OR_BAD OW_w_scratch(const BYTE * data, int length, const struct parsedname *pn); static GOOD_OR_BAD OW_w_register(BYTE data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_register(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_w_data(const BYTE data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_data(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_w_gpio(BYTE data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_gpio(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_version(BYTE * data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_counters(UINT * data, const struct parsedname *pn); static GOOD_OR_BAD OW_r_memory(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_w_memory(BYTE * data, size_t size, off_t offset, struct parsedname *pn); static GOOD_OR_BAD OW_clear(const struct parsedname *pn); static GOOD_OR_BAD OW_w_screen(BYTE lcd_location, const char *text, int size, const struct parsedname *pn); static GOOD_OR_BAD LCD_byte(BYTE b, int delay, const struct parsedname *pn); static GOOD_OR_BAD LCD_2byte(BYTE * bytes, int delay, const struct parsedname *pn); static GOOD_OR_BAD OW_simple_command(BYTE lcd_command_code, const struct parsedname *pn); static GOOD_OR_BAD OW_w_unpaged_to_screen(BYTE lcd_location, BYTE length, const char *text, const struct parsedname *pn); /* Internal files */ Make_SlaveSpecificTag(CUM, fc_persistent); //cumulative /* LCD */ static ZERO_OR_ERROR FS_simple_command(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); UINT lcd_command_pair = (UINT) pn->selected_filetype->data.u; BYTE lcd_command_code = OWQ_Y(owq) ? UNPACK_ON(lcd_command_pair) : UNPACK_OFF(lcd_command_pair); return GB_to_Z_OR_E(OW_simple_command(lcd_command_code, pn)) ; } static ZERO_OR_ERROR FS_r_version(struct one_wire_query *owq) { BYTE v[_LCD_PAGE_SIZE]; RETURN_ERROR_IF_BAD( OW_r_version(v, PN(owq)) ) ; return OWQ_format_output_offset_and_size((ASCII *) v, _LCD_PAGE_SIZE, owq); } static ZERO_OR_ERROR FS_r_gpio(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD( OW_r_gpio(&data, PN(owq)) ); OWQ_U(owq) = (~data) & 0x0F; return 0; } /* 4 value array */ static ZERO_OR_ERROR FS_w_gpio(struct one_wire_query *owq) { BYTE data = ~OWQ_U(owq) & 0x0F; /* Now set pins */ return GB_to_Z_OR_E(OW_w_gpio(data, PN(owq))) ; } static ZERO_OR_ERROR FS_r_register(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD( OW_r_register(&data, PN(owq)) ) ; OWQ_U(owq) = data; return 0; } static ZERO_OR_ERROR FS_w_register(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_register((BYTE) (BYTE_MASK(OWQ_U(owq))), PN(owq))) ; } static ZERO_OR_ERROR FS_r_data(struct one_wire_query *owq) { BYTE data; RETURN_ERROR_IF_BAD( OW_r_data(&data, PN(owq)) ) ; OWQ_U(owq) = data; return 0; } static ZERO_OR_ERROR FS_w_data(struct one_wire_query *owq) { return GB_to_Z_OR_E(OW_w_data((BYTE) (BYTE_MASK(OWQ_U(owq))), PN(owq))) ; } static ZERO_OR_ERROR FS_r_counters(struct one_wire_query *owq) { UINT u[4]; RETURN_ERROR_IF_BAD( OW_r_counters(u, PN(owq)) ) ; OWQ_array_U(owq, 0) = u[0]; OWQ_array_U(owq, 1) = u[1]; OWQ_array_U(owq, 2) = u[2]; OWQ_array_U(owq, 3) = u[3]; return 0; } /* caching system for storage */ static ZERO_OR_ERROR FS_r_cum(struct one_wire_query *owq) { UINT u[4]; /* just to prime the "CUM" data */ RETURN_ERROR_IF_BAD( OW_r_counters(u, PN(owq)) ) ; if ( BAD( Cache_Get_SlaveSpecific((void *) u, 4 * sizeof(UINT), SlaveSpecificTag(CUM), PN(owq))) ) { return -EINVAL; } OWQ_array_U(owq, 0) = u[0]; OWQ_array_U(owq, 1) = u[1]; OWQ_array_U(owq, 2) = u[2]; OWQ_array_U(owq, 3) = u[3]; return 0; } static ZERO_OR_ERROR FS_w_cum(struct one_wire_query *owq) { UINT u[4] = { OWQ_array_U(owq, 0), OWQ_array_U(owq, 1), OWQ_array_U(owq, 2), OWQ_array_U(owq, 3), }; return GB_to_Z_OR_E( Cache_Add_SlaveSpecific((const void *) u, 4 * sizeof(UINT), SlaveSpecificTag(CUM), PN(owq)) ); } static ZERO_OR_ERROR FS_w_lineX(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int width = pn->selected_filetype->data.i; BYTE lcd_line_start[] = { 0x00, 0x40, 0x00 + width, 0x40 + width }; char line[width]; size_t size = OWQ_size(owq); int start = OWQ_offset(owq); if (start >= width) { return -EADDRNOTAVAIL; } if ((int) (start + size) > width) { size = width - start; } memset(line, ' ', width); memcpy(&line[start], OWQ_buffer(owq), size); return GB_to_Z_OR_E(OW_w_screen(lcd_line_start[pn->extension], line, width, pn)) ; } static ZERO_OR_ERROR FS_w_screenX(struct one_wire_query *owq) { struct one_wire_query * owq_line ; int extension; struct parsedname *pn = PN(owq); int width = pn->selected_filetype->data.i; int rows = (width == 40) ? 2 : 4; /* max number of rows */ char *start_of_remaining_text = OWQ_buffer(owq); char *pointer_after_all_text = OWQ_buffer(owq) + OWQ_size(owq); if (OWQ_offset(owq)) { return -ERANGE; } if (BAD( OW_clear(pn) ) ) { return -EFAULT; } owq_line = OWQ_create_separate( 0, owq ) ; if ( owq_line == NO_ONE_WIRE_QUERY ) { return -ENOMEM ; } for (extension = 0; extension < rows; ++extension) { char *newline_location = memchr(start_of_remaining_text, '\n', pointer_after_all_text - start_of_remaining_text); OWQ_pn(owq_line).extension = extension; OWQ_buffer(owq_line) = start_of_remaining_text; if ((newline_location != NULL) && (newline_location < start_of_remaining_text + width)) { OWQ_size(owq_line) = newline_location - start_of_remaining_text; start_of_remaining_text = newline_location + 1; /* skip over newline */ } else { char *lineend_location = start_of_remaining_text + width; if (lineend_location > pointer_after_all_text) { lineend_location = pointer_after_all_text; } OWQ_size(owq_line) = lineend_location - start_of_remaining_text; start_of_remaining_text = lineend_location; } if (FS_w_lineX(owq_line)) { OWQ_destroy( owq_line ) ; return -EINVAL; } if (start_of_remaining_text >= pointer_after_all_text) break; } OWQ_destroy( owq_line ) ; return 0; } static ZERO_OR_ERROR FS_r_memory(struct one_wire_query *owq) { return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, _LCD_PAGE_SIZE, OW_r_memory)) ; } static ZERO_OR_ERROR FS_w_memory(struct one_wire_query *owq) { return GB_to_Z_OR_E(COMMON_readwrite_paged(owq, 0, _LCD_PAGE_SIZE, OW_w_memory)) ; } static GOOD_OR_BAD OW_w_scratch(const BYTE * data, int length, const struct parsedname *pn) { BYTE write_command[1] = { _LCD_COMMAND_SCRATCHPAD_WRITE, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(write_command), TRXN_WRITE(data, length), TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD OW_r_scratch(BYTE * data, int length, const struct parsedname *pn) { BYTE read_command[1] = { _LCD_COMMAND_SCRATCHPAD_READ, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(read_command), TRXN_READ(data, length), TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD OW_w_register(BYTE data, const struct parsedname *pn) { BYTE w[] = { _LCD_COMMAND_REGISTER_WRITE_BYTE, data, }; // 100uS return LCD_2byte(w, 1, pn); } static GOOD_OR_BAD OW_r_register(BYTE * data, const struct parsedname *pn) { // 150uS RETURN_BAD_IF_BAD( LCD_byte(_LCD_COMMAND_REGISTER_TO_SCRATCH, 1, pn)) ; return OW_r_scratch(data, 1, pn) ; } static GOOD_OR_BAD OW_w_data(const BYTE data, const struct parsedname *pn) { BYTE w[] = { _LCD_COMMAND_DATA_WRITE_BYTE, data, }; // 100uS return LCD_2byte(w, 1, pn); } static GOOD_OR_BAD OW_r_data(BYTE * data, const struct parsedname *pn) { // 150uS RETURN_BAD_IF_BAD( LCD_byte(_LCD_COMMAND_DATA_TO_SCRATCH, 1, pn)) ; return OW_r_scratch(data, 1, pn) ; } static GOOD_OR_BAD OW_w_gpio(BYTE data, const struct parsedname *pn) { /* Note, it would be nice to control separately, nut we can't know the set state of the pin, i.e. sensed and set are confused */ /* Datasheet says bit 7 should be 1 */ BYTE w[] = { _LCD_COMMAND_GPIO_WRITE_BYTE, 0x80 | data, }; // 20uS return LCD_2byte(w, 1, pn); } static GOOD_OR_BAD OW_r_gpio(BYTE * data, const struct parsedname *pn) { // 70uS RETURN_BAD_IF_BAD( LCD_byte(_LCD_COMMAND_GPIO_READ_TO_SCRATCH, 1, pn)) ; return OW_r_scratch(data, 1, pn) ; } static GOOD_OR_BAD OW_r_counters(UINT * data, const struct parsedname *pn) { BYTE d[8]; UINT cum[4]; RETURN_BAD_IF_BAD( LCD_byte(_LCD_COMMAND_COUNTER_READ_TO_SCRATCH, 1, pn)) ; RETURN_BAD_IF_BAD( OW_r_scratch(d, 8, pn)) ; data[0] = ((UINT) d[1]) << 8 | d[0]; data[1] = ((UINT) d[3]) << 8 | d[2]; data[2] = ((UINT) d[5]) << 8 | d[4]; data[3] = ((UINT) d[7]) << 8 | d[6]; //printf("OW_COUNTER key=%s\n",key); if ( BAD( Cache_Get_SlaveSpecific((void *) cum, sizeof(cum), SlaveSpecificTag(CUM), pn)) ) { /* First pass at cumulative */ cum[0] = data[0]; cum[1] = data[1]; cum[2] = data[2]; cum[3] = data[3]; } else { cum[0] += data[0]; cum[1] += data[1]; cum[2] += data[2]; cum[3] += data[3]; } Cache_Add_SlaveSpecific((void *) cum, sizeof(cum), SlaveSpecificTag(CUM), pn); return gbGOOD; } /* memory is 112 bytes */ /* can only read 16 bytes at a time (due to scratchpad size) */ /* Will pretend pagesize = 16 */ /* minor inefficiency if start is not on "page" boundary */ /* Call will not span "page" */ static GOOD_OR_BAD OW_r_memory(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE location_setup[2] = { BYTE_MASK(offset), BYTE_MASK(size), }; // 500uS RETURN_BAD_IF_BAD( OW_w_scratch(location_setup, 2, pn)) ; RETURN_BAD_IF_BAD( LCD_byte(_LCD_COMMAND_EEPROM_READ_TO_SCRATCH, 1, pn)) ; return OW_r_scratch(data, BYTE_MASK(size), pn); } /* memory is 112 bytes */ /* can only write 16 bytes at a time (due to scratchpad size) */ /* Will pretend pagesize = 16 */ /* minor inefficiency if start is not on "page" boundary */ /* Call will not span "page" */ static GOOD_OR_BAD OW_w_memory(BYTE * data, size_t size, off_t offset, struct parsedname *pn) { BYTE location_and_buffer[1 + _LCD_PAGE_SIZE] = { BYTE_MASK(offset), }; if (size == 0) { return gbGOOD; } memcpy(&location_and_buffer[1], data, size); // 4mS/byte RETURN_BAD_IF_BAD(OW_w_scratch(location_and_buffer, size + 1, pn)) ; return LCD_byte(_LCD_COMMAND_EEPROM_WRITE_FROM_SCRATCH, 4 * size, pn) ; } /* data is 16 bytes */ static GOOD_OR_BAD OW_r_version(BYTE * data, const struct parsedname *pn) { // 500uS RETURN_BAD_IF_BAD( LCD_byte(_LCD_COMMAND_VERSION_READ_TO_SCRATCH, 1, pn)) ; return OW_r_scratch(data, _LCD_PAGE_SIZE, pn) ; } static GOOD_OR_BAD OW_w_screen(BYTE lcd_location, const char *text, int size, const struct parsedname *pn) { int chars_left_to_print = size; while (chars_left_to_print > 0) { int current_index_in_buffer; int chars_printing_now = chars_left_to_print; if (chars_printing_now > _LCD_PAGE_SIZE) { chars_printing_now = _LCD_PAGE_SIZE; } current_index_in_buffer = size - chars_left_to_print; RETURN_BAD_IF_BAD( OW_w_unpaged_to_screen(lcd_location + current_index_in_buffer, chars_printing_now, &text[current_index_in_buffer], pn) ) ; chars_left_to_print -= chars_printing_now; } return gbGOOD; } static GOOD_OR_BAD OW_w_unpaged_to_screen(BYTE lcd_location, BYTE length, const char *text, const struct parsedname *pn) { BYTE location_and_string[1 + _LCD_PAGE_SIZE] = { lcd_location, }; memcpy(&location_and_string[1], text, length); RETURN_BAD_IF_BAD( OW_w_scratch(location_and_string, 1 + length, pn) ) ; return LCD_byte(_LCD_COMMAND_PRINT_FROM_SCRATCH, 2, pn) ; } static GOOD_OR_BAD OW_clear(const struct parsedname *pn) { /* clear */ return LCD_byte(_LCD_COMMAND_LCD_CLEAR, 3, pn); // 2.5mS } static GOOD_OR_BAD OW_simple_command(BYTE lcd_command_code, const struct parsedname *pn) { struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(&lcd_command_code), TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD LCD_byte(BYTE b, int delay, const struct parsedname *pn) { struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(&b), TRXN_DELAY(delay), TRXN_END, }; return BUS_transaction(t, pn); } static GOOD_OR_BAD LCD_2byte(BYTE * bytes, int delay, const struct parsedname *pn) { struct transaction_log t[] = { TRXN_START, TRXN_WRITE2(bytes), TRXN_DELAY(delay), TRXN_END, }; return BUS_transaction(t, pn) ; } owfs-3.1p5/module/owlib/src/c/ow_lib_close.c0000644000175000001440000000177212654730021015742 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_devices.h" #include "ow_pid.h" /* All ow library closeup */ void LibClose(void) { Globals.exitmode = exit_early ; LEVEL_CALL("Starting Library cleanup"); LibStop(); PIDstop(); DeviceDestroy(); Detail_Close() ; ArgFree() ; _MUTEX_ATTR_DESTROY(Mutex.mattr); #if OW_ZERO // Used by browse and announce OW_Free_dnssd_library(); #endif #if OW_USB if ( Globals.luc != NULL ) { libusb_exit( Globals.luc ) ; Globals.luc = NULL ; } #endif /* OW_USB */ LEVEL_CALL("Finished Library cleanup"); if (log_available) { closelog(); log_available = 0; } SAFEFREE(Globals.announce_name) ; SAFEFREE(Globals.fatal_debug_file) ; LEVEL_DEBUG("Libraries closed"); } owfs-3.1p5/module/owlib/src/c/ow_lib_setup.c0000644000175000001440000000227712654730021015776 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" /* For thread ID to aid exitting */ int main_threadid_init = 0 ; pthread_t main_threadid; /* All ow library setup */ void LibSetup(enum enum_program_type program_type) { Return_code_setup() ; /* Setup the multithreading synchronizing locks */ LockSetup(); Globals.program_type = program_type; Cache_Open(); Detail_Init(); StateInfo.start_time = NOW_TIME; SetLocalControlFlags() ; // reset by every option and other change. errno = 0; /* set error level none */ Globals.exitmode = exit_normal ; #if OW_USB // for libusb if ( Globals.luc == NULL ) { int libusb_err; // testing for NULL protects against double inits if ( (libusb_err=libusb_init( & ( Globals.luc )) ) != 0 ) { LEVEL_DEFAULT( "<%s> Cannot initialize libusb -- USB library for using some bus masters",libusb_error_name(libusb_err) ); Globals.luc = NULL ; } } #endif /* OW_USB */ } owfs-3.1p5/module/owlib/src/c/ow_lib_stop.c0000644000175000001440000000211512654730021015612 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" /* Just close in/out devices and clear cache. Just enough to make it possible to call LibStart() again. This is called from swig/ow.i to when script wants to initialize a new server-connection. */ void LibStop(void) { char *argv[1] = { NULL }; LEVEL_CALL("Clear Cache"); Cache_Clear(); LEVEL_CALL("Closing input devices"); FreeInAll(); LEVEL_CALL("Closing output devices"); FreeOutAll(); LEVEL_CALL("Clearing compiled expressions"); ow_regdestroy() ; /* Have to reset more internal variables, and this should be fixed * by setting optind = 0 and call getopt() * (first_nonopt = last_nonopt = 1;) */ optind = 0; (void) getopt_long(1, argv, " ", NULL, NULL); optarg = NULL; optind = 1; opterr = 1; optopt = '?'; } owfs-3.1p5/module/owlib/src/c/ow_link.c0000644000175000001440000007416312672234566014765 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" /* Telnet handling concepts from Jerry Scharf: You should request the number of bytes you expect. When you scan it, start looking for FF FA codes. If that shows up, see if the F0 is in the read buffer. If so, move the char pointer back to where the FF point was and ask for the rest of the string (expected - FF...F0 bytes.) If the F0 isn't in the read buffer, start reading byte by byte into a separate variable looking for F0. Once you find that, then do the move the pointer and read the rest piece as above. Finally, don't forget to scan the rest of the strings for more FF FA blocks. It's most sloppy when the FF is the last character of the initial read buffer... You can also scan and remove the patterns FF F1 - FF F9 as these are 2 byte commands that the transmitter can send at any time. It is also possible that you could see FF FB xx - FF FE xx 3 byte codes, but this would be in response to FF FA codes that you would send, so that seems unlikely. Handling these would be just the same as the FF FA codes above. */ /* Multimaster: * In general the link is NOT a multimaster design (only one bus master per serial or telnet port) * The LinkHubE is supposed to have separately addressable lines, but this is not implemented * None the less, all settings are assigned to the head line */ /* lsusb output for LinkUSB Bus 001 Device 024: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0403 Future Technology Devices International, Ltd idProduct 0x6001 FT232 USB-Serial (UART) IC bcdDevice 6.00 iManufacturer 1 FTDI iProduct 2 FT232R USB UART iSerial 3 A900a3Z7 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 90mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 2 FT232R USB UART Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 */ struct LINK_id { char verstring[36]; char name[30]; enum adapter_type Adapter; }; // Steven Bauer added code for the VM links struct LINK_id LINK_id_tbl[] = { {"1.0", "LinkHub-E v1.0", adapter_LINK_E}, {"1.1", "LinkHub-E v1.1", adapter_LINK_E}, {"1.0", "LINK v1.0", adapter_LINK_10}, {"1.1", "LINK v1.1", adapter_LINK_11}, {"1.2", "LINK v1.2", adapter_LINK_12}, {"VM12a", "LINK OEM v1.2a", adapter_LINK_12}, {"VM12", "LINK OEM v1.2", adapter_LINK_12}, {"1.3", "LinkUSB V1.3", adapter_LINK_13}, {"1.4", "LinkUSB V1.4", adapter_LINK_14}, {"1.5", "LinkUSB V1.5", adapter_LINK_15}, {"0", "0", 0} }; #define MAX_LINK_VERSION_LENGTH 36 static RESET_TYPE LINK_reset(const struct parsedname *pn); static enum search_status LINK_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD LINK_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD LINK_sendback_bits(const BYTE * databits, BYTE * respbits, const size_t size, const struct parsedname *pn); static GOOD_OR_BAD LINK_PowerByte(const BYTE data, BYTE * resp, const UINT delay, const struct parsedname *pn); static GOOD_OR_BAD LINK_PowerBit(const BYTE data, BYTE * resp, const UINT delay, const struct parsedname *pn); static void LINK_close(struct connection_in *in) ; static void LINK_setroutines(struct connection_in *in); static void LINKE_setroutines(struct connection_in *in); static RESET_TYPE LINK_reset_in(struct connection_in * in); static GOOD_OR_BAD LINK_detect_serial(struct connection_in * in) ; static GOOD_OR_BAD LINK_detect_serial0(struct connection_in * in, int timeout_secs) ; static GOOD_OR_BAD LINK_detect_net(struct connection_in * in) ; static GOOD_OR_BAD LINK_version(struct connection_in * in) ; static void LINK_set_baud(struct connection_in * in) ; static GOOD_OR_BAD LINK_read(BYTE * buf, size_t size, struct connection_in * in); static GOOD_OR_BAD LINK_read_true_length(BYTE * buf, size_t size, struct connection_in *in) ; static GOOD_OR_BAD LINK_write(const BYTE * buf, size_t size, struct connection_in *in); static GOOD_OR_BAD LINK_directory(struct device_search *ds, struct connection_in * in); static GOOD_OR_BAD LINK_search_type(struct device_search *ds, struct connection_in * in) ; static GOOD_OR_BAD LINK_readback_data( BYTE * resp, const size_t size, struct connection_in * in); static GOOD_OR_BAD LinkVersion_knownstring( const char * reported_string, struct connection_in * in ) ; static GOOD_OR_BAD LinkVersion_unknownstring( const char * reported_string, struct connection_in * in ) ; static void LINK_flush( struct connection_in * in ) ; static void LINK_slurp(struct connection_in *in); static void LINK_setroutines(struct connection_in *in) { in->iroutines.detect = LINK_detect; in->iroutines.reset = LINK_reset; in->iroutines.next_both = LINK_next_both; in->iroutines.PowerByte = LINK_PowerByte; in->iroutines.PowerBit = LINK_PowerBit; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = LINK_sendback_data; in->iroutines.sendback_bits = LINK_sendback_bits; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = LINK_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_no2409path | ADAP_FLAG_no2404delay ; in->bundling_length = LINK_FIFO_SIZE; } static void LINKE_setroutines(struct connection_in *in) { LINK_setroutines(in) ; in->bundling_length = LINKE_FIFO_SIZE; } #define LINK_string(x) ((BYTE *)(x)) static GOOD_OR_BAD LinkVersion_knownstring( const char * reported_string, struct connection_in * in ) { int version_index; // bad string if ( reported_string == NULL || reported_string[0] == '\0' ) { return LinkVersion_unknownstring(reported_string,in) ; } // loop through LINK version string table looking for a match for (version_index = 0; LINK_id_tbl[version_index].verstring[0] != '0'; version_index++) { if (strstr(reported_string, LINK_id_tbl[version_index].verstring) != NULL) { LEVEL_DEBUG("Link version Found %s", LINK_id_tbl[version_index].verstring); in->Adapter = LINK_id_tbl[version_index].Adapter; in->adapter_name = LINK_id_tbl[version_index].name; return gbGOOD; } } return LinkVersion_unknownstring(reported_string,in) ; } static GOOD_OR_BAD LinkVersion_unknownstring( const char * reported_string, struct connection_in * in ) { const char * version_pointer; // Apparently strcasestr isn't available by default, will hard code: for ( version_pointer = reported_string ; version_pointer != '\0' ; ++version_pointer ) { switch ( *version_pointer ) { case 'l': case 'L': if ( strncasecmp( "link", version_pointer, 4 ) == 0 ) { LEVEL_DEBUG("Link version is unrecognized: %s (but that's ok).", reported_string); in->Adapter = adapter_LINK_other; in->adapter_name = "Other LINK"; return gbGOOD; } break ; default: break ; } } return gbBAD; } // bus locking done at a higher level GOOD_OR_BAD LINK_detect(struct port_in *pin) { struct connection_in * in = pin->first ; if (pin->init_data == NULL) { // requires input string LEVEL_DEFAULT("LINK busmaster requires port name"); return gbBAD; } COM_set_standard( in ) ; // standard COM port settings switch( pin->type ) { case ct_telnet: // LinkHub-E pin->baud = B115200 ; LEVEL_DEBUG("Attempt connection to networked LINK at 115200 baud"); RETURN_GOOD_IF_GOOD( LINK_detect_net( in ) ); // Xport or ser2net pin->baud = B9600 ; LEVEL_DEBUG("Attempt connection to networked LINK at 9600 baud"); RETURN_GOOD_IF_GOOD( LINK_detect_net( in ) ); break ; case ct_serial: case ct_ftdi: { /* The LINK (both regular and USB) can run in different baud modes. * On power reset it will always use 9600bps, but it can be configured for other * baud rates by sending different commands. * For ct_serial links we use 9600bps, but for the improved ct_ftdi we * go ahead and improve the speed as well, trying to keep it at 19200bps. * * The Link DOES support higher baud rates (38400, 56700), BUT then we have * to enforce output throttling in order to not overflow the 1-Wire bus... * So, keep it at 19200. */ RETURN_BAD_IF_BAD(LINK_detect_serial(in)); if(pin->type == ct_ftdi) { // ct_serial handling of BREAK, which is required to re-set to 9600bps, is not // reliable. Only enable for ftdi devices with proper BREAK support. LEVEL_DEBUG("Reconfiguring found LinkUSB to 19200bps"); pin->baud = B19200; LINK_set_baud(in); // ensure still found RETURN_GOOD_IF_GOOD( LINK_version(in) ) ; ERROR_CONNECT("LINK baud reconfigure failed, cannot find it after 19200 change."); } break; } default: return gbBAD ; } return gbBAD ; } /* Detect serial device by probing with different baud-rates. Calls LINK_detect_serial0 */ static GOOD_OR_BAD LINK_detect_serial(struct connection_in * in) { /* LINK docs does not say anything about flow control. Studying the LinkOEM * datasheet however, indicates that we only have Tx and Rx; no RTS/CTS. * And it does not mention XON/XOFF.. * And it works fine with no flow control... So, let's go with no flow control. * * For startup detection, we first try with 9600, then 19200. We do however * force a shorter timeout, the standard 5s is pretty overkill.. */ int i; struct port_in * pin = in->pown ; speed_t bauds[] = {B9600, B19200, B38400 #ifdef B57600 , B57600 #endif , 0}; #define SHORT_TIMEOUT 1 /* A break should put the Link in 9600... * However, the LinkUSB v1.5 fails to do this, unless we are in byte mode. * If we are, it reacts to break, and changes to 9600.. * But, in plain command mode, break does not work. * * iButtonLink said they would investige this bug(?), but never replied. */ COM_break( in ) ; i=0; // First try quickly in all baudrates with no flow control while((pin->baud = bauds[i++]) != 0) { pin->flow = flow_none; LEVEL_DEBUG("Detecting %s LINK using %d bps", (pin->type == ct_serial ? "serial" : "ftdi"), COM_BaudRate(pin->baud)); RETURN_GOOD_IF_GOOD( LINK_detect_serial0(in, SHORT_TIMEOUT) ) ; } i=0; // No? Try different flow controls then (the way it was done in the old code..) while((pin->baud = bauds[i++]) != 0) { LEVEL_DEBUG("Second attempt at serial LINK setup, %d bps", COM_BaudRate(pin->baud)); pin->flow = flow_first; RETURN_GOOD_IF_GOOD( LINK_detect_serial0(in, Globals.timeout_serial) ) ; LEVEL_DEBUG("Third attempt at serial LINK setup"); pin->flow = flow_second ; RETURN_GOOD_IF_GOOD( LINK_detect_serial0(in, Globals.timeout_serial) ) ; } return gbBAD; } /* Detect serial device with a specific configured baud-rate */ static GOOD_OR_BAD LINK_detect_serial0(struct connection_in * in, int timeout_secs) { struct port_in * pin = in->pown ; /* Set up low-level routines */ LINK_setroutines(in); pin->timeout.tv_sec = timeout_secs ; pin->timeout.tv_usec = 0 ; /* Open the com port */ RETURN_BAD_IF_BAD(COM_open(in)) ; COM_break( in ) ; // BREAK also sends it into command mode, if in another mode LEVEL_DEBUG("Slurp in initial bytes"); LINK_slurp( in ) ; UT_delay(100) ; // based on https://web.archive.org/web/20080624060114/http://morpheus.wcf.net/phpbb2/viewtopic.php?t=89 LINK_slurp( in ) ; RETURN_GOOD_IF_GOOD( LINK_version(in) ) ; LEVEL_DEFAULT("LINK detection error, trying powercycle"); serial_powercycle(in) ; LEVEL_DEBUG("Slurp in initial bytes"); LINK_slurp( in ) ; UT_delay(100) ; // based on https://web.archive.org/web/20080624060114/http://morpheus.wcf.net/phpbb2/viewtopic.php?t=89 LINK_slurp( in ) ; RETURN_GOOD_IF_GOOD( LINK_version(in) ) ; LEVEL_DEFAULT("LINK detection error, giving up"); COM_close(in) ; return gbBAD; } static GOOD_OR_BAD LINK_detect_net(struct connection_in * in) { struct port_in * pin = in->pown ; /* Set up low-level routines */ LINKE_setroutines(in); pin->timeout.tv_sec = 0 ; pin->timeout.tv_usec = 300000 ; /* Open the tcp port */ RETURN_BAD_IF_BAD( COM_open(in) ) ; LEVEL_DEBUG("Slurp in initial bytes"); // LINK_slurp( in ) ; UT_delay(1000) ; // based on http://morpheus.wcf.net/phpbb2/viewtopic.php?t=89&sid=3ab680415917a0ebb1ef020bdc6903ad LINK_slurp( in ) ; // LINK_flush(in); pin->dev.telnet.telnet_negotiated = needs_negotiation ; RETURN_GOOD_IF_GOOD( LINK_version(in) ) ; // second try -- send a break and line settings LEVEL_DEBUG("Second try -- send BREAK"); COM_flush(in) ; COM_break(in); telnet_change(in); // LINK_slurp( in ) ; RETURN_GOOD_IF_GOOD( LINK_version(in) ) ; LEVEL_DEFAULT("LINK detection error"); COM_close(in) ; return gbBAD; } static GOOD_OR_BAD LINK_version(struct connection_in * in) { char version_string[MAX_LINK_VERSION_LENGTH+1] ; enum { lvs_string, lvs_0d, } lvs = lvs_string ; // read state machine int version_index ; in->master.link.tmode = e_link_t_unknown ; in->master.link.qmode = e_link_t_unknown ; // clear out the buffer memset(version_string, 0, MAX_LINK_VERSION_LENGTH+1); if ( BAD( LINK_write(LINK_string(" "), 1, in) ) ) { LEVEL_DEFAULT("LINK version string cannot be requested"); return gbBAD ; } /* read the version string */ LEVEL_DEBUG("Checking LINK version"); // need to read 1 char at a time to get a short string for ( version_index=0 ; version_index but no 0x0D 0x0A",version_string) ; return gbBAD ; case lvs_0d: LEVEL_DEBUG("Found string <%s> but no 0x0A",version_string) ; return gbBAD ; default: return gbBAD ; } } switch( version_string[version_index] ) { case 0x0D: switch ( lvs ) { case lvs_string: lvs = lvs_0d ; // end of text version_string[version_index] = '\0' ; break ; case lvs_0d: LEVEL_DEBUG("Extra CR char in <%s>",version_string); return gbBAD ; } break ; case 0x0A: switch ( lvs ) { case lvs_string: LEVEL_DEBUG("No CR before LF char in <%s>",version_string); return gbBAD ; case lvs_0d: return LinkVersion_knownstring( version_string, in ) ; } break ; default: switch ( lvs ) { case lvs_string: // add to string break ; case lvs_0d: ++in->CRLF_size; break ; } break ; } } LEVEL_DEFAULT("LINK version string too long. <%s> greater than %d chars",version_string,MAX_LINK_VERSION_LENGTH); return gbBAD ; } static void LINK_set_baud(struct connection_in * in) { struct port_in * pin = in->pown ; int send_break = 0; char * speed_code ; if ( pin->type == ct_telnet ) { // telnet pinned at 115200 return ; } COM_BaudRestrict( &(pin->baud), B9600, B19200, B38400, B57600, 0 ) ; LEVEL_DEBUG("LINK set baud to %d",COM_BaudRate(pin->baud)); // Find rate parameter switch ( pin->baud ) { case B9600: // Put in Byte mode, and then send break. speed_code = "b"; send_break = 1; break; case B19200: speed_code = "," ; break ; case B38400: speed_code = "`" ; break ; #ifdef B57600 /* MacOSX support max 38400 in termios.h ? */ case B57600: speed_code = "^" ; break ; #endif default: LEVEL_DEBUG("Unrecognized baud rate"); return ; } LEVEL_DEBUG("LINK change baud string <%s>",speed_code); LINK_flush(in); if ( BAD( LINK_write(LINK_string(speed_code), 1, in) ) ) { LEVEL_DEBUG("LINK change baud error -- will return to 9600"); pin->baud = B9600 ; ++in->changed_bus_settings ; return ; } if(send_break) { COM_break(in); } // Send configuration change LINK_flush(in); // Change OS view of rate UT_delay(5); COM_change(in) ; UT_delay(5); LINK_slurp(in); return ; } static void LINK_flush( struct connection_in * in ) { COM_flush(in) ; } static RESET_TYPE LINK_reset(const struct parsedname *pn) { return LINK_reset_in(pn->selected_connection); } static RESET_TYPE LINK_reset_in(struct connection_in * in) { BYTE resp[1+in->CRLF_size]; if (in->changed_bus_settings > 0) { --in->changed_bus_settings ; LINK_set_baud(in); // reset paramters } else { LINK_flush(in); } if ( BAD(LINK_write(LINK_string("r"), 1, in) || BAD( LINK_read(resp, 1, in))) ) { LEVEL_DEBUG("Error resetting LINK device"); LINK_slurp(in); return BUS_RESET_ERROR; } switch (resp[0]) { case 'P': in->AnyDevices = anydevices_yes; return BUS_RESET_OK; case 'N': in->AnyDevices = anydevices_no; return BUS_RESET_OK; case 'S': return BUS_RESET_SHORT; default: LEVEL_DEBUG("bad, Unknown LINK response %c", resp[0]); LINK_slurp(in); return BUS_RESET_ERROR; } } static enum search_status LINK_next_both(struct device_search *ds, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; //Special case for DS2409 hub, use low-level code if ( pn->ds2409_depth>0 ) { return search_error ; } if (ds->LastDevice) { return search_done; } if (ds->index == -1) { if ( BAD(LINK_directory(ds, in)) ) { return search_error; } } // LOOK FOR NEXT ELEMENT ++ds->index; LEVEL_DEBUG("Index %d", ds->index); switch ( DirblobGet(ds->index, ds->sn, &(ds->gulp) ) ) { case 0: LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; case -ENODEV: default: ds->LastDevice = 1; LEVEL_DEBUG("SN finished"); return search_done; } } static void LINK_slurp(struct connection_in *in) { COM_slurp(in); } static GOOD_OR_BAD LINK_read(BYTE * buf, size_t size, struct connection_in *in) { return LINK_read_true_length( buf, size+in->CRLF_size, in ) ; } static GOOD_OR_BAD LINK_read_true_length(BYTE * buf, size_t size, struct connection_in *in) { return COM_read( buf, size, in ) ; } // Write a string to the serial port // return 0=good, // -EIO = error //Special processing for the remote hub (add 0x0A) static GOOD_OR_BAD LINK_write(const BYTE * buf, size_t size, struct connection_in *in) { return COM_write( buf, size, in ) ; } static GOOD_OR_BAD LINK_search_type(struct device_search *ds, struct connection_in * in) { char resp[3+in->CRLF_size]; int response_length ; LEVEL_DEBUG("Test to see if LINK supports the tF0 command"); switch ( in->master.link.tmode ) { case e_link_t_unknown: RETURN_BAD_IF_BAD( LINK_write(LINK_string("tF0"), 3, in)); RETURN_BAD_IF_BAD(LINK_read(LINK_string(resp), 2, in)); switch ( resp[0] ) { case 'F': in->master.link.tmode = e_link_t_none ; response_length = 2 ; break; default: in->master.link.tmode = e_link_t_extra ; response_length = 3 ; LINK_slurp(in); break; } break ; case e_link_t_extra: response_length = 3 ; break ; case e_link_t_none: default: response_length = 2 ; break ; } //Depending on the search type, the LINK search function //needs to be selected //tEC -- Conditional searching //tF0 -- Normal searching // Send the configuration command and check response if (ds->search == _1W_CONDITIONAL_SEARCH_ROM) { RETURN_BAD_IF_BAD(LINK_write(LINK_string("tEC"), 3, in)) ; RETURN_BAD_IF_BAD(LINK_read(LINK_string(resp), response_length, in)) ; if (strstr(resp, "EC") == NULL) { LEVEL_DEBUG("Did not change to conditional search"); return gbBAD; } LEVEL_DEBUG("LINK set for conditional search"); } else { RETURN_BAD_IF_BAD( LINK_write(LINK_string("tF0"), 3, in)); RETURN_BAD_IF_BAD(LINK_read(LINK_string(resp), response_length, in)); if (strstr(resp, "F0") == NULL) { LEVEL_DEBUG("Did not change to normal search"); return gbBAD; } LEVEL_DEBUG("LINK set for normal search"); } return gbGOOD ; } /************************************************************************/ /* */ /* LINK_directory: searches the Directory stores it in a dirblob */ /* & stores in in a dirblob object depending if it */ /* Supports conditional searches of the bus for */ /* /alarm branch */ /* */ /* Only called for the first element, everything else comes from dirblob*/ /* returns 0 even if no elements, errors only on communication errors */ /* */ /************************************************************************/ #define DEVICE_LENGTH 16 #define COMMA_LENGTH 1 #define PLUS_LENGTH 1 static GOOD_OR_BAD LINK_directory(struct device_search *ds, struct connection_in * in) { char resp[DEVICE_LENGTH+COMMA_LENGTH+PLUS_LENGTH+in->CRLF_size]; DirblobClear( &(ds->gulp) ); // Send the configuration command and check response RETURN_BAD_IF_BAD( LINK_search_type( ds, in )) ; // send the first search RETURN_BAD_IF_BAD(LINK_write(LINK_string("f"), 1, in)) ; //One needs to check the first character returned. //If nothing is found, the link will timeout rather then have a quick //return. This happens when looking at the alarm directory and //there are no alarms pending //So we grab the first character and check it. If not an E leave it //in the resp buffer and get the rest of the response from the LINK //device RETURN_BAD_IF_BAD(LINK_read(LINK_string(resp), 1, in)) ; switch (resp[0]) { case 'E': LEVEL_DEBUG("LINK returned E: No devices in alarm"); // pass through case 'N': // remove extra 2 bytes LEVEL_DEBUG("LINK returned E or N: Empty bus"); if (ds->search != _1W_CONDITIONAL_SEARCH_ROM) { in->AnyDevices = anydevices_no; } return gbGOOD ; default: break ; } if ( BAD(LINK_read(LINK_string(&resp[1+in->CRLF_size]), DEVICE_LENGTH+COMMA_LENGTH+PLUS_LENGTH-1-in->CRLF_size, in)) ) { return gbBAD; } // Check if we should start scanning switch (resp[0]) { case '-': case '+': if (ds->search != _1W_CONDITIONAL_SEARCH_ROM) { in->AnyDevices = anydevices_yes; } break; default: LEVEL_DEBUG("LINK_search unrecognized case"); return gbBAD; } /* Join the loop after the first query -- subsequent handled differently */ while ((resp[0] == '+') || (resp[0] == '-')) { BYTE sn[SERIAL_NUMBER_SIZE]; sn[7] = string2num(&resp[2]); sn[6] = string2num(&resp[4]); sn[5] = string2num(&resp[6]); sn[4] = string2num(&resp[8]); sn[3] = string2num(&resp[10]); sn[2] = string2num(&resp[12]); sn[1] = string2num(&resp[14]); sn[0] = string2num(&resp[16]); LEVEL_DEBUG("SN found: " SNformat, SNvar(sn)); // CRC check if (CRC8(sn, SERIAL_NUMBER_SIZE) || (sn[0] == 0x00)) { LEVEL_DEBUG("BAD family or CRC8"); return gbBAD; } DirblobAdd(sn, &(ds->gulp) ); switch (resp[0]) { case '+': // get next element if ( BAD(LINK_write(LINK_string("n"), 1, in))) { return gbBAD; } if ( BAD(LINK_read(LINK_string((resp)), DEVICE_LENGTH+COMMA_LENGTH+PLUS_LENGTH, in)) ) { return gbBAD; } break; case '-': return gbGOOD; default: break; } } return gbGOOD; } /* Control The Link AUX port, an extra physical line which * can be set high, low or HiZ by means of reading line state */ GOOD_OR_BAD LINK_aux_write(int level, struct connection_in * in) { BYTE out[1]; if(level) { // Set the Auxiliary line to the HIGH (default) level and low impedance. out[0] = 'd'; } else { // Set the Auxiliary line to the LOW level and low impedance. out[0] = 'z'; } RETURN_BAD_IF_BAD(LINK_write(out, 1, in)) ; // These commands does not generate any response return gbGOOD; } GOOD_OR_BAD LINK_aux_read(int *level_out, struct connection_in * in) { BYTE buf[1+in->CRLF_size] ; // Set the Auxiliary line to high impedance and report the current intended input level. RETURN_BAD_IF_BAD(LINK_write(LINK_string("&"), 1, in)) ; RETURN_BAD_IF_BAD(LINK_readback_data(buf, 1, in)) ; *level_out = (buf[0]=='0') ? 0 : 1 ; return gbGOOD; } static void LINK_close(struct connection_in *in) { struct port_in * pin = in->pown ; if ( pin->state == cs_virgin ) { LEVEL_DEBUG("LINK_close called on already closed connection"); return ; } if(pin->baud != B9600) { // Ensure we reset it to 9600bps to speed up detection on next startup LEVEL_DEBUG("Reconfiguring adapter to 9600bps before closing"); pin->baud = B9600; LINK_set_baud(in); } // the standard COM_free routine cleans up the connection } static GOOD_OR_BAD LINK_PowerByte(const BYTE data, BYTE * resp, const UINT delay, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; ASCII buf[3] = "pxx"; BYTE respond[2+in->CRLF_size] ; num2string(&buf[1], data); RETURN_BAD_IF_BAD(LINK_write(LINK_string(buf), 3, in) ) ; // delay UT_delay(delay); // flush the buffers RETURN_BAD_IF_BAD(LINK_write(LINK_string("\r"), 1, in) ) ; RETURN_BAD_IF_BAD( LINK_readback_data( LINK_string(respond), 2, in) ) ; resp[0] = string2num((const ASCII *) respond); return gbGOOD ; } // _sendback_bits // Send data and return response block // return 0=good static GOOD_OR_BAD LINK_PowerBit(const BYTE data, BYTE * resp, const UINT delay, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; BYTE buf[2+1+1+in->CRLF_size] ; buf[0] = '~'; //put in power bit mode buf[1] = data ? '1' : '0' ; // send to LINK (wait for final CR) RETURN_BAD_IF_BAD(LINK_write(buf, 2, in) ) ; // delay UT_delay(delay); // // take out of power bit mode RETURN_BAD_IF_BAD(LINK_write(LINK_string("\r"), 1, in) ) ; // read back RETURN_BAD_IF_BAD( LINK_readback_data(buf, 1, in) ) ; // place data (converted back to hex) in resp resp[0] = (buf[0]=='0') ? 0x00 : 0xFF ; return gbGOOD; } // _sendback_data // Send data and return response block // return 0=good #define LINK_SEND_SIZE 32 static GOOD_OR_BAD LINK_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; size_t left = size; size_t location = 0 ; BYTE buf[1+LINK_SEND_SIZE*2+1+1+in->CRLF_size] ; if (size == 0) { return gbGOOD; } //Debug_Bytes( "ELINK sendback send", data, size) ; while (left > 0) { // Loop through taking only 32 bytes at a time size_t this_length = (left > LINK_SEND_SIZE) ? LINK_SEND_SIZE : left; size_t this_length2 = 2 * this_length ; // doubled for switch from hex to ascii buf[0] = 'b'; //put in byte mode bytes2string((char *) &buf[1], &data[location], this_length); // load in data as ascii data buf[1+this_length2] = '\r'; // take out of byte mode // send to LINK RETURN_BAD_IF_BAD(LINK_write(buf, 1+this_length2+1, in) ) ; // read back RETURN_BAD_IF_BAD( LINK_readback_data(buf, this_length2, in) ) ; // place data (converted back to hex) in resp string2bytes((char *) buf, &resp[location], this_length); left -= this_length; location += this_length ; } //Debug_Bytes( "ELINK sendback get", resp, size) ; return gbGOOD; } // _sendback_bits // Send data and return response block // return 0=good static GOOD_OR_BAD LINK_sendback_bits(const BYTE * databits, BYTE * respbits, const size_t size, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; size_t left = size; size_t location = 0 ; BYTE buf[1+LINK_SEND_SIZE+1+1+in->CRLF_size] ; if (size == 0) { return gbGOOD; } Debug_Bytes( "ELINK sendback bits send", databits, size) ; while (left > 0) { // Loop through taking only 32 bytes at a time size_t this_length = (left > LINK_SEND_SIZE) ? LINK_SEND_SIZE : left; size_t i ; buf[0] = 'j'; //put in bit mode for ( i=0 ; imaster.link.qmode ) { case e_link_t_extra: qmode_extra = 1 ; break ; case e_link_t_unknown: case e_link_t_none: default: qmode_extra = 0 ; break ; } // read back RETURN_BAD_IF_BAD( LINK_read(buf, size+qmode_extra, in) ) ; // see if we've yet tested the extra '?' "feature" if ( in->master.link.qmode == e_link_t_unknown ) { if ( buf[size] != 0x0D ) { in->master.link.qmode = e_link_t_extra ; LINK_slurp(in) ; } else { in->master.link.qmode = e_link_t_none ; } } return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_locator.c0000644000175000001440000000472612654730021015454 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_standard.h" /* ------- Prototypes ----------- */ static GOOD_OR_BAD OW_locator(BYTE * loc, const struct parsedname *pn); static GOOD_OR_BAD OW_fake_locator(BYTE * loc, const struct parsedname *pn); static GOOD_OR_BAD OW_any_locator(BYTE * loc, const struct parsedname *pn); /* ------- Functions ------------ */ ZERO_OR_ERROR FS_locator(struct one_wire_query *owq) { BYTE loc[SERIAL_NUMBER_SIZE]; ASCII ad[SERIAL_NUMBER_SIZE*2]; OW_any_locator(loc, PN(owq) ) ; bytes2string(ad, loc, SERIAL_NUMBER_SIZE); return OWQ_format_output_offset_and_size(ad, sizeof(ad), owq); } // reversed address ZERO_OR_ERROR FS_r_locator(struct one_wire_query *owq) { BYTE loc[SERIAL_NUMBER_SIZE]; ASCII ad[SERIAL_NUMBER_SIZE*2]; size_t i; RETURN_ERROR_IF_BAD( OW_any_locator(loc, PN(owq) ) ) ; for (i = 0; i < SERIAL_NUMBER_SIZE; ++i) { num2string(ad + (i << 1), loc[7 - i]); } return OWQ_format_output_offset_and_size(ad, sizeof(ad), owq); } static GOOD_OR_BAD OW_any_locator(BYTE * loc, const struct parsedname *pn) { memset( loc, 0xFF, SERIAL_NUMBER_SIZE ) ; // default if no locator switch (get_busmode(pn->selected_connection)) { case bus_fake: case bus_tester: case bus_mock: return OW_fake_locator(loc, pn); default: return OW_locator(loc, pn); } } static GOOD_OR_BAD OW_locator(BYTE * loc, const struct parsedname *pn) { BYTE addr[2+SERIAL_NUMBER_SIZE] = { _1W_LOCATOR, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; // key and 8 byte default struct transaction_log t[] = { TRXN_NVERIFY, TRXN_MODIFY(addr, addr, sizeof(addr)), TRXN_END, }; if (BUS_transaction(t, pn)) { return gbBAD; } memcpy(loc, &addr[2], SERIAL_NUMBER_SIZE); return gbGOOD; } static GOOD_OR_BAD OW_fake_locator(BYTE * loc, const struct parsedname *pn) { if (pn->sn[SERIAL_NUMBER_SIZE-1] & 0x01) { // 50% chance of locator // start with 0xFE and use rest of sn (with valid CRC8) loc[0] = 0xFE; loc[1] = pn->sn[1] ; loc[2] = pn->sn[2] ; loc[3] = pn->sn[3] ; loc[4] = pn->sn[4] ; loc[5] = pn->sn[5] ; loc[6] = pn->sn[6] ; loc[SERIAL_NUMBER_SIZE-1] = CRC8compute(loc, SERIAL_NUMBER_SIZE-1, 0); } return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_locks.c0000644000175000001440000000513512654730021015117 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* locks are to handle multithreading */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" /* ------- Globals ----------- */ #ifdef __UCLIBC__ #if ((__UCLIBC_MAJOR__ << 16)+(__UCLIBC_MINOR__ << 8)+(__UCLIBC_SUBLEVEL__) < 0x00091D) /* If uClibc < 0.9.29, then re-initialize internal pthread-structs */ extern char *__pthread_initial_thread_bos; void __pthread_initialize(void); #endif /* UCLIBC_VERSION */ #endif /* __UCLIBC__ */ // Global structure holding mutexes struct mutexes Mutex ; /* Essentially sets up mutexes to protect global data/devices */ void LockSetup(void) { /* global mutex attribute */ _MUTEX_ATTR_INIT(Mutex.mattr); #ifdef __UCLIBC__ #if ((__UCLIBC_MAJOR__ << 16)+(__UCLIBC_MINOR__ << 8)+(__UCLIBC_SUBLEVEL__) < 0x00091D) /* If uClibc < 0.9.29, then re-initialize internal pthread-structs * pthread and mutexes doesn't work after daemon() is called and * the main-process is gone. * * This workaround will probably be fixed in uClibc-0.9.28 * Other uClibc developers have noticed similar problems which are * trigged when pthread functions are used in shared libraries. */ __pthread_initial_thread_bos = NULL; __pthread_initialize(); /* global mutex attribute */ _MUTEX_ATTR_SET(Mutex.mattr, PTHREAD_MUTEX_ADAPTIVE_NP); #else /* UCLIBC_VERSION */ _MUTEX_ATTR_SET(Mutex.mattr, PTHREAD_MUTEX_DEFAULT); #endif /* UCLIBC_VERSION */ #define MUTEX_ATTR_INIT_DONE _MUTEX_INIT(Mutex.uclibc_mutex); #endif /* __UCLIBC__ */ #ifndef MUTEX_ATTR_INIT_DONE #define MUTEX_ATTR_INIT_DONE if ( Globals.locks ) { _MUTEX_ATTR_SET(Mutex.mattr, PTHREAD_MUTEX_ERRORCHECK); } else { _MUTEX_ATTR_SET(Mutex.mattr, PTHREAD_MUTEX_DEFAULT); } #endif _MUTEX_INIT(Mutex.stat_mutex); _MUTEX_INIT(Mutex.controlflags_mutex); _MUTEX_INIT(Mutex.fstat_mutex); _MUTEX_INIT(Mutex.dir_mutex); #if OW_USB _MUTEX_INIT(Mutex.libusb_mutex); #endif /* OW_USB */ _MUTEX_INIT(Mutex.typedir_mutex); _MUTEX_INIT(Mutex.externaldir_mutex); _MUTEX_INIT(Mutex.namefind_mutex); _MUTEX_INIT(Mutex.aliaslist_mutex); _MUTEX_INIT(Mutex.externalcount_mutex); _MUTEX_INIT(Mutex.timegm_mutex); _MUTEX_INIT(Mutex.detail_mutex); RWLOCK_INIT(Mutex.lib); RWLOCK_INIT(Mutex.cache); RWLOCK_INIT(Mutex.persistent_cache); RWLOCK_INIT(Mutex.connin); RWLOCK_INIT(Mutex.monitor); } owfs-3.1p5/module/owlib/src/c/ow_masterhub.c0000644000175000001440000005432312654730021016001 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" /* Hobby Boards Master Hub v2.3 * designed by Eric Vickery * Support by Paul Alfille 2014 * * dmesg output: * usb 1-1.1: new full-speed USB device number 9 using ehci-pci * usb 1-1.1: New USB device found, idVendor=04d8, idProduct=f897 * usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 * usb 1-1.1: Product: Hobby Boards USB Master * usb 1-1.1: Manufacturer: Hobby Boards * cdc_acm 1-1.1:1.0: This device cannot do calls on its own. It is not a modem. * cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device * usbcore: registered new interface driver cdc_acm * cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters * * MAC address: 00:04:a3:f4:4c:9c * Serial settings 9600,8N1 although other baud rates seem well tolerated * * According to Eric Vickary * * */ /* Full lsusb output Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 2 Communications bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 16 idVendor 0x04d8 Microchip Technology, Inc. idProduct 0xf897 bcdDevice 1.00 iManufacturer 1 Hobby Boards iProduct 2 Hobby Boards USB Master iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 67 bNumInterfaces 2 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 2 Communications bInterfaceSubClass 2 Abstract (modem) bInterfaceProtocol 1 AT-commands (v.25ter) iInterface 0 CDC Header: bcdCDC 1.10 CDC ACM: bmCapabilities 0x02 line coding and serial state CDC Union: bMasterInterface 0 bSlaveInterface 1 CDC Call Management: bmCapabilities 0x00 bDataInterface 1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x000a 1x 10 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 10 CDC Data bInterfaceSubClass 0 Unused bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 */ /* * Updated 10/2014 to version 1.1 * */ /* Ascii commands */ #define MH_available 'a' #define MH_reset 'r' #define MH_bitwrite 'B' #define MH_bitread 'b' #define MH_address 'A' #define MH_strong 'S' #define MH_first 'f' #define MH_firstcap 'F' #define MH_conditional 'c' #define MH_conditionalcap 'C' #define MH_next 'n' #define MH_nextcap 'N' #define MH_pullup 'P' #define MH_write 'W' #define MH_read 'R' #define MH_lastheard 'L' #define MH_deletecache 'D' #define MH_info 'I' #define MH_setlocation 'l' #define MH_version 'V' #define MH_help 'h' #define MH_helpcap 'H' #define MH_sync 's' #define MH_powerreset 'p' #define MH_update 'U' //static void byteprint( const BYTE * b, int size ) ; static RESET_TYPE MasterHub_reset(const struct parsedname *pn); static RESET_TYPE MasterHub_reset_once(struct connection_in * in) ; static enum search_status MasterHub_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD MasterHub_sendback_part(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) ; static GOOD_OR_BAD MasterHub_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static void MasterHub_setroutines(struct connection_in *in); static void MasterHub_close(struct connection_in *in); static GOOD_OR_BAD MasterHub_directory( struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD MasterHub_select( const struct parsedname * pn ) ; static GOOD_OR_BAD MasterHub_verify( const struct parsedname * pn ) ; static GOOD_OR_BAD MasterHub_sender_ascii( char cmd, ASCII * data, int length, struct connection_in * in ) ; static GOOD_OR_BAD MasterHub_sender_bytes( char cmd, const BYTE * data, int length, struct connection_in * in ); static SIZE_OR_ERROR MasterHub_readin( ASCII * data, size_t minlength, size_t maxlength, struct connection_in * in ) ; static SIZE_OR_ERROR MasterHub_readin_bytes( BYTE * data, size_t length, struct connection_in * in ) ; static GOOD_OR_BAD MasterHub_read(BYTE * buf, size_t size, struct connection_in * in) ; static GOOD_OR_BAD MasterHub_powercycle(struct connection_in *in) ; static GOOD_OR_BAD MasterHub_sync(struct connection_in *in) ; static GOOD_OR_BAD MasterHub_sync_once(struct connection_in *in) ; static GOOD_OR_BAD MasterHub_available(struct connection_in *head) ; static GOOD_OR_BAD MasterHub_available_once(struct connection_in *head) ; static void MasterHub_setroutines(struct connection_in *in) { in->iroutines.detect = MasterHub_detect; in->iroutines.reset = MasterHub_reset; in->iroutines.next_both = MasterHub_next_both; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = MasterHub_sendback_data; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = MasterHub_select ; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE ; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = MasterHub_close; in->iroutines.verify = MasterHub_verify ; in->iroutines.flags = ADAP_FLAG_dirgulp | ADAP_FLAG_bundle | ADAP_FLAG_dir_auto_reset | ADAP_FLAG_no2404delay ; in->bundling_length = 240; // characters not bytes (in hex) } GOOD_OR_BAD MasterHub_detect(struct port_in *pin) { struct connection_in * in = pin->first ; struct parsedname pn; FS_ParsedName_Placeholder(&pn); // minimal parsename -- no destroy needed pn.selected_connection = in; /* Set up low-level routines */ MasterHub_setroutines(in); if (pin->init_data == NULL) { LEVEL_DEFAULT("MasterHub bus master requires port name"); return gbBAD; } /* Open the com port */ COM_set_standard( in ) ; // standard COM port settings RETURN_BAD_IF_BAD(COM_open(in)) ; // Sync, then get channels if ( GOOD( MasterHub_sync(in) ) ) { return MasterHub_available( in ) ; } LEVEL_DEFAULT("Error in MasterHub detection: can't sync and query"); return gbBAD; } static RESET_TYPE MasterHub_reset(const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; if ( MasterHub_reset_once(in) == BUS_RESET_OK ) { return BUS_RESET_OK ; } // resync and retry if ( GOOD( MasterHub_sync( in ) ) ) { return MasterHub_reset_once( in ) ; } // resync and retry if ( GOOD( MasterHub_sync( in ) ) ) { return MasterHub_reset_once( in ) ; } return BUS_RESET_ERROR ; } // single send static RESET_TYPE MasterHub_reset_once(struct connection_in * in) { ASCII resp[11]; SIZE_OR_ERROR length ; RETURN_BAD_IF_BAD( MasterHub_sender_ascii( MH_reset, "", 0, in ) ) ; // send reset // two possible returns: "Presence" and "No Presence" length = MasterHub_readin( resp, 8, 11, in ) ; if ( length == -1 ) { return BUS_RESET_ERROR; } if ( length == 11 ) { in->AnyDevices = anydevices_no ; } return BUS_RESET_OK; } static enum search_status MasterHub_next_both(struct device_search *ds, const struct parsedname *pn) { if (ds->LastDevice) { return search_done; } if (ds->index == -1) { // gulp it in if ( BAD( MasterHub_directory(ds, pn) ) ) { return search_error; } } // LOOK FOR NEXT ELEMENT ++ds->index; LEVEL_DEBUG("Index %d", ds->index); switch ( DirblobGet(ds->index, ds->sn, &(ds->gulp)) ) { case 0: LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; case -ENODEV: default: ds->LastDevice = 1; LEVEL_DEBUG("SN finished"); return search_done; } } /************************************************************************/ /* MasterHub_directory: searches the Directory stores it in a dirblob */ /* & stores in in a dirblob object depending if it */ /* Supports conditional searches of the bus for */ /* /alarm directory */ /* */ /* Only called for the first element, everything else comes from dirblob */ /* returns 0 even if no elements, errors only on communication errors */ /************************************************************************/ static GOOD_OR_BAD MasterHub_directory(struct device_search *ds, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; char first, next, current ; DirblobClear( &(ds->gulp) ); //Depending on the search type, the MasterHub search function //needs to be selected //tEC -- Conditional searching //tF0 -- Normal searching // Send the configuration command and check response if (ds->search == _1W_CONDITIONAL_SEARCH_ROM) { first = MH_conditionalcap ; next = MH_nextcap ; } else { first = MH_firstcap ; next = MH_nextcap ; } current = first ; // if ( MasterHub_reset( pn ) != BUS_RESET_OK ) { // LEVEL_DEBUG("Unable to reset MasterHub for directory search") ; // return gbBAD ; // } while (1) { SIZE_OR_ERROR length ; ASCII resp[16]; BYTE sn[SERIAL_NUMBER_SIZE]; RETURN_BAD_IF_BAD( MasterHub_sender_ascii( current, "", 0, in ) ) ; // request directory element /* three possible returns: * No more devices * No devices found * 6300080054141010 * */ length = MasterHub_readin( resp, 15, 16, in ) ; if ( length < 0 ) { LEVEL_DEBUG("Error reading MasterHub directory" ); return gbBAD ; } current = next ; // set up for next pass if ( length == 15 ) { // No more devices return gbGOOD ; } if ( strncmp( resp, "No devices found", 16 ) == 0 ) { return gbGOOD ; } sn[7] = string2num(&resp[0]); sn[6] = string2num(&resp[2]); sn[5] = string2num(&resp[4]); sn[4] = string2num(&resp[6]); sn[3] = string2num(&resp[8]); sn[2] = string2num(&resp[10]); sn[1] = string2num(&resp[12]); sn[0] = string2num(&resp[14]); LEVEL_DEBUG("SN found: " SNformat, SNvar(sn)); // CRC check if (CRC8(sn, SERIAL_NUMBER_SIZE) || (sn[0] == 0)) { /* A minor "error" and should perhaps only return -1 */ /* to avoid reconnect */ LEVEL_DEBUG("CRC error sn = %s", sn); return gbBAD ; } DirblobAdd(sn, &(ds->gulp) ); } } static GOOD_OR_BAD MasterHub_select( const struct parsedname * pn ) { struct connection_in * in = pn->selected_connection ; char send_address[16] ; char resp[22] ; SIZE_OR_ERROR length ; if ( (pn->selected_device==NO_DEVICE) || (pn->selected_device==DeviceThermostat) ) { return gbRESET( MasterHub_reset(pn) ) ; } if ( MasterHub_reset( pn ) != BUS_RESET_OK ) { LEVEL_DEBUG("Unable to reset MasterHub for device addressing") ; return gbBAD ; } num2string( &send_address[ 0], pn->sn[7] ) ; num2string( &send_address[ 2], pn->sn[6] ) ; num2string( &send_address[ 4], pn->sn[5] ) ; num2string( &send_address[ 6], pn->sn[4] ) ; num2string( &send_address[ 8], pn->sn[3] ) ; num2string( &send_address[10], pn->sn[2] ) ; num2string( &send_address[12], pn->sn[1] ) ; num2string( &send_address[14], pn->sn[0] ) ; // Send command RETURN_BAD_IF_BAD( MasterHub_sender_ascii( MH_address, send_address, 16, in ) ) ; /* Possible responses: * + * ! Network Error * ! Device Not Found Error * */ length = MasterHub_readin( resp, 0, 22, in ) ; if ( length < 0 ) { return gbBAD ; } return gbGOOD ; } static GOOD_OR_BAD MasterHub_verify( const struct parsedname * pn ) { struct connection_in * in = pn->selected_connection ; char send_address[16] ; char resp[22] ; SIZE_OR_ERROR length ; if ( (pn->selected_device==NO_DEVICE) || (pn->selected_device==DeviceThermostat) ) { return gbRESET( MasterHub_reset(pn) ) ; } if ( MasterHub_reset( pn ) != BUS_RESET_OK ) { LEVEL_DEBUG("Unable to reset MasterHub for device addressing") ; return gbBAD ; } num2string( &send_address[ 0], pn->sn[7] ) ; num2string( &send_address[ 2], pn->sn[6] ) ; num2string( &send_address[ 4], pn->sn[5] ) ; num2string( &send_address[ 6], pn->sn[4] ) ; num2string( &send_address[ 8], pn->sn[3] ) ; num2string( &send_address[10], pn->sn[2] ) ; num2string( &send_address[12], pn->sn[1] ) ; num2string( &send_address[14], pn->sn[0] ) ; // Send command RETURN_BAD_IF_BAD( MasterHub_sender_ascii( MH_strong, send_address, 16, in ) ) ; /* Possible responses: * + * ! Network Error * ! Device Not Found Error * */ length = MasterHub_readin( resp, 0, 22, in ) ; if ( length < 0 ) { return gbBAD ; } return gbGOOD ; } // Send data and return response block -- up to 120 bytes static GOOD_OR_BAD MasterHub_sendback_part(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; SIZE_OR_ERROR length ; RETURN_BAD_IF_BAD( MasterHub_sender_bytes( MH_write, data, size, in ) ) ; length = MasterHub_readin_bytes( resp, size, in ) ; if ( length != (int) size ) { return gbBAD ; } return gbGOOD ; } static GOOD_OR_BAD MasterHub_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { int left; for ( left=size ; left>0 ; left -= 120 ) { size_t pass_start = size - left ; size_t pass_size = (left>120)?120:left ; RETURN_BAD_IF_BAD( MasterHub_sendback_part( &data[pass_start], &resp[pass_start], pass_size, pn ) ) ; } return gbGOOD; } /********************************************************/ /* MasterHub_close ** clean local resources before */ /* closing the serial port */ /* */ /********************************************************/ static void MasterHub_close(struct connection_in *in) { COM_close(in); } // Send bytes to the master hub -- // this routine converts the bytes to ascii hex and uses MasterHub_sender_ascii static GOOD_OR_BAD MasterHub_sender_bytes( char cmd, const BYTE * data, int length, struct connection_in * in ) { char send_string[250] ; bytes2string( send_string, data, length ) ; return MasterHub_sender_ascii( cmd, send_string, length*2, in ) ; } static GOOD_OR_BAD MasterHub_sender_ascii( char cmd, ASCII * data, int length, struct connection_in * in ) { char send_string[250] = { cmd, } ; int length_so_far = 1 ; if ( length > 120 ) { LEVEL_DEBUG("String too long for MasterHub" ) ; return gbBAD ; } // potentially add the channel char based on type of command switch (cmd) { case MH_available: //'a' case MH_next: //'n' case MH_nextcap: //'N' case MH_lastheard: //'L' case MH_deletecache://'D' case MH_info: //'I' case MH_setlocation://'l' case MH_version: //'V' case MH_help: //'h' case MH_helpcap: //'H' case MH_sync: //'s' case MH_powerreset: //'p' case MH_update: //'U' // command with no channel included break ; case MH_reset: //'r' case MH_bitwrite: //'B' case MH_bitread: //'b' case MH_address: //'A' case MH_strong: //'S' case MH_first: //'f' case MH_firstcap: //'F' case MH_conditional://'c' case MH_conditionalcap://'C' case MH_pullup: //'P' case MH_write: //'W' case MH_read: //'R' // this command needs the channel char added send_string[length_so_far] = in->master.masterhub.channel_char ; ++length_so_far ; break ; } memcpy( &send_string[length_so_far], data, length ) ; length_so_far += length ; strcpy( &send_string[length_so_far], "\r" ) ; length_so_far += 1 ; LEVEL_DEBUG("Sending %d chars to masterhub <%s>", length_so_far, send_string ) ; return COM_write( (BYTE*)send_string, length_so_far, in ) ; } static GOOD_OR_BAD MasterHub_read(BYTE * buf, size_t size, struct connection_in *in) { return COM_read( buf, size, in ) ; } static GOOD_OR_BAD MasterHub_sync(struct connection_in *in) { int attempts ; // Try to sync a few times until successful for ( attempts = 0 ; attempts < 4 ; ++ attempts ) { if ( GOOD( MasterHub_sync_once( in ) ) ) { return gbGOOD ; } LEVEL_DEBUG("Try power cycle to recapture MasterHub" ) ; RETURN_BAD_IF_BAD( MasterHub_powercycle( in ) ) ; } return MasterHub_sync_once( in ) ; } static GOOD_OR_BAD MasterHub_sync_once(struct connection_in *in) { int attempts ; // Try to sync a few times until successful for ( attempts = 0 ; attempts < 4 ; ++ attempts ) { ASCII read_buffer[10] ; COM_slurp(in) ; // empty pending data RETURN_BAD_IF_BAD( MasterHub_sender_ascii( MH_sync, "", 0, in ) ) ; // send sync // read back if ( MasterHub_readin( read_buffer, 0, 10, in ) == 0 ) { LEVEL_DEBUG("Sync success") ; return gbGOOD ; } LEVEL_DEBUG( "Bad sync response %d", attempts ) ; } LEVEL_DEBUG("Sync failure") ; return gbBAD ; } static GOOD_OR_BAD MasterHub_powercycle(struct connection_in *in) { LEVEL_DEBUG("MasterHub initial power cycle start" ); RETURN_BAD_IF_BAD( MasterHub_sender_ascii( MH_powerreset, "", 0, in ) ); // send power cycle sleep(2) ; LEVEL_DEBUG("MasterHub initial power cycle done" ); return gbGOOD ; } static SIZE_OR_ERROR MasterHub_readin_bytes( BYTE * data, size_t length, struct connection_in * in ) { ASCII buffer[250] ; SIZE_OR_ERROR lengthback = MasterHub_readin( buffer, length*2, length*2, in ) ; if ( lengthback < 0 ) { return lengthback ; } string2bytes( buffer, data, length ) ; return length ; } // data is a buffer of *length size // returns data and length -- don't include preamble (+ ) and post-amble (\r\n?) // // Also special case in minlength==0: "+\r\n?" ( no space after + ) static SIZE_OR_ERROR MasterHub_readin( ASCII * data, size_t minlength, size_t maxlength, struct connection_in * in ) { size_t min_l = 2 + 2 + 1 ; // "+ \r\n?" or "! \r\n?" size_t max_l = 250 ; BYTE buffer[max_l+min_l] ; SIZE_OR_ERROR length ; BYTE end_string[] = { 0x0D, 0x0A, '?' } ; if ( max_l < maxlength ) { LEVEL_DEBUG( "read too large" ) ; return gbBAD ; } memset( data, 0, maxlength ) ; // zero-fill if ( minlength > 0 ) { // read enough for error RETURN_BAD_IF_BAD( MasterHub_read( buffer, min_l, in ) ) ; if ( maxlength == 0 ) { // no data return 0 ; } // read rest of minimum RETURN_BAD_IF_BAD( MasterHub_read( &buffer[min_l], minlength, in ) ) ; } else { // special case with minlength -- 0 to allow "+\t\n?" -- no space // read enough for error RETURN_BAD_IF_BAD( MasterHub_read( buffer, min_l-1, in ) ) ; if ( memcmp( &buffer[1], end_string, 3 ) == 0 ) { // Success! if ( buffer[0] != '+' ) { // an error of sorts return -1 ; } return 0 ; } // read rest of minimum ( for the ignored space RETURN_BAD_IF_BAD( MasterHub_read( &buffer[min_l-1], 1, in ) ) ; } for ( length = minlength ; length < ( ssize_t) maxlength ; ++length ) { if ( memcmp( &buffer[ length+min_l-3 ], end_string, 3 ) == 0 ) { // Success! memcpy( data, &buffer[2], length ) ; if ( buffer[0] != '+' ) { // an error of sorts return -length ; } return length ; } RETURN_BAD_IF_BAD( MasterHub_read( &buffer[min_l+length], 1, in ) ) ; } memcpy( data, &buffer[2], maxlength ) ; if ( buffer[0] != '+' ) { COM_slurp( in ) ; return -maxlength ; } return maxlength ; } // Not only finds the available channels, but sets up the port and connections. // Note this is the only place to change if future hubs support more channels static GOOD_OR_BAD MasterHub_available(struct connection_in *head) { int attempts ; for ( attempts = 0 ; attempts < 4 ; ++ attempts ) { if ( GOOD( MasterHub_available_once( head ) ) ) { return gbGOOD ; } LEVEL_DEBUG("Need to try searching for available MasterHub channels again") ; RETURN_BAD_IF_BAD( MasterHub_sync( head ) ) ; } return MasterHub_available_once( head ) ; ; } static GOOD_OR_BAD MasterHub_available_once(struct connection_in *head) { SIZE_OR_ERROR length ; int index ; ASCII data[6] ; char *name[] = { "MasterHub(All)", "MasterHub(1)", "MasterHub(2)", "MasterHub(3)", "MasterHub(4)", "MasterHub(W)", }; RETURN_BAD_IF_BAD( MasterHub_sender_ascii( MH_available, "", 0, head ) ) ; // send available // two possible returns: A1234 and A1234W length = MasterHub_readin( data, 5, 6, head ) ; if ( length < 0 ) { return gbBAD ; } LEVEL_DEBUG( "Available %*s", length, data ) ; for ( index = 1 ; index < length ; ++index ) { struct connection_in * added ; if ( index == 1 ) { // already head added = head ; } else { added = AddtoPort(head->pown); if (added == NO_CONNECTION) { return gbBAD; } } added->master.masterhub.channel_char = data[index] ; added->master.masterhub.channels = length - 1 ; // ignore 'A' (All channels) added->adapter_name = name[index]; added->Adapter = adapter_masterhub ; LEVEL_DEBUG( "Added %s on channel %c", added->adapter_name, added->master.masterhub.channel_char ) ; } return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_memblob.c0000644000175000001440000001141312654730021015415 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 2006 memblob */ #include #include "owfs_config.h" #include "ow.h" static int MemblobIncrease(size_t length, struct memblob *mb); /* A "memblob" is a structure holding a list of 1-wire serial numbers (8 bytes each) with some housekeeping information It is used for directory caches, and some "all at once" adapters types Most interesting, it allocates memory dynamically. */ void MemblobClear(struct memblob *mb) { SAFEFREE(mb->memory_storage) ; mb->memory_storage = NULL; mb->troubled = 0 ; mb->used = 0; mb->allocated = 0; } void MemblobInit(struct memblob *mb, size_t increment) { mb->used = 0; mb->allocated = 0; mb->troubled = 0 ; mb->increment = increment; mb->memory_storage = NULL; } BYTE * MemblobData(struct memblob * mb) { return mb->memory_storage ; } size_t MemblobLength(struct memblob * mb) { return mb->used ; } int MemblobPure(struct memblob *mb) { return !mb->troubled; } void MemblobTrim(size_t nchars, struct memblob * mb) { if (mb->used < nchars) { MemblobClear(mb) ; } else { mb->used -= nchars ; } } static int MemblobIncrease(size_t length, struct memblob *mb) { // make more room? -- blocks of 10 devices (80byte) if ((mb->used + length > mb->allocated) || (mb->memory_storage == NULL)) { size_t increment = ((length / mb->increment) + 1) * mb->increment; size_t newalloc = mb->allocated + increment; BYTE *try_bigger_block = owrealloc(mb->memory_storage, newalloc); if (try_bigger_block != NULL) { mb->allocated = newalloc; mb->memory_storage = try_bigger_block; } else { // allocation failed -- keep old mb->troubled = 1 ; return -ENOMEM; } } mb->used += length; return 0; } int MemblobAdd(const BYTE * data, size_t length, struct memblob *mb) { size_t used = mb->used; int ret = MemblobIncrease(length, mb); if (ret == 0) { // add the device and increment the counter memcpy(&(mb->memory_storage[used]), data, length); } return ret; } int MemblobAddChar(BYTE character, size_t length, struct memblob *mb) { size_t used = mb->used; int ret = MemblobIncrease(length, mb); if (ret == 0) { // add the device and increment the counter memset(&(mb->memory_storage[used]), character, length); } return ret; } owfs-3.1p5/module/owlib/src/c/ow_memory.c0000644000175000001440000001075612654730021015321 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_connection.h" #define _1W_READ_F0 0xF0 #define _1W_READ_A5 0xA5 #define _1W_READ_AA 0xAA static void Set_OWQ_length(struct one_wire_query *owq); static GOOD_OR_BAD OW_r_crc16(BYTE code, struct one_wire_query *owq, size_t page, size_t pagesize); static void Set_OWQ_length(struct one_wire_query *owq) { switch (OWQ_pn(owq).selected_filetype->format) { case ft_binary: case ft_ascii: case ft_vascii: case ft_alias: OWQ_length(owq) = OWQ_size(owq); break; default: break; } } /* No CRC -- 0xF0 code */ GOOD_OR_BAD COMMON_read_memory_F0(struct one_wire_query *owq, size_t page, size_t pagesize) { off_t offset = OWQ_offset(owq) + page * pagesize; BYTE p[3] = { _1W_READ_F0, LOW_HIGH_ADDRESS(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE3(p), TRXN_READ((BYTE *) OWQ_buffer(owq), OWQ_size(owq)), TRXN_END, }; Set_OWQ_length(owq); return BUS_transaction(t, PN(owq)); } /* read up to end of page to CRC16 -- 0xA5 code */ static GOOD_OR_BAD OW_r_crc16(BYTE code, struct one_wire_query *owq, size_t page, size_t pagesize) { off_t offset = OWQ_offset(owq) + page * pagesize; size_t size = OWQ_size(owq); BYTE p[3 + pagesize + 2]; int rest = pagesize - (offset % pagesize); struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 3, rest), TRXN_END, }; p[0] = code; p[1] = BYTE_MASK(offset); p[2] = BYTE_MASK(offset >> 8); RETURN_BAD_IF_BAD(BUS_transaction(t, PN(owq))) ; memcpy(OWQ_buffer(owq), &p[3], size); Set_OWQ_length(owq); return gbGOOD; } /* read up to end of page to CRC16 -- 0xA5 code */ GOOD_OR_BAD COMMON_read_memory_crc16_A5(struct one_wire_query *owq, size_t page, size_t pagesize) { return OW_r_crc16(_1W_READ_A5, owq, page, pagesize)?-EINVAL:0; } /* read up to end of page to CRC16 -- 0xA5 code */ GOOD_OR_BAD COMMON_read_memory_crc16_AA(struct one_wire_query *owq, size_t page, size_t pagesize) { return OW_r_crc16(_1W_READ_AA, owq, page, pagesize)?-EINVAL:0; } /* read up to end of page to CRC16 -- 0xA5 code */ /* Extra 8 bytes, (for counter) too -- discarded */ GOOD_OR_BAD COMMON_read_memory_toss_counter(struct one_wire_query *owq, size_t page, size_t pagesize) { off_t offset = OWQ_offset(owq) + page * pagesize; BYTE p[3 + pagesize + 8 + 2]; int rest = pagesize - (offset % pagesize); struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 3, rest + 8), TRXN_END, }; p[0] = _1W_READ_A5; p[1] = BYTE_MASK(offset); p[2] = BYTE_MASK(offset >> 8); RETURN_BAD_IF_BAD(BUS_transaction(t, PN(owq))) ; memcpy(OWQ_buffer(owq), &p[3], OWQ_size(owq)); Set_OWQ_length(owq); return gbGOOD; } #define _1W_Throw_Away_Bytes 1 /* 0xA5 code */ /* Extra 8 bytes, too */ GOOD_OR_BAD COMMON_read_memory_plus_counter(BYTE * extra, size_t page, size_t pagesize, struct parsedname *pn) { off_t offset = (page + 1) * pagesize - _1W_Throw_Away_Bytes; // last byte of page BYTE p[3 + _1W_Throw_Away_Bytes + 8 + 2] = { _1W_READ_A5, LOW_HIGH_ADDRESS(offset), }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(p, 3, _1W_Throw_Away_Bytes + 8), TRXN_END, }; RETURN_BAD_IF_BAD(BUS_transaction(t, pn)) ; memcpy(extra, &p[3 + _1W_Throw_Away_Bytes], 8); LEVEL_DEBUG("Counter Data: %.2X %.2X %.2X %.2X %.2X %.2X %.2X %.2X", extra[0], extra[1], extra[2], extra[3], extra[4], extra[5], extra[6], extra[7] ); return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_multicast.c0000644000175000001440000001124412654730021016007 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_net holds the network utility routines. Mainly stolen unashamedly from Steven's Book */ /* Much modification by Christian Magnusson especially for Valgrind and embedded */ /* non-threaded fixes by Jerry Scharf */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #ifdef HAVE_ARPA_INET_H #include #endif /* Multicast to discover HA7 servers */ /* Wait 10 seconds for responses */ /* returns number found (>=0) or <0 on error */ /* Taken from Embedded Data Systems' documentation */ /* http://www.talk1wire.com/?q=node/7 */ #pragma pack(push,1) struct HA7_response { char signature[2] ; uint16_t command ; uint16_t port ; uint16_t sslport ; char serial_num[12] ; // MAC char dev_name[64] ; } ; #pragma pack(pop) static int Read_HA7_response( FILE_DESCRIPTOR_OR_ERROR file_descriptor, struct addrinfo *now, char * name ) ; static int Test_HA7_response( struct HA7_response * ha7_response ) { LEVEL_DEBUG("From ha7_response: signature=%.2s, command=%X, port=%d, ssl=%d, MAC=%.12s, device=%s", ha7_response->signature, ntohs(ha7_response->command), ntohs(ha7_response->port), ntohs(ha7_response->sslport), ha7_response->serial_num, ha7_response->dev_name) ; if (memcmp("HA", ha7_response->signature, 2)) { LEVEL_CONNECT("HA7 response signature error"); return 1; } if ( 0x8001 != ntohs(ha7_response->command) ) { LEVEL_CONNECT("HA7 response command error"); return 1; } return 0 ; } static void Setup_HA7_hint( struct addrinfo * hint ) { memset(hint, 0, sizeof(struct addrinfo)); #ifdef AI_NUMERICSERV hint->ai_flags = AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV; #else hint->ai_flags = AI_CANONNAME | AI_NUMERICHOST; #endif hint->ai_family = AF_INET; // hint->ai_socktype = SOCK_DGRAM | SOCK_CLOEXEC ; // udp hint->ai_socktype = SOCK_DGRAM ; // udp hint->ai_protocol = 0; } static int Get_HA7_response( struct addrinfo *now, char * name ) { FILE_DESCRIPTOR_OR_ERROR file_descriptor = socket(now->ai_family, now->ai_socktype, now->ai_protocol) ; int read_return = Read_HA7_response( file_descriptor, now, name ) ; Test_and_Close( & file_descriptor ) ; return read_return ; } static int Read_HA7_response( FILE_DESCRIPTOR_OR_ERROR file_descriptor, struct addrinfo *now, char * name ) { struct timeval tv = { 50, 0 }; struct HA7_response ha7_response ; struct sockaddr_in from ; socklen_t fromlen = sizeof(struct sockaddr_in) ; int on = 1; if ( FILE_DESCRIPTOR_NOT_VALID(file_descriptor) ) { ERROR_DEBUG("Cannot get socket file descriptor for broadcast."); return 1; } // fcntl (file_descriptor, F_SETFD, FD_CLOEXEC); // for safe forking if (setsockopt(file_descriptor, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)) == -1) { ERROR_DEBUG("Cannot set socket option for broadcast."); return 1; } if (sendto(file_descriptor, "HA\000\001", 4, 0, now->ai_addr, now->ai_addrlen) != 4) { ERROR_CONNECT("Trouble sending broadcast message"); return 1; } /* now read */ if ( udp_read(file_descriptor, &ha7_response, sizeof(struct HA7_response), &tv, &from, &fromlen) != sizeof(struct HA7_response) ) { LEVEL_CONNECT("HA7 response bad length"); return 1; } if ( Test_HA7_response( &ha7_response ) != 0 ) { return 1 ; } UCLIBCLOCK ; snprintf(name,INET_ADDRSTRLEN+20,"%s:%d",inet_ntoa(from.sin_addr),ntohs(ha7_response.port)); UCLIBCUNLOCK ; return 0 ; } GOOD_OR_BAD FS_FindHA7(void) { struct addrinfo *ai; struct addrinfo hint; struct addrinfo *now; int number_found = 0; int getaddr_error ; LEVEL_DEBUG("Attempting udp multicast search for the HA7Net bus master at %s:%s",HA7_DISCOVERY_ADDRESS,HA7_DISCOVERY_PORT); Setup_HA7_hint( &hint ) ; if ((getaddr_error = getaddrinfo(HA7_DISCOVERY_ADDRESS, HA7_DISCOVERY_PORT, &hint, &ai))) { LEVEL_CONNECT("Couldn't set up HA7 broadcast message %s", gai_strerror(getaddr_error)); return gbBAD; } for (now = ai; now; now = now->ai_next) { ASCII name[INET_ADDRSTRLEN+20]; // tcp quad + port struct port_in * pin ; struct connection_in *in; if ( Get_HA7_response( now, name ) ) { continue ; } pin = NewPort(NO_CONNECTION) ; if (pin == NULL) { continue; } in = pin->first ; pin->type = ct_tcp ; pin->init_data = owstrdup(name); DEVICENAME(in) = owstrdup(name); pin->busmode = bus_ha7net; LEVEL_CONNECT("HA7Net bus master discovered at %s",DEVICENAME(in)); ++number_found ; } freeaddrinfo(ai); return number_found > 0 ? gbGOOD : gbBAD ; } owfs-3.1p5/module/owlib/src/c/ow_name.c0000644000175000001440000000356012654730021014724 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_devices.h" char *ePN_name[] = { "", "", "statistics", "system", "settings", "structure", "interface", 0, }; /* device display format */ void FS_devicename(char *buffer, const size_t length, const BYTE * sn, const struct parsedname *pn) { UCLIBCLOCK; switch (DeviceFormat(pn)) { case fi: snprintf(buffer, length, "%02X%02X%02X%02X%02X%02X%02X", sn[0], sn[1], sn[2], sn[3], sn[4], sn[5], sn[6]); break; case fdidc: snprintf(buffer, length, "%02X.%02X%02X%02X%02X%02X%02X.%02X", sn[0], sn[1], sn[2], sn[3], sn[4], sn[5], sn[6], sn[7]); break; case fdic: snprintf(buffer, length, "%02X.%02X%02X%02X%02X%02X%02X%02X", sn[0], sn[1], sn[2], sn[3], sn[4], sn[5], sn[6], sn[7]); break; case fidc: snprintf(buffer, length, "%02X%02X%02X%02X%02X%02X%02X.%02X", sn[0], sn[1], sn[2], sn[3], sn[4], sn[5], sn[6], sn[7]); break; case fic: snprintf(buffer, length, "%02X%02X%02X%02X%02X%02X%02X%02X", sn[0], sn[1], sn[2], sn[3], sn[4], sn[5], sn[6], sn[7]); break; case fdi: default: snprintf(buffer, length, "%02X.%02X%02X%02X%02X%02X%02X", sn[0], sn[1], sn[2], sn[3], sn[4], sn[5], sn[6]); break; } UCLIBCUNLOCK; } /* Return the last part of the file name specified by pn */ /* This can be a device, directory, subdiirectory, if property file */ /* Prints this directory element (not the whole path) */ /* Suggest that size = OW_FULLNAME_MAX */ const char *FS_DirName(const struct parsedname *pn) { char *slash; if (pn == NULL) { return ""; } slash = strrchr(pn->path, '/'); if (slash == NULL) { return ""; } return slash + 1; } owfs-3.1p5/module/owlib/src/c/ow_net_client.c0000644000175000001440000001075012654730021016127 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_net holds the network utility routines. Many stolen unashamedly from Steven's Book */ /* Much modification by Christian Magnusson especially for Valgrind and embedded */ /* non-threaded fixes by Jerry Scharf */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" GOOD_OR_BAD ClientAddr(char *sname, char * default_port, struct connection_in *in) { struct port_in * pin = in->pown ; struct addrinfo hint; struct address_pair ap ; int ret; LEVEL_DEBUG("Called with %s default=%s",SAFESTRING(sname),SAFESTRING(default_port)); Parse_Address( sname, &ap ) ; switch ( ap.entries ) { case 0: // Complete default address pin->dev.tcp.host = NULL; pin->dev.tcp.service = owstrdup(default_port); break ; case 1: // single entry -- usually port unless a dotted quad switch ( ap.first.type ) { case address_none: pin->dev.tcp.host = NULL; pin->dev.tcp.service = owstrdup(default_port); break ; case address_dottedquad: // looks like an IP address pin->dev.tcp.host = owstrdup(ap.first.alpha); pin->dev.tcp.service = owstrdup(default_port); break ; case address_numeric: pin->dev.tcp.host = NULL; pin->dev.tcp.service = owstrdup(ap.first.alpha); break ; default: // assume it's a port if it's the SERVER if ( strcasecmp( default_port, DEFAULT_SERVER_PORT ) == 0 ) { pin->dev.tcp.host = NULL; pin->dev.tcp.service = owstrdup(ap.first.alpha); } else { pin->dev.tcp.host = owstrdup(ap.first.alpha); pin->dev.tcp.service = owstrdup(default_port); } break ; } break ; case 2: default: // address:port format -- unambiguous pin->dev.tcp.host = ( ap.first.type == address_none ) ? NULL : owstrdup(ap.first.alpha) ; pin->dev.tcp.service = ( ap.second.type == address_none ) ? owstrdup(default_port) : owstrdup(ap.second.alpha) ; break ; } Free_Address( &ap ) ; memset(&hint, 0, sizeof(struct addrinfo)); // hint.ai_socktype = SOCK_STREAM | SOCK_CLOEXEC ; hint.ai_socktype = SOCK_STREAM ; #if OW_CYGWIN hint.ai_family = AF_INET; if( pin->dev.tcp.host == NULL) { /* getaddrinfo doesn't work with host=NULL for cygwin */ pin->dev.tcp.host = owstrdup("127.0.0.1"); } #else hint.ai_family = AF_UNSPEC; #endif LEVEL_DEBUG("Called with [%s] IP address=[%s] port=[%s]", SAFESTRING(sname),SAFESTRING( pin->dev.tcp.host), SAFESTRING(pin->dev.tcp.service) ); ret = getaddrinfo( pin->dev.tcp.host, pin->dev.tcp.service, &hint, &( pin->dev.tcp.ai) ) ; if ( ret != 0 ) { LEVEL_CONNECT("GETADDRINFO error %s", gai_strerror(ret)); return gbBAD; } return gbGOOD; } void FreeClientAddr(struct connection_in *in) { struct port_in * pin = in->pown ; SAFEFREE( pin->dev.tcp.host) ; SAFEFREE( pin->dev.tcp.service) ; if ( pin->dev.tcp.ai != NULL ) { freeaddrinfo( pin->dev.tcp.ai); pin->dev.tcp.ai = NULL; } pin->dev.tcp.ai_ok = NULL; } /* Usually called with BUS locked, to protect ai settings */ FILE_DESCRIPTOR_OR_ERROR ClientConnect(struct connection_in *in) { struct port_in * pin = in->pown ; FILE_DESCRIPTOR_OR_ERROR file_descriptor; struct addrinfo *ai; if ( pin->dev.tcp.ai == NULL) { LEVEL_DEBUG("Client address not yet parsed"); return FILE_DESCRIPTOR_BAD; } /* Can't change ai_ok without locking the in-device. * First try the last working address info, if it fails lock * the in-device and loop through the list until it works. * Not a perfect solution, but it should work at least. */ ai = pin->dev.tcp.ai_ok; if (ai) { file_descriptor = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if ( FILE_DESCRIPTOR_VALID(file_descriptor) ) { if (connect(file_descriptor, ai->ai_addr, ai->ai_addrlen) == 0) { return file_descriptor; } close(file_descriptor); } } ai = pin->dev.tcp.ai; // loop from first address info since it failed. do { file_descriptor = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if ( FILE_DESCRIPTOR_VALID(file_descriptor) ) { if (connect(file_descriptor, ai->ai_addr, ai->ai_addrlen) == 0) { pin->dev.tcp.ai_ok = ai; return file_descriptor; } close(file_descriptor); } } while ((ai = ai->ai_next)); pin->dev.tcp.ai_ok = NULL; ERROR_CONNECT("Socket problem"); STAT_ADD1(NET_connection_errors); return FILE_DESCRIPTOR_BAD; } owfs-3.1p5/module/owlib/src/c/ow_net_server.c0000644000175000001440000002663512711737666016210 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_net holds the network utility routines. Many stolen unashamedly from Steven's Book */ /* Much modification by Christian Magnusson especially for Valgrind and embedded */ /* non-threaded fixes by Jerry Scharf */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" /* Locking for thread work */ /* Variables only used in this particular file */ /* i.e. "locally global" */ my_rwlock_t shutdown_mutex_rw ; pthread_mutex_t handler_thread_mutex ; int handler_thread_count ; int shutdown_in_progress ; FILE_DESCRIPTOR_OR_ERROR shutdown_pipe[2] ; /* Prototypes */ static GOOD_OR_BAD ServerAddr(const char * default_port, struct connection_out *out); static GOOD_OR_BAD ServerListen(struct connection_out *out); static FILE_DESCRIPTOR_OR_ERROR SetupListenSet( fd_set * listenset ) ; static GOOD_OR_BAD SetupListenSockets( void (*HandlerRoutine) (FILE_DESCRIPTOR_OR_ERROR file_descriptor) ) ; static void CloseListenSockets( void ) ; static void ProcessListenSocket( struct connection_out * out ) ; static void *ProcessAcceptSocket(void *arg) ; static void ProcessListenSet( fd_set * listenset ) ; static GOOD_OR_BAD ListenCycle( void ) ; static GOOD_OR_BAD ServerAddr(const char * default_port, struct connection_out *out) { struct addrinfo hint; char *p; if (out->name == NULL) { // use defaults out->host = owstrdup("0.0.0.0"); out->service = owstrdup(default_port); } else if ((p = strrchr(out->name, ':')) == NULL) { if (strchr(out->name, '.')) { //probably an address out->host = owstrdup(out->name); out->service = owstrdup(default_port); } else { // assume a port out->host = owstrdup("0.0.0.0"); out->service = owstrdup(out->name); } } else { p[0] = '\0'; out->host = owstrdup(out->name); p[0] = ':'; out->service = owstrdup(&p[1]); } memset(&hint, 0, sizeof(struct addrinfo)); hint.ai_flags = AI_PASSIVE; // SOCK_CLOEXEC causes problems // hint.ai_socktype = SOCK_STREAM | SOCK_CLOEXEC ; hint.ai_socktype = SOCK_STREAM ; #if OW_CYGWIN || defined(__FreeBSD__) hint.ai_family = AF_INET; // FreeBSD will bind IP6 preferentially #else /* __FreeBSD__ */ hint.ai_family = AF_UNSPEC; #endif /* __FreeBSD__ */ LEVEL_DEBUG("ServerAddr: [%s] [%s]", SAFESTRING(out->host), SAFESTRING(out->service)); if ( getaddrinfo(out->host, out->service, &hint, &out->ai) != 0 ) { ERROR_CONNECT("GetAddrInfo error [%s]=%s:%s", SAFESTRING(out->name), SAFESTRING(out->host), SAFESTRING(out->service)); return gbBAD; } return gbGOOD; } /* for all connection_out * use ip and port to open a socket for listening * systemd and launchd already have the socket * so this routine is not called for them * (caught in ServerOutSetup) * */ static GOOD_OR_BAD ServerListen(struct connection_out *out) { if (out->ai == NULL) { LEVEL_CONNECT("Server address not yet parsed [%s]", SAFESTRING(out->name)); return gbBAD ; } if (out->ai_ok == NULL) { out->ai_ok = out->ai; } do { int on = 1; FILE_DESCRIPTOR_OR_ERROR file_descriptor = socket(out->ai_ok->ai_family, out->ai_ok->ai_socktype, out->ai_ok->ai_protocol); if ( FILE_DESCRIPTOR_NOT_VALID(file_descriptor) ) { ERROR_CONNECT("Socket problem [%s]", SAFESTRING(out->name)); } else if (setsockopt(file_descriptor, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof(on)) != 0) { ERROR_CONNECT("SetSockOpt problem [%s]", SAFESTRING(out->name)); } else if (bind(file_descriptor, out->ai_ok->ai_addr, out->ai_ok->ai_addrlen) != 0) { // this is where the default linking to a busy port shows up ERROR_CONNECT("Bind problem [%s]", SAFESTRING(out->name)); } else if (listen(file_descriptor, SOMAXCONN) != 0) { ERROR_CONNECT("Listen problem [%s]", SAFESTRING(out->name)); } else { // fcntl (file_descriptor, F_SETFD, FD_CLOEXEC); // for safe forking out->file_descriptor = file_descriptor; return gbGOOD; } Test_and_Close(&file_descriptor) ; } while ((out->ai_ok = out->ai_ok->ai_next)); LEVEL_CONNECT("No good listen network sockets [%s]", SAFESTRING(out->name)); return gbBAD; } GOOD_OR_BAD ServerOutSetup(struct connection_out *out) { switch ( out->inet_type ) { case inet_launchd: case inet_systemd: // file descriptor already set up return gbGOOD ; default: break ; } if ( out->name == NULL ) { // NULL name means default attempt char * default_port ; // First time through, try default port switch (Globals.program_type) { case program_type_server: case program_type_external: default_port = DEFAULT_SERVER_PORT ; break ; case program_type_ftpd: default_port = DEFAULT_FTP_PORT ; break ; default: default_port = NULL ; break ; } if ( default_port != NULL ) { // one of the 2 cases above RETURN_BAD_IF_BAD( ServerAddr( default_port, out ) ) ; if ( GOOD(ServerListen(out)) ) { return gbGOOD ; } ERROR_CONNECT("Default port not successful. Try an ephemeral port"); } } // second time through, use ephemeral port RETURN_BAD_IF_BAD( ServerAddr( "0", out ) ) ; return ServerListen(out) ; } /* MAke a set of the listening sockets to poll for a connection */ /* Done by looking though connect_out */ static FILE_DESCRIPTOR_OR_ERROR SetupListenSet( fd_set * listenset ) { FILE_DESCRIPTOR_OR_ERROR maxfd = FILE_DESCRIPTOR_BAD ; struct connection_out * out ; FD_ZERO( listenset ) ; for (out = Outbound_Control.head; out; out = out->next) { FILE_DESCRIPTOR_OR_ERROR fd = out->file_descriptor ; if ( FILE_DESCRIPTOR_VALID( fd ) ) { FD_SET( fd, listenset ) ; if ( fd > maxfd ) { maxfd = fd ; } } } return maxfd ; } static GOOD_OR_BAD SetupListenSockets( void (*HandlerRoutine) (FILE_DESCRIPTOR_OR_ERROR file_descriptor) ) { struct connection_out * out ; GOOD_OR_BAD any_sockets = gbBAD ; for (out = Outbound_Control.head; out; out = out->next) { if ( GOOD( ServerOutSetup( out ) ) ) { any_sockets = gbGOOD; ZeroConf_Announce(out); } out-> HandlerRoutine = HandlerRoutine ; } return any_sockets ; } /* close all connection_out listen sockets */ static void CloseListenSockets( void ) { struct connection_out * out ; for (out = Outbound_Control.head; out; out = out->next) { Test_and_Close( &(out->file_descriptor) ) ; } } /* Go through list set to find requesting sockets */ static void ProcessListenSet( fd_set * listenset ) { struct connection_out * out ; for (out = Outbound_Control.head; out; out = out->next) { if ( FD_ISSET( out->file_descriptor, listenset ) ) { ProcessListenSocket( out ) ; } } } /* structure */ struct Accept_Socket_Data { FILE_DESCRIPTOR_OR_ERROR acceptfd; struct connection_out * out; }; /* Wait for a connection * process it * Expects to be called in a loop */ static GOOD_OR_BAD ListenCycle( void ) { fd_set listenset ; FILE_DESCRIPTOR_OR_ERROR maxfd = SetupListenSet( &listenset) ; if ( FILE_DESCRIPTOR_VALID( maxfd ) ) { if ( select( maxfd+1, &listenset, NULL, NULL, NULL) > 0 ) { ProcessListenSet( &listenset) ; return gbGOOD ; } } return gbBAD ; } // Read data from the waiting socket and do the actual work static void *ProcessAcceptSocket(void *arg) { struct Accept_Socket_Data * asd = (struct Accept_Socket_Data *) arg; DETACH_THREAD; // Do the actual work asd->out->HandlerRoutine( asd->acceptfd ); // cleanup Test_and_Close( &(asd->acceptfd) ); owfree(asd); LEVEL_DEBUG("Normal completion."); // All done. If shutdown in progress and this is a last handler thread, send a message to the main thread. RWLOCK_RLOCK( shutdown_mutex_rw ) ; _MUTEX_LOCK( handler_thread_mutex ) ; --handler_thread_count ; if ( shutdown_in_progress && handler_thread_count==0) { if ( FILE_DESCRIPTOR_VALID( shutdown_pipe[fd_pipe_write] ) ) { ignore_result = write( shutdown_pipe[fd_pipe_write],"X",1) ; //dummy payload } } _MUTEX_UNLOCK( handler_thread_mutex ) ; RWLOCK_RUNLOCK( shutdown_mutex_rw ) ; return VOID_RETURN; } static void ProcessListenSocket( struct connection_out * out ) { FILE_DESCRIPTOR_OR_ERROR acceptfd; struct Accept_Socket_Data * asd ; acceptfd = accept(out->file_descriptor, NULL, NULL); if ( FILE_DESCRIPTOR_NOT_VALID( acceptfd ) ) { return ; } // allocate space to pass variables to thread // MUST be cleaned up in thread handler, not in this routine asd = owmalloc( sizeof(struct Accept_Socket_Data) ) ; if ( asd == NULL ) { LEVEL_DEBUG("Could not allocate memory to handle this request"); close( acceptfd ) ; return ; } asd->acceptfd = acceptfd ; asd->out = out ; // Launch Handler thread only if shutdown not in progress RWLOCK_RLOCK( shutdown_mutex_rw ) ; if ( ! shutdown_in_progress ) { pthread_t tid; _MUTEX_LOCK( handler_thread_mutex ) ; ++handler_thread_count ; _MUTEX_UNLOCK( handler_thread_mutex ) ; if ( pthread_create(&tid, DEFAULT_THREAD_ATTR, ProcessAcceptSocket, asd ) != 0 ) { // Do it in the main routine rather than a thread LEVEL_DEBUG("Thread creation problem. Will handle request unthreaded"); ProcessAcceptSocket(asd) ; } } RWLOCK_RUNLOCK( shutdown_mutex_rw ) ; // asd does not leak; it is passed to ProcessAcceptSocket in another thread. } /* Setup Servers -- select on each port */ /* Not only sets up, we start a loop for new connections and processes them, * basically, this is the main loop of the owserver and owhttpd program * */ void ServerProcess(void (*HandlerRoutine) (FILE_DESCRIPTOR_OR_ERROR file_descriptor)) { /* Locking for thread work */ int need_to_read_pipe ; handler_thread_count = 0 ; shutdown_in_progress = 0 ; Init_Pipe( shutdown_pipe ) ; RWLOCK_INIT( shutdown_mutex_rw ) ; _MUTEX_INIT(handler_thread_mutex); if ( pipe( shutdown_pipe ) != 0 ) { ERROR_DEFAULT("Cannot allocate a shutdown pipe. The program shutdown may be messy"); Init_Pipe( shutdown_pipe ) ; } if ( GOOD( SetupListenSockets( HandlerRoutine ) ) ) { Announce_Systemd() ; // systemd mode -- ready for business while ( GOOD( ListenCycle() ) ) { } // Make sure all the handler threads are complete before closing down RWLOCK_WLOCK( shutdown_mutex_rw ) ; shutdown_in_progress = 1 ; // Signal time to wrap up // need to test if there is a handler to wait for before closing // note that a new one can't be started while the write lock is held need_to_read_pipe = handler_thread_count>0 && FILE_DESCRIPTOR_VALID( shutdown_pipe[fd_pipe_read] ) ; RWLOCK_WUNLOCK( shutdown_mutex_rw ) ; if ( need_to_read_pipe ) { // now wait for write to pipe from last handler thread char buf[2] ; ignore_result = read( shutdown_pipe[fd_pipe_read],buf,1) ; } Test_and_Close_Pipe(shutdown_pipe) ; RWLOCK_DESTROY(shutdown_mutex_rw) ; _MUTEX_DESTROY(handler_thread_mutex) ; CloseListenSockets() ; } else { LEVEL_DEFAULT("Isolated from any control -- exit") ; } /* Cleanup that may never be reached */ return; } /* Call from elseware * specifically the configuration monitoring code * to stop the loops * */ void InterruptListening( void ) { // Launch Handler thread only if shutdown not in progress LEVEL_DEBUG("Stop listening process") ; RWLOCK_WLOCK( shutdown_mutex_rw ) ; shutdown_in_progress = 1 ; RWLOCK_WUNLOCK( shutdown_mutex_rw ) ; LEVEL_DEBUG("Listening loop stopped") ; // this means no processing is going on // and no more calls to connection_out structures // so can close those file descriptors bore exit or restart } owfs-3.1p5/module/owlib/src/c/ow_offset.c0000644000175000001440000000351312654730021015270 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow.h" /* Offset manipulation * Performs a shift of the offset to do an operation, * then returns the offset to the initial value. * The reason is that some reads or writes are done in another place in memory, * but OWQ_parse_output checks the file size against the original property constraints. */ ZERO_OR_ERROR COMMON_offset_process( ZERO_OR_ERROR (*func) (struct one_wire_query *), struct one_wire_query * owq, off_t shift_offset) { ZERO_OR_ERROR func_return_value ; OWQ_offset(owq) += shift_offset ; func_return_value = func(owq) ; OWQ_offset(owq) -= shift_offset ; return func_return_value ; } owfs-3.1p5/module/owlib/src/c/ow_opt.c0000644000175000001440000010064712654730021014612 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_opt -- owlib specific command line options processing */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_pid.h" #include "ow_external.h" struct lineparse { char * line; size_t line_length ; const ASCII *file; ASCII *prog; ASCII *opt; ASCII *val; int reverse_prog; int c; int line_number; }; static void ParseTheLine(struct lineparse *lp); static GOOD_OR_BAD ConfigurationFile(const ASCII * file); static int ParseInterp(struct lineparse *lp); static GOOD_OR_BAD OW_parsevalue_I(long long int *var, const ASCII * str); static GOOD_OR_BAD OW_parsevalue_F(_FLOAT *var, const ASCII * str); #define NO_LINKED_VAR NULL const struct option owopts_long[] = { {"alias", required_argument, NO_LINKED_VAR, 'a'}, {"aliases", required_argument, NO_LINKED_VAR, 'a'}, {"aliasfile", required_argument, NO_LINKED_VAR, 'a'}, {"configuration", required_argument, NO_LINKED_VAR, 'c'}, {"config", required_argument, NO_LINKED_VAR, 'c'}, {"conf", required_argument, NO_LINKED_VAR, 'c'}, {"device", required_argument, NO_LINKED_VAR, 'd'}, {"usb", optional_argument, NO_LINKED_VAR, 'u'}, {"USB", optional_argument, NO_LINKED_VAR, 'u'}, {"help", optional_argument, NO_LINKED_VAR, 'h'}, {"port", required_argument, NO_LINKED_VAR, 'p'}, {"mountpoint", required_argument, NO_LINKED_VAR, 'm'}, {"server", required_argument, NO_LINKED_VAR, 's'}, {"readonly", no_argument, NO_LINKED_VAR, 'r'}, {"safemode", no_argument, NO_LINKED_VAR, e_safemode}, {"safe_mode", no_argument, NO_LINKED_VAR, e_safemode}, {"safe", no_argument, NO_LINKED_VAR, e_safemode}, {"write", no_argument, NO_LINKED_VAR, 'w'}, {"Celsius", no_argument, NO_LINKED_VAR, 'C'}, {"celsius", no_argument, NO_LINKED_VAR, 'C'}, {"Fahrenheit", no_argument, NO_LINKED_VAR, 'F'}, {"fahrenheit", no_argument, NO_LINKED_VAR, 'F'}, {"Kelvin", no_argument, NO_LINKED_VAR, 'K'}, {"kelvin", no_argument, NO_LINKED_VAR, 'K'}, {"Rankine", no_argument, NO_LINKED_VAR, 'R'}, {"rankine", no_argument, NO_LINKED_VAR, 'R'}, {"mbar", no_argument, NO_LINKED_VAR, e_pressure_mbar}, {"millibar", no_argument, NO_LINKED_VAR, e_pressure_mbar}, {"mBar", no_argument, NO_LINKED_VAR, e_pressure_mbar}, {"atm", no_argument, NO_LINKED_VAR, e_pressure_atm}, {"mmhg", no_argument, NO_LINKED_VAR, e_pressure_mmhg}, {"mmHg", no_argument, NO_LINKED_VAR, e_pressure_mmhg}, {"torr", no_argument, NO_LINKED_VAR, e_pressure_mmhg}, {"inhg", no_argument, NO_LINKED_VAR, e_pressure_inhg}, {"inHg", no_argument, NO_LINKED_VAR, e_pressure_inhg}, {"psi", no_argument, NO_LINKED_VAR, e_pressure_psi}, {"psia", no_argument, NO_LINKED_VAR, e_pressure_psi}, {"psig", no_argument, NO_LINKED_VAR, e_pressure_psi}, {"Pa", no_argument, NO_LINKED_VAR, e_pressure_Pa}, {"pa", no_argument, NO_LINKED_VAR, e_pressure_Pa}, {"pascal", no_argument, NO_LINKED_VAR, e_pressure_Pa}, {"version", no_argument, NO_LINKED_VAR, 'V'}, {"format", required_argument, NO_LINKED_VAR, 'f'}, {"pid_file", required_argument, NO_LINKED_VAR, 'P'}, {"pid-file", required_argument, NO_LINKED_VAR, 'P'}, {"unaliased", no_argument, &Globals.unaliased, 1 }, {"aliased", no_argument, &Globals.unaliased, 0 }, {"uncached", no_argument, &Globals.uncached, 1 }, {"cached", no_argument, &Globals.uncached, 0 }, {"external", no_argument, &Globals.allow_external, 1}, {"no_external", no_argument, &Globals.allow_external, 0}, {"background", no_argument, NO_LINKED_VAR, e_want_background}, {"foreground", no_argument, NO_LINKED_VAR, e_want_foreground}, {"fatal_debug", no_argument, &Globals.fatal_debug, 1}, {"fatal-debug", no_argument, &Globals.fatal_debug, 1}, {"nofatal_debug", no_argument, &Globals.fatal_debug, 0}, {"nofatal-debug", no_argument, &Globals.fatal_debug, 0}, {"fatal_debug_file", required_argument, NO_LINKED_VAR, e_fatal_debug_file}, {"fatal-debug-file", required_argument, NO_LINKED_VAR, e_fatal_debug_file}, {"error_print", required_argument, NO_LINKED_VAR, e_error_print}, {"error-print", required_argument, NO_LINKED_VAR, e_error_print}, {"errorprint", required_argument, NO_LINKED_VAR, e_error_print}, {"error_level", required_argument, NO_LINKED_VAR, e_error_level}, {"error-level", required_argument, NO_LINKED_VAR, e_error_level}, {"errorlevel", required_argument, NO_LINKED_VAR, e_error_level}, {"debug", no_argument, NO_LINKED_VAR, e_debug}, {"cache_size", required_argument, NO_LINKED_VAR, e_cache_size}, /* max cache size */ {"cache-size", required_argument, NO_LINKED_VAR, e_cache_size}, /* max cache size */ {"cachesize", required_argument, NO_LINKED_VAR, e_cache_size}, /* max cache size */ {"fuse_opt", required_argument, NO_LINKED_VAR, e_fuse_opt}, /* owfs, fuse mount option */ {"fuse-opt", required_argument, NO_LINKED_VAR, e_fuse_opt}, /* owfs, fuse mount option */ {"fuseopt", required_argument, NO_LINKED_VAR, e_fuse_opt}, /* owfs, fuse mount option */ {"fuse_open_opt", required_argument, NO_LINKED_VAR, e_fuse_open_opt}, /* owfs, fuse open option */ {"fuse-open-opt", required_argument, NO_LINKED_VAR, e_fuse_open_opt}, /* owfs, fuse open option */ {"fuseopenopt", required_argument, NO_LINKED_VAR, e_fuse_open_opt}, /* owfs, fuse open option */ {"max_clients", required_argument, NO_LINKED_VAR, e_max_clients}, /* ftp max connections */ {"max-clients", required_argument, NO_LINKED_VAR, e_max_clients}, /* ftp max connections */ {"maxclients", required_argument, NO_LINKED_VAR, e_max_clients}, /* ftp max connections */ {"passive", required_argument, NO_LINKED_VAR, e_passive}, /* DS9097 passive */ {"PASSIVE", required_argument, NO_LINKED_VAR, e_passive}, /* DS9097 passive */ {"ds1wm", required_argument, NO_LINKED_VAR, e_ds1wm}, /* DS1WM synthesizable adapters */ {"DS1WM", required_argument, NO_LINKED_VAR, e_ds1wm}, /* DS1WM synthesizable adapters */ {"k1wm", required_argument, NO_LINKED_VAR, e_k1wm}, /* DS1WM synthesizable adapters */ {"K1WM", required_argument, NO_LINKED_VAR, e_k1wm}, /* DS1WM synthesizable adapters */ {"i2c", optional_argument, NO_LINKED_VAR, e_i2c}, /* i2c adapters */ {"I2C", optional_argument, NO_LINKED_VAR, e_i2c}, /* i2c adapters */ {"HA7", optional_argument, NO_LINKED_VAR, e_ha7}, /* HA7Net */ {"ha7", optional_argument, NO_LINKED_VAR, e_ha7}, /* HA7Net */ {"HA7NET", optional_argument, NO_LINKED_VAR, e_ha7}, {"HA7Net", optional_argument, NO_LINKED_VAR, e_ha7}, {"ha7net", optional_argument, NO_LINKED_VAR, e_ha7}, {"enet", optional_argument, NO_LINKED_VAR, e_enet}, {"Enet", optional_argument, NO_LINKED_VAR, e_enet}, {"ENET", optional_argument, NO_LINKED_VAR, e_enet}, {"OW-Server-Enet", optional_argument, NO_LINKED_VAR, e_enet}, {"FAKE", required_argument, NO_LINKED_VAR, e_fake}, /* Fake */ {"Fake", required_argument, NO_LINKED_VAR, e_fake}, /* Fake */ {"fake", required_argument, NO_LINKED_VAR, e_fake}, /* Fake */ {"link", required_argument, NO_LINKED_VAR, e_link}, /* link in ascii mode */ {"LINK", required_argument, NO_LINKED_VAR, e_link}, /* link in ascii mode */ {"PBM", required_argument, NO_LINKED_VAR, e_pbm}, /* Dirk Opfer's elabnet "power bus master" */ {"pbm", required_argument, NO_LINKED_VAR, e_pbm}, /* Dirk Opfer's elabnet "power bus master" */ {"HA3", required_argument, NO_LINKED_VAR, e_ha3}, {"ha3", required_argument, NO_LINKED_VAR, e_ha3}, {"HA4B", required_argument, NO_LINKED_VAR, e_ha4b}, {"HA4b", required_argument, NO_LINKED_VAR, e_ha4b}, {"ha4b", required_argument, NO_LINKED_VAR, e_ha4b}, {"HA5", required_argument, NO_LINKED_VAR, e_ha5}, {"ha5", required_argument, NO_LINKED_VAR, e_ha5}, {"ha7e", required_argument, NO_LINKED_VAR, e_ha7e}, {"HA7e", required_argument, NO_LINKED_VAR, e_ha7e}, {"HA7E", required_argument, NO_LINKED_VAR, e_ha7e}, {"ha7s", required_argument, NO_LINKED_VAR, e_ha7e}, {"HA7s", required_argument, NO_LINKED_VAR, e_ha7e}, {"HA7S", required_argument, NO_LINKED_VAR, e_ha7e}, {"xport", required_argument, NO_LINKED_VAR, e_xport, }, {"telnet", required_argument, NO_LINKED_VAR, e_xport, }, {"TELNET", required_argument, NO_LINKED_VAR, e_xport, }, {"Xport", required_argument, NO_LINKED_VAR, e_xport, }, {"XPort", required_argument, NO_LINKED_VAR, e_xport, }, {"XPORT", required_argument, NO_LINKED_VAR, e_xport, }, {"telnet", required_argument, NO_LINKED_VAR, e_xport, }, {"TESTER", required_argument, NO_LINKED_VAR, e_tester}, /* Tester */ {"Tester", required_argument, NO_LINKED_VAR, e_tester}, /* Tester */ {"tester", required_argument, NO_LINKED_VAR, e_tester}, /* Tester */ {"mock", required_argument, NO_LINKED_VAR, e_mock}, /* Mock */ {"Mock", required_argument, NO_LINKED_VAR, e_mock}, /* Mock */ {"MOCK", required_argument, NO_LINKED_VAR, e_mock}, /* Mock */ {"etherweather", required_argument, NO_LINKED_VAR, e_etherweather}, /* EtherWeather */ {"EtherWeather", required_argument, NO_LINKED_VAR, e_etherweather}, /* EtherWeather */ {"zero", no_argument, &Globals.announce_off, 0}, {"nozero", no_argument, &Globals.announce_off, 1}, {"autoserver", no_argument, NO_LINKED_VAR, e_browse}, {"auto", no_argument, NO_LINKED_VAR, e_browse}, {"AUTO", no_argument, NO_LINKED_VAR, e_browse}, {"browse", no_argument, NO_LINKED_VAR, e_browse}, {"w1", no_argument, NO_LINKED_VAR, e_w1_monitor}, {"W1", no_argument, NO_LINKED_VAR, e_w1_monitor}, {"masterhub", required_argument, NO_LINKED_VAR, e_masterhub}, {"Masterhub", required_argument, NO_LINKED_VAR, e_masterhub}, {"MasterHub", required_argument, NO_LINKED_VAR, e_masterhub}, {"MASTERHUB", required_argument, NO_LINKED_VAR, e_masterhub}, {"announce", required_argument, NO_LINKED_VAR, e_announce}, {"allow_other", no_argument, &Globals.allow_other, 1}, {"altUSB", no_argument, &Globals.altUSB, 1}, /* Willy Robison's tweaks */ {"altusb", no_argument, &Globals.altUSB, 1}, /* Willy Robison's tweaks */ {"usb_flextime", no_argument, &Globals.usb_flextime, 1}, {"USB_flextime", no_argument, &Globals.usb_flextime, 1}, {"usb_regulartime", no_argument, &Globals.usb_flextime, 0}, {"USB_regulartime", no_argument, &Globals.usb_flextime, 0}, {"serial_flex", no_argument, &Globals.serial_flextime, 1}, {"serial_flextime", no_argument, &Globals.serial_flextime, 1}, {"serial_regulartime", no_argument, &Globals.serial_flextime, 0}, {"serial_regular", no_argument, &Globals.serial_flextime, 0}, { "no_hard", no_argument, &Globals.serial_hardflow, 0 }, // hardware flow control { "flow_none", no_argument, &Globals.serial_hardflow, 0 }, // hardware flow control { "no_hardflow", no_argument, &Globals.serial_hardflow, 0 }, // hardware flow control { "hard", no_argument, &Globals.serial_hardflow, 1 }, // hardware flow control { "hardware", no_argument, &Globals.serial_hardflow, 1 }, // hardware flow control { "hardflow", no_argument, &Globals.serial_hardflow, 1 }, // hardware flow control {"serial_standardtime", no_argument, &Globals.serial_flextime, 0}, {"serial_standard", no_argument, &Globals.serial_flextime, 0}, {"serial_stdtime", no_argument, &Globals.serial_flextime, 0}, {"serial_std", no_argument, &Globals.serial_flextime, 0}, {"reverse", no_argument, &Globals.serial_reverse, 1}, {"reverse_polarity", no_argument, &Globals.serial_reverse, 1}, {"straight_polarity", no_argument, &Globals.serial_reverse, 0}, {"baud_rate", required_argument, NO_LINKED_VAR, e_baud}, {"baud", required_argument, NO_LINKED_VAR, e_baud}, {"Baud", required_argument, NO_LINKED_VAR, e_baud}, {"BAUD", required_argument, NO_LINKED_VAR, e_baud}, {"timeout_volatile", required_argument, NO_LINKED_VAR, e_timeout_volatile,}, // timeout -- changing cached values {"timeout_stable", required_argument, NO_LINKED_VAR, e_timeout_stable,}, // timeout -- unchanging cached values {"timeout_directory", required_argument, NO_LINKED_VAR, e_timeout_directory,}, // timeout -- direcory cached values {"timeout_presence", required_argument, NO_LINKED_VAR, e_timeout_presence,}, // timeout -- device location {"timeout_serial", required_argument, NO_LINKED_VAR, e_timeout_serial,}, // timeout -- serial wait (read and write) {"timeout_usb", required_argument, NO_LINKED_VAR, e_timeout_usb,}, // timeout -- usb wait {"timeout_network", required_argument, NO_LINKED_VAR, e_timeout_network,}, // timeout -- tcp wait {"timeout_server", required_argument, NO_LINKED_VAR, e_timeout_server,}, // timeout -- server wait {"timeout_ftp", required_argument, NO_LINKED_VAR, e_timeout_ftp,}, // timeout -- ftp wait {"timeout_HA7", required_argument, NO_LINKED_VAR, e_timeout_ha7,}, // timeout -- HA7Net wait {"timeout_ha7", required_argument, NO_LINKED_VAR, e_timeout_ha7,}, // timeout -- HA7Net wait {"timeout_HA7Net", required_argument, NO_LINKED_VAR, e_timeout_ha7,}, // timeout -- HA7Net wait {"timeout_ha7net", required_argument, NO_LINKED_VAR, e_timeout_ha7,}, // timeout -- HA7Net wait {"timeout_w1", required_argument, NO_LINKED_VAR, e_timeout_w1,}, // timeout -- w1 netlink {"timeout_W1", required_argument, NO_LINKED_VAR, e_timeout_w1,}, // timeout -- w1 netlink {"timeout_persistent_low", required_argument, NO_LINKED_VAR, e_timeout_persistent_low,}, {"timeout_persistent_high", required_argument, NO_LINKED_VAR, e_timeout_persistent_high,}, {"clients_persistent_low", required_argument, NO_LINKED_VAR, e_clients_persistent_low,}, {"clients_persistent_high", required_argument, NO_LINKED_VAR, e_clients_persistent_high,}, {"temperature_low", required_argument, NO_LINKED_VAR, e_templow,}, {"low_temperature", required_argument, NO_LINKED_VAR, e_templow,}, {"templow", required_argument, NO_LINKED_VAR, e_templow,}, {"temperature_high", required_argument, NO_LINKED_VAR, e_temphigh,}, {"high_temperature", required_argument, NO_LINKED_VAR, e_temphigh,}, {"temphigh", required_argument, NO_LINKED_VAR, e_temphigh,}, {"temperature_hi", required_argument, NO_LINKED_VAR, e_temphigh,}, {"hi_temperature", required_argument, NO_LINKED_VAR, e_temphigh,}, {"temphi", required_argument, NO_LINKED_VAR, e_temphigh,}, {"one_device", no_argument, &Globals.one_device, 1}, {"1_device", no_argument, &Globals.one_device, 1}, {"pingcrazy", no_argument, &Globals.pingcrazy, 1}, {"no_dirall", no_argument, &Globals.no_dirall, 1}, {"no_get", no_argument, &Globals.no_get, 1}, {"no_persistence", no_argument, &Globals.no_persistence, 1}, {"8bit", no_argument, &Globals.eightbit_serial, 1}, {"6bit", no_argument, &Globals.eightbit_serial, 0}, {"ActivePullUp", no_argument, &Globals.i2c_APU, 1}, {"activepullup", no_argument, &Globals.i2c_APU, 1}, {"APU", no_argument, &Globals.i2c_APU, 1}, {"apu", no_argument, &Globals.i2c_APU, 1}, {"no_ActivePullUp", no_argument, &Globals.i2c_APU, 0}, {"no_activepullup", no_argument, &Globals.i2c_APU, 0}, {"no_APU", no_argument, &Globals.i2c_APU, 0}, {"no_apu", no_argument, &Globals.i2c_APU, 0}, {"PresencePulseMasking", no_argument, &Globals.i2c_PPM, 1}, {"presencepulsemasking", no_argument, &Globals.i2c_PPM, 1}, {"PPM", no_argument, &Globals.i2c_PPM, 1}, {"ppm", no_argument, &Globals.i2c_PPM, 1}, {"no_PresencePulseMasking", no_argument, &Globals.i2c_PPM, 0}, {"no_presencepulsemasking", no_argument, &Globals.i2c_PPM, 0}, {"no_PPM", no_argument, &Globals.i2c_PPM, 0}, {"no_ppm", no_argument, &Globals.i2c_PPM, 0}, {"trim", no_argument, &Globals.trim, 1}, {"TRIM", no_argument, &Globals.trim, 1}, {"detail", required_argument, NO_LINKED_VAR, e_detail}, /* slave detail */ {"details", required_argument, NO_LINKED_VAR, e_detail}, /* slave detail */ {"traffic", no_argument, &Globals.traffic, 1}, {"notraffic", no_argument, &Globals.traffic, 0}, {"no_traffic", no_argument, &Globals.traffic, 0}, {"locks", no_argument, &Globals.locks, 1}, {"nolocks", no_argument, &Globals.locks, 0}, {"no_locks", no_argument, &Globals.locks, 0}, {0, 0, 0, 0}, }; // Called after "ParseTheLine" has filled the lineparse structure static int ParseInterp(struct lineparse *lp) { size_t option_name_length; const struct option *long_option_pointer; LEVEL_DEBUG("Configuration file (%s:%d) Program=%s%s, Option=%s, Value=%s", SAFESTRING(lp->file), lp->line_number, lp->reverse_prog ? "Not " : "", SAFESTRING(lp->prog), SAFESTRING(lp->opt), SAFESTRING(lp->val)); // Check for program specification if (lp->prog != NULL) { // lp-> prog already in lower case if (strstr(lp->prog, "server") != NULL) { if ((Globals.program_type == program_type_server) == lp->reverse_prog) { return 0; // ignore this line -- doesn't apply } } else if (strstr(lp->prog, "external") != NULL) { if ((Globals.program_type == program_type_external) == lp->reverse_prog) { return 0; // ignore this line -- doesn't apply } } else if (strstr(lp->prog, "http") != NULL) { if ((Globals.program_type == program_type_httpd) == lp->reverse_prog) { return 0; // ignore this line -- doesn't apply } } else if (strstr(lp->prog, "ftp") != NULL) { if ((Globals.program_type == program_type_ftpd) == lp->reverse_prog) { return 0; // ignore this line -- doesn't apply } } else if (strstr(lp->prog, "fs") != NULL) { if ((Globals.program_type == program_type_filesystem) == lp->reverse_prog) { return 0; // ignore this line -- doesn't apply } } else { LEVEL_DEFAULT("Configuration file (%s:%d) Unrecognized program %s. Option=%s, Value=%s", SAFESTRING(lp->file), lp->line_number, SAFESTRING(lp->prog), SAFESTRING(lp->opt), SAFESTRING(lp->val)); return 0; } } // empty option field -- probably comment or blank line if (lp->opt == NULL) { return 0; } option_name_length = strlen(lp->opt); // single character option if (option_name_length == 1) { return lp->opt[0]; } // long option -- search in owopts_long array for (long_option_pointer = owopts_long; long_option_pointer->name != NULL; ++long_option_pointer) { if (strncasecmp(lp->opt, long_option_pointer->name, option_name_length) == 0) { LEVEL_DEBUG("Configuration file (%s:%d) Option %s recognized as %s. Value=%s", SAFESTRING(lp->file), lp->line_number, lp->opt, long_option_pointer->name, SAFESTRING(lp->val)); if (long_option_pointer->flag != NULL) { // immediate value mode //printf("flag c=%d flag=%p long_option_pointer->flag=%p\n",c,flag,long_option_pointer->flag); (long_option_pointer->flag)[0] = long_option_pointer->val; return 0; } else { return long_option_pointer->val; } } } LEVEL_DEFAULT("Configuration file (%s:%d) Unrecognized option %s. Value=%s", SAFESTRING(lp->file), lp->line_number, SAFESTRING(lp->opt), SAFESTRING(lp->val)); return 0; } // Parse the configuration file line // Basically look for lines of form opt=val // optional white space // optional '=' // optional val // Comment with # // set opt and val as pointers into line (or NULL if not there) // set NULL char at end of opt and val static void ParseTheLine(struct lineparse *lp) { ASCII *current_char; // state machine -- pretty self-explanatory. // note that there is no program state, it is only deduced post-facto when a colon is seen. enum e_parse_state { ps_pre_opt, ps_in_opt, ps_pre_equals, ps_pre_value, ps_in_value } parse_state = ps_pre_opt; lp->prog = NULL; lp->opt = NULL; lp->val = NULL; lp->reverse_prog = 0; // plod through the line, char by char for (current_char = lp->line; *current_char; ++current_char) { // change states on special chars switch (*current_char) { // end of line characters case '#': case '\n': case '\r': *current_char = '\0'; return; // whitespace characters case ' ': case '\t': switch (parse_state) { case ps_in_opt: *current_char = '\0'; parse_state = ps_pre_equals; break; case ps_in_value: *current_char = '\0'; return; default: break; } break; // dashes before options ignored (only needed in real command line) case '-': switch (parse_state) { case ps_pre_value: // not ignored before values, of course lp->val = current_char; parse_state = ps_in_value; break; default: break; } break; // negate program state (even though program not yet assigned) case '!': switch (parse_state) { case ps_pre_opt: lp->reverse_prog = !lp->reverse_prog; break; case ps_pre_value: // not ignored before values, of course lp->val = current_char; parse_state = ps_in_value; break; default: break; } break; // colon special case -- assigns to a program // Since we had assumed this was an opt, we have to adjust case ':': switch (parse_state) { case ps_in_opt: case ps_pre_equals: *current_char = '\0'; lp->prog = lp->opt; lp->opt = NULL; { // put in lower case ASCII *prog_char; for (prog_char = lp->prog; *prog_char; ++prog_char) { *prog_char = tolower( (int) prog_char[0] ); } } // special cases for sensor and property lines // they use a different syntax if (strstr(lp->prog, "sensor") != NULL) { // sensor line for external device LEVEL_DEBUG("SENSOR entry found <%s>", current_char+1); lp->prog = NULL ; AddSensor(current_char+1) ; return ; } else if (strstr(lp->prog, "script") != NULL) { // property line for external device LEVEL_DEBUG("SCRIPT entry found <%s>", current_char+1); lp->prog = NULL ; AddProperty(current_char+1,et_script) ; return ; } else if (strstr(lp->prog, "property") != NULL) { // property line for external device LEVEL_DEBUG("PROPERTY (SCRIPT) entry found <%s>", current_char+1); lp->prog = NULL ; AddProperty(current_char+1,et_script) ; return ; } parse_state = ps_pre_opt; break; case ps_pre_value: // not ignored before values, of course lp->val = current_char; parse_state = ps_in_value; break; default: break; } break; // equals special case: jump state case '=': switch (parse_state) { case ps_in_opt: // parse_state = ps_pre_equals; // fall through intentionally case ps_pre_equals: *current_char = '\0'; parse_state = ps_pre_value; break; case ps_in_value: break; default: // rogue '=' *current_char = '\0'; return; } break; // real character, start or continue parameter, jump past "=" default: switch (parse_state) { case ps_pre_opt: lp->opt = current_char; parse_state = ps_in_opt; break; case ps_pre_equals: case ps_pre_value: lp->val = current_char; parse_state = ps_in_value; break; default: break; } break; } } } static GOOD_OR_BAD ConfigurationFile(const ASCII * file) { FILE *configuration_file_pointer = fopen(file, "r"); if (configuration_file_pointer) { int ret = gbGOOD; struct lineparse lp; lp.line_number = 0; lp.file = file; lp.line = NULL ; // setup for getline while (getline(&(lp.line), &(lp.line_length), configuration_file_pointer)>=0) { ++lp.line_number; ParseTheLine(&lp); if ( BAD( owopt(ParseInterp(&lp), lp.val) ) ) { ret = gbBAD ; break ; } } fclose(configuration_file_pointer); if ( lp.line != NULL) { free(lp.line) ; // not owfree } return ret; } else { ERROR_DEFAULT("Cannot process configuration file %s", file); return gbBAD; } } GOOD_OR_BAD owopt_packed(const char *params) { char *params_copy; // copy of the input line char *current_location_in_params_copy; // pointers into the input line copy char *next_location_in_params_copy; // pointers into the input line copy char **argv = NULL; int argc = 0; GOOD_OR_BAD ret = 0; int allocated = 0; int option_char; if (params == NULL) { return gbGOOD; } current_location_in_params_copy = params_copy = owstrdup(params); if (params_copy == NULL) { return gbBAD; } // Stuffs arbitrary first value since argv[0] ignored by getopt // create a synthetic argv/argc for get_opt for (next_location_in_params_copy = "X"; next_location_in_params_copy != NULL; next_location_in_params_copy = strsep(¤t_location_in_params_copy, " ")) { // make room if (argc >= allocated - 1) { char **larger_argv = owrealloc(argv, (allocated + 10) * sizeof(char *)); if (larger_argv != NULL) { allocated += 10; argv = larger_argv; } else { ret = gbBAD; break; } } argv[argc] = next_location_in_params_copy; ++argc; argv[argc] = NULL; } // analyze argv/argc as if real command line arguments ArgCopy( argc, argv ) ; while (ret == 0) { if ((option_char = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL)) == -1) { break; } ret = owopt(option_char, optarg); } /* non-option arguments */ while ((ret == 0) && (optind < argc)) { //printf("optind = %d arg=%s\n",optind,SAFESTRING(argv[optind])); ARG_Generic(argv[optind]); ++optind; } SAFEFREE(argv) ; owfree(params_copy); return ret; } /* Parses one argument */ /* return 0 if ok */ /* Note: owopt is called in single thread mode -- rest of owfs machinery hasn't been launched */ GOOD_OR_BAD owopt(const int option_char, const char *arg) { // depth of nesting for config files static int config_depth = 0; // utility variables for parsing options long long int arg_to_integer ; _FLOAT arg_to_float ; //printf("Option %c (%d) Argument=%s\n",c,c,SAFESTRING(arg)) ; switch (option_char) { case 'a' : return ReadAliasFile(arg) ; case 'c': if (config_depth > 4) { LEVEL_DEFAULT("Configuration file layered too deeply (>%d)", config_depth); return gbBAD; } else { GOOD_OR_BAD ret; ++config_depth; Config_Monitor_Add( arg ) ; // add for monitoring changes ret = ConfigurationFile(arg); --config_depth; return ret; } case 'h': FS_help(arg); return gbBAD; case 'u': return ARG_USB(arg); case 'd': return ARG_Device(arg); case 't': RETURN_BAD_IF_BAD(OW_parsevalue_I(&arg_to_integer, arg)) ; Globals.timeout_volatile = (int) arg_to_integer; break; case 'r': Globals.readonly = 1; break; case 'w': Globals.readonly = 0; break; case 'C': Globals.temp_scale = temp_celsius ; SetLocalControlFlags() ; break; case 'F': Globals.temp_scale = temp_fahrenheit ; SetLocalControlFlags() ; break; case 'R': Globals.temp_scale = temp_rankine ; SetLocalControlFlags() ; break; case 'K': Globals.temp_scale = temp_kelvin ; SetLocalControlFlags() ; break; case 'V': printf("libow version:\n\t" VERSION "\n"); return gbBAD; case 's': return ARG_Net(arg); case 'p': if ( Globals.daemon_status == e_daemon_sd ) { LEVEL_DEFAULT("systemd mode -- ignore 'p' option"); return gbGOOD ; } switch (Globals.program_type) { case program_type_httpd: case program_type_server: case program_type_external: case program_type_ftpd: return ARG_Server(arg); default: return gbGOOD; } case 'm': switch (Globals.program_type) { case program_type_filesystem: return ARG_Server(arg); default: return gbGOOD; } case 'f': if (!strcasecmp(arg, "f.i")) { Globals.format = fdi ; } else if (!strcasecmp(arg, "fi")) { Globals.format = fi ; } else if (!strcasecmp(arg, "f.i.c")) { Globals.format = fdidc ; } else if (!strcasecmp(arg, "f.ic")) { Globals.format = fdic ; } else if (!strcasecmp(arg, "fi.c")) { Globals.format = fidc ; } else if (!strcasecmp(arg, "fic")) { Globals.format = fic ; } else { LEVEL_DEFAULT("Unrecognized format type %s", arg); return gbBAD; } SetLocalControlFlags() ; break; case 'P': if (arg == NULL || strlen(arg) == 0) { LEVEL_DEFAULT("No PID file specified"); return gbBAD; } else if ((pid_file = owstrdup(arg)) == NULL) { fprintf(stderr, "Insufficient memory to store the PID filename: %s", arg); return gbBAD; } break; case e_fatal_debug_file: if (arg == NULL || strlen(arg) == 0) { LEVEL_DEFAULT("No fatal_debug_file specified"); return gbBAD; } else if ((Globals.fatal_debug_file = owstrdup(arg)) == NULL) { LEVEL_DEBUG("Out of memory."); return gbBAD; } break; case e_error_print: RETURN_BAD_IF_BAD(OW_parsevalue_I(&arg_to_integer, arg)) ; Globals.error_print = (int) arg_to_integer; break; case e_error_level: RETURN_BAD_IF_BAD(OW_parsevalue_I(&arg_to_integer, arg)) ; Globals.error_level = (int) arg_to_integer; break; case e_debug: // shortcut for --foreground --error_level=9 #if OW_DEBUG printf("DEBUG MODE\n"); #else printf("DEBUG MODE disabled at compile time. Sorry.\n"); #endif /* OW_DEBUG */ printf("libow version:\n\t" VERSION "\n"); switch (Globals.daemon_status) { case e_daemon_want_bg: Globals.daemon_status = e_daemon_fg ; break ; default: break ; } Globals.error_level = 9 ; Globals.error_level_restore = 9 ; break ; case e_cache_size: RETURN_BAD_IF_BAD(OW_parsevalue_I(&arg_to_integer, arg)) ; Globals.cache_size = (size_t) arg_to_integer; break; case e_fuse_opt: /* fuse_opt, handled in owfs.c */ break; case e_fuse_open_opt: /* fuse_open_opt, handled in owfs.c */ break; case e_max_clients: RETURN_BAD_IF_BAD(OW_parsevalue_I(&arg_to_integer, arg)) ; Globals.max_clients = (int) arg_to_integer; break; case e_want_background: switch (Globals.daemon_status) { case e_daemon_sd: LEVEL_DEFAULT("systemd mode -- ignore background request"); break ; case e_daemon_fg: case e_daemon_unknown: Globals.daemon_status = e_daemon_want_bg ; break ; default: break ; } break ; case e_want_foreground: switch (Globals.daemon_status) { case e_daemon_sd: LEVEL_DEFAULT("systemd mode -- ignore foreground request"); break ; case e_daemon_want_bg: case e_daemon_unknown: Globals.daemon_status = e_daemon_fg ; break ; default: break ; } break ; case e_i2c: return ARG_I2C(arg); case e_ha5: return ARG_HA5(arg); case e_ha7: return ARG_HA7(arg); case e_ha7e: return ARG_HA7E(arg); case e_enet: return ARG_ENET(arg); case e_fake: return ARG_Fake(arg); case e_link: return ARG_Link(arg); case e_passive: return ARG_Passive("Passive", arg); case e_pbm: return ARG_PBM(arg); case e_ha3: return ARG_Passive("HA3", arg); case e_ha4b: return ARG_Passive("HA4B", arg); case e_xport: return ARG_Xport(arg); case e_tester: return ARG_Tester(arg); case e_mock: return ARG_Mock(arg); case e_etherweather: return ARG_EtherWeather(arg); case e_masterhub: return ARG_MasterHub(arg); case e_w1_monitor: return ARG_W1_monitor(); case e_ds1wm: return ARG_DS1WM(arg); case e_k1wm: return ARG_K1WM(arg); case e_browse: return ARG_Browse(); case e_announce: Globals.announce_name = owstrdup(arg); break; // Pressure scale case e_pressure_mbar: Globals.pressure_scale = pressure_mbar ; SetLocalControlFlags() ; break ; case e_pressure_atm: Globals.pressure_scale = pressure_atm ; SetLocalControlFlags() ; break ; case e_pressure_mmhg: Globals.pressure_scale = pressure_mmhg ; SetLocalControlFlags() ; break ; case e_pressure_inhg: Globals.pressure_scale = pressure_inhg ; SetLocalControlFlags() ; break ; case e_pressure_psi: Globals.pressure_scale = pressure_psi ; SetLocalControlFlags() ; break ; case e_pressure_Pa: Globals.pressure_scale = pressure_Pa ; SetLocalControlFlags() ; break ; // TIMEOUTS case e_timeout_volatile: case e_timeout_stable: case e_timeout_directory: case e_timeout_presence: case e_timeout_serial: case e_timeout_usb: case e_timeout_network: case e_timeout_server: case e_timeout_ftp: case e_timeout_ha7: case e_timeout_w1: case e_timeout_persistent_low: case e_timeout_persistent_high: case e_clients_persistent_low: case e_clients_persistent_high: RETURN_BAD_IF_BAD(OW_parsevalue_I(&arg_to_integer, arg)) ; // Using the character as a numeric value -- convenient but risky (&Globals.timeout_volatile)[option_char - e_timeout_volatile] = (int) arg_to_integer; break; case e_baud: RETURN_BAD_IF_BAD(OW_parsevalue_I(&arg_to_integer, arg)) ; Globals.baud = COM_MakeBaud( arg_to_integer ) ; break ; case e_templow: RETURN_BAD_IF_BAD(OW_parsevalue_F(&arg_to_float, arg)) ; Globals.templow = arg_to_float; break; case e_temphigh: RETURN_BAD_IF_BAD(OW_parsevalue_F(&arg_to_float, arg)) ; Globals.temphigh = arg_to_float; break; case e_safemode: LocalControlFlags |= SAFEMODE ; break ; case e_detail: return Detail_Add(arg) ; break; case 0: break; default: return gbBAD; } return gbGOOD; } static GOOD_OR_BAD OW_parsevalue_I(long long int *var, const ASCII * str) { errno = 0; var[0] = strtol(str, NULL, 10); if (errno) { ERROR_DETAIL("Bad integer configuration value %s", str); return gbBAD; } return gbGOOD; } static GOOD_OR_BAD OW_parsevalue_F(_FLOAT *var, const ASCII * str) { errno = 0; var[0] = (_FLOAT) strtod(str, NULL); if (errno) { ERROR_DETAIL("Bad floating point configuration value %s", str); return gbBAD; } return gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_parse_address.c0000644000175000001440000001071312654730021016621 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" static void Init_Address( struct address_pair * ap ) ; static void Parse_Single_Address( struct address_entry * ae ) ; static void Parse_Single_Address( struct address_entry * ae ) { static regex_t rx_pa_none ; static regex_t rx_pa_all ; static regex_t rx_pa_scan ; static regex_t rx_pa_star ; static regex_t rx_pa_quad ; static regex_t rx_pa_num ; ow_regcomp( &rx_pa_none, "^$", REG_NOSUB ) ; ow_regcomp( &rx_pa_all, "^all$", REG_NOSUB | REG_ICASE ) ; ow_regcomp( &rx_pa_scan, "^scan$", REG_NOSUB | REG_ICASE ) ; ow_regcomp( &rx_pa_star, "^\\*$", REG_NOSUB ) ; ow_regcomp( &rx_pa_quad, "^[[:digit:]]{1,3}\\.[[:digit:]]{1,3}\\.[[:digit:]]{1,3}\\.[[:digit:]]{1,3}$", REG_NOSUB ) ; ow_regcomp( &rx_pa_num, "^-?[[:digit:]]+$", REG_NOSUB ) ; if ( ae->alpha == NULL ) { // null entry ae->type = address_none ; } else if ( ow_regexec( &rx_pa_none, ae->alpha, NULL ) == 0 ) { ae->type = address_none ; LEVEL_DEBUG("None <%s>",ae->alpha); } else if ( ow_regexec( &rx_pa_all, ae->alpha, NULL ) == 0 ) { ae->type = address_all ; LEVEL_DEBUG("All <%s>",ae->alpha); } else if ( ow_regexec( &rx_pa_scan, ae->alpha, NULL ) == 0 ) { ae->type = address_scan ; LEVEL_DEBUG("Scan <%s>",ae->alpha); } else if ( ow_regexec( &rx_pa_star, ae->alpha, NULL ) == 0 ) { ae->type = address_asterix ; LEVEL_DEBUG("Star <%s>",ae->alpha); } else if ( ow_regexec( &rx_pa_quad, ae->alpha, NULL ) == 0 ) { ae->type = address_dottedquad ; LEVEL_DEBUG("IP <%s>",ae->alpha); } else if ( ow_regexec( &rx_pa_num, ae->alpha, NULL ) == 0 ) { ae->type = address_numeric ; ae->number = atoi(ae->alpha ) ; LEVEL_DEBUG("Num <%s> %d",ae->alpha,ae->number); } else { ae->type = address_alpha ; LEVEL_DEBUG("Text <%s>",ae->alpha); } } /* Search for a ":" in the name Change it to a null,and parse the remaining text as either null, a number, or nothing */ void Parse_Address( char * address, struct address_pair * ap ) { static regex_t rx_pa_one ; static regex_t rx_pa_two ; static regex_t rx_pa_three ; struct ow_regmatch orm ; ow_regcomp( &rx_pa_one, "^ *([^ ]+)[ \r]*$", 0 ) ; ow_regcomp( &rx_pa_two, "^ *([^ ]+) *: *([^ ]+)[ \r]*$", 0 ) ; ow_regcomp( &rx_pa_three, "^ *([^ ]+) *: *([^ ]+) *: *([^ ]+)[ \r]*$", 0 ) ; // Set up address structure into previously allocated structure if ( ap == NULL ) { return ; } Init_Address(ap); // no entries if ( address == NULL) { ap->entries = 0 ; return ; } // copy the text string // All entries will point into this text copy // Note that this is a maximum length, paring off spaces and colon will make room for extra \0 ap->first.alpha = owstrdup(address) ; if ( ap->first.alpha == NULL ) { return ; } // test out the various matches orm.number = 3 ; if ( ow_regexec( &rx_pa_three, address, &orm ) == 0 ) { ap->entries = 3 ; } else { orm.number = 2 ; if ( ow_regexec( &rx_pa_two, address, &orm ) == 0 ) { ap->entries = 2 ; } else { orm.number = 1 ; if ( ow_regexec( &rx_pa_one, address, &orm ) == 0 ) { ap->entries = 1 ; } else { return ; } } } // Now copy and parse strcpy( ap->first.alpha, orm.match[1] ) ; Parse_Single_Address( &(ap->first) ) ; LEVEL_DEBUG("First <%s>",ap->first.alpha); if ( ap->entries > 1 ) { ap->second.alpha = ap->first.alpha + strlen(ap->first.alpha) + 1 ; strcpy( ap->second.alpha, orm.match[2] ) ; LEVEL_DEBUG("Second <%s>",ap->second.alpha); Parse_Single_Address( &(ap->second) ) ; if ( ap->entries > 2 ) { ap->third.alpha = ap->second.alpha + strlen(ap->second.alpha) + 1 ; strcpy( ap->third.alpha, orm.match[3] ) ; LEVEL_DEBUG("Third <%s>",ap->third.alpha); Parse_Single_Address( &(ap->third) ) ; } } ow_regexec_free( &orm ) ; } void Free_Address( struct address_pair * ap ) { if ( ap == NULL ) { return ; } // Eliminates ap->second.alpha, too SAFEFREE( ap->first.alpha ) ; Init_Address( ap ) ; } static void Init_Address( struct address_pair * ap ) { if ( ap == NULL ) { return ; } ap->first.alpha = NULL ; ap->first.type = address_none ; ap->second.alpha = NULL ; ap->second.type = address_none ; ap->third.alpha = NULL ; ap->third.type = address_none ; } owfs-3.1p5/module/owlib/src/c/ow_parse_external.c0000644000175000001440000004531612711737666017045 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_parse_external -- read the SENSOR and PROPERTY lines */ /* in general the lines are comma separated tokens * with backslash escaping and * quote and double quote matching * */ /* 11/2014 -- considerable testing and patches from Sven Giermann */ #include #include "owfs_config.h" #include "ow.h" #include "ow_external.h" static char * string_parse( char * text_string, char delim, char ** last_char ); static char * trim_parse( char * raw_string ); static char * unquote_parse( char * raw_string ); static int LastParam( char * input_string ) ; static void create_just_print( char * s_prop, char * s_family, char * s_data ); static void create_subdirs( char * s_prop, char * s_family ); static void AddFamilyToTree( char * s_family ) ; static struct family_node * create_family_node( char * s_family ) ; static void AddSensorToTree( char * s_name, char * s_family, char * s_description, char * data ) ; static struct sensor_node * create_sensor_node( char * s_name, char * s_family, char * s_description, char * s_data ) ; static void AddPropertyToTree( char * s_property, char * s_family, enum ft_format s_format, size_t s_array, enum ag_combined s_combined, enum ag_index s_index_type, size_t s_length, enum fc_change s_change, char * s_read, char * s_write, char * s_data, char * s_other, enum external_type et ) ; static struct property_node * create_property_node( char * s_property, char * s_family, enum ft_format s_format, size_t s_array, enum ag_combined s_combined, enum ag_index s_index_type, size_t s_length, enum fc_change s_change, char * s_read, char * s_write, char * s_data, char * s_other, enum external_type et ) ; void * property_tree = NULL ; void * family_tree = NULL ; void * sensor_tree = NULL ; // For AddSensor and AddProperty // uses the various tools to get a string into s_name (name is given) // start_pointer (a char *) is used and updated. #define GetQuotedString( name ) do { \ char * end_pointer ; \ s_##name = string_parse( start_pointer, ',', &end_pointer ) ; \ start_pointer = end_pointer ; \ if ( ! LastParam( s_##name ) ) { \ ++ start_pointer ; \ } \ s_##name = unquote_parse( trim_parse( s_##name ) ) ; \ LEVEL_DEBUG( #name" assigned %s",s_##name ) ; \ } while (0) ; // Look through text_string, ignore backslash and match quoting varibles // allocates a new string with the token static char * string_parse( char * text_string, char delim, char ** last_char ) { char * copy_string ; char * old_string_pointer = text_string ; char * new_string_pointer ; //printf("->>>STRING (%c) PARSE <%s>\n",delim,text_string); if ( text_string == NULL ) { *last_char = text_string ; return owstrdup("") ; } new_string_pointer = copy_string = owstrdup( text_string ) ; // more than enough room if ( copy_string == NULL ) { *last_char = text_string ; return NULL ; } while ( 1 ) { char current_char = old_string_pointer[0] ; new_string_pointer[0] = current_char ; // default copy if ( current_char == '\0' ) { // end of string *last_char = old_string_pointer ; //printf("<<<-STRING (%c) PARSE <%s>, end:<%s>\n",delim,copy_string,*last_char); return copy_string ; } else if ( current_char == '\\' ) { // backslash, use next char literally if ( old_string_pointer[1] ) { new_string_pointer[0] = old_string_pointer[1] ; ++ new_string_pointer ; old_string_pointer += 2 ; } else { // unless there is no next char *last_char = old_string_pointer + 1 ; //printf("<<<-STRING (%c) PARSE <%s>, end:<%s>\n",delim,copy_string,*last_char); return copy_string ; } } else if ( current_char == delim ) { // found delimitter match // point to it, and null terminate *last_char = old_string_pointer ; new_string_pointer[1] = '\0' ; //printf("<<<-STRING (%c) PARSE <%s>, end:<%s>\n",delim,copy_string,*last_char); return copy_string ; } else if ( current_char == '"' || current_char == '\'' ) { // quotation -- find matching end char * quote_last_char ; char * quoted_string = string_parse( old_string_pointer+1, current_char, "e_last_char ) ; //printf("----STRING (%c) PARSE Quote <%s> end:<%s>\n",delim,quoted_string,quote_last_char); if ( quoted_string ) { strcpy( new_string_pointer+1, quoted_string ) ; new_string_pointer += strlen( quoted_string ) + 1 ; if ( quote_last_char[0] == current_char ) { quote_last_char[0] = '\0' ; // clear trailing quote old_string_pointer = quote_last_char + 1 ; } else { old_string_pointer = quote_last_char ; } owfree( quoted_string ) ; } else { new_string_pointer[1] = '\0' ; *last_char = old_string_pointer ; //printf("<<<-STRING (%c) PARSE <%s>, end:<%s>\n",delim,copy_string,*last_char); return copy_string ; } } else { ++ old_string_pointer ; ++ new_string_pointer ; } } } static char * trim_parse( char * raw_string ) { char * start_position ; char * end_position ; char * return_string ; // trim off preamble whitespace for ( start_position = raw_string ; start_position[0] ; ++ start_position ) { switch ( start_position[0] ) { case ' ': case '\t': // ignore these characters continue ; case '\n': case '\r': // end of the line -- empty string return owfree( raw_string ); return owstrdup("") ; default: break ; } // getting here means a valid character found break ; } // delete old string and use new copy starting at first non whitespace position return_string = owstrdup ( start_position ) ; owfree( raw_string ) ; // trim off for ( end_position = return_string + strlen( return_string ) ; end_position >= return_string ; -- end_position ) { switch ( end_position[0] ) { case ' ': case '\0': case '\r': case '\n': case '\t': // ignorable end char -- make null end_position[0] = '\0' ; continue ; default: // good char break ; } // getting here means a valid character found break ; } return return_string ; } static char * unquote_parse( char * raw_string ) { if ( raw_string == NULL ) { return NULL ; } switch ( raw_string[0] ) { case '"': case '\'': if ( raw_string[1] == '\0' ) { owfree( raw_string ) ; return owstrdup("") ; } else { char * unquoted = owstrdup( raw_string+1 ) ; char * unquoted_end = unquoted + strlen(unquoted) -1 ; if ( unquoted_end[0] == raw_string[0] ) { unquoted_end[0] = '\0' ; } owfree( raw_string ) ; return unquoted ; } break ; default: return raw_string ; } } static int LastParam( char * input_string ) { if ( input_string == NULL ) { return 1 ; } else { int len = strlen(input_string) ; if ( len == 0 ) { return 1 ; } if ( input_string[len-1] != ',' ) { return 1 ; } input_string[len-1] = '\0' ; return 0 ; } } // Gets a string with property,family,structure,read_function,write_function,property_data,extra // write, data and extra are optional // starts with script: // or property: /* * property * family * structure * read * write * data * other * */ void AddProperty( char * input_string, enum external_type et ) { char * s_family = NULL ; char * s_property = NULL ; char * s_dummy ; ssize_t s_array ; enum ag_combined s_combined ; enum ag_index s_index_type ; enum ft_format s_format ; ssize_t s_length ; enum fc_change s_change ; char * s_read = NULL ; char * s_write = NULL ; char * s_data = NULL ; char * s_other = NULL; char * start_pointer = input_string ; if ( input_string == NULL ) { return ; } if ( ! Globals.allow_external ) { LEVEL_DEBUG("External prgroams not supported by %s",Globals.argv[0]) ; return ; } // property GetQuotedString( property ) ; // family GetQuotedString( family ) ; // type GetQuotedString( dummy ) ; switch ( s_dummy[0] ) { case 'D': s_length = PROPERTY_LENGTH_DIRECTORY ; s_format = ft_directory ; break ; case 'i': s_length = PROPERTY_LENGTH_INTEGER ; s_format = ft_integer ; break ; case 'u': s_length = PROPERTY_LENGTH_UNSIGNED ; s_format = ft_unsigned ; break ; case 'f': s_length = PROPERTY_LENGTH_FLOAT ; s_format = ft_float ; break ; case 'a': s_length = 1 ; s_format = ft_ascii ; break ; case 'b': s_length = 1 ; s_format = ft_binary ; break ; case 'y': s_length = PROPERTY_LENGTH_YESNO ; s_format = ft_yesno ; break ; case 'd': s_length = PROPERTY_LENGTH_DATE ; s_format = ft_date ; break ; case 't': s_length = PROPERTY_LENGTH_TEMP ; s_format = ft_temperature ; break ; case 'g': s_length = PROPERTY_LENGTH_TEMPGAP ; s_format = ft_tempgap ; break ; case 'p': s_length = PROPERTY_LENGTH_PRESSURE ; s_format = ft_pressure ; break ; default: LEVEL_DEFAULT("Unrecognized variable type <%s> for property <%s> family <%s>",s_dummy,s_property,s_family); goto cleanup; } if ( s_dummy[1] ) { int temp_length ; temp_length = strtol( &s_dummy[1], NULL, 0 ) ; if ( temp_length < 1 ) { LEVEL_DEFAULT("Unrecognized variable length <%s> for property <%s> family <%s>",s_dummy,s_property,s_family); goto cleanup; } s_length = temp_length ; } // array owfree(s_dummy); GetQuotedString( dummy ) ; switch ( s_dummy[0] ) { case '1': case '0': case '\0': s_combined = ag_separate ; s_index_type = ag_numbers ; s_array = 1 ; break ; case '-': s_array = 1 ; switch ( s_dummy[1] ) { case '1': s_combined = ag_sparse ; s_index_type = ag_numbers ; break ; default: s_combined = ag_sparse ; s_index_type = ag_letters ; break ; } break ; case '+': if ( isalpha( (int) s_dummy[1] ) ) { s_array = toupper( (int) s_dummy[1] ) - 'A' ; s_combined = ag_aggregate ; s_index_type = ag_letters ; } else { s_array = strtol( s_dummy, NULL, 0 ) ; s_combined = ag_aggregate ; s_index_type = ag_numbers ; } break ; default: if ( isalpha( (int) s_dummy[0] ) ) { s_array = toupper( (int) s_dummy[0] ) - 'A' ; s_combined = ag_separate ; s_index_type = ag_letters ; } else { s_array = strtol( s_dummy, NULL, 0 ) ; s_combined = ag_separate ; s_index_type = ag_numbers ; } break ; } if ( s_array < 1 ) { LEVEL_DEFAULT("Unrecognized array type <%s> for property <%s> family <%s>",s_dummy,s_property,s_family); goto cleanup; } // persistance owfree(s_dummy); GetQuotedString( dummy ) ; switch ( s_dummy[0] ) { case 'f': s_change = fc_static ; break ; case 's': s_change = fc_stable ; break ; case 'v': s_change = fc_volatile ; break ; case 't': s_change = fc_second ; break ; case 'u': s_change = fc_uncached ; break ; default: LEVEL_DEFAULT("Unrecognized persistance <%s> for property <%s> family <%s>",s_dummy,s_property,s_family); goto cleanup; } // read GetQuotedString( read ) ; // write GetQuotedString( write ) ; // data GetQuotedString( data ) ; // other GetQuotedString( other ) ; // test minimums if ( strlen( s_family ) > 0 && strlen( s_property ) > 0 ) { // Actually add AddFamilyToTree( s_family ) ; AddPropertyToTree( s_property, s_family, s_format, s_array, s_combined, s_index_type, s_length, s_change, s_read, s_write, s_data, s_other, et ) ; create_subdirs( s_property, s_family ) ; } cleanup: // Clean up owfree( s_dummy ); owfree( s_property ) ; owfree( s_family ) ; owfree( s_read ) ; owfree( s_write ) ; owfree( s_data ) ; owfree( s_other ) ; } // Gets a string with name,family, and description // description is optional /* * name * family * description * */ void AddSensor( char * input_string ) { char * s_name = NULL ; char * s_family = NULL ; char * s_description = NULL ; char * s_data = NULL ; char * start_pointer = input_string ; if ( input_string == NULL ) { return ; } if ( ! Globals.allow_external ) { LEVEL_DEBUG("External prgroams not supported by %s",Globals.argv[0]) ; return ; } // name GetQuotedString( name ) ; // family GetQuotedString( family ) ; // description GetQuotedString( description ) ; // data GetQuotedString( data ) ; if ( strlen(s_name) > 0 && strlen(s_family) > 0 ) { // Actually add AddFamilyToTree( s_family ) ; AddSensorToTree( s_name, s_family, s_description, s_data ) ; create_just_print( "family", s_family, s_family ) ; create_just_print( "type", s_family, "external" ) ; } // Clean up owfree( s_name ); owfree( s_family ) ; owfree( s_description ) ; owfree( s_data ) ; } static struct sensor_node * create_sensor_node( char * s_name, char * s_family, char * s_description, char * s_data ) { int l_name = strlen(s_name)+1; int l_family = strlen(s_family)+1; int l_description = strlen(s_description)+1; int l_data = strlen(s_data)+1; struct sensor_node * s = owmalloc( sizeof(struct sensor_node) + l_name + l_family + l_description + l_data ) ; if ( s==NULL) { return NULL ; } memset( s, 0, sizeof(struct sensor_node) + l_name + l_family + l_description + l_data ) ; s->name = s->payload ; strcpy( s->name, s_name ) ; s->family = s->name + l_name ; strcpy( s->family, s_family ) ; s->description = s->family + l_family ; strcpy( s->description, s_description ) ; s->data = s->description + l_description ; strcpy( s->data, s_data ) ; return s ; } static struct family_node * create_family_node( char * s_family ) { int l_family = strlen(s_family)+1; struct family_node * s = owmalloc( sizeof(struct family_node) + l_family ) ; if ( s==NULL) { return NULL ; } memset( s, 0, sizeof(struct family_node) + l_family ) ; s->family = s->payload ; strcpy( s->family, s_family ) ; // fill some of device fields s->dev.count_of_filetypes = 0 ; // until known s->dev.family_code = s->family ; s->dev.readable_name = s->family ; s->dev.filetype_array = NULL ; // until known s->dev.flags = 0 ; s->dev.g_read = NULL ; s->dev.g_write = NULL ; return s ; } static struct property_node * create_property_node( char * s_property, char * s_family, enum ft_format s_format, size_t s_array, enum ag_combined s_combined, enum ag_index s_index_type, size_t s_length, enum fc_change s_change, char * s_read, char * s_write, char * s_data, char * s_other, enum external_type et ) { // AddPropertyToTree (the calling routine) ensures these aren't null int l_property = strlen( s_property )+1 ; int l_family = strlen( s_family )+1 ; int l_read = strlen( s_read )+1 ; int l_write = strlen( s_write )+1 ; int l_data = strlen( s_data )+1 ; int l_other = strlen( s_other )+1 ; int l_total = sizeof(struct property_node) + l_property + l_family + l_read + l_write + l_data + l_other ; struct property_node * s = owmalloc( l_total ) ; if ( s==NULL) { return NULL ; } memset( s, 0, l_total ) ; s->property = s->payload ; strcpy( s->property, s_property ) ; s->family = s->property + l_property ; strcpy( s->family, s_family ) ; s->read = s->family + l_family ; strcpy( s->read, s_read ) ; s->write = s->read + l_read ; strcpy( s->write, s_write ) ; s->data = s->write + l_write ; strcpy( s->data, s_data ) ; s->other = s->data + l_data ; strcpy( s->other, s_other ) ; s->et = et ; // Fill in the filetype structure s->ft.name = s->property ; s->ft.suglen = s_length ; s->ft.ag = &(s->ag) ; s->ft.format = s_format ; s->ft.change = s_change ; s->ft.visible = VISIBLE ; s->ft.read = NO_READ_FUNCTION ; s->ft.write = NO_WRITE_FUNCTION ; s->ft.data.a = s->data ; // Check read function if ( l_read > 1 ) { s->ft.read = FS_r_external ; } // Check write function if ( l_write > 1 ) { s->ft.write = FS_w_external ; } // Fill in aggregate structure s->ag.elements = s_array ; s->ag.letters = s_index_type ; s->ag.combined = s_combined ; // Flag scalars if ( s_array == 1 ) { s->ft.ag = NON_AGGREGATE ; } return s ; } static void AddSensorToTree( char * s_name, char * s_family, char * s_description, char * s_data ) { struct sensor_node * n = create_sensor_node( s_name, s_family, s_description, s_data ) ; struct { struct sensor_node * key ; char other[0] ; } * opaque = tsearch( (void *) n, &sensor_tree, sensor_compare ) ; if ( opaque->key != n ) { // already exists LEVEL_DEBUG("Duplicate sensor entry: %s,%s,%s,%s",s_name,s_family,s_description,s_data); owfree( n ) ; } else { LEVEL_DEBUG("New sensor entry: %s,%s,%s,%s",s_name,s_family,s_description,s_data); } } static void AddFamilyToTree( char * s_family ) { struct family_node * n = create_family_node( s_family ) ; struct { struct family_node * key ; char other[0] ; } * opaque = tsearch( (void *) n, &family_tree, family_compare ) ; if ( opaque->key != n ) { // already exists LEVEL_DEBUG("Duplicate family entry: %s",s_family); owfree( n ) ; } else { ARG_External(NULL); LEVEL_DEBUG("New family entry: %s",s_family); } } #define NonNull(x) if(x==NULL) { x=""; } static void AddPropertyToTree( char * s_property, char * s_family, enum ft_format s_format, size_t s_array, enum ag_combined s_combined, enum ag_index s_index_type, size_t s_length, enum fc_change s_change, char * s_read, char * s_write, char * s_data, char * s_other, enum external_type et ) { struct property_node * n ; struct { struct property_node * key ; char other[0] ; } * opaque ; NonNull( s_property ) NonNull( s_family ) NonNull( s_read ) NonNull( s_write ) NonNull( s_data ) NonNull( s_other ) n = create_property_node( s_property, s_family, s_format, s_array, s_combined, s_index_type, s_length, s_change, s_read, s_write, s_data, s_other, et ) ; opaque = tsearch( (void *) n, &property_tree, property_compare ) ; if ( opaque->key != n ) { // already exists LEVEL_DEBUG("Duplicate property entry: %s,%s,%s,%s,%s,%s",s_property,s_family,s_read,s_write,s_data,s_other); owfree( n ) ; } else { LEVEL_DEBUG("New property entry: %s,%s,%s,%s,%s,%s",s_property,s_family,s_read,s_write,s_data,s_other); } } static void create_just_print( char * s_prop, char * s_family, char * s_data ) { AddPropertyToTree( s_prop, s_family, ft_ascii, 1, ag_separate, ag_numbers, strlen(s_data), fc_static, "just_print_data", "", s_data, "", et_internal ) ; } static void create_subdirs( char * s_prop, char * s_family ) { char * slash ; char * subdir = owstrdup( s_prop ) ; if ( subdir == NULL ) { return ; } while ( (slash = strrchr( subdir, '/' )) != NULL ) { slash[0] = '\0' ; AddPropertyToTree( subdir, s_family, ft_subdir, 1, ag_separate, ag_numbers, 0, fc_subdir, "", "", "", "", et_none ) ; } owfree(subdir) ; } owfs-3.1p5/module/owlib/src/c/ow_parseinput.c0000644000175000001440000003373112711737666016221 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #define DEFAULT_INPUT_BUFFER_LENGTH 128 /* ------- Prototypes ----------- */ static ZERO_OR_ERROR FS_input_yesno(struct one_wire_query *owq); static ZERO_OR_ERROR FS_input_integer(struct one_wire_query *owq); static ZERO_OR_ERROR FS_input_unsigned(struct one_wire_query *owq); static ZERO_OR_ERROR FS_input_float(struct one_wire_query *owq); static ZERO_OR_ERROR FS_input_date(struct one_wire_query *owq); static ZERO_OR_ERROR FS_input_ascii(struct one_wire_query *owq); static ZERO_OR_ERROR FS_input_array_with_commas(struct one_wire_query *owq); static ZERO_OR_ERROR FS_input_ascii_array(struct one_wire_query *owq); static ZERO_OR_ERROR FS_input_array_no_commas(struct one_wire_query *owq); static size_t FS_check_length(struct one_wire_query *owq); /* ---------------------------------------------- */ /* Filesystem callback functions */ /* ---------------------------------------------- */ /* Note on return values: */ /* Top level FS_write will return size if ok, else a negative number */ /* Each lower level function called will return 0 if ok, else non-zero */ /* Note on size and offset: */ /* Buffer length (and requested data) is size bytes */ /* writing should start after offset bytes in original data */ /* only binary, and ascii data support offset in single data points */ /* only binary supports offset in array data */ /* size and offset are vetted against specification data size and calls */ /* outside of this module will not have buffer overflows */ /* I.e. the rest of owlib can trust size and buffer to be legal */ /* Format of input, Depends on "filetype" type function format Handled as integer strol decimal integer integer array unsigned strou decimal integer unsigned array bitfield strou decimal integer unsigned array yesno strcmp "0" "1" "yes" "no" "on" "off" unsigned array float strod decimal floating point double array date strptime "Jan 01, 1901", etc date array ascii strcpy string without "," or null comma-separated-strings binary memcpy fixed length binary string binary "string" */ // Routines to take write data (ascii representation) and interpret it and place into the proper fields. ZERO_OR_ERROR OWQ_parse_input(struct one_wire_query *owq) { switch (OWQ_pn(owq).extension) { case EXTENSION_BYTE: return FS_input_unsigned(owq); case EXTENSION_ALL: switch (OWQ_pn(owq).selected_filetype->format) { case ft_ascii: case ft_vascii: case ft_alias: return FS_input_ascii_array(owq); case ft_binary: return FS_input_array_no_commas(owq); default: return FS_input_array_with_commas(owq); } default: // Sort out locally unknown filetype. if (OWQ_pn(owq).selected_filetype == NO_FILETYPE) { return FS_input_ascii(owq); } // Switch by known filetype. switch (OWQ_pn(owq).selected_filetype->format) { case ft_integer: return FS_input_integer(owq); case ft_yesno: case ft_bitfield: return FS_input_yesno(owq); case ft_unsigned: return FS_input_unsigned(owq); case ft_pressure: case ft_temperature: case ft_tempgap: case ft_float: return FS_input_float(owq); case ft_date: return FS_input_date(owq); case ft_vascii: case ft_alias: case ft_ascii: case ft_binary: return FS_input_ascii(owq); case ft_directory: case ft_subdir: case ft_unknown: return -ENOENT; } } return -EINVAL; // should never be reached if all the cases are truly covered } /* return 0 if ok */ static ZERO_OR_ERROR FS_input_yesno(struct one_wire_query *owq) { char default_input_buffer[DEFAULT_INPUT_BUFFER_LENGTH + 1]; char *input_buffer = default_input_buffer; char *end; int I; ZERO_OR_ERROR ret; /* allocate more space if buffer is really long */ if (OWQ_size(owq) > DEFAULT_INPUT_BUFFER_LENGTH) { input_buffer = owmalloc(OWQ_size(owq) + 1); if (input_buffer == NULL) { RETURN_CODE_RETURN( 79 ) ; // unable to allocate memory } } memcpy(input_buffer, OWQ_buffer(owq), OWQ_size(owq)); input_buffer[OWQ_size(owq)] = '\0'; // make sure null-ended //printf("YESNO: %s\n",input_buffer); errno = 0; I = strtol(input_buffer, &end, 10); if ((errno == 0) && (end != input_buffer)) { // NUMBER? //printf("YESNO number = %d\n",I) ; OWQ_Y(owq) = (I != 0); ret = 0; } else { // WORD? char *non_blank; ret = -EFAULT; //default error until a non-blank found for (non_blank = input_buffer; non_blank[0]; ++non_blank) { if (non_blank[0] != ' ' && non_blank[0] != '\t') { ret = 0; // now assume good if (strncasecmp(non_blank, "y", 1) == 0) { OWQ_Y(owq) = 1; break; } if (strncasecmp(non_blank, "n", 1) == 0) { OWQ_Y(owq) = 0; break; } if (strncasecmp(non_blank, "on", 2) == 0) { OWQ_Y(owq) = 1; break; } if (strncasecmp(non_blank, "off", 3) == 0) { OWQ_Y(owq) = 0; break; } ret = -EINVAL; break; } } } /* free specially long buffer */ if (input_buffer != default_input_buffer) { owfree(input_buffer); } return ret; } /* parse a value for write from buffer to value_object */ /* return 0 if ok */ static ZERO_OR_ERROR FS_input_integer(struct one_wire_query *owq) { char default_input_buffer[DEFAULT_INPUT_BUFFER_LENGTH + 1]; char *input_buffer = default_input_buffer; char *end; /* allocate more space if buffer is really long */ if (OWQ_size(owq) > DEFAULT_INPUT_BUFFER_LENGTH) { input_buffer = owmalloc(OWQ_size(owq) + 1); if (input_buffer == NULL) { return -ENOMEM; } } memcpy(input_buffer, OWQ_buffer(owq), OWQ_size(owq)); input_buffer[OWQ_size(owq)] = '\0'; // make sure null-ended errno = 0; OWQ_I(owq) = strtol(input_buffer, &end, 10); /* free specially long buffer */ if (input_buffer != default_input_buffer) owfree(input_buffer); if (errno) { return -errno; // conversion error } if (end == input_buffer) { return -EINVAL; // nothing valid found for conversion } return 0; // good return } /* parse a value for write from buffer to value_object */ /* return 0 if ok */ static ZERO_OR_ERROR FS_input_unsigned(struct one_wire_query *owq) { char default_input_buffer[DEFAULT_INPUT_BUFFER_LENGTH + 1]; char *input_buffer = default_input_buffer; char *end; /* allocate more space if buffer is really long */ if (OWQ_size(owq) > DEFAULT_INPUT_BUFFER_LENGTH) { input_buffer = owmalloc(OWQ_size(owq) + 1); if (input_buffer == NULL) { return -ENOMEM; } } memcpy(input_buffer, OWQ_buffer(owq), OWQ_size(owq)); input_buffer[OWQ_size(owq)] = '\0'; // make sure null-ended errno = 0; OWQ_U(owq) = strtoul(input_buffer, &end, 10); /* free specially long buffer */ if (input_buffer != default_input_buffer) { owfree(input_buffer); } if (errno) { return -errno; // conversion error } if (end == input_buffer) { return -EINVAL; // nothing valid found for conversion } return 0; // good return } /* parse a value for write from buffer to value_object */ /* return 0 if ok */ static ZERO_OR_ERROR FS_input_float(struct one_wire_query *owq) { char default_input_buffer[DEFAULT_INPUT_BUFFER_LENGTH + 1]; char *input_buffer = default_input_buffer; char *end; _FLOAT F; /* allocate more space if buffer is really long */ if (OWQ_size(owq) > DEFAULT_INPUT_BUFFER_LENGTH) { input_buffer = owmalloc(OWQ_size(owq) + 1); if (input_buffer == NULL) { return -ENOMEM; } } memcpy(input_buffer, OWQ_buffer(owq), OWQ_size(owq)); input_buffer[OWQ_size(owq)] = '\0'; // make sure null-ended errno = 0; F = strtod(input_buffer, &end); /* free specially long buffer */ if (input_buffer != default_input_buffer) { owfree(input_buffer); } if (errno) { return -errno; // conversion error } if (end == input_buffer) { return -EINVAL; // nothing valid found for conversion } switch (OWQ_pn(owq).selected_filetype->format) { case ft_pressure: OWQ_F(owq) = fromPressure(F, PN(owq)); break; case ft_temperature: OWQ_F(owq) = fromTemperature(F, PN(owq)); break; case ft_tempgap: OWQ_F(owq) = fromTempGap(F, PN(owq)); break; default: OWQ_F(owq) = F; break; } return 0; // good return } /* return 0 if ok */ static ZERO_OR_ERROR FS_input_date(struct one_wire_query *owq) { char default_input_buffer[DEFAULT_INPUT_BUFFER_LENGTH + 1]; char *input_buffer = default_input_buffer; struct tm tm; ZERO_OR_ERROR ret = 0; // default ok /* allocate more space if buffer is really long */ if (OWQ_size(owq) > DEFAULT_INPUT_BUFFER_LENGTH) { input_buffer = owmalloc(OWQ_size(owq) + 1); if (input_buffer == NULL) { return -ENOMEM; } } memcpy(input_buffer, OWQ_buffer(owq), OWQ_size(owq)); input_buffer[OWQ_size(owq)] = '\0'; // make sure null-ended if (OWQ_size(owq) < 2 || input_buffer[0] == '\0' || input_buffer[0] == '\n') { OWQ_D(owq) = NOW_TIME; } else if ((strptime(input_buffer, "%T %a %b %d %Y", &tm) == NULL) // 12:27:02 Tuesday March 23 2007 && (strptime(input_buffer, "%b %d %Y %T", &tm) == NULL) // March 23 2007 12:27:03 && (strptime(input_buffer, "%a %b %d %Y %T", &tm) == NULL) // Tuesday March 23 2007 12:27:02 && (strptime(input_buffer, "%c", &tm) == NULL) && (strptime(input_buffer, "%D %T", &tm) == NULL)) { ret = -EINVAL; } else { OWQ_D(owq) = mktime(&tm); } /* free specially long buffer */ if (input_buffer != default_input_buffer) { owfree(input_buffer); } return ret; } static size_t FS_check_length(struct one_wire_query *owq) { /* need to check property length */ size_t size = OWQ_size(owq) ; size_t filelength = FileLength(PN(owq)) ; off_t offset = OWQ_offset(owq) ; // check overall length if ( filelength < size ) { size = filelength ; } // check overall offset if ( (size_t) offset > filelength ) { size = 0 ; // and check offset plus size } else if ( offset + size > filelength ) { // cannot be negative despite compiler warnings size = filelength - offset ; } return size ; } static int FS_input_ascii(struct one_wire_query *owq) { OWQ_length(owq) = OWQ_size(owq) = FS_check_length(owq) ; return 0; } /* returns 0 if ok */ /* creates a new allocated memory area IF no error */ static ZERO_OR_ERROR FS_input_array_with_commas(struct one_wire_query *owq) { int elements = OWQ_pn(owq).selected_filetype->ag->elements; int extension; char *end = OWQ_buffer(owq) + OWQ_size(owq); char *comma = NULL; // assignment to avoid compiler warning char *buffer_position; if (OWQ_offset(owq)!=0) { return -EINVAL; } for (extension = 0; extension < elements; ++extension) { struct one_wire_query * owq_single ; // find start of buffer span if (extension == 0) { buffer_position = OWQ_buffer(owq); } else { buffer_position = comma + 1; if (buffer_position >= end) { return -EINVAL; } } // find end of buffer span if (extension == elements - 1) { comma = end; } else { comma = memchr(buffer_position, ',', end - buffer_position); if (comma == NULL) { return -EINVAL; } } //Debug_Bytes("FS_input_array_with_commas -- to end",buffer_position,end-buffer_position) ; //Debug_Bytes("FS_input_array_with_commas -- to comma",buffer_position,comma-buffer_position) ; // set up single element owq_single = OWQ_create_separate( extension, owq ) ; if ( owq_single == NO_ONE_WIRE_QUERY ) { return -ENOMEM ; } OWQ_assign_read_buffer(buffer_position, comma - buffer_position, 0, owq_single) ; if (OWQ_parse_input(owq_single)) { OWQ_destroy(owq_single) ; return -EINVAL; } memcpy(&(OWQ_array(owq)[extension]), &OWQ_val(owq_single), sizeof(union value_object)); OWQ_destroy(owq_single) ; } return 0; } /* returns 0 if ok */ /* Basically pack the entries onto the buffer array and find the position with the cumulative length entries */ static ZERO_OR_ERROR FS_input_ascii_array(struct one_wire_query *owq) { int elements = OWQ_pn(owq).selected_filetype->ag->elements; int extension; char *end = OWQ_buffer(owq) + OWQ_size(owq); char *buffer_position = OWQ_buffer(owq); size_t suglen = OWQ_pn(owq).selected_filetype->suglen; if (OWQ_offset(owq)!=0) { return -EINVAL; } for (extension = 0; extension < elements; ++extension) { char *comma; size_t allowed_length = suglen ; size_t entry_length ; // find end of buffer span if (extension == elements - 1) { // last element entry_length = end - buffer_position ; if ( entry_length < suglen ) { allowed_length = entry_length ; } OWQ_array_length(owq, extension) = allowed_length ; return 0; } // pre-terminal element comma = memchr(buffer_position, ',', end - buffer_position); if (comma == NULL) { return -EINVAL; } entry_length = comma - buffer_position; if ( entry_length < suglen ) { allowed_length = entry_length ; } // Set the entry size OWQ_array_length(owq, extension) = allowed_length ; // move the rest of the buffer (after the comma) to the end of this entry memmove(buffer_position + allowed_length, comma + 1, end - comma - 1); // shorten the buffer length by the comma and discarded chars end -= (entry_length - allowed_length) + 1 ; // move the buffer start to the start of the next entry buffer_position += allowed_length ; } return -ERANGE; // never reach ! } /* returns 0 if ok */ /* creates a new allocated memory area IF no error */ static ZERO_OR_ERROR FS_input_array_no_commas(struct one_wire_query *owq) { int elements = OWQ_pn(owq).selected_filetype->ag->elements; int extension; int suglen = FileLength(PN(owq)) ; if ((OWQ_offset(owq) != 0) || ((int) OWQ_size(owq) != suglen * elements)) { return -EINVAL; } for (extension = 0; extension < elements; ++extension) { OWQ_array_length(owq, extension) = suglen; } return 0; } owfs-3.1p5/module/owlib/src/c/ow_parsename.c0000644000175000001440000007311712654730021015764 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ // regex #include #include "owfs_config.h" #include "ow_devices.h" #include "ow_counters.h" #include "ow_external.h" static ZERO_OR_ERROR BranchAdd(struct parsedname *pn); enum parse_pass { parse_pass_pre_remote, parse_pass_post_remote, }; struct parsedname_pointers { char pathcpy[PATH_MAX+1]; char *pathnow; char *pathnext; char *pathlast; }; static enum parse_enum set_type( enum ePN_type epntype, struct parsedname * pn ) ; static enum parse_enum Parse_Unspecified(char *pathnow, enum parse_pass remote_status, struct parsedname *pn); static enum parse_enum Parse_Branch(char *pathnow, enum parse_pass remote_status, struct parsedname *pn); static enum parse_enum Parse_Real(char *pathnow, enum parse_pass remote_status, struct parsedname *pn); static enum parse_enum Parse_NonReal(char *pathnow, struct parsedname *pn); static enum parse_enum Parse_RealDevice(char *filename, enum parse_pass remote_status, struct parsedname *pn); static enum parse_enum Parse_Property(char *filename, struct parsedname *pn); static enum parse_enum Parse_RealDeviceSN(enum parse_pass remote_status, struct parsedname *pn); static enum parse_enum Parse_NonRealDevice(char *filename, struct parsedname *pn); static enum parse_enum Parse_External_Device( char *filename, struct parsedname *pn) ; static enum parse_enum Parse_Bus( INDEX_OR_ERROR bus_number, struct parsedname *pn); static enum parse_enum Parse_Alias(char *filename, enum parse_pass remote_status, struct parsedname *pn); static enum parse_enum Parse_Alias_Known( char *filename, enum parse_pass remote_status, struct parsedname *pn); static void ReplaceAliasInPath( char * filename, struct parsedname * pn); static ZERO_OR_ERROR FS_ParsedName_anywhere(const char *path, enum parse_pass remote_status, struct parsedname *pn); static ZERO_OR_ERROR FS_ParsedName_setup(struct parsedname_pointers *pp, const char *path, struct parsedname *pn); static char * find_segment_in_path( char * segment, char * path ) ; #define BRANCH_INCR (9) /* ---------------------------------------------- */ /* Filename (path) parsing functions */ /* ---------------------------------------------- */ void FS_ParsedName_destroy(struct parsedname *pn) { if (!pn) { return; } LEVEL_DEBUG("%s", SAFESTRING(pn->path)); CONNIN_RUNLOCK ; Detail_Free( pn ) ; SAFEFREE(pn->sparse_name); SAFEFREE(pn->bp) ; } /* * Path is either NULL (in which case a minimal structure is created that doesn't need Destroy -- used for Bus Master setups) * or Path is a full "filename" type string of form: 10.1243Ab000 or uncached/bus.0/statistics etc. * * The Path passed in isn't altered, but 2 copies are made -- one with the full path, the other (to_server) has the first bus.n removed. * An initial / is added to the path, and the full length has to be less than MAX_PATH (2048) * * For efficiency, the two path copies are allocated in the same memory allocation call, and so can be removed together. * */ /* Parse a path to check it's validity and attach to the propery data structures */ ZERO_OR_ERROR FS_ParsedName(const char *path, struct parsedname *pn) { return FS_ParsedName_anywhere(path, parse_pass_pre_remote, pn); } /* Parse a path from a remote source back -- so don't check presence */ ZERO_OR_ERROR FS_ParsedName_BackFromRemote(const char *path, struct parsedname *pn) { return FS_ParsedName_anywhere(path, parse_pass_post_remote, pn); } /* Parse off starting "mode" directory (uncached, alarm...) */ static ZERO_OR_ERROR FS_ParsedName_anywhere(const char *path, enum parse_pass remote_status, struct parsedname *pn) { struct parsedname_pointers s_pp; struct parsedname_pointers *pp = &s_pp; ZERO_OR_ERROR parse_error_status = 0; enum parse_enum pe = parse_first; // To make the debug output useful it's cleared here. // Even on normal glibc, errno isn't cleared on good system calls errno = 0; LEVEL_CALL("path=[%s]", SAFESTRING(path)); RETURN_CODE_ERROR_RETURN( FS_ParsedName_setup(pp, path, pn) ); if (path == NO_PATH) { RETURN_CODE_RETURN( 0 ) ; // success (by default) } while (1) { // Check for extreme conditions (done, error) switch (pe) { case parse_done: // the only exit! //LEVEL_DEBUG("PARSENAME parse_done") ; //printf("PARSENAME end parse_error_status=%d\n",parse_error_status) ; if (parse_error_status) { FS_ParsedName_destroy(pn); return parse_error_status ; } if ( pp->pathnext != NULL ) { // extra text -- make this an error RETURN_CODE_SET_SCALAR( parse_error_status, 77 ) ; // extra text in path pe = parse_done; continue; } //printf("%s: Parse %s before corrections: %.4X -- state = %d\n",(back_from_remote)?"BACK":"FORE",pn->path,pn->state,pn->type) ; // Play with remote levels switch ( pn->type ) { case ePN_interface: // /interface is interesting -- it's actually a property of the calling server if ( SpecifiedVeryRemoteBus(pn) ) { // veryremote -> remote pn->state &= ~ePS_busveryremote ; } else if ( SpecifiedRemoteBus(pn) ) { // remote -> local pn->state &= ~ePS_busremote ; pn->state |= ePS_buslocal ; } break ; case ePN_root: // root buses are considered "real" pn->type = ePN_real; // default state break ; default: // everything else gets promoted so directories aren't added on if ( SpecifiedRemoteBus(pn) ) { // very remote pn->state |= ePS_busveryremote; } break ; } //printf("%s: Parse %s after corrections: %.4X -- state = %d\n\n",(back_from_remote)?"BACK":"FORE",pn->path,pn->state,pn->type) ; // set up detail debugging Detail_Test( pn ) ; // turns on debug mode only during this device's query return 0; case parse_error: RETURN_CODE_SET_SCALAR( parse_error_status, 27 ) ; // bad path syntax pe = parse_done; continue; default: break; } // break out next name in path if ( pp->pathnext == NULL ) { // make sure pp->pathnext isn't NULL. (SIGSEGV in uClibc) pp->pathnow = NULL ; } else { pp->pathnow = strsep(&(pp->pathnext), "/") ; } //LEVEL_DEBUG("PARSENAME pathnow=[%s] rest=[%s]",pp->pathnow,pp->pathnext) ; // test next path segment for existence if (pp->pathnow == NULL || pp->pathnow[0] == '\0') { // done parsing pe = parse_done; } // rest of state machine on parsename switch (pe) { case parse_done: // nothing left to process -- will be handled in next loop pass break ; case parse_first: //LEVEL_DEBUG("PARSENAME parse_first") ; pe = Parse_Unspecified(pp->pathnow, remote_status, pn); break; case parse_real: //LEVEL_DEBUG("PARSENAME parse_real") ; pe = Parse_Real(pp->pathnow, remote_status, pn); break; case parse_branch: //LEVEL_DEBUG("PARSENAME parse_branch") ; pe = Parse_Branch(pp->pathnow, remote_status, pn); break; case parse_nonreal: //LEVEL_DEBUG("PARSENAME parse_nonreal\n") ; pe = Parse_NonReal(pp->pathnow, pn); break; case parse_prop: //LEVEL_DEBUG("PARSENAME parse_prop") ; pn->dirlength = pp->pathnow - pp->pathcpy + 1 ; //LEVEL_DEBUG("Dirlength=%d <%*s>",pn->dirlength,pn->dirlength,pn->path) ; //printf("dirlength = %d which makes the path <%s> <%.*s>\n",pn->dirlength,pn->path,pn->dirlength,pn->path); pp->pathlast = pp->pathnow; /* Save for concatination if subdirectory later wanted */ pe = Parse_Property(pp->pathnow, pn); break; case parse_subprop: //LEVEL_DEBUG("PARSENAME parse_subprop") ; pp->pathnow[-1] = '/'; pe = Parse_Property(pp->pathlast, pn); break; default: pe = parse_error; // unknown state break; } //printf("PARSENAME pe=%d\n",pe) ; } } /* Initial memory allocation and pn setup */ static ZERO_OR_ERROR FS_ParsedName_setup(struct parsedname_pointers *pp, const char *path, struct parsedname *pn) { if (pn == NO_PARSEDNAME) { RETURN_CODE_RETURN( 78 ); // unexpected null pointer } memset(pn, 0, sizeof(struct parsedname)); pn->known_bus = NULL; /* all buses */ pn->sparse_name = NULL ; RETURN_CODE_INIT(pn); /* Set the persistent state info (temp scale, ...) -- will be overwritten by client settings in the server */ CONTROLFLAGSLOCK; pn->control_flags = LocalControlFlags | SHOULD_RETURN_BUS_LIST; // initial flag as the bus-returning level, will change if a bus is specified CONTROLFLAGSUNLOCK; // initialization pp->pathnow = NO_PATH; pp->pathlast = NO_PATH; pp->pathnext = NO_PATH; /* Default attributes */ pn->state = ePS_normal; pn->type = ePN_root; /* uncached attribute */ if ( Globals.uncached ) { // local settings (--uncached) can set pn->state |= ePS_uncached; } // Also can be set by path ("/uncached") // Also in owserver, can be set by client flags // sibling inherits parent /* unaliased attribute */ if ( Globals.unaliased ) { // local settings (--unalaised) can set pn->state |= ePS_unaliased; } // Also can be set by path ("/unaliased") // Also in owserver, can be set by client flags // sibling inherits parent /* No device lock yet assigned */ pn->lock = NULL ; /* minimal structure for initial bus "detect" use -- really has connection and LocalControlFlags only */ pn->dirlength = -1 ; if (path == NO_PATH) { return 0; // success } if (strlen(path) > PATH_MAX) { RETURN_CODE_RETURN( 26 ) ; // path too long } /* Have to save pn->path at once */ strcpy(pn->path, "/"); // initial slash strcpy(pn->path+1, path[0]=='/'?path+1:path); strcpy(pn->path_to_server, pn->path); /* make a copy for destructive parsing without initial '/'*/ strcpy(pp->pathcpy,&pn->path[1]); /* pointer to rest of path after current token peeled off */ pp->pathnext = pp->pathcpy; pn->dirlength = strlen(pn->path) ; /* device name */ pn->device_name = NULL ; /* connection_in list and start */ /* ---------------------------- */ /* -- This is important: -- */ /* -- Buses can -- */ /* -- be added by Browse so -- */ /* -- a reader/writer lock is - */ /* -- held until ParsedNameDestroy */ /* ---------------------------- */ CONNIN_RLOCK; pn->selected_connection = NO_CONNECTION ; // Default bus assignment return 0 ; // success } /* Used for virtual directories like settings and statistics * If local, applies to all local (this program) and not a * specific local bus. * If remote, pass it on for the remote to handle * */ static enum parse_enum set_type( enum ePN_type epntype, struct parsedname * pn ) { if (SpecifiedLocalBus(pn)) { return parse_error; } else if ( ! SpecifiedRemoteBus(pn) ) { pn->type |= ePS_busanylocal; } pn->type = epntype; return parse_nonreal; } // Early parsing -- only bus entries, uncached and text may have preceeded static enum parse_enum Parse_Unspecified(char *pathnow, enum parse_pass remote_status, struct parsedname *pn) { static regex_t rx_bus ; static regex_t rx_set ; static regex_t rx_sta ; static regex_t rx_str ; static regex_t rx_sys ; static regex_t rx_int ; static regex_t rx_tex ; static regex_t rx_jso ; static regex_t rx_unc ; static regex_t rx_una ; struct ow_regmatch orm ; orm.number = 1 ; // for bus ow_regcomp( &rx_bus, "^bus\\.([[:digit:]]+)/?", REG_ICASE ) ; ow_regcomp( &rx_set, "^settings/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_sta, "^statistics/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_str, "^structure/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_sys, "^system/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_int, "^interface/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_tex, "^text/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_jso, "^json/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_unc, "^uncached/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_una, "^unaliased/?", REG_ICASE | REG_NOSUB ) ; if ( ow_regexec( &rx_bus, pathnow, &orm ) == 0) { INDEX_OR_ERROR bus_number = (INDEX_OR_ERROR) atoi(orm.match[1]) ; ow_regexec_free( &orm ) ; return Parse_Bus( bus_number, pn); } else if (ow_regexec( &rx_set, pathnow, NULL ) == 0) { return set_type( ePN_settings, pn ) ; } else if (ow_regexec( &rx_sta, pathnow, NULL ) == 0) { return set_type( ePN_statistics, pn ) ; } else if (ow_regexec( &rx_str, pathnow, NULL ) == 0) { return set_type( ePN_structure, pn ) ; } else if (ow_regexec( &rx_sys, pathnow, NULL ) == 0) { return set_type( ePN_system, pn ) ; } else if (ow_regexec( &rx_int, pathnow, NULL ) == 0) { if (!SpecifiedBus(pn)) { return parse_error; } pn->type = ePN_interface; return parse_nonreal; } else if (ow_regexec( &rx_tex, pathnow, NULL ) == 0) { pn->state |= ePS_text; return parse_first; } else if (ow_regexec( &rx_jso, pathnow, NULL ) == 0) { pn->state |= ePS_json; return parse_first; } else if (ow_regexec( &rx_unc, pathnow, NULL ) == 0) { pn->state |= ePS_uncached; return parse_first; } else if (ow_regexec( &rx_una, pathnow, NULL ) == 0) { pn->state |= ePS_unaliased; return parse_first; } pn->type = ePN_real; return Parse_Branch(pathnow, remote_status, pn); } static enum parse_enum Parse_Branch(char *pathnow, enum parse_pass remote_status, struct parsedname *pn) { static regex_t rx_ala ; ow_regcomp( &rx_ala, "^alarm\?", REG_ICASE | REG_NOSUB ) ; if (ow_regexec( &rx_ala, pathnow, NULL ) == 0) { pn->state |= ePS_alarm; pn->type = ePN_real; return parse_real; } return Parse_Real(pathnow, remote_status, pn); } static enum parse_enum Parse_Real(char *pathnow, enum parse_pass remote_status, struct parsedname *pn) { static regex_t rx_sim ; static regex_t rx_the ; static regex_t rx_tex ; static regex_t rx_jso ; static regex_t rx_unc ; static regex_t rx_una ; ow_regcomp( &rx_sim, "^simultaneous/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_the, "^thermostat/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_tex, "^text/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_jso, "^json/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_unc, "^uncached/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_una, "^unaliased/?", REG_ICASE | REG_NOSUB ) ; if (ow_regexec( &rx_sim, pathnow, NULL ) == 0) { pn->selected_device = DeviceSimultaneous; return parse_prop; } else if (ow_regexec( &rx_tex, pathnow, NULL ) == 0) { pn->state |= ePS_text; return parse_real; } else if (ow_regexec( &rx_jso, pathnow, NULL ) == 0) { pn->state |= ePS_json; return parse_real; } else if (ow_regexec( &rx_the, pathnow, NULL ) == 0) { pn->selected_device = DeviceThermostat; return parse_prop; } else if (ow_regexec( &rx_unc, pathnow, NULL ) == 0) { pn->state |= ePS_uncached; return parse_real; } else if (ow_regexec( &rx_una, pathnow, NULL ) == 0) { pn->state |= ePS_unaliased; return parse_real; } else { return Parse_RealDevice(pathnow, remote_status, pn); } } static enum parse_enum Parse_NonReal(char *pathnow, struct parsedname *pn) { static regex_t rx_tex ; static regex_t rx_jso ; static regex_t rx_unc ; static regex_t rx_una ; ow_regcomp( &rx_tex, "^text/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_jso, "^json/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_unc, "^uncached/?", REG_ICASE | REG_NOSUB ) ; ow_regcomp( &rx_una, "^unaliased/?", REG_ICASE | REG_NOSUB ) ; if (ow_regexec( &rx_tex, pathnow, NULL ) == 0) { pn->state |= ePS_text; return parse_nonreal; } else if (ow_regexec( &rx_jso, pathnow, NULL ) == 0) { pn->state |= ePS_json; return parse_nonreal; } else if (ow_regexec( &rx_unc, pathnow, NULL ) == 0) { pn->state |= ePS_uncached; return parse_nonreal; } else if (ow_regexec( &rx_una, pathnow, NULL ) == 0) { pn->state |= ePS_unaliased; return parse_nonreal; } else { return Parse_NonRealDevice(pathnow, pn); } return parse_error; } /* We've reached a /bus.n entry */ static enum parse_enum Parse_Bus( INDEX_OR_ERROR bus_number, struct parsedname *pn) { static regex_t rx_p_bus ; struct ow_regmatch orm ; ow_regcomp( &rx_p_bus, "^/bus\\.[[:digit:]]+/?", REG_ICASE ) ; orm.number = 0 ; /* Processing for bus.X directories -- eventually will make this more generic */ if ( INDEX_NOT_VALID(bus_number) ) { return parse_error; } /* Should make a presence check on remote buses here, but * it's not a major problem if people use bad paths since * they will just end up with empty directory listings. */ if (SpecifiedLocalBus(pn)) { /* already specified a "bus." */ /* too many levels of bus for a non-remote adapter */ return parse_error; } else if (SpecifiedRemoteBus(pn)) { /* already specified a "bus." */ /* Let the remote bus do the heavy lifting */ pn->state |= ePS_busveryremote; return parse_first; } /* Since we are going to use a specific in-device now, set * pn->selected_connection to point at that device at once. */ if ( SetKnownBus(bus_number, pn) ) { return parse_error ; // bus doesn't exist } pn->state |= BusIsServer((pn)->selected_connection) ? ePS_busremote : ePS_buslocal ; if (SpecifiedLocalBus(pn)) { /* don't return bus-list for local paths. */ pn->control_flags &= (~SHOULD_RETURN_BUS_LIST); } /* Create the path without the "bus.x" part in pn->path_to_server */ if ( ow_regexec( &rx_p_bus, pn->path, &orm ) == 0 ) { strcpy( pn->path_to_server, orm.pre[0] ) ; strcat( pn->path_to_server, "/" ) ; strcat( pn->path_to_server, orm.post[0] ) ; ow_regexec_free( &orm ) ; } return parse_first; } // search path for this exact matching path segment static char * find_segment_in_path( char * segment, char * path ) { int segment_length = strlen(segment) ; char augmented_segment[ segment_length + 2 ] ; char * path_pointer = path ; augmented_segment[0] = '/' ; strcpy( &augmented_segment[1], segment ) ; while ( (path_pointer = strstr( path_pointer , augmented_segment )) != NULL ) { ++ path_pointer ; // point after '/' switch( path_pointer[segment_length] ) { case '\0': case '/': return path_pointer ; default: // not a full match -- try again break ; } } return NULL ; } /* replace alias with sn */ static void ReplaceAliasInPath( char * filename, struct parsedname * pn) { int alias_len = strlen(filename) ; // check total length if ( strlen(pn->path_to_server) + 14 - alias_len <= PATH_MAX ) { // find the alias char * alias_loc = find_segment_in_path( filename, pn->path_to_server ) ; if ( alias_loc != NULL ) { char * post_alias_loc ; post_alias_loc = alias_loc + alias_len ; // move rest of path memmove( &alias_loc[14], post_alias_loc, strlen(post_alias_loc)+1 ) ; //write in serial number for alias bytes2string( alias_loc, pn->sn, 7 ) ; } } } /* This is when the alias name in mapped to a known serial number * behaves much more like the standard handling -- bus from sn */ static enum parse_enum Parse_Alias_Known( char *filename, enum parse_pass remote_status, struct parsedname *pn) { if (remote_status == parse_pass_pre_remote) { ReplaceAliasInPath( filename, pn ) ; } return Parse_RealDeviceSN( remote_status, pn ) ; } /* Get a device that isn't a serial number -- see if it's an alias */ static enum parse_enum Parse_Alias(char *filename, enum parse_pass remote_status, struct parsedname *pn) { INDEX_OR_ERROR bus ; // See if the alias is known in the permanent list. We get the serial number if ( GOOD( Cache_Get_Alias_SN(filename,pn->sn)) ) { // Success! The alias is already registered and the serial // number just now loaded in pn->sn return Parse_Alias_Known( filename, remote_status, pn ) ; } // By definition this is a remote device, or non-existent. pn->selected_device = &RemoteDevice ; // is alias name cached from previous query? bus = Cache_Get_Alias_Bus( filename ) ; if ( bus != INDEX_BAD ) { // This alias is cached in temporary list SetKnownBus(bus, pn); return parse_prop ; } // Look for alias in remote buses bus = RemoteAlias(pn) ; if ( bus == INDEX_BAD ) { return parse_error ; } // Found the alias (remotely) SetKnownBus(bus, pn); if ( pn->sn[0] == 0 && pn->sn[7]==0 ) { // no serial number owserver (older) Cache_Add_Alias_Bus(filename,bus) ; } else { Cache_Add_Alias( filename, pn->sn ) ; Cache_Add_Device( bus, pn->sn ) ; pn->selected_device = FS_devicefindhex(pn->sn[0], pn); } return parse_prop ; } /* Parse Name (only device name) part of string */ /* Return -ENOENT if not a valid name return 0 if good *next points to next segment, or NULL if not filetype */ static enum parse_enum Parse_RealDevice(char *filename, enum parse_pass remote_status, struct parsedname *pn) { pn->device_name = find_segment_in_path( filename, pn->path ) ; switch ( Parse_SerialNumber(filename,pn->sn) ) { case sn_not_sn: if ( Find_External_Sensor( filename ) ) { return Parse_External_Device( filename, pn ) ; } else { return Parse_Alias( filename, remote_status, pn) ; } case sn_valid: return Parse_RealDeviceSN( remote_status, pn ) ; case sn_invalid: default: return parse_error ; } } /* Device is known with serial number */ static enum parse_enum Parse_RealDeviceSN(enum parse_pass remote_status, struct parsedname *pn) { /* Search for known 1-wire device -- keyed to device name (family code in HEX) */ pn->selected_device = FS_devicefindhex(pn->sn[0], pn); // returning from owserver -- don't need to check presence (it's implied) if (remote_status == parse_pass_post_remote) { return parse_prop; } if (Globals.one_device) { // Single slave device -- use faster routines SetKnownBus(INDEX_DEFAULT, pn); } else { /* Check the presence, and cache the proper bus number for better performance */ INDEX_OR_ERROR bus_nr = CheckPresence(pn); if ( INDEX_NOT_VALID(bus_nr) ) { return parse_error; /* CheckPresence failed */ } } return parse_prop; } /* Device is known with serial number */ static enum parse_enum Parse_External_Device( char *filename, struct parsedname *pn) { struct sensor_node * sensor_n = Find_External_Sensor( filename ) ; struct family_node * family_n = Find_External_Family( sensor_n->family ) ; pn->selected_device = &(family_n->dev) ; SetKnownBus(Inbound_Control.external->index, pn); return parse_prop; } /* Parse Name (non-device name) part of string */ static enum parse_enum Parse_NonRealDevice(char *filename, struct parsedname *pn) { //printf("Parse_NonRealDevice: [%s] [%s]\n", filename, pn->path); pn->device_name = find_segment_in_path( filename, pn->path ) ; FS_devicefind(filename, pn); return (pn->selected_device == &UnknownDevice) ? parse_error : parse_prop; } static enum parse_enum Parse_Property(char *filename, struct parsedname *pn) { struct device * pdev = pn->selected_device ; struct filetype * ft ; static regex_t rx_extension ; static regex_t rx_all ; static regex_t rx_byte ; static regex_t rx_number ; static regex_t rx_letter ; int extension_given ; struct ow_regmatch orm ; orm.number = 0 ; ow_regcomp( &rx_extension, "\\.", 0 ) ; ow_regcomp( &rx_all, "\\.all$", REG_ICASE ) ; ow_regcomp( &rx_byte, "\\.byte$", REG_ICASE ) ; ow_regcomp( &rx_number, "\\.[[:digit:]]+$", 0 ) ; ow_regcomp( &rx_letter, "\\.[[:alpha:]]$", REG_ICASE ) ; //printf("FilePart: %s %s\n", filename, pn->path); // Special case for remote device. Use distant data if ( pdev == &RemoteDevice ) { // remote device, no known sn, handle property in server. return parse_done ; } // separate filename.dot // filename = strsep(&dot, "."); if ( ow_regexec( &rx_extension, filename, &orm ) == 0 ) { // extension given extension_given = 1 ; ft = bsearch(orm.pre[0], pdev->filetype_array, (size_t) pdev->count_of_filetypes, sizeof(struct filetype), filetype_cmp) ; ow_regexec_free( &orm ) ; } else { // no extension given extension_given = 0 ; ft = bsearch(filename, pdev->filetype_array, (size_t) pdev->count_of_filetypes, sizeof(struct filetype), filetype_cmp) ; } pn->selected_filetype = ft ; if (ft == NO_FILETYPE ) { LEVEL_DEBUG("Unknown property for this device %s",SAFESTRING(filename) ) ; return parse_error; /* filetype not found */ } //printf("FP known filetype %s\n",pn->selected_filetype->name) ; /* Filetype found, now process extension */ if (extension_given==0) { /* no extension */ if (ft->ag != NON_AGGREGATE) { return parse_error; /* aggregate filetypes need an extension */ } pn->extension = 0; /* default when no aggregate */ // Non-aggregate cannot have an extension } else if (ft->ag == NON_AGGREGATE) { return parse_error; /* An extension not allowed when non-aggregate */ // Sparse uses the extension verbatim (text or number) } else if (ft->ag->combined==ag_sparse) { /* Sparse */ if (ft->ag->letters == ag_letters) { /* text string */ pn->extension = 0; /* text extension, not number */ ow_regexec( &rx_extension, filename, &orm ) ; // don't need to test -- already succesful pn->sparse_name = owstrdup(orm.post[0]) ; ow_regexec_free( &orm ) ; LEVEL_DEBUG("Sparse alpha extension found: <%s>",pn->sparse_name); } else { /* Numbers */ if ( ow_regexec( &rx_number, filename, &orm ) == 0 ) { pn->extension = atoi( &orm.match[0][1] ); /* Number conversion */ ow_regexec_free( &orm ) ; LEVEL_DEBUG("Sparse numeric extension found: <%ld>",(long int) pn->extension); } else { LEVEL_DEBUG("Non numeric extension for %s",filename ) ; return parse_error ; } } // Non-sparse "ALL" } else if (ow_regexec( &rx_all, filename, NULL ) == 0) { //printf("FP ALL\n"); pn->extension = EXTENSION_ALL; /* ALL */ // Non-sparse "BYTE" } else if (ft->format == ft_bitfield && ow_regexec( &rx_byte, filename, NULL) == 0) { pn->extension = EXTENSION_BYTE; /* BYTE */ //printf("FP BYTE\n") ; // Non-sparse extension -- interpret and check bounds } else { /* specific extension */ if (ft->ag->letters == ag_letters) { /* Letters */ //printf("FP letters\n") ; if ( ow_regexec( &rx_letter, filename, &orm ) == 0 ) { pn->extension = toupper(orm.match[0][1]) - 'A'; /* Letter extension */ ow_regexec_free( &orm ) ; } else { return parse_error; } } else { /* Numbers */ if ( ow_regexec( &rx_number, filename, &orm ) == 0 ) { pn->extension = atoi( &orm.match[0][1] ); /* Number conversion */ ow_regexec_free( &orm ) ; } else { return parse_error; } } //printf("FP ext=%d nr_elements=%d\n", pn->extension, pn->selected_filetype->ag->elements) ; /* Now check range */ if ((pn->extension < 0) || (pn->extension >= ft->ag->elements)) { //printf("FP Extension out of range %d %d %s\n", pn->extension, pn->selected_filetype->ag->elements, pn->path); LEVEL_DEBUG("Extension %d out of range",pn->extension ) ; return parse_error; /* Extension out of range */ } //printf("FP in range\n") ; } //printf("FP Good\n") ; switch (ft->format) { case ft_directory: // aux or main if ( pn->type == ePN_structure ) { // special case, structure for aux and main return parse_done; } if (BranchAdd(pn) != 0) { //printf("PN BranchAdd failed for %s\n", filename); return parse_error; } /* STATISTICS */ STATLOCK; if (pn->ds2409_depth > dir_depth) { dir_depth = pn->ds2409_depth; } STATUNLOCK; return parse_branch; case ft_subdir: //printf("PN %s is a subdirectory\n", filename); pn->subdir = ft; pn->selected_filetype = NO_FILETYPE; return parse_subprop; default: return parse_done; } } static ZERO_OR_ERROR BranchAdd(struct parsedname *pn) { //printf("BRANCHADD\n"); if ((pn->ds2409_depth % BRANCH_INCR) == 0) { void *temp = pn->bp; if ((pn->bp = owrealloc(temp, (BRANCH_INCR + pn->ds2409_depth) * sizeof(struct ds2409_hubs))) == NULL) { SAFEFREE(temp) ; RETURN_CODE_RETURN( 79 ) ; // unable to allocate memory } } memcpy(pn->bp[pn->ds2409_depth].sn, pn->sn, SERIAL_NUMBER_SIZE); /* copy over DS2409 name */ pn->bp[pn->ds2409_depth].branch = pn->selected_filetype->data.i; ++pn->ds2409_depth; pn->selected_filetype = NO_FILETYPE; pn->selected_device = NO_DEVICE; return 0; } int filetype_cmp(const void *name, const void *ex) { return strcmp((const char *) name, ((const struct filetype *) ex)->name); } /* Parse a path/file combination */ ZERO_OR_ERROR FS_ParsedNamePlus(const char *path, const char *file, struct parsedname *pn) { ZERO_OR_ERROR ret = 0; char *fullpath; if (path == NO_PATH) { path = "" ; } if (file == NULL) { file = "" ; } fullpath = owmalloc(strlen(file) + strlen(path) + 2); if (fullpath == NO_PATH) { RETURN_CODE_RETURN( 79 ) ; // unable to allocate memory } strcpy(fullpath, path); if (fullpath[strlen(fullpath) - 1] != '/') { strcat(fullpath, "/"); } strcat(fullpath, file); //printf("PARSENAMEPLUS path=%s pre\n",fullpath) ; ret = FS_ParsedName(fullpath, pn); //printf("PARSENAMEPLUS path=%s post\n",fullpath) ; owfree(fullpath); //printf("PARSENAMEPLUS free\n") ; return ret; } /* Parse a path/file combination */ ZERO_OR_ERROR FS_ParsedNamePlusExt(const char *path, const char *file, int extension, enum ag_index alphanumeric, struct parsedname *pn) { if (extension == EXTENSION_BYTE ) { return FS_ParsedNamePlusText(path, file, "BYTE", pn); } else if (extension == EXTENSION_ALL ) { return FS_ParsedNamePlusText(path, file, "ALL", pn); } else if (alphanumeric == ag_letters) { char name[2] = { 'A'+extension, 0x00, } ; return FS_ParsedNamePlusText(path, file, name, pn); } else { char name[OW_FULLNAME_MAX]; UCLIBCLOCK; snprintf(name, OW_FULLNAME_MAX, "%d", extension); UCLIBCUNLOCK; return FS_ParsedNamePlusText(path, file, name, pn); } } /* Parse a path/file combination */ ZERO_OR_ERROR FS_ParsedNamePlusText(const char *path, const char *file, const char *extension, struct parsedname *pn) { char name[OW_FULLNAME_MAX]; UCLIBCLOCK; snprintf(name, OW_FULLNAME_MAX, "%s.%s", file, extension ); UCLIBCUNLOCK; return FS_ParsedNamePlus(path, name, pn); } void FS_ParsedName_Placeholder( struct parsedname * pn ) { FS_ParsedName( NULL, pn ) ; // minimal parsename -- no destroy needed } owfs-3.1p5/module/owlib/src/c/ow_parseobject.c0000644000175000001440000002341712654730021016310 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" static GOOD_OR_BAD OWQ_allocate_array( struct one_wire_query * owq ) ; static GOOD_OR_BAD OWQ_parsename(const char *path, struct one_wire_query *owq); static GOOD_OR_BAD OWQ_parsename_plus(const char *path, const char * file, struct one_wire_query *owq); #define OWQ_DEFAULT_READ_BUFFER_SIZE 1 /* Create the Parsename structure and create the buffer */ struct one_wire_query * OWQ_create_from_path(const char *path) { int sz = sizeof( struct one_wire_query ) + OWQ_DEFAULT_READ_BUFFER_SIZE; struct one_wire_query * owq = owmalloc( sz ); LEVEL_DEBUG("%s", path); if ( owq == NO_ONE_WIRE_QUERY) { LEVEL_DEBUG("No memory to create object for path %s",path) ; return NO_ONE_WIRE_QUERY ; } memset(owq, 0, sz); OWQ_cleanup(owq) = owq_cleanup_owq ; if ( GOOD( OWQ_parsename(path,owq) ) ) { if ( GOOD( OWQ_allocate_array(owq)) ) { /* Add a 1 byte buffer by default. This distinguishes from filesystem calls at end of buffer */ /* Read bufer is provided by OWQ_assign_read_buffer or OWQ_allocate_read_buffer */ OWQ_buffer(owq) = (char *) (& owq[1]) ; // point just beyond the one_wire_query struct OWQ_size(owq) = OWQ_DEFAULT_READ_BUFFER_SIZE ; return owq ; } } OWQ_destroy(owq); return NO_ONE_WIRE_QUERY ; } /* Create the Parsename structure and load the relevant fields */ struct one_wire_query * OWQ_create_sibling(const char *sibling, struct one_wire_query *owq_original) { char path[PATH_MAX] ; struct parsedname * pn_original = PN(owq_original) ; int dirlength = pn_original->dirlength ; struct one_wire_query * owq_sib ; strncpy(path, pn_original->path,dirlength) ; strcpy(&path[dirlength],sibling) ; if ( pn_original->selected_filetype == NO_FILETYPE ) { if ( pn_original->subdir == NO_SUBDIR ) { // not a filetype or a subdir return NO_ONE_WIRE_QUERY ; } // Add extension only if original property is aggregate } else if ( pn_original->selected_filetype->ag != NON_AGGREGATE ) { // search for sibling in the filetype array struct filetype * sib_filetype = bsearch(sibling, pn_original->selected_device->filetype_array, (size_t) pn_original->selected_device->count_of_filetypes, sizeof(struct filetype), filetype_cmp) ; // see if sibling is also an aggregate property LEVEL_DEBUG("Path %s is an agggregate",SAFESTRING(pn_original->path)); if ( sib_filetype != NO_FILETYPE && sib_filetype->ag != NON_AGGREGATE ) { char * aggregate_point = path + strlen(path) ; LEVEL_DEBUG("Sibling is also an aggregate",sibling); if (pn_original->extension == EXTENSION_BYTE ) { strcpy( aggregate_point, ".BYTE" ) ; } else if (pn_original->extension == EXTENSION_ALL ) { strcpy( aggregate_point, ".ALL" ) ; } else if (sib_filetype->ag->letters == ag_letters) { UCLIBCLOCK; snprintf(aggregate_point, OW_FULLNAME_MAX, ".%c", pn_original->extension + 'A'); UCLIBCUNLOCK; } else { UCLIBCLOCK; snprintf(aggregate_point, OW_FULLNAME_MAX, ".%d", pn_original->extension ); UCLIBCUNLOCK; } } } LEVEL_DEBUG("Create sibling %s from %s as %s", sibling, pn_original->path,path); owq_sib = OWQ_create_from_path(path) ; if ( owq_sib != NO_ONE_WIRE_QUERY ) { // Sib has no offset OWQ_offset(owq_sib) = 0 ; // Make uncached as restrictive as original // Make unaliased as restrictive as original PN(owq_sib)->state |= (pn_original->state & (ePS_uncached|ePS_unaliased) ) ; return owq_sib ; } return NO_ONE_WIRE_QUERY ; } /* Use an aggregate OWQ as a template for a single element */ struct one_wire_query * OWQ_create_separate( int extension, struct one_wire_query * owq_aggregate ) { int sz = sizeof( struct one_wire_query ) + OWQ_DEFAULT_READ_BUFFER_SIZE; struct one_wire_query * owq_sep = owmalloc( sz ); LEVEL_DEBUG("%s with extension %d", PN(owq_aggregate)->path,extension); if ( owq_sep== NO_ONE_WIRE_QUERY) { LEVEL_DEBUG("No memory to create object for extension %d",extension) ; return NO_ONE_WIRE_QUERY ; } memset(owq_sep, 0, sz); OWQ_cleanup(owq_sep) = owq_cleanup_owq ; memcpy( PN(owq_sep), PN(owq_aggregate), sizeof(struct parsedname) ) ; PN(owq_sep)->extension = extension ; OWQ_buffer(owq_sep) = (char *) (& owq_sep[1]) ; // point just beyond the one_wire_query struct OWQ_size(owq_sep) = OWQ_DEFAULT_READ_BUFFER_SIZE ; OWQ_offset(owq_sep) = 0 ; return owq_sep ; } /* Use an single OWQ as a template for the aggregate one */ struct one_wire_query * OWQ_create_aggregate( struct one_wire_query * owq_single ) { int sz = sizeof( struct one_wire_query ) + OWQ_DEFAULT_READ_BUFFER_SIZE; struct one_wire_query * owq_all = owmalloc( sz ); LEVEL_DEBUG("%s with extension ALL", PN(owq_single)->path); if ( owq_all == NO_ONE_WIRE_QUERY) { LEVEL_DEBUG("No memory to create object for extension ALL") ; return NO_ONE_WIRE_QUERY ; } memset(owq_all, 0, sz); OWQ_cleanup(owq_all) = owq_cleanup_owq ; memcpy( PN(owq_all), PN(owq_single), sizeof(struct parsedname) ) ; PN(owq_all)->extension = EXTENSION_ALL ; OWQ_buffer(owq_all) = (char *) (& owq_all[1]) ; // point just beyond the one_wire_query struct OWQ_size(owq_all) = OWQ_DEFAULT_READ_BUFFER_SIZE ; OWQ_offset(owq_all) = 0 ; if ( BAD( OWQ_allocate_array(owq_all)) ) { OWQ_destroy(owq_all); return NO_ONE_WIRE_QUERY ; } return owq_all ; } /* Create the Parsename structure and load the relevant fields */ GOOD_OR_BAD OWQ_create(const char *path, struct one_wire_query *owq) { LEVEL_DEBUG("%s", path); if ( GOOD( OWQ_parsename(path,owq) ) ) { if ( GOOD( OWQ_allocate_array(owq)) ) { return gbGOOD ; } OWQ_destroy(owq); } return gbBAD ; } /* Create the Parsename structure (using path and file) and load the relevant fields */ /* Starts with a statically allocated owq space */ GOOD_OR_BAD OWQ_create_plus(const char *path, const char *file, struct one_wire_query *owq) { LEVEL_DEBUG("%s + %s", path, file); OWQ_cleanup(owq) = owq_cleanup_none ; if ( GOOD( OWQ_parsename_plus(path,file,owq) ) ) { if ( GOOD( OWQ_allocate_array(owq)) ) { return gbGOOD ; } OWQ_destroy(owq); } return gbBAD ; } /* Create the Parsename structure in owq */ static GOOD_OR_BAD OWQ_parsename(const char *path, struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if ( FS_ParsedName(path, pn) != 0 ) { return gbBAD ; } OWQ_cleanup(owq) |= owq_cleanup_pn ; return gbGOOD ; } static GOOD_OR_BAD OWQ_parsename_plus(const char *path, const char * file, struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if ( FS_ParsedNamePlus(path, file, pn) != 0 ) { return gbBAD ; } OWQ_cleanup(owq) |= owq_cleanup_pn ; return gbGOOD ; } static GOOD_OR_BAD OWQ_allocate_array( struct one_wire_query * owq ) { struct parsedname * pn = PN(owq) ; if (pn->extension == EXTENSION_ALL && pn->type != ePN_structure) { OWQ_array(owq) = owcalloc((size_t) pn->selected_filetype->ag->elements, sizeof(union value_object)); if (OWQ_array(owq) == NO_ONE_WIRE_QUERY) { return gbBAD ; } OWQ_cleanup(owq) |= owq_cleanup_array ; } else { OWQ_I(owq) = 0; } return gbGOOD ; } void OWQ_assign_read_buffer(char *buffer, size_t size, off_t offset, struct one_wire_query *owq) { OWQ_buffer(owq) = buffer; OWQ_size(owq) = size; OWQ_offset(owq) = offset; } void OWQ_assign_write_buffer(const char *buffer, size_t size, off_t offset, struct one_wire_query *owq) { // OWQ_buffer used for both read (non-const) and write (const) #if ( __GNUC__ > 4 ) || (__GNUC__ == 4 && __GNUC_MINOR__ > 4 ) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" OWQ_buffer(owq) = (char *) buffer; #pragma GCC diagnostic pop #else OWQ_buffer(owq) = (char *) buffer; #endif OWQ_size(owq) = size; OWQ_offset(owq) = offset; } // create the buffer of size filesize GOOD_OR_BAD OWQ_allocate_read_buffer(struct one_wire_query * owq ) { struct parsedname * pn = PN(owq) ; size_t size = FullFileLength(pn); if ( size > 0 ) { char * buffer = owmalloc(size+1) ; if ( buffer == NULL ) { return gbBAD ; } memset(buffer,0,size+1) ; OWQ_buffer(owq) = buffer ; OWQ_size(owq) = size ; OWQ_offset(owq) = 0 ; OWQ_cleanup(owq) |= owq_cleanup_buffer ; } return gbGOOD; } GOOD_OR_BAD OWQ_allocate_write_buffer( const char * write_buffer, size_t buffer_length, off_t offset, struct one_wire_query * owq ) { char * buffer_copy ; if ( buffer_length == 0 ) { // Buffer size is zero. Allowed, but make it NULL and no cleanup needed. OWQ_size(owq) = 0 ; OWQ_offset(owq) = 0 ; return gbGOOD ; } buffer_copy = owmalloc( buffer_length+1) ; if ( buffer_copy == NULL) { // cannot allocate space for buffer LEVEL_DEBUG("Cannot allocate %ld bytes for buffer", buffer_length) ; OWQ_size(owq) = 0 ; OWQ_offset(owq) = 0 ; return gbBAD ; } memcpy( buffer_copy, write_buffer, buffer_length) ; buffer_copy[buffer_length] = '\0' ; // make sure it's zero-ended OWQ_buffer(owq) = buffer_copy ; OWQ_size(owq) = buffer_length ; OWQ_length(owq) = buffer_length ; OWQ_offset(owq) = offset ; OWQ_cleanup(owq) |= owq_cleanup_buffer ; // buffer needs cleanup return gbGOOD ; } void OWQ_destroy(struct one_wire_query *owq) { if ( owq == NO_ONE_WIRE_QUERY) { return ; } if ( OWQ_cleanup(owq) & owq_cleanup_buffer ) { owfree(OWQ_buffer(owq)) ; } if ( OWQ_cleanup(owq) & owq_cleanup_rbuffer ) { //owfree(OWQ_read_buffer(owq)) ; } if ( OWQ_cleanup(owq) & owq_cleanup_array ) { owfree(OWQ_array(owq)) ; } if ( OWQ_cleanup(owq) & owq_cleanup_pn ) { FS_ParsedName_destroy(PN(owq)) ; } if ( OWQ_cleanup(owq) & owq_cleanup_owq ) { owfree(owq) ; } else { OWQ_cleanup(owq) = owq_cleanup_none ; } } owfs-3.1p5/module/owlib/src/c/ow_parseoutput.c0000644000175000001440000002416412654730021016402 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor $ID: $ */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" /* ------- Prototypes ----------- */ static SIZE_OR_ERROR OWQ_parse_output_integer(struct one_wire_query *owq); static SIZE_OR_ERROR OWQ_parse_output_unsigned(struct one_wire_query *owq); static SIZE_OR_ERROR OWQ_parse_output_float(struct one_wire_query *owq); static SIZE_OR_ERROR OWQ_parse_output_date(struct one_wire_query *owq); static SIZE_OR_ERROR OWQ_parse_output_yesno(struct one_wire_query *owq); static SIZE_OR_ERROR OWQ_parse_output_ascii(struct one_wire_query *owq); static SIZE_OR_ERROR OWQ_parse_output_array_with_commas(struct one_wire_query *owq); static SIZE_OR_ERROR OWQ_parse_output_array_no_commas(struct one_wire_query *owq); static SIZE_OR_ERROR OWQ_parse_output_ascii_array(struct one_wire_query *owq); static SIZE_OR_ERROR OWQ_parse_output_offset_and_size_z(const char *string, struct one_wire_query *owq) ; static SIZE_OR_ERROR OWQ_parse_output_offset_and_size(const char *string, size_t length, struct one_wire_query *owq) ; /* Change in strategy 6/2006: Now use CheckPresence as primary method of finding correct bus Can break down cases into: 1. bad ParsedName -- no read possible 2. structure -- read from 1st bus (local) 3. specified bus (picked up in ParsedName) -- use that 4. statistics, settings, Simultaneous, Thermostat -- use first or specified 5. real -- use caced, if error, delete cache entry and try twice more. */ /* ---------------------------------------------- */ /* Filesystem callback functions */ /* ---------------------------------------------- */ SIZE_OR_ERROR OWQ_parse_output(struct one_wire_query *owq) { // have to check if offset is beyond the filesize. if (OWQ_offset(owq)) { size_t file_length = 0; file_length = FileLength(PN(owq)); LEVEL_DEBUG("file_length=%lu offset=%lu size=%lu", (unsigned long) file_length, (unsigned long) OWQ_offset(owq), (unsigned long) OWQ_size(owq)); if ((unsigned long) OWQ_offset(owq) >= (unsigned long) file_length) { return 0; // This is data-length } } /* Special case, structure is always ascii */ if (OWQ_pn(owq).type == ePN_structure) { return OWQ_parse_output_ascii(owq); } switch (OWQ_pn(owq).extension) { case EXTENSION_BYTE: return OWQ_parse_output_unsigned(owq); case EXTENSION_ALL: switch (OWQ_pn(owq).selected_filetype->format) { case ft_ascii: case ft_vascii: case ft_alias: return OWQ_parse_output_ascii_array(owq); case ft_binary: return OWQ_parse_output_array_no_commas(owq); default: return OWQ_parse_output_array_with_commas(owq); } default: switch (OWQ_pn(owq).selected_filetype->format) { case ft_integer: return OWQ_parse_output_integer(owq); case ft_yesno: case ft_bitfield: return OWQ_parse_output_yesno(owq); case ft_unsigned: return OWQ_parse_output_unsigned(owq); case ft_pressure: case ft_temperature: case ft_tempgap: case ft_float: return OWQ_parse_output_float(owq); case ft_date: return OWQ_parse_output_date(owq); case ft_vascii: case ft_alias: case ft_ascii: case ft_binary: return OWQ_parse_output_ascii(owq); case ft_directory: case ft_subdir: case ft_unknown: return -ENOENT; } } return -EINVAL; // should never be reached if all the cases are truly covered } static SIZE_OR_ERROR OWQ_parse_output_integer(struct one_wire_query *owq) { /* should only need suglen+1, but uClibc's snprintf() seem to trash 'len' if not increased */ int len; char c[PROPERTY_LENGTH_INTEGER + 2]; UCLIBCLOCK; if ( ShouldTrim(PN(owq)) ) { len = snprintf(c, PROPERTY_LENGTH_INTEGER + 1, "%1d", OWQ_I(owq)); } else { len = snprintf(c, PROPERTY_LENGTH_INTEGER + 1, "%*d", PROPERTY_LENGTH_INTEGER, OWQ_I(owq)); } UCLIBCUNLOCK; if ((len < 0) || ((size_t) len > PROPERTY_LENGTH_INTEGER)) { return -EMSGSIZE; } return OWQ_parse_output_offset_and_size(c, len, owq); } static SIZE_OR_ERROR OWQ_parse_output_unsigned(struct one_wire_query *owq) { /* should only need suglen+1, but uClibc's snprintf() seem to trash 'len' if not increased */ int len; char c[PROPERTY_LENGTH_UNSIGNED + 2]; UCLIBCLOCK; if ( ShouldTrim(PN(owq)) ) { len = snprintf(c, PROPERTY_LENGTH_UNSIGNED + 1, "%1u", OWQ_U(owq)); } else { len = snprintf(c, PROPERTY_LENGTH_UNSIGNED + 1, "%*u", PROPERTY_LENGTH_UNSIGNED, OWQ_U(owq)); } UCLIBCUNLOCK; if ((len < 0) || ((size_t) len > PROPERTY_LENGTH_UNSIGNED)) { return -EMSGSIZE; } return OWQ_parse_output_offset_and_size(c, len, owq); } static SIZE_OR_ERROR OWQ_parse_output_float(struct one_wire_query *owq) { /* should only need suglen+1, but uClibc's snprintf() seem to trash 'len' if not increased */ int len; char c[PROPERTY_LENGTH_FLOAT + 2]; _FLOAT F; switch (OWQ_pn(owq).selected_filetype->format) { case ft_pressure: F = Pressure(OWQ_F(owq), PN(owq)); break; case ft_temperature: F = Temperature(OWQ_F(owq), PN(owq)); break; case ft_tempgap: F = TemperatureGap(OWQ_F(owq), PN(owq)); break; default: F = OWQ_F(owq); break; } UCLIBCLOCK; if ( ShouldTrim(PN(owq)) ) { len = snprintf(c, PROPERTY_LENGTH_FLOAT + 1, "%1G", F); } else { len = snprintf(c, PROPERTY_LENGTH_FLOAT + 1, "%*G", PROPERTY_LENGTH_FLOAT, F); } UCLIBCUNLOCK; if ((len < 0) || ((size_t) len > PROPERTY_LENGTH_FLOAT)) { return -EMSGSIZE; } return OWQ_parse_output_offset_and_size(c, len, owq); } static SIZE_OR_ERROR OWQ_parse_output_date(struct one_wire_query *owq) { char c[PROPERTY_LENGTH_DATE + 2]; if (OWQ_size(owq) < PROPERTY_LENGTH_DATE) { return -EMSGSIZE; } ctime_r(&OWQ_D(owq), c); return OWQ_parse_output_offset_and_size(c, PROPERTY_LENGTH_DATE, owq); } static SIZE_OR_ERROR OWQ_parse_output_yesno(struct one_wire_query *owq) { if (OWQ_size(owq) < PROPERTY_LENGTH_YESNO) { return -EMSGSIZE; } OWQ_buffer(owq)[0] = ((OWQ_Y(owq) & 0x1) == 0) ? '0' : '1'; return ShouldTrim(PN(owq))? 1 : PROPERTY_LENGTH_YESNO; } ZERO_OR_ERROR OWQ_format_output_offset_and_size_z(const char *string, struct one_wire_query *owq) { SIZE_OR_ERROR ret = OWQ_parse_output_offset_and_size_z(string,owq) ; if ( ret > 0 ) { return 0 ; } return ret ; } ZERO_OR_ERROR OWQ_format_output_offset_and_size(const char *string, size_t length, struct one_wire_query *owq) { SIZE_OR_ERROR ret = OWQ_parse_output_offset_and_size(string,length,owq) ; if ( ret > 0 ) { return 0 ; } return ret ; } static SIZE_OR_ERROR OWQ_parse_output_offset_and_size_z(const char *string, struct one_wire_query *owq) { return OWQ_parse_output_offset_and_size(string, strlen(string), owq); } /* Put a string ionto the OWQ structure and return the length check lengths and offsets as part of the process */ static SIZE_OR_ERROR OWQ_parse_output_offset_and_size(const char *string, size_t length, struct one_wire_query *owq) { size_t copy_length = length; off_t offset = OWQ_offset(owq); Debug_Bytes("OWQ_parse_output_offset_and_size", (const BYTE *) string, length); /* offset is after the length of the string -- return 0 since some conditions a read after the end is done automatically */ if (offset > (off_t) length) { return 0; } /* correct length for offset (cannot be negative because of previous check) */ copy_length -= offset; /* correct length for buffer space */ if (copy_length > OWQ_size(owq)) { copy_length = OWQ_size(owq); } /* and copy */ memcpy(OWQ_buffer(owq), &string[offset], copy_length); // Warning, this will overwrite the I U or DATA value, // but that shouldn't matter since it's only called on ascii values // and all structure values OWQ_length(owq) = copy_length; return copy_length; } static SIZE_OR_ERROR OWQ_parse_output_ascii(struct one_wire_query *owq) { Debug_OWQ(owq); return OWQ_length(owq); } static SIZE_OR_ERROR OWQ_parse_output_array_with_commas(struct one_wire_query *owq) { struct one_wire_query owq_single; size_t extension; int len; size_t used_size = 0; size_t remaining_size = OWQ_size(owq); size_t elements = OWQ_pn(owq).selected_filetype->ag->elements; // loop though all array elements for (extension = 0; extension < elements; ++extension) { //printf("OWQ_parse_output_array_with_commas element=%d, size_used=%d, remaining=%d\n",(int)extension,(int)used_size,(int)remaining_size) ; // Prepare a copy of owq that only points to a single element memcpy(&owq_single, owq, sizeof(owq_single)); OWQ_pn(&owq_single).extension = extension; memcpy(&OWQ_val(&owq_single), &OWQ_array(owq)[extension], sizeof(union value_object)); // add the comma first (if not the first element and enough room) if (used_size > 0) { if (remaining_size == 0) { return -EFAULT; } OWQ_buffer(owq)[used_size] = ','; ++used_size; --remaining_size; } // Now process the single element OWQ_buffer(&owq_single) = &OWQ_buffer(owq)[used_size]; OWQ_size(&owq_single) = remaining_size; len = OWQ_parse_output(&owq_single); // any error aborts if (len < 0) { return len; } remaining_size -= len; used_size += len; } return used_size; } static SIZE_OR_ERROR OWQ_parse_output_ascii_array(struct one_wire_query *owq) { size_t extension; size_t elements = OWQ_pn(owq).selected_filetype->ag->elements; size_t total_length = 0; size_t current_offset = OWQ_array_length(owq, 0); for (extension = 0; extension < elements; ++extension) { total_length += OWQ_array_length(owq, extension); } for (extension = 1; extension < elements; ++extension) { memmove(&OWQ_buffer(owq)[current_offset + 1], &OWQ_buffer(owq)[current_offset], total_length - current_offset); OWQ_buffer(owq)[current_offset] = ','; ++total_length; current_offset += 1 + OWQ_array_length(owq, extension); } return total_length; } static SIZE_OR_ERROR OWQ_parse_output_array_no_commas(struct one_wire_query *owq) { size_t extension; size_t total_length = 0; size_t elements = OWQ_pn(owq).selected_filetype->ag->elements; for (extension = 0; extension < elements; ++extension) { total_length += OWQ_array_length(owq, extension); } return total_length; } owfs-3.1p5/module/owlib/src/c/ow_parseshallow.c0000644000175000001440000000125612654730021016510 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" void OWQ_create_temporary(struct one_wire_query *owq_temporary, char *buffer, size_t size, off_t offset, struct parsedname *pn) { OWQ_buffer(owq_temporary) = buffer; OWQ_size(owq_temporary) = size; OWQ_offset(owq_temporary) = offset; memcpy(PN(owq_temporary), pn, sizeof(struct parsedname)); } owfs-3.1p5/module/owlib/src/c/ow_parse_sn.c0000644000175000001440000000344212654730021015615 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ // regex #include #include "owfs_config.h" #include "ow.h" /* Fill get serikal number from a character string */ enum parse_serialnumber Parse_SerialNumber(char *sn_char, BYTE * sn) { static regex_t rx_sn_parse ; struct ow_regmatch orm ; ow_regcomp( &rx_sn_parse, "^([[:xdigit:]]{2})\\.?([[:xdigit:]]{12})\\.?([[:xdigit:]]{2}){0,1}$", 0 ) ; orm.number = 3 ; if ( sn_char == NULL ) { return sn_null ; } if ( ow_regexec( &rx_sn_parse, sn_char, &orm ) != 0 ) { return sn_not_sn ; } sn[0] = string2num(orm.match[1]); sn[1] = string2num(&orm.match[2][0]); sn[2] = string2num(&orm.match[2][2]); sn[3] = string2num(&orm.match[2][4]); sn[4] = string2num(&orm.match[2][6]); sn[5] = string2num(&orm.match[2][8]); sn[6] = string2num(&orm.match[2][10]); sn[7] = CRC8compute(sn, SERIAL_NUMBER_SIZE-1, 0); if (orm.match[3] != NULL) { // CRC given if ( string2num(orm.match[3]) != sn[7] ) { ow_regexec_free( &orm ) ; return sn_invalid; } } ow_regexec_free( &orm ) ; return sn_valid ; } // returns number of valid bytes in serial number int SerialNumber_length(char *sn_char, BYTE * sn) { int bytes; for ( bytes = 0 ; bytes < SERIAL_NUMBER_SIZE ; ++bytes ) { char ID[2] ; if (*sn_char == '.') { // ignore dots ++sn_char; } if (isxdigit(*sn_char)) { ID[0] = *sn_char; } else { return bytes; // non-hex } ++sn_char ; if (isxdigit(*sn_char)) { ID[1] = *sn_char; } else { return bytes; // non-hex } sn[bytes] = string2num(ID); ++sn_char ; } return SERIAL_NUMBER_SIZE ; } owfs-3.1p5/module/owlib/src/c/ow_pid.c0000644000175000001440000000224112654730021014553 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_pid.h" #include "sd-daemon.h" /* Globals */ int pid_created = 0; /* flag flag when file actually created */ char *pid_file = NULL; /* filename where PID number stored */ void PIDstart(void) { /* store the PID */ pid_t pid_num = getpid(); if (pid_file) { FILE *pid = fopen(pid_file, "w+"); if (pid == NULL) { ERROR_CONNECT("Cannot open PID file: %s", pid_file); owfree(pid_file); pid_file = NULL; } else { fprintf(pid, "%lu", (unsigned long int) pid_num); fclose(pid); pid_created = 1; } } /* Send the PID to systemd * -- will be a NOP if systed not available */ sd_notifyf( 0, "MAINPID=%d",pid_num ) ; } /* At library closeup */ void PIDstop(void) { if (pid_created && pid_file) { if (unlink(pid_file)) { ERROR_CONNECT("Cannot remove PID file: %s", pid_file); } SAFEFREE(pid_file); } } owfs-3.1p5/module/owlib/src/c/ow_powerbyte.c0000644000175000001440000000520012654730021016015 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" // Send 8 bits of communication to the 1-Wire Net // Delay delay msec and return to normal // GOOD_OR_BAD BUS_PowerByte(BYTE data, BYTE * resp, UINT delay, const struct parsedname *pn) { GOOD_OR_BAD ret; struct connection_in * in = pn->selected_connection ; /* Special handling for some adapters that can handle independent channels * but others, like the DS2482-800 aren't completely independent * */ /* Very tricky -- we will release the port but not the channel * so other threads can use the port's other channels * but we have to be careful of deadlocks * by fully releasing before relocking. * We are locking and releasing out of sequence * */ /* At the end, we need to relock because that's what the surrounding code expects * -- that this routine is called with locked port and channel * and leaves with same * */ if ( in->iroutines.PowerByte != NO_POWERBYTE_ROUTINE ) { // use available byte level routine ret = (in->iroutines.PowerByte) (data, resp, delay, pn); } else if ( in->iroutines.PowerBit != NO_POWERBIT_ROUTINE && in->iroutines.sendback_bits != NO_SENDBACKBITS_ROUTINE ) { // use available bit level routine BYTE sending[8]; BYTE receive[8] ; int i ; for ( i = 0 ; i < 8 ; ++i ) { // load up bits sending[i] = UT_getbit(&data,i) ? 0xFF : 0x00 ; } ret = BUS_sendback_bits( sending, receive, 7, pn ) ; // send first 7 bits if ( GOOD(ret) ) { ret = BUS_PowerBit( sending[7], &receive[7], delay, pn ) ; // last bit with power and delay } for ( i = 0 ; i < 8 ; ++i ) { UT_setbit( resp, i, receive[i] ) ; } } else { // send with no true power applied if (in->iroutines.flags & ADAP_FLAG_unlock_during_delay) { /* Can unlock port (but not channel) */ ret = BUS_sendback_data(&data, resp, 1, pn); PORTUNLOCKIN(in); // other channels are accessible, but this channel is still locked // delay UT_delay(delay); CHANNELUNLOCKIN(in); // have to release channel, too // now need to relock for further work in transaction BUSLOCKIN(in); } else { // send with no true power applied ret = BUS_sendback_data(&data, resp, 1, pn); // delay UT_delay(delay); } } if ( BAD(ret) ) { STAT_ADD1_BUS(e_bus_pullup_errors, in); return gbBAD ; } return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_powerbit.c0000644000175000001440000000440412654730021015635 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" // Send 8 bits of communication to the 1-Wire Net // Delay delay msec and return to normal // // Power is supplied by normal pull-up resistor, nothing special // /* Returns 0=good bad = -EIO */ GOOD_OR_BAD BUS_PowerBit(BYTE data, BYTE * resp, UINT delay, const struct parsedname *pn) { GOOD_OR_BAD ret; struct connection_in * in = pn->selected_connection ; /* Special handling for some adapters that can handle independent channels * but others, like the DS2482-800 aren't completely independent * */ /* Very tricky -- we will release the port but not the channel * so other threads can use the port's other channels * but we have to be careful of deadlocks * by fully releasing before relocking. * We are locking and releasing out of sequence * */ /* At the end, we need to relock because that's what the surrounding code expects * -- that this routine is called with locked port and channel * and leaves with same * */ if ( in->iroutines.PowerBit !=NO_POWERBIT_ROUTINE ) { // use available bit level routine ret = (in->iroutines.PowerBit) (data, resp, delay, pn); } else { // send a bit and delay (use normal pull-up for power) if (in->iroutines.flags & ADAP_FLAG_unlock_during_delay) { ret = BUS_sendback_bits(&data, resp, 1, pn); /* Can unlock port (but not channel) */ PORTUNLOCKIN(in); // other channels are accessible, but this channel is still locked // delay UT_delay(delay); CHANNELUNLOCKIN(in); // have to release channel, too // now need to relock for further work in transaction BUSLOCKIN(in); // Wait for other thread to complete } else { // send the packet but keep port locked // No real "power" in the default case ret = BUS_sendback_bits(&data, resp, 1, pn); // delay UT_delay(delay); } } if ( BAD(ret) ) { STAT_ADD1_BUS(e_bus_pullup_errors, in); return gbBAD ; } return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_presence.c0000644000175000001440000002042012654730021015602 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_standard.h" #include "ow_counters.h" #include "ow_connection.h" /* ------- Prototypes ------------ */ static INDEX_OR_ERROR CheckPresence_low(struct parsedname *pn); static INDEX_OR_ERROR CheckThisConnection(int bus_nr, struct parsedname *pn) ; static GOOD_OR_BAD PresenceFromDirblob( struct parsedname * pn ) ; /* ------- Functions ------------ */ /* Check if device exists -- >=0 yes, -1 no */ INDEX_OR_ERROR CheckPresence(struct parsedname *pn) { INDEX_OR_ERROR bus_nr; if (NotRealDir(pn)) { return INDEX_DEFAULT; } if ((pn->selected_device == DeviceSimultaneous) || (pn->selected_device == DeviceThermostat)) { return INDEX_DEFAULT; } /* If set, already found bus. */ /* Use UnsetKnownBus to clear and allow a new search */ if (KnownBus(pn)) { return pn->known_bus->index; } if ( GOOD( Cache_Get_Device(&bus_nr, pn)) ) { LEVEL_DEBUG("Found device on bus %d",bus_nr); SetKnownBus(bus_nr, pn); return bus_nr; } LEVEL_DETAIL("Checking presence of %s", SAFESTRING(pn->path)); bus_nr = CheckPresence_low(pn); // check only allocated inbound connections if ( INDEX_VALID(bus_nr) ) { SetKnownBus(bus_nr, pn); Cache_Add_Device( bus_nr, pn->sn ) ; return bus_nr; } UnsetKnownBus(pn); return INDEX_BAD; } /* See if a cached location is accurate -- called with "Known Bus" set */ INDEX_OR_ERROR ReCheckPresence(struct parsedname *pn) { INDEX_OR_ERROR bus_nr; if (NotRealDir(pn)) { return INDEX_DEFAULT; } if ((pn->selected_device == DeviceSimultaneous) || (pn->selected_device == DeviceThermostat)) { return INDEX_DEFAULT; } if (KnownBus(pn)) { if ( INDEX_VALID( CheckThisConnection(pn->known_bus->index,pn) ) ) { return pn->known_bus->index ; } } if ( GOOD( Cache_Get_Device(&bus_nr, pn)) ) { LEVEL_DEBUG("Found device on bus %d",bus_nr); if ( INDEX_VALID( CheckThisConnection(bus_nr,pn) ) ) { SetKnownBus(bus_nr, pn); return bus_nr ; } } UnsetKnownBus(pn); Cache_Del_Device(pn) ; return CheckPresence(pn); } /* Check if device exists -- -1 no, >=0 yes (bus number) */ /* lower level, cycle through the devices */ struct checkpresence_struct { struct port_in * pin; struct connection_in * cin; struct parsedname *pn; INDEX_OR_ERROR bus_nr; }; static void * CheckPresence_callback_conn(void * v) { struct checkpresence_struct * cps = (struct checkpresence_struct *) v ; struct checkpresence_struct cps_next ; pthread_t thread; int threadbad = 0 ; cps_next.cin = cps->cin->next ; if ( cps_next.cin == NO_CONNECTION ) { threadbad = 1 ; } else { cps_next.pin = cps->pin ; cps_next.pn = cps->pn ; cps_next.bus_nr = INDEX_BAD ; threadbad = pthread_create(&thread, DEFAULT_THREAD_ATTR, CheckPresence_callback_conn, (void *) (&cps_next)) ; } cps->bus_nr = CheckThisConnection( cps->cin->index, cps->pn ) ; if (threadbad == 0) { /* was a thread created? */ if (pthread_join(thread, NULL)==0) { if ( INDEX_VALID(cps_next.bus_nr) ) { cps->bus_nr = cps_next.bus_nr ; } } } return VOID_RETURN ; } static void * CheckPresence_callback_port(void * v) { struct checkpresence_struct * cps = (struct checkpresence_struct *) v ; struct checkpresence_struct cps_next ; pthread_t thread; int threadbad = 0 ; cps_next.pin = cps->pin->next ; if ( cps_next.pin == NULL ) { threadbad = 1 ; } else { cps_next.pn = cps->pn ; cps_next.bus_nr = INDEX_BAD ; threadbad = pthread_create(&thread, DEFAULT_THREAD_ATTR, CheckPresence_callback_port, (void *) (&cps_next)) ; } cps->cin = cps->pin->first ; if ( cps->cin != NO_CONNECTION ) { CheckPresence_callback_conn(v) ; } if (threadbad == 0) { /* was a thread created? */ if (pthread_join(thread, NULL)==0) { if ( INDEX_VALID(cps_next.bus_nr) ) { cps->bus_nr = cps_next.bus_nr ; } } } return VOID_RETURN ; } static INDEX_OR_ERROR CheckPresence_low(struct parsedname *pn) { struct checkpresence_struct cps = { Inbound_Control.head_port, NULL, pn, INDEX_BAD }; if ( cps.pin != NULL ) { CheckPresence_callback_port( (void *) (&cps) ) ; } return cps.bus_nr; } ZERO_OR_ERROR FS_present(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if (NotRealDir(pn) || pn->selected_device == DeviceSimultaneous || pn->selected_device == DeviceThermostat) { OWQ_Y(owq) = 1; } else if ( IsUncachedDir(pn) ) { struct transaction_log t[] = { TRXN_NVERIFY, TRXN_END, }; OWQ_Y(owq) = BAD(BUS_transaction(t, pn)) ? 0 : 1; } else if ( pn->selected_connection->iroutines.flags & ADAP_FLAG_presence_from_dirblob ) { OWQ_Y(owq) = GOOD( PresenceFromDirblob(pn) ) ; } else if ( pn->selected_connection->iroutines.flags & ADAP_FLAG_sham ) { OWQ_Y(owq) = 0 ; } else { struct transaction_log t[] = { TRXN_NVERIFY, TRXN_END, }; OWQ_Y(owq) = BAD(BUS_transaction(t, pn)) ? 0 : 1; } return 0; } // Look on a given connection for the device static INDEX_OR_ERROR CheckThisConnection(int bus_nr, struct parsedname *pn) { struct parsedname s_pn_copy; struct parsedname * pn_copy = &s_pn_copy ; struct connection_in * in = find_connection_in(bus_nr) ; INDEX_OR_ERROR connection_result = INDEX_BAD ; if ( in == NO_CONNECTION ) { return INDEX_BAD ; } memcpy(pn_copy, pn, sizeof(struct parsedname)); // shallow copy pn_copy->selected_connection = in; if ( BAD( TestConnection(pn_copy) ) ) { // Connection currently disconnected return INDEX_BAD; } else if (BusIsServer(in)) { // Server if ( INDEX_VALID( ServerPresence(pn_copy) ) ) { connection_result = in->index; } } else if ( in->iroutines.flags & ADAP_FLAG_sham ) { return INDEX_BAD ; } else if ( in->iroutines.flags & ADAP_FLAG_presence_from_dirblob ) { // local connection with a dirblob (like fake, mock, ...) if ( GOOD( PresenceFromDirblob( pn_copy ) ) ) { connection_result = in->index ; } } else { // local connection but need to ask directly struct transaction_log t[] = { TRXN_NVERIFY, TRXN_END, }; if ( GOOD( BUS_transaction(t, pn_copy) ) ) { connection_result = in->index ; } } if ( connection_result == INDEX_BAD ) { LEVEL_DEBUG("Presence of "SNformat" NOT found on bus %s",SNvar(pn_copy->sn),SAFESTRING(DEVICENAME(in))) ; } else { LEVEL_DEBUG("Presence of "SNformat" FOUND on bus %s",SNvar(pn_copy->sn),SAFESTRING(DEVICENAME(in))) ; Cache_Add_Device(in->index,pn_copy->sn) ; // add or update cache */ } return connection_result ; } static GOOD_OR_BAD PresenceFromDirblob( struct parsedname * pn ) { struct dirblob db; // cached dirblob if ( GOOD( Cache_Get_Dir( &db , pn ) ) ) { // Use the dirblob from the cache GOOD_OR_BAD ret = ( DirblobSearch(pn->sn, &db ) >= 0 ) ? gbGOOD : gbBAD ; DirblobClear( &db ) ; return ret ; } else { // look through actual directory struct device_search ds ; enum search_status nextboth = BUS_first( &ds, pn ) ; while ( nextboth == search_good ) { if ( memcmp( ds.sn, pn->sn, SERIAL_NUMBER_SIZE ) == 0 ) { // found it. Early exit. BUS_next_cleanup( &ds ); return gbGOOD ; } // Not found. Clean up done by BUS_next in this case nextboth = BUS_next( &ds, pn ) ; } return gbBAD ; } } owfs-3.1p5/module/owlib/src/c/ow_pressure.c0000644000175000001440000000204712654730021015653 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" struct pressure_data { char * name ; _FLOAT in_mbars ; } PressureData[] = { { "mbar", 1.0, }, { "atm", 0.00098692316931, }, { "mmHg", 0.7500615613, }, { "inHg", 0.029529983071, }, { "psi", 0.014503773801, }, { "Pa", 100.0, }, { "", 1.0, }, { "", 1.0, }, } ; const char *PressureScaleName(enum pressure_type p) { return PressureData[p].name; } /* Pressure Conversion routines */ /* convert internal (mbar) to external format */ _FLOAT Pressure(_FLOAT P, const struct parsedname * pn) { return P * PressureData[PressureScale(pn)].in_mbars ; } /* convert to internal (mbar) from external format */ _FLOAT fromPressure(_FLOAT P, const struct parsedname * pn) { return P / PressureData[PressureScale(pn)].in_mbars ; } owfs-3.1p5/module/owlib/src/c/ow_printparse.c0000644000175000001440000000203712654730021016171 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" void _print_owq(struct one_wire_query *owq) { char c[32]; fprintf(stderr,"OWQ OneWireQuery structure of %s\n", PN(owq)->path); fprintf(stderr," OneWireQuery size=%lu offset=%lu, extension=%d\n", (unsigned long) OWQ_size(owq), (unsigned long) OWQ_offset(owq), (int) OWQ_pn(owq).extension); if ( OWQ_buffer(owq) != NULL ) { Debug_Bytes("OneWireQuery buffer", (BYTE *) OWQ_buffer(owq), OWQ_size(owq)); } fprintf(stderr," Cleanup = %.4X",OWQ_cleanup(owq)); fprintf(stderr," OneWireQuery I=%d U=%u F=%G Y=%d D=%s\n", OWQ_I(owq), OWQ_U(owq), OWQ_F(owq), OWQ_Y(owq), SAFESTRING(ctime_r(&OWQ_D(owq), c))); fprintf(stderr,"--- OneWireQuery done\n"); } owfs-3.1p5/module/owlib/src/c/ow_programpulse.c0000644000175000001440000000135712654730021016526 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" GOOD_OR_BAD BUS_ProgramPulse(const struct parsedname *pn) { GOOD_OR_BAD ret = gbBAD ; if ( pn->selected_connection->iroutines.ProgramPulse != NO_PROGRAMPULSE_ROUTINE ) { ret = (pn->selected_connection->iroutines.ProgramPulse) (pn); } if ( BAD(ret) ) { STAT_ADD1_BUS(e_bus_program_errors, pn->selected_connection); } return ret; } owfs-3.1p5/module/owlib/src/c/ow_read.c0000644000175000001440000005602612654730021014724 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" /* ------- Prototypes ----------- */ static SIZE_OR_ERROR FS_r_virtual(struct one_wire_query *owq); static SIZE_OR_ERROR FS_read_real(struct one_wire_query *owq); static SIZE_OR_ERROR FS_r_given_bus(struct one_wire_query *owq); static SIZE_OR_ERROR FS_r_local(struct one_wire_query *owq); static ZERO_OR_ERROR FS_read_owq(struct one_wire_query *owq); static ZERO_OR_ERROR FS_structure(struct one_wire_query *owq); static ZERO_OR_ERROR FS_read_all_bits(struct one_wire_query *owq_byte); static ZERO_OR_ERROR FS_read_a_bit( struct one_wire_query *owq_bit ); static SIZE_OR_ERROR FS_r_simultaneous(struct one_wire_query *owq) ; static void adjust_file_size(struct one_wire_query *owq) ; static SIZE_OR_ERROR FS_read_distribute(struct one_wire_query *owq) ; static ZERO_OR_ERROR FS_read_all( struct one_wire_query *owq_all ); static ZERO_OR_ERROR FS_read_a_part( struct one_wire_query *owq_part ); static ZERO_OR_ERROR FS_read_in_parts( struct one_wire_query *owq_all ); /* Change in strategy 6/2006: Now use CheckPresence as primary method of finding correct bus Can break down cases into: 1. bad ParsedName -- no read possible 2. structure -- read from 1st bus (local) 3. specified bus (picked up in ParsedName) -- use that 4. statistics, settings, Simultaneous, Thermostat -- use first or specified 5. real -- use caced, if error, delete cache entry and try twice more. */ /* ---------------------------------------------- */ /* Filesystem callback functions */ /* ---------------------------------------------- */ SIZE_OR_ERROR FS_read(const char *path, char *buf, const size_t size, const off_t offset) { SIZE_OR_ERROR read_or_error; OWQ_allocate_struct_and_pointer(owq); LEVEL_CALL("path=%s size=%d offset=%d", SAFESTRING(path), (int) size, (int) offset); // Parseable path? if ( BAD( OWQ_create(path, owq) ) ) { // for read return -ENOENT; } OWQ_assign_read_buffer( buf, size, offset, owq) ; read_or_error = FS_read_postparse(owq); OWQ_destroy(owq); return read_or_error; } /* After parsing, but before sending to various devices. Will repeat 3 times if needed */ SIZE_OR_ERROR FS_read_postparse(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); SIZE_OR_ERROR read_or_error; /* Normal read. Try three times */ LEVEL_DEBUG("%s", pn->path); STATLOCK; AVERAGE_IN(&read_avg); AVERAGE_IN(&all_avg); STATUNLOCK; /* First try */ STAT_ADD1(read_tries[0]); /* Check file type. */ if (pn->selected_device == NO_DEVICE || pn->selected_filetype == NO_FILETYPE) { if (KnownBus(pn) && BusIsServer(pn->selected_connection)) { /* Pass unknown remote filetype to remote owserver. */ read_or_error = FS_r_given_bus(owq); } else { /* Local unknown filetypes are directories. */ return -EISDIR; } } else { /* Local known filetypes are handled here. */ read_or_error = (pn->type == ePN_real) ? FS_read_real(owq) : FS_r_virtual(owq); } STATLOCK; if (read_or_error >= 0) { ++read_success; /* statistics */ read_bytes += read_or_error; /* statistics */ } AVERAGE_OUT(&read_avg); AVERAGE_OUT(&all_avg); STATUNLOCK; LEVEL_DEBUG("%s return %d", pn->path, read_or_error); return read_or_error; } /* Read real device (Non-virtual). Will repeat 3 times if needed */ static SIZE_OR_ERROR FS_read_real(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); SIZE_OR_ERROR read_or_error; /* First try */ /* in and bus_nr already set */ read_or_error = FS_read_distribute(owq); /* Second Try */ /* if not a specified bus, relook for chip location */ if (read_or_error < 0) { //error STAT_ADD1(read_tries[1]); if (SpecifiedBus(pn)) { // this bus or bust! if ( BAD(TestConnection(pn)) ) { read_or_error = -ECONNABORTED; } else { read_or_error = FS_read_distribute(owq); // 2nd try if (read_or_error < 0) { // third try STAT_ADD1(read_tries[2]); read_or_error = FS_read_distribute(owq); } } } else if (BusIsServer(pn->selected_connection)) { int bus_nr = pn->selected_connection->index ; // current selected bus INDEX_OR_ERROR busloc_or_error = ReCheckPresence(pn) ; // special handling or remote // only repeat if the bus number is wrong // because the remote does the rereads if ( bus_nr != busloc_or_error ) { if (busloc_or_error < 0) { read_or_error = -ENOENT; } else { read_or_error = FS_read_distribute(owq); if (read_or_error < 0) { // third try STAT_ADD1(read_tries[2]); read_or_error = FS_read_distribute(owq); } } } } else { INDEX_OR_ERROR busloc_or_error = ReCheckPresence(pn); // search again if (busloc_or_error < 0) { read_or_error = -ENOENT; } else { read_or_error = FS_read_distribute(owq); if (read_or_error < 0) { // third try STAT_ADD1(read_tries[2]); read_or_error = FS_read_distribute(owq); } } } } return read_or_error; } // This function probably needs to be modified a bit... static SIZE_OR_ERROR FS_r_simultaneous(struct one_wire_query *owq) { // Device not locked. OWQ_allocate_struct_and_pointer(owq_given); if (SpecifiedBus(PN(owq))) { return FS_r_given_bus(owq); } memcpy(owq_given, owq, sizeof(struct one_wire_query)); // shallow copy // it's hard to know what we should return when reading /simultaneous/temperature SetKnownBus(0, PN(owq_given)); return FS_r_given_bus(owq_given); } /* Note on return values */ /* functions return the actual number of bytes read, */ /* or a negative value if an error */ /* negative values are of the form -EINVAL, etc */ /* the negative of a system errno */ /* Note on size and offset: */ /* Buffer length (and requested data) is size bytes */ /* reading should start after offset bytes in original data */ /* only date, binary, and ascii data support offset in single data points */ /* only binary supports offset in array data */ /* size and offset are vetted against specification data size and calls */ /* outside of this module will not have buffer overflows */ /* I.e. the rest of owlib can trust size and buffer to be legal */ /* After parsing, choose special read based on path type */ static SIZE_OR_ERROR FS_read_distribute(struct one_wire_query *owq) { // Device not locked SIZE_OR_ERROR read_or_error = 0; LEVEL_DEBUG("%s", PN(owq)->path); STATLOCK; AVERAGE_IN(&read_avg); AVERAGE_IN(&all_avg); STATUNLOCK; /* handle DeviceSimultaneous */ if (PN(owq)->selected_device == DeviceSimultaneous) { read_or_error = FS_r_simultaneous(owq); } else { read_or_error = FS_r_given_bus(owq); } STATLOCK; if (read_or_error >= 0) { ++read_success; /* statistics */ read_bytes += read_or_error; /* statistics */ } AVERAGE_OUT(&read_avg); AVERAGE_OUT(&all_avg); STATUNLOCK; LEVEL_DEBUG("%s returns %d", PN(owq)->path, read_or_error); //printf("FS_read_distribute: pid=%ld return %d\n", pthread_self(), read_or_error); return read_or_error; } // This function should return number of bytes read... not status. static SIZE_OR_ERROR FS_r_given_bus(struct one_wire_query *owq) { // Device locking occurs here struct parsedname *pn = PN(owq); SIZE_OR_ERROR read_or_error = 0; LEVEL_DEBUG("About to read <%s> extension=%d size=%d offset=%d",SAFESTRING(pn->path),(int) pn->extension,(int) OWQ_size(owq),(int) OWQ_offset(owq)); if (KnownBus(pn) && BusIsServer(pn->selected_connection)) { /* The bus is not local... use a network connection instead */ LEVEL_DEBUG("pid=%ld call ServerRead", pthread_self()); // Read afar -- returns already formatted in buffer read_or_error = ServerRead(owq); LEVEL_DEBUG("back from server"); //printf("FS_r_given_bus pid=%ld r=%d\n",pthread_self(), read_or_error); } else { STAT_ADD1(read_calls); /* statistics */ if (DeviceLockGet(pn) == 0) { read_or_error = FS_r_local(owq); // this returns status DeviceLockRelease(pn); LEVEL_DEBUG("return=%d", read_or_error); if (read_or_error >= 0) { // local success -- now format in buffer read_or_error = OWQ_parse_output(owq); // this returns nr. bytes } } else { LEVEL_DEBUG("Cannot lock bus to perform read") ; read_or_error = -EADDRINUSE; } } LEVEL_DEBUG("After read is performed (bytes or error %d)", read_or_error); Debug_OWQ(owq); return read_or_error; } // This function should return number of bytes read... not status. // Works for all the virtual directories, like statistics, interface, ... // Doesn't need three-peat and bus was already set or not needed. static SIZE_OR_ERROR FS_r_virtual(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); SIZE_OR_ERROR read_status = 0; if (SpecifiedRemoteBus(pn)) { /* The bus is not local... use a network connection instead */ // Read afar -- returns already formatted in buffer read_status = ServerRead(owq); LEVEL_DEBUG("back from server"); Debug_OWQ(owq); } else { /* local bus -- any special locking needs? */ STAT_ADD1(read_calls); /* statistics */ switch (pn->type) { case ePN_structure: read_status = FS_structure(owq); break; case ePN_interface: BUSLOCK(pn); read_status = FS_r_local(owq); // this returns status BUSUNLOCK(pn); break; case ePN_statistics: // reading /statistics/read/tries.ALL // will cause a deadlock since it calls STAT_ADD1(read_array); // Should perhaps create a new mutex for this. // Comment out this STATLOCK until it's solved. // STATLOCK now done at time of actual read in ow_stats.c read_status = FS_r_local(owq); // this returns status break; default: read_status = FS_r_local(owq); // this returns status } if (read_status >= 0) { // local success -- now format in buffer read_status = OWQ_parse_output(owq); // this returns nr. bytes } } LEVEL_DEBUG("return %d", read_status); return read_status; } /* Adjusts size so that size+offset do not point past end of real file length*/ /* If offset is too large, size is set to 0 */ static void adjust_file_size(struct one_wire_query *owq) { size_t file_length = 0; /* Adjust file length -- especially important for fuse which uses 4k buffers */ /* First file filelength */ file_length = FullFileLength(PN(owq)); /* next adjust for offset */ if ((unsigned long) OWQ_offset(owq) >= (unsigned long) file_length) { // This check is done in OWQ_parse_output() too, since it's always called when this function OWQ_size(owq) = 0 ; // this is status ok... but 0 bytes were read... } else if ( OWQ_size(owq) + OWQ_offset(owq) > file_length ) { // Finally adjust buffer length OWQ_size(owq) = file_length - OWQ_offset(owq) ; } LEVEL_DEBUG("file_length=%lu offset=%lu size=%lu", (unsigned long) file_length, (unsigned long) OWQ_offset(owq), (unsigned long) OWQ_size(owq)); } /* Real read -- called from read Integrates with cache -- read not called if cached value already set */ static SIZE_OR_ERROR FS_r_local(struct one_wire_query *owq) { // Bus and device already locked struct parsedname *pn = PN(owq); struct filetype * ft = pn->selected_filetype ; /* Readable? */ if (ft->read == NO_READ_FUNCTION) { return -ENOTSUP; } // Check buffer length adjust_file_size(owq) ; if ( OWQ_size(owq) == 0 ) { // Mounting fuse with "direct_io" will cause a second read with offset // at end-of-file... Just return 0 if offset == size LEVEL_DEBUG("Call for read at very end of file") ; return 0 ; } // Special check for alias -- it's ok for fake and tester and mock as well if ( ft->read == FS_r_alias ) { return FS_read_owq(owq) ; } if (ft->change != fc_static && ft->format != ft_alias && IsRealDir(pn)) { switch (pn->selected_connection->Adapter) { case adapter_fake: /* Special case for "fake" adapter */ return FS_read_fake(owq); case adapter_tester: /* Special case for "tester" adapter */ return FS_read_tester(owq); case adapter_mock: /* Special case for "mock" adapter */ if ( GOOD( OWQ_Cache_Get(owq)) ) { // cached LEVEL_DEBUG("Mock value in cache"); return 0; } LEVEL_DEBUG("Mock value NOT in cache"); return FS_read_fake(owq); default: break ; } } if ( ft->ag == NON_AGGREGATE ) { /* non array property */ return FS_read_owq(owq) ; } /* Array property * Read separately? * Read together and manually separate? */ /* array */ switch ( ft->ag->combined ) { case ag_sparse: // skip cache test and storing return (ft->read) (owq); case ag_aggregate: switch (pn->extension) { case EXTENSION_BYTE: LEVEL_DEBUG("Read an aggregate .BYTE %s",pn->path); return FS_read_owq(owq); case EXTENSION_ALL: LEVEL_DEBUG("Read an aggregate .ALL %s",pn->path); return FS_read_all(owq); default: LEVEL_DEBUG("Read an aggregate element %s",pn->path); return FS_read_a_part(owq); } case ag_mixed: switch (pn->extension) { case EXTENSION_BYTE: LEVEL_DEBUG("Read a mixed .BYTE %s",pn->path); OWQ_Cache_Del_parts(owq); return FS_read_owq(owq); case EXTENSION_ALL: LEVEL_DEBUG("Read a mixed .ALL %s",pn->path); OWQ_Cache_Del_parts(owq); return FS_read_all(owq); default: LEVEL_DEBUG("Read a mixed element %s",pn->path); OWQ_Cache_Del_ALL(owq); OWQ_Cache_Del_BYTE(owq); return FS_read_owq(owq); } case ag_separate: switch (pn->extension) { case EXTENSION_BYTE: LEVEL_DEBUG("Read a separate .BYTE %s",pn->path); return FS_read_all_bits(owq); case EXTENSION_ALL: LEVEL_DEBUG("Read a separate .ALL %s",pn->path); return FS_read_in_parts(owq); default: LEVEL_DEBUG("Read a separate element %s",pn->path); return FS_read_owq(owq); } default: return -ENOENT ; } } /* Structure file */ static ZERO_OR_ERROR FS_structure(struct one_wire_query *owq) { char structure_text[PROPERTY_LENGTH_STRUCTURE+1] ; int output_length; struct parsedname * pn = PN(owq) ; struct filetype * ftype = pn->selected_filetype ; char format_char ; char change_char ; int index_num ; int elements_num ; // TEMPORARY change type from structure->real to get real length rhather than structure length pn->type = ePN_real; /* "real" type to get return length, rather than "structure" length */ // Set property type switch ( ftype->format ) { case ft_directory: case ft_subdir: format_char = 'D' ; break ; case ft_integer: format_char = 'i' ; break ; case ft_unsigned: format_char = 'u' ; break ; case ft_float: format_char = 'f' ; break ; case ft_alias: format_char = 'l' ; break ; case ft_ascii: case ft_vascii: format_char = 'a' ; break ; case ft_binary: format_char = 'b' ; break ; case ft_yesno: case ft_bitfield: format_char = 'y' ; break ; case ft_date: format_char = 'd' ; break ; case ft_temperature: format_char = 't' ; break ; case ft_tempgap: format_char = 'g' ; break ; case ft_pressure: format_char = 'p' ; break ; case ft_unknown: default: format_char = '?' ; break ; } // Set index index_num = (ftype->ag) ? pn->extension : 0 ; // Set elements if ( ftype-> ag ) { // array if ( ftype -> ag -> combined == ag_sparse) { if ( ftype -> ag -> letters == ag_letters) { elements_num = -1 ; } else { // numbered elements_num = 0 ; } } else { // non sparse elements_num = ftype->ag->elements ; } } else { // scallar elements_num = 1 ; } // Set changability switch ( ftype->change ) { case fc_static: case fc_subdir: case fc_directory: change_char = 'f' ; break ; case fc_stable: case fc_persistent: change_char = 's' ; break ; case fc_volatile: case fc_read_stable: case fc_simultaneous_temperature: case fc_simultaneous_voltage: case fc_uncached: case fc_statistic: case fc_presence: case fc_link: case fc_page: change_char = 'v' ; break ; case fc_second: default: change_char = 't' ; break ; } UCLIBCLOCK; output_length = snprintf(structure_text, PROPERTY_LENGTH_STRUCTURE+1, "%c,%.6d,%.6d,%.2s,%.6d,%c,", format_char, index_num , elements_num, (ftype->read == NO_READ_FUNCTION) ? ((ftype->write == NO_WRITE_FUNCTION) ? "oo" : "wo") : ((ftype->write == NO_WRITE_FUNCTION) ? "ro" : "rw"), (int) FullFileLength(PN(owq)), change_char ); UCLIBCUNLOCK; LEVEL_DEBUG("length=%d", output_length); // TEMPORARY restore type from real to structure pn->type = ePN_structure; if (output_length < 0) { LEVEL_DEBUG("Problem formatting structure string"); return -EFAULT; } if ( output_length > PROPERTY_LENGTH_STRUCTURE ) { LEVEL_DEBUG("Structure string too long"); return -EINVAL ; } return OWQ_format_output_offset_and_size(structure_text,output_length,owq); } /* read without artificial separation or combination */ // Handles: ALL static ZERO_OR_ERROR FS_read_all( struct one_wire_query *owq_all) { struct parsedname * pn = PN(owq_all) ; // bitfield, convert to .BYTE format and write ( and delete cache ) as BYTE. if ( pn->selected_filetype->format == ft_bitfield ) { struct one_wire_query * owq_byte = OWQ_create_separate( EXTENSION_BYTE, owq_all ) ; int ret = -EINVAL ; if ( owq_byte != NO_ONE_WIRE_QUERY ) { if ( FS_read_owq( owq_byte ) >= 0 ) { size_t elements = pn->selected_filetype->ag->elements; size_t extension; for ( extension=0 ; extension < elements ; ++extension ) { OWQ_array_Y(owq_all,extension) = UT_getbit_U( OWQ_U(owq_byte), extension ) ; } ret = 0 ; } OWQ_destroy( owq_byte ) ; } return ret ; } return FS_read_owq( owq_all ) ; } /* read in native format */ /* ALL for aggregate * .n for separate * BYTE bitfield * */ static ZERO_OR_ERROR FS_read_owq(struct one_wire_query *owq) { // Bus and device already locked if ( BAD( OWQ_Cache_Get(owq)) ) { // not found ZERO_OR_ERROR read_error = (OWQ_pn(owq).selected_filetype->read) (owq); LEVEL_DEBUG("Read %s Extension %d Gives result %d",PN(owq)->path,PN(owq)->extension,read_error); if (read_error < 0) { return read_error; } OWQ_Cache_Add(owq); // Only add good attempts } else { LEVEL_DEBUG("Data obtained from cache") ; } return 0; } /* Read each array element independently, but return as one long string */ // Handles: ALL static ZERO_OR_ERROR FS_read_in_parts( struct one_wire_query *owq_all ) { struct parsedname *pn = PN(owq_all); struct filetype * ft = pn->selected_filetype ; struct one_wire_query * owq_part ; size_t elements = pn->selected_filetype->ag->elements; size_t extension; char * buffer_pointer = OWQ_buffer(owq_all) ; size_t buffer_left = OWQ_size(owq_all) ; // single for BYTE or iteration owq_part = OWQ_create_separate( 0, owq_all ) ; if ( owq_part == NO_ONE_WIRE_QUERY ) { return -ENOENT ; } // bitfield if ( ft->format == ft_bitfield ) { OWQ_pn(owq_part).extension = EXTENSION_BYTE ; if ( FS_read_owq(owq_part) < 0 ) { OWQ_destroy( owq_part ) ; return -EINVAL ; } for (extension = 0; extension < elements; ++extension) { OWQ_array_Y(owq_all,extension) = UT_getbit_U( OWQ_U(owq_part), extension ) ; } OWQ_destroy( owq_part ) ; return 0 ; } if ( BAD( OWQ_allocate_read_buffer( owq_part )) ) { LEVEL_DEBUG("Can't allocate buffer space"); OWQ_destroy( owq_part ) ; return -EMSGSIZE ; } /* Loop through get data */ for (extension = 0; extension < elements; ++extension) { size_t part_length ; OWQ_pn(owq_part).extension = extension; if ( FS_read_owq(owq_part) < 0 ) { OWQ_destroy( owq_part ) ; return -EINVAL ; } // Check that there is enough space for the combined message switch ( ft->format ) { case ft_ascii: case ft_vascii: case ft_alias: case ft_binary: part_length = OWQ_length(owq_part) ; if ( buffer_left < part_length ) { OWQ_destroy( owq_part ) ; return -EMSGSIZE ; } memcpy( buffer_pointer, OWQ_buffer(owq_part), part_length ) ; OWQ_array_length(owq_all,extension) = part_length ; buffer_pointer += part_length ; buffer_left -= part_length ; break ; default: // copy object (single to mixed array) memcpy(&OWQ_array(owq_all)[extension], &OWQ_val(owq_part), sizeof(union value_object)); break; } } OWQ_destroy( owq_part ) ; return 0; } /* read a BYTE using bits */ // Handles: BYTE static ZERO_OR_ERROR FS_read_all_bits(struct one_wire_query *owq_byte) { struct one_wire_query * owq_bit = OWQ_create_separate( 0, owq_byte ) ; struct parsedname *pn = PN(owq_byte); size_t elements = pn->selected_filetype->ag->elements; size_t extension; if ( owq_bit == NO_ONE_WIRE_QUERY ) { return -ENOENT ; } /* Loop through F_r_single, just to get data */ for (extension = 0; extension < elements; ++extension) { OWQ_pn(owq_bit).extension = extension ; if ( FS_read_owq(owq_bit) < 0 ) { OWQ_destroy(owq_bit); return -EINVAL; } UT_setbit_U( &OWQ_U(owq_byte), extension, OWQ_Y(owq_bit) ) ; } OWQ_destroy(owq_bit); return 0; } /* read a bit from BYTE */ static ZERO_OR_ERROR FS_read_a_bit( struct one_wire_query *owq_bit ) { // Bus and device already locked struct one_wire_query * owq_byte = OWQ_create_separate( EXTENSION_BYTE, owq_bit ) ; struct parsedname *pn = PN(owq_bit); ZERO_OR_ERROR z_or_e = -ENOENT ; if ( owq_byte == NO_ONE_WIRE_QUERY ) { return -ENOENT ; } /* read the UINT */ if ( FS_read_owq(owq_byte) >= 0) { OWQ_Y(owq_bit) = UT_getbit_U( OWQ_U(owq_byte), pn->extension) ; z_or_e = 0 ; } OWQ_destroy(owq_byte); return z_or_e; } /* Read just one field of an aggregate property -- but a property that is handled as one big object */ // Handles .n static ZERO_OR_ERROR FS_read_a_part( struct one_wire_query *owq_part ) { struct parsedname *pn = PN(owq_part); size_t extension = pn->extension; struct filetype * ft = pn->selected_filetype ; struct one_wire_query * owq_all ; // bitfield if ( ft->format == ft_bitfield ) { return FS_read_a_bit( owq_part ) ; } // non-bitfield owq_all = OWQ_create_aggregate( owq_part ) ; if ( owq_all == NO_ONE_WIRE_QUERY ) { return -ENOENT ; } // First fill the whole array with current values if ( FS_read_owq( owq_all ) < 0 ) { OWQ_destroy( owq_all ) ; return -EINVAL ; } // Copy ascii/binary field switch (ft->format) { case ft_binary: case ft_ascii: case ft_vascii: case ft_alias: { size_t extension_index; char *buffer_pointer = OWQ_buffer(owq_all); // All prior elements for (extension_index = 0; extension_index < extension; ++extension_index) { // move past their buffer position buffer_pointer += OWQ_array_length(owq_all, extension_index); } // now move current element's buffer to location OWQ_length(owq_part) = OWQ_array_length(owq_all, extension) ; memmove( OWQ_buffer(owq_part), buffer_pointer, OWQ_length(owq_part)); break; } default: // Copy value field memcpy( &OWQ_val(owq_part), &OWQ_array(owq_all)[pn->extension], sizeof(union value_object) ); break; } OWQ_destroy(owq_all); return 0 ; } /* Used in sibling reads Reads locally without locking the bus (since it's already locked) */ SIZE_OR_ERROR FS_read_local( struct one_wire_query *owq) { return FS_r_local(owq); } owfs-3.1p5/module/owlib/src/c/ow_read_external.c0000644000175000001440000001045312654730021016620 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_external.h" /* strategy for external read: A common read function for all communication schemes e.g. script The actual device record and actual family record is obtained from the trees. The script is called (via popen) or other method for other types The device should be locked for the communication arguments include fields from the tree records and owq the returned value is obvious */ static ZERO_OR_ERROR OW_trees_for_read( char * device, char * property, struct one_wire_query * owq ) ; static ZERO_OR_ERROR OW_read_external_script( struct sensor_node * sensor_n, struct property_node * property_n, struct one_wire_query * owq ) ; static ZERO_OR_ERROR OW_script_read( FILE * script_f, struct one_wire_query * owq ) ; // ------------------------ ZERO_OR_ERROR FS_r_external( struct one_wire_query * owq ) { ZERO_OR_ERROR zoe = -ENOENT ; // default char * device_property = owstrdup( PN(owq)->device_name ) ; // copy of device/property part of path if ( device_property != NULL ) { char * property = device_property ; char * device = strsep( &property, "/" ) ; // separate out property char * extension = property ; if ( property != NULL ) { // pare off extension property = strsep( &extension, "." ) ; } zoe = OW_trees_for_read( device, property, owq ) ; owfree( device_property ) ; // clean up } return zoe ; } static ZERO_OR_ERROR OW_trees_for_read( char * device, char * property, struct one_wire_query * owq ) { // find sensor node struct sensor_node * sense_n = Find_External_Sensor( device ) ; if ( sense_n != NULL ) { // found // find property node struct property_node * property_n = Find_External_Property( sense_n->family, property ) ; if ( property_n != NULL ) { switch ( property_n->et ) { case et_none: return 0 ; case et_internal: return OWQ_format_output_offset_and_size_z( property_n->data, owq ) ; case et_script: return OW_read_external_script( sense_n, property_n, owq ) ; default: return -ENOTSUP ; } } } return -ENOENT ; } static ZERO_OR_ERROR OW_read_external_script( struct sensor_node * sensor_n, struct property_node * property_n, struct one_wire_query * owq ) { char cmd[PATH_MAX+1] ; struct parsedname * pn = PN(owq) ; FILE * script_f ; int snp_return ; ZERO_OR_ERROR zoe ; // load the command script and arguments if ( pn->sparse_name == NULL ) { // not a text sparse name snp_return = snprintf( cmd, PATH_MAX+1, "%s %s %s %d %s %d %d %s %s", property_n->read, // command sensor_n->name, // sensor name property_n->property, // property, pn->extension, // extension "read", // mode (int) OWQ_size(owq), // size (int) OWQ_offset(owq), // offset sensor_n->data, // sensor-specific data property_n->data // property-specific data ) ; } else { snp_return = snprintf( cmd, PATH_MAX+1, "%s %s %s %s %s %d %d %s %s", property_n->read, // command sensor_n->name, // sensor name property_n->property, // property, pn->sparse_name, // extension "read", // mode (int) OWQ_size(owq), // size (int) OWQ_offset(owq), // offset sensor_n->data, // sensor-specific data property_n->data // property-specific data ) ; } if ( snp_return < 0 ) { LEVEL_DEBUG("Problem creating script string for %s/%s",sensor_n->name,property_n->property) ; return -EINVAL ; } script_f = popen( cmd, "r" ) ; if ( script_f == NULL ) { ERROR_DEBUG("Cannot create external program link for reading %s/%s",sensor_n->name,property_n->property); return -EIO ; } zoe = OW_script_read( script_f, owq ) ; pclose( script_f ) ; return zoe ; } static ZERO_OR_ERROR OW_script_read( FILE * script_f, struct one_wire_query * owq ) { size_t fr_return ; memset( OWQ_buffer(owq), 0, OWQ_size(owq) ) ; fr_return = fread( OWQ_buffer(owq), OWQ_size(owq), 1, script_f ) ; if ( fr_return == 0 && ferror(script_f) != 0 ) { LEVEL_DEBUG( "Could not read script data back for %s",PN(owq)->path ) ; return -EIO ; } return OWQ_parse_input( owq ) ; } owfs-3.1p5/module/owlib/src/c/ow_read_telnet.c0000644000175000001440000001760212654730021016274 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ // regex #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "telnet.h" /* Telnet handling concepts from Jerry Scharf: You should request the number of bytes you expect. When you scan it, start looking for FF FA codes. If that shows up, see if the F0 is in the read buffer. If so, move the char pointer back to where the FF point was and ask for the rest of the string (expected - FF...F0 bytes.) If the F0 isn't in the read buffer, start reading byte by byte into a separate variable looking for F0. Once you find that, then do the move the pointer and read the rest piece as above. Finally, don't forget to scan the rest of the strings for more FF FA blocks. It's most sloppy when the FF is the last character of the initial read buffer... You can also scan and remove the patterns FF F1 - FF F9 as these are 2 byte commands that the transmitter can send at any time. It is also possible that you could see FF FB xx - FF FE xx 3 byte codes, but this would be in response to FF FA codes that you would send, so that seems unlikely. Handling these would be just the same as the FF FA codes above. */ /* Read from a telnet device */ GOOD_OR_BAD telnet_read(BYTE * buf, const size_t size, struct connection_in *in) { struct port_in * pin ; // temporary buffer (add some extra space) BYTE readin_buf[size+2] ; // state machine for telnet escape chars // handles TELNET protocol, specifically RFC854 // http://www.ietf.org/rfc/rfc854.txt enum { telnet_regular, telnet_iac, telnet_sb, telnet_sb_opt, telnet_sb_val, telnet_sb_iac, telnet_will, telnet_wont, telnet_do, telnet_dont, } telnet_read_state = telnet_regular ; size_t actual_readin = 0 ; size_t current_index = 0 ; size_t still_needed = size ; // test inputs if ( size == 0 ) { return gbGOOD ; } if ( in == NO_CONNECTION ) { return gbBAD ; } pin = in->pown ; if ( FILE_DESCRIPTOR_NOT_VALID(pin->file_descriptor) ) { return gbBAD ; } // loop and look for escape sequances while ( still_needed > 0 ) { // see if the state requires a longer read than currently scheduled size_t minimum_chars = still_needed ; switch( telnet_read_state ) { case telnet_sb: minimum_chars += 4 ; break ; case telnet_sb_opt: minimum_chars += 3 ; break ; case telnet_sb_val: minimum_chars += 2 ; break ; case telnet_iac: case telnet_sb_iac: case telnet_will: case telnet_wont: case telnet_do: case telnet_dont: minimum_chars += 1 ; break ; case telnet_regular: break ; } if ( current_index >= actual_readin ) { // need to read more -- just read what we think we need -- escape chars may require repeat if ( tcp_read( pin->file_descriptor, readin_buf, minimum_chars, &(pin->timeout), &actual_readin) < 0 ) { LEVEL_DEBUG("tcp seems closed") ; Test_and_Close( &(pin->file_descriptor) ) ; return gbBAD ; } if (actual_readin < minimum_chars) { LEVEL_CONNECT("Telnet (ethernet) error"); Test_and_Close( &(pin->file_descriptor) ) ; return gbBAD; } current_index = 0 ; } switch ( telnet_read_state ) { case telnet_regular : if ( readin_buf[current_index] == TELNET_IAC ) { if (Globals.traffic) { LEVEL_DEBUG("TELNET: IAC"); } // starting escape sequence // following bytes will better characterize telnet_read_state = telnet_iac ; } else { // normal processing // move byte to response and decrement needed bytes // stay in current state buf[size - still_needed] = readin_buf[current_index] ; -- still_needed ; } break ; case telnet_iac: //printf("TELNET: IAC %d\n",readin_buf[current_index]); switch ( readin_buf[current_index] ) { case TELNET_EOF: case TELNET_SUSP: case TELNET_ABORT: case TELNET_EOR: case TELNET_SE: case TELNET_NOP: case TELNET_DM: case TELNET_BREAK: case TELNET_IP: case TELNET_AO: case TELNET_AYT: case TELNET_EC: case TELNET_EL: case TELNET_GA: // 2 byte sequence // just read 2nd character if (Globals.traffic) { LEVEL_DEBUG("TELNET: End 2-byte sequence"); } telnet_read_state = telnet_regular ; break ; case TELNET_SB: // multibyte squence // start scanning for 0xF0 telnet_read_state = telnet_sb ; break ; case TELNET_WILL: // 3 byte sequence // just read 2nd char telnet_read_state = telnet_will ; break ; case TELNET_WONT: // 3 byte sequence // just read 2nd char telnet_read_state = telnet_wont ; break ; case TELNET_DO: // 3 byte sequence // just read 2nd char telnet_read_state = telnet_do ; break ; case TELNET_DONT: // 3 byte sequence // just read 2nd char telnet_read_state = telnet_dont ; break ; case TELNET_IAC: // escape the FF character // make this a single regular FF char buf[size - still_needed] = 0xFF ; -- still_needed ; if (Globals.traffic) { LEVEL_DEBUG("TELNET: FF escape sequence"); } telnet_read_state = telnet_regular ; break ; default: LEVEL_DEBUG("Unexpected telnet sequence"); return gbBAD ; } break ; case telnet_sb: switch ( readin_buf[current_index] ) { case TELNET_IAC: LEVEL_DEBUG("Unexpected telnet sequence"); return gbBAD ; default: //printf("TELNET: IAC SB opt=%d\n",readin_buf[current_index]); // stay in this mode telnet_read_state = telnet_sb_opt ; break ; } break ; case telnet_sb_opt: switch ( readin_buf[current_index] ) { case TELNET_IAC: LEVEL_DEBUG("Unexpected telnet sequence"); return gbBAD ; default: //printf("TELNET: IAC SB sub_opt=%d\n",readin_buf[current_index]); // stay in this mode telnet_read_state = telnet_sb_val ; break ; } break ; case telnet_sb_val: switch ( readin_buf[current_index] ) { case TELNET_IAC: // stay in this mode telnet_read_state = telnet_sb_iac ; break ; default: //printf("TELNET: IAC SB val=%d\n",readin_buf[current_index]); // stay in this mode break ; } break ; case telnet_sb_iac: switch ( readin_buf[current_index] ) { case TELNET_SE: //printf("TELNET: IAC SE\n"); if (Globals.traffic) { LEVEL_DEBUG("TELNET: End multi-byte sequence"); } telnet_read_state = telnet_regular ; break ; default: LEVEL_DEBUG("Unexpected telnet sequence"); return gbBAD ; } break ; case telnet_will: //printf("TELNET: IAC WILL %d\n",readin_buf[current_index]); // 3 byte sequence // now reading 3rd char if (Globals.traffic) { LEVEL_DEBUG("TELNET: End 3-byte sequence"); } telnet_read_state = telnet_regular ; break ; case telnet_wont: //printf("TELNET: IAC WONT %d\n",readin_buf[current_index]); // 3 byte sequence // now reading 3rd char if (Globals.traffic) { LEVEL_DEBUG("TELNET: End 3-byte sequence"); } telnet_read_state = telnet_regular ; break ; case telnet_do: //printf("TELNET: IAC DO %d\n",readin_buf[current_index]); // 3 byte sequence // now reading 3rd char if (Globals.traffic) { LEVEL_DEBUG("TELNET: End 3-byte sequence"); } telnet_read_state = telnet_regular ; break ; case telnet_dont: // 3 byte sequence // now reading 3rd char if (Globals.traffic) { LEVEL_DEBUG("TELNET: End 3-byte sequence"); } telnet_read_state = telnet_regular ; break ; } ++ current_index ; } return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_reconnect.c0000644000175000001440000000371712654730021015770 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" /* Tests whether this bus (pn->selected_connection) has too many consecutive reset errors */ /* If so, the bus is closed and "reconnected" */ /* Reconnection usually just means reopening (detect) with the same initial name like ttyS0 */ /* USB is a special case, in gets reenumerated, so we look for similar DS2401 chip */ GOOD_OR_BAD TestConnection(const struct parsedname *pn) { GOOD_OR_BAD ret = 0; struct connection_in *in ; if ( pn == NO_PARSEDNAME ) { return gbGOOD ; } in = pn->selected_connection ; if ( in == NO_CONNECTION ) { return gbGOOD ; } // Test without a lock -- efficient if ( in->reconnect_state < reconnect_error ) { return gbGOOD; } // Lock the bus BUSLOCK(pn); // Test again if (in->reconnect_state >= reconnect_error) { // Add Statistics STAT_ADD1_BUS(e_bus_reconnects, in); // Close the bus (should leave enough reconnection information available) BUS_close(in); // already locked // Call reconnection in->AnyDevices = anydevices_unknown ; if ( in->iroutines.reconnect != NO_RECONNECT_ROUTINE ) { // reconnect method exists ret = (in->iroutines.reconnect) (pn) ; // call bus-specific reconnect } else { ret = BUS_detect(in->pown) ; // call initial opener } if ( BAD( ret ) ) { in->reconnect_state = reconnect_ok + 1 ; // delay to slow thrashing UT_delay(200); } else { in->reconnect_state = reconnect_ok; } } BUSUNLOCK(pn); if ( BAD( ret ) ) { LEVEL_DEFAULT("Failed to reconnect %s bus master!", in->adapter_name); } else { LEVEL_DEFAULT("%s bus master reconnected", in->adapter_name); } return ret; } owfs-3.1p5/module/owlib/src/c/ow_regex.c0000644000175000001440000001266712654730021015126 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_interate.c */ /* routines to split reads and writes if longer than page */ #include #include "owfs_config.h" #include "ow.h" // tree to hold pointers to compiled regex expressions to cache compilation and free void * regex_tree = NULL ; enum e_regcomp_test { e_regcomp_exists, e_regcomp_new, e_regcomp_error, } ; struct s_regex { regex_t * reg ; } ; static int reg_compare( const void * a, const void *b) { const struct s_regex * pa = (const struct s_regex *) a ; const struct s_regex * pb = (const struct s_regex *) b ; return (int) (pa->reg - pb->reg) ; } // Add a reg comp to tree if doesn't already exist static enum e_regcomp_test regcomp_test( regex_t * reg ) { struct s_regex * pnode = owmalloc( sizeof( struct s_regex ) ) ; struct s_regex * found ; void * result ; if ( pnode == NULL ) { LEVEL_DEBUG("memory exhuasted") ; return e_regcomp_error ; } pnode->reg = reg ; result = tsearch( (void *) pnode, ®ex_tree, reg_compare ) ; found = *(struct s_regex **) result ; if ( found == pnode ) { // new entry return e_regcomp_new ; } // existing entry owfree( pnode ) ; return e_regcomp_exists ; } // Compile a regex // Actually only compile if needed, check first if it's already // cached in the regex tree void ow_regcomp( regex_t * reg, const char * regex, int cflags ) { switch ( regcomp_test( reg ) ) { case e_regcomp_error: return ; case e_regcomp_exists: return ; case e_regcomp_new: { int reg_res = regcomp( reg, regex, cflags | REG_EXTENDED ) ; if ( reg_res == 0 ) { LEVEL_DEBUG("Reg Ex expression <%s> compiled to %p",regex,reg) ; } else { char e[101]; regerror( reg_res, reg, e, 100 ) ; LEVEL_DEBUG("Problem compiling reg expression <%s>: %s",regex, e ) ; } } } } // free a regex node (cached compiled action) void ow_regfree( regex_t * reg ) { struct s_regex node = { reg, } ; void * result = tdelete( (void *) (&node), ®ex_tree, reg_compare ) ; if ( result != NULL ) { regfree( reg ) ; } else { LEVEL_DEBUG( "attempt to free an uncompiled regex" ) ; } } #if 0 // Debugging to show tree contents static void regexaction(const void *t, const VISIT which, const int depth) { (void) depth; switch (which) { case leaf: case postorder: LEVEL_DEBUG("Regex compiled pointer %p",(*(const struct s_regex * const *) t)->reg ) ; default: break; } } #endif static void regexkillaction(const void *t, const VISIT which, const int depth) { (void) depth; switch (which) { case leaf: case postorder: LEVEL_DEBUG("Regex Free %p",(*(const struct s_regex * const *) t)->reg ) ; regfree((*(const struct s_regex * const *) t)->reg ) ; default: break; } } void ow_regdestroy( void ) { // twalk( regex_tree, regexaction ) ; twalk( regex_tree, regexkillaction ) ; SAFETDESTROY( regex_tree, owfree_func ) ; LEVEL_DEBUG("Regex destroy done") ; regex_tree = NULL ; } // wrapper for regcomp // pmatch rm_so abd rm_eo handled internally // allocates (with owcalloc) and fills match_strings // Can be nmatch==0 and matched_strings==NULL for just a test with no return int ow_regexec( const regex_t * rex, const char * string, struct ow_regmatch * orm ) { if ( orm == NULL ) { // special case -- no matches saved if ( regexec( rex, string, 0, NULL, 0 ) != 0 ) { return -1 ; } return 0 ; } else { // case with saved matches int i ; int number = orm->number ; int len = strlen( string ) ; regmatch_t pmatch[ number + 2 ] ; // try the regexec on the string if ( regexec( rex, string, number+1, pmatch, 0 ) != 0 ) { LEVEL_DEBUG("Not found"); return -1 ; } // allocate space for the array of matches -- pointer array first orm->pre = owcalloc( sizeof( char * ) , 3*(number+1) ) ; if ( orm->pre == NULL ) { LEVEL_DEBUG("Memory allocation error"); return -1 ; } orm->match = orm->pre + number+1 ; orm->post = orm->match + number+1 ; for ( i=0 ; i < number+1 ; ++i ) { // Note last index is kept null orm->pre[i] = NULL ; orm->match[i] = NULL ; orm->post[i] = NULL ; } // not actual string array -- allocated as a buffer with space for pre,match and post // only need to allocat once per matched number for ( i=0 ; i < number+1 ; ++i ) { int s = pmatch[i].rm_so ; int e = pmatch[i].rm_eo ; if ( s != -1 && e != -1 ) { int l = e - s ; // each buffer is only slightly longer than original string (since contains string plus some EOS nulls orm->pre[i] = owmalloc( len + 3 ) ; if ( orm->pre[i] == NULL ) { LEVEL_DEBUG("Memory problem") ; ow_regexec_free( orm ) ; return -1 ; } // pre at start memset( orm->pre[i], 0 , len+3 ) ; memcpy( orm->pre[i], string, s ) ; // match next orm->match[i] = orm->pre[i] + s + 1 ; memcpy( orm->match[i], &string[s], l ) ; // then post orm->post[i] = orm->match[i] + l + 1 ; memcpy( orm->post[i], &string[e], len-e+1 ) ; LEVEL_DEBUG("%d: %d->%d found <%s><%s><%s>",i,s,e,orm->pre[i],orm->match[i],orm->post[i]) ; } } return 0 ; } } void ow_regexec_free( struct ow_regmatch * orm ) { if ( orm != NULL ) { int i ; for ( i = 0 ; i < orm->number + 1 ; ++ i ) { if ( orm->pre[i] != NULL ) { owfree( orm->pre[i] ) ; } } owfree( orm->pre ) ; } } owfs-3.1p5/module/owlib/src/c/ow_remote_alias.c0000644000175000001440000001204712654730021016450 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow_standard.h" #include "ow_counters.h" #include "ow_connection.h" /* ------- Prototypes ------------ */ static struct connection_in * NextServer( struct connection_in * in ) ; static INDEX_OR_ERROR ServerAlias( BYTE * sn, struct connection_in * in, struct parsedname * pn ) ; /* ------- Functions ------------ */ static struct connection_in * NextServer( struct connection_in * in ) { do { if ( in == NO_CONNECTION ) { return NO_CONNECTION ; } if ( BusIsServer(in) ) { return in ; } in = in->next ; } while (1) ; } static INDEX_OR_ERROR ServerAlias( BYTE * sn, struct connection_in * in, struct parsedname * pn ) { if ( in != NO_CONNECTION ) { struct parsedname s_pn_copy; struct parsedname * pn_copy = &s_pn_copy ; INDEX_OR_ERROR bus_nr ; memcpy(pn_copy, pn, sizeof(struct parsedname)); // shallow copy pn_copy->selected_connection = in; bus_nr = ServerPresence( pn_copy) ; memcpy( sn, pn_copy->sn, SERIAL_NUMBER_SIZE ); return bus_nr ; } return INDEX_BAD ; } struct remotealias_struct { struct port_in * pin; struct connection_in *cin; struct parsedname *pn; BYTE sn[SERIAL_NUMBER_SIZE] ; INDEX_OR_ERROR bus_nr; }; static void * RemoteAlias_callback_conn(void * v) { struct remotealias_struct * ras = (struct remotealias_struct *) v ; struct remotealias_struct ras_next ; pthread_t thread; int threadbad = 0; // set up for next server connection ras_next.cin = NextServer(ras->cin->next) ; if ( ras_next.cin == NO_CONNECTION ) { threadbad = 1 ; } else { ras_next.pin = ras->pin ; ras_next.pn = ras->pn ; ras_next.bus_nr = INDEX_BAD ; memset( ras_next.sn, 0, SERIAL_NUMBER_SIZE) ; threadbad = pthread_create(&thread, DEFAULT_THREAD_ATTR, RemoteAlias_callback_conn, (void *) (&ras_next)) ; } // Result for this server connection (while next one is processing) ras->bus_nr = ServerAlias( ras->sn, ras->cin, ras->pn ) ; if (threadbad == 0) { /* was a thread created? */ if (pthread_join(thread, NULL)==0) { // Set answer to the next bus if it's found // else use current answer if ( INDEX_VALID(ras_next.bus_nr) ) { ras->bus_nr = ras_next.bus_nr ; memcpy( ras->sn, ras_next.sn, SERIAL_NUMBER_SIZE ) ; } } } return VOID_RETURN ; } static void * RemoteAlias_callback_port(void * v) { struct remotealias_struct * ras = (struct remotealias_struct *) v ; struct remotealias_struct ras_next ; pthread_t thread; int threadbad = 0; // set up for next server connection ras_next.pin = ras->pin->next ; if ( ras_next.pin == NULL ) { threadbad = 1 ; } else { ras_next.pn = ras->pn ; ras_next.bus_nr = INDEX_BAD ; memset( ras_next.sn, 0, SERIAL_NUMBER_SIZE) ; threadbad = pthread_create(&thread, DEFAULT_THREAD_ATTR, RemoteAlias_callback_port, (void *) (&ras_next)) ; } ras->cin = NextServer( ras->pin->first ) ; if ( ras->cin != NO_CONNECTION ) { RemoteAlias_callback_conn(v) ; } if (threadbad == 0) { /* was a thread created? */ if (pthread_join(thread, NULL)==0) { // Set answer to the next bus if it's found // else use current answer if ( INDEX_VALID(ras_next.bus_nr) ) { ras->bus_nr = ras_next.bus_nr ; memcpy( ras->sn, ras_next.sn, SERIAL_NUMBER_SIZE ) ; } } } return VOID_RETURN ; } INDEX_OR_ERROR RemoteAlias(struct parsedname *pn) { struct remotealias_struct ras ; ras.pin = Inbound_Control.head_port ; ras.pn = pn ; ras.bus_nr = INDEX_BAD ; memset( ras.sn, 0, SERIAL_NUMBER_SIZE) ; if ( ras.pin != NULL ) { RemoteAlias_callback_port( (void *) (&ras) ) ; } memcpy( pn->sn, ras.sn, SERIAL_NUMBER_SIZE ) ; if ( INDEX_VALID( ras.bus_nr ) ) { LEVEL_DEBUG("Remote alias for %s bus=%d "SNformat,pn->path_to_server,ras.bus_nr,SNvar(ras.sn)); } else { LEVEL_DEBUG("Remote alias for %s not found",pn->path_to_server); } return ras.bus_nr; } owfs-3.1p5/module/owlib/src/c/ow_reset.c0000644000175000001440000000326412654730021015127 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" // RESET called with bus locked RESET_TYPE BUS_reset(const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; STAT_ADD1_BUS(e_bus_resets, in); // External adapter has no reset routine at all, so sort it out here. if ((in->iroutines.reset) == NO_RESET_ROUTINE) { return BUS_RESET_OK ; } // Switch by result of adapter reset routine. switch ( (in->iroutines.reset) (pn) ) { case BUS_RESET_OK: in->reconnect_state = reconnect_ok; // Flag as good! if (in->ds2404_found && ((in->iroutines.flags&ADAP_FLAG_no2404delay)==0) ) { // extra delay for alarming DS1994/DS2404 complience UT_delay(5); } return BUS_RESET_OK ; case BUS_RESET_SHORT: /* Shorted 1-wire bus or minor error shouldn't cause a reconnect */ in->AnyDevices = anydevices_unknown; LEVEL_CONNECT("1-wire bus short circuit."); STAT_ADD1_BUS(e_bus_short_errors, in); return BUS_RESET_SHORT; case BUS_RESET_ERROR: default: if ( in->ds2404_found ) { // extra reset for DS1994/DS2404 might be needed if ( (in->iroutines.reset) (pn) == BUS_RESET_OK ) { return BUS_RESET_OK ; } } in->reconnect_state++; // Flag for eventual reconnection LEVEL_DEBUG("Reset error. Reconnection %d/%d",in->reconnect_state,reconnect_error); STAT_ADD1_BUS(e_bus_reset_errors, in); return BUS_RESET_ERROR ; } } owfs-3.1p5/module/owlib/src/c/ow_return_code.c0000644000175000001440000002202312654730021016310 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" char * return_code_strings[] = { "Good result", // 0 "Startup - command line parameters invalid", "legacy - No such entity", "Startup - a device could not be opened", "legacy - Interrupted", "legacy - IO error", // 5 "Startup - network could not be opened", "Startup - Avahi library could not be loaded", "Startup - Bonjour library could not be loaded", "legacy - Bad filesystem", "Startup - zeroconf communication problem", // 10 "legacy - Temporary interruption", "legacy - memory exhausted", "legacy - Access error", "legacy - Communication fault", "Startup - memory could not be allocated", // 15 "legacy - Busy", "Program - not initialized", "Program - not yet ready", "legacy - No such device", "legacy - Not a directory", // 20 "legacy - Is a directory", "legacy - Invalid transaction", "Program - closing", "Program - closed", "Program - cannot close", // 25 "Path - input path too long", "Path - bad path syntax", "Device - Device name bad CRC8", "Device - Unrecognized device name or alias", "legacy - Read-only file system", // 30 "Device - alias name too long", "Device - unrecognized device property", "Device - device property not an array", "legacy - Out of range", "Device - device property should be an array", // 35 "legacy - Name too long", "Device - device not a bit field", "Device - array index out of range", "Device - device property not a subpath", "legacy - Loop discovered", // 40 "Device - device not found", "legacy - No message", "Device - other device error", "Bus - bus short", "Bus - no such bus", // 45 "Bus - bus not appropriate", "Bus - bus not responding", "Bus - bus being reset", "Bus - bus closed", "Bus - bus could not be opened", // 50 "Bus - communication error on bus", "Bus - communication timeout", "Bus - telnet error", "Bus - tcp error", "Bus - bus is local", // 55 "Bus - bus is remote", "Read - data too large", "Read - data communication error", "Read - not a property", "Read - not a readable property", // 60 "Write - data too large", "Write - data too small", "Write - data wrong format", "Write - not a property", "Write - not a writable property", // 65 "Write - read-only mode", "Write - data communication error", "Directory - output path too long", "Directory - not a directory", // 69 "Presence - not a device", // 70 "Unknown query type", "Owserver protocol - socket problem", "Owserver protocol - timeout", "legacy - Bad message", "Owserver protocol - version mismatch", // 75 "Owserver protocol - packet size error", "Path - extra text in path", "Internal - unexpected null pointer", "Internal - unable to allocate memory", "Unassigned error 80", // 80 "Unassigned error 81", "Unassigned error 82", "Unassigned error 83", "Unassigned error 84", "Unassigned error 85", // 85 "Unassigned error 86", "Unassigned error 87", "Unassigned error 88", "Unassigned error 89", "legacy - Message size problem", // 90 "Unassigned error 91", "Unassigned error 92", "Unassigned error 93", "Unassigned error 94", "legacy - Not supported", // 95 "Unassigned error 96", "Unassigned error 97", "legacy - Address in use", "legacy - Address not available", "Unassigned error 100", // 100 "Unassigned error 101", "Unassigned error 102", "legacy - Connection aborted", "Unassigned error 104", "legacy - No buffers", // 105 "Unassigned error 106", "Unassigned error 107", "Unassigned error 108", "Unassigned error 109", "Unassigned error 110", // 110 "Unassigned error 111", "Unassigned error 112", "Unassigned error 113", "Unassigned error 114", "Unassigned error 115", // 115 "Unassigned error 116", "Unassigned error 117", "Unassigned error 118", "Unassigned error 119", "Unassigned error 120", // 120 "Unassigned error 121", "Unassigned error 122", "Unassigned error 123", "Unassigned error 124", "Unassigned error 125", // 125 "Unassigned error 126", "Unassigned error 127", "Unassigned error 128", "Unassigned error 129", "Unassigned error 130", // 130 "Unassigned error 131", "Unassigned error 132", "Unassigned error 133", "Unassigned error 134", "Unassigned error 135", // 135 "Unassigned error 136", "Unassigned error 137", "Unassigned error 138", "Unassigned error 139", "Unassigned error 140", // 140 "Unassigned error 141", "Unassigned error 142", "Unassigned error 143", "Unassigned error 144", "Unassigned error 145", // 145 "Unassigned error 146", "Unassigned error 147", "Unassigned error 148", "Unassigned error 149", "Unassigned error 150", // 150 "Unassigned error 151", "Unassigned error 152", "Unassigned error 153", "Unassigned error 154", "Unassigned error 155", // 155 "Unassigned error 156", "Unassigned error 157", "Unassigned error 158", "Unassigned error 159", "Unassigned error 160", // 160 "Unassigned error 161", "Unassigned error 162", "Unassigned error 163", "Unassigned error 164", "Unassigned error 165", // 165 "Unassigned error 166", "Unassigned error 167", "Unassigned error 168", "Unassigned error 169", "Unassigned error 170", // 170 "Unassigned error 171", "Unassigned error 172", "Unassigned error 173", "Unassigned error 174", "Unassigned error 175", // 175 "Unassigned error 176", "Unassigned error 177", "Unassigned error 178", "Unassigned error 179", "Unassigned error 180", // 180 "Unassigned error 181", "Unassigned error 182", "Unassigned error 183", "Unassigned error 184", "Unassigned error 185", // 185 "Unassigned error 186", "Unassigned error 187", "Unassigned error 188", "Unassigned error 189", "Unassigned error 190", // 190 "Unassigned error 191", "Unassigned error 192", "Unassigned error 193", "Unassigned error 194", "Unassigned error 195", // 195 "Unassigned error 196", "Unassigned error 197", "Unassigned error 198", "Unassigned error 199", "Unassigned error 200", // 200 "Unassigned error 201", "Unassigned error 202", "Unassigned error 203", "Unassigned error 204", "Unassigned error 205", // 205 "Unassigned error 206", "Unassigned error 207", "Unassigned error 208", "Unassigned error 209", "Error number out of range", // 210 return_code_out_of_bounds // Note: If you add more return_codes, make sure you adjust // #define return_code_out_of_bounds 210 // it's defined in ow_return_code.h } ; int return_code_calls[N_RETURN_CODES] ; void Return_code_setup(void) { int i ; for ( i=0 ; ireturn_code != 0 ) { // Already set? #if OW_DEBUG if (Globals.error_level>=e_err_debug) { err_msg( e_err_type_level, e_err_debug, d_file, d_line, d_func, "%s: Resetting error from %d <%s> to %d",SAFESTRING(pn->path),pn->return_code,return_code_strings[pn->return_code],rc); } #endif } if ( rc > return_code_out_of_bounds || rc < 0 ) { // Out of bounds? #if OW_DEBUG if (Globals.error_level>=e_err_debug) { err_msg( e_err_type_level, e_err_debug, d_file, d_line, d_func, "%s: Reset out of bounds error from %d to %d <%s>",SAFESTRING(pn->path),rc,return_code_out_of_bounds,return_code_strings[return_code_out_of_bounds]); } #endif pn->return_code = return_code_out_of_bounds ; ++ return_code_calls[return_code_out_of_bounds] ; } else { // Error and success pn->return_code = rc ; ++ return_code_calls[rc] ; if ( rc != 0 ) { // Error found -- return_code_calls[0] ; #if OW_DEBUG if (Globals.error_level>=e_err_debug) { err_msg( e_err_type_level, e_err_debug, d_file, d_line, d_func, "%s: Set error to %d <%s>",SAFESTRING(pn->path),rc,return_code_strings[rc]); } #endif } } } void return_code_set_scalar( int raw_rc, int * pi, const char * d_file, int d_line, const char * d_func ) { int rc = raw_rc ; if ( rc < 0 ) { // make positive rc = -rc ; } if ( rc > return_code_out_of_bounds || rc < 0 ) { // Out of bounds? //printf("Return code out of bounds\n"); #if OW_DEBUG if (Globals.error_level>=e_err_debug) { err_msg( e_err_type_level, e_err_debug, d_file, d_line, d_func, "Reset out of bounds error from %d to %d <%s>",rc,return_code_out_of_bounds,return_code_strings[return_code_out_of_bounds]); } #endif *pi = return_code_out_of_bounds ; ++ return_code_calls[return_code_out_of_bounds] ; } else { // Error and success //printf("Return code in bounds\n"); *pi = rc ; ++ return_code_calls[rc] ; if ( rc != 0 ) { //printf("Return code still non-zero\n"); // Error found -- return_code_calls[0] ; #if OW_DEBUG if (Globals.error_level>=e_err_debug) { err_msg( e_err_type_level, e_err_debug, d_file, d_line, d_func, "Set error to %d <%s>",rc,return_code_strings[rc]); } #endif } } //printf("Return code done\n"); } owfs-3.1p5/module/owlib/src/c/ow_rwlock.c0000644000175000001440000001000612654730021015276 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* locks are to handle multithreading */ /* From: Communications of the ACM :Concurrent Control with "Readers" and "Writers" P.J. Courtois,* F. H, 1971 */ #include #include "owfs_config.h" #include "ow.h" #define LOCK_DEBUG(...) if ( Globals.locks != 0 ) { LEVEL_DEFAULT(__VA_ARGS__) ; } #if PTHREAD_RWLOCK #ifndef EXTENDED_RWLOCK_DEBUG void my_rwlock_init(my_rwlock_t * rwlock) { int semrc; semrc = pthread_rwlock_init(rwlock, NULL); if(semrc != 0) { LOCK_DEBUG("semrc=%d [%s] RWLOCK INIT", semrc, strerror(errno)); debug_crash(); } } void my_rwlock_destroy(my_rwlock_t * rwlock) { int semrc; semrc = pthread_rwlock_destroy(rwlock); if(semrc != 0) { /* Might return EBUSY */ LOCK_DEBUG("semrc=%d [%s] RWLOCK DESTROY", semrc, strerror(errno)); debug_crash(); } } int my_rwlock_write_lock(my_rwlock_t * rwlock) { int semrc; semrc = pthread_rwlock_wrlock(rwlock); if(semrc != 0) { LOCK_DEBUG("semrc=%d [%s] RWLOCK WLOCK", semrc, strerror(errno)); debug_crash(); } return semrc; } int my_rwlock_write_unlock(my_rwlock_t * rwlock) { int semrc; semrc = pthread_rwlock_unlock(rwlock); if(semrc != 0) { LEVEL_DEFAULT("semrc=%d [%s] RWLOCK WUNLOCK", semrc, strerror(errno)); debug_crash(); } return semrc; } int my_rwlock_read_lock(my_rwlock_t * rwlock) { int semrc; semrc = pthread_rwlock_rdlock(rwlock); if(semrc != 0) { LOCK_DEBUG("semrc=%d [%s] RWLOCK RLOCK", semrc, strerror(errno)); debug_crash(); } return semrc; } int my_rwlock_read_unlock(my_rwlock_t * rwlock) { int semrc; semrc = pthread_rwlock_unlock(rwlock); if(semrc != 0) { LOCK_DEBUG("semrc=%d [%s] RWLOCK RUNLOCK", semrc, strerror(errno)); debug_crash(); } return semrc; } #endif #else #ifndef EXTENDED_RWLOCK_DEBUG /* rwlock-implementation with semaphores */ /* Don't use the builtin rwlock-support in pthread */ void my_rwlock_init(my_rwlock_t * my_rwlock) { int semrc = 0; memset(my_rwlock, 0, sizeof(my_rwlock_t)); _MUTEX_INIT(my_rwlock->protect_reader_count); semrc |= sem_init(&(my_rwlock->allow_readers), 0, 1); if(semrc != 0) { LOCK_DEBUG("rc=%d [%s] RWLOCK INIT1", semrc, strerror(errno)); debug_crash(); } semrc |= sem_init(&(my_rwlock->no_processes), 0, 1); if(semrc != 0) { LOCK_DEBUG("rc=%d [%s] RWLOCK INIT2", semrc, strerror(errno)); debug_crash(); } my_rwlock->reader_count = 0; } void my_rwlock_destroy(my_rwlock_t * my_rwlock) { int semrc = 0; _MUTEX_DESTROY(my_rwlock->protect_reader_count); semrc |= sem_destroy(&(my_rwlock->allow_readers)); if(semrc != 0) { LOCK_DEBUG("rc=%d [%s] RWLOCK DESTROY1", semrc, strerror(errno)); debug_crash(); } semrc |= sem_destroy(&(my_rwlock->no_processes)); if(semrc != 0) { LOCK_DEBUG("rc=%d [%s] RWLOCK DESTROY2", semrc, strerror(errno)); debug_crash(); } memset(my_rwlock, 0, sizeof(my_rwlock_t)); } int my_rwlock_write_lock(my_rwlock_t * my_rwlock) { sem_wait(&(my_rwlock->allow_readers)); sem_wait(&(my_rwlock->no_processes)); return 0; } int my_rwlock_write_unlock(my_rwlock_t * my_rwlock) { sem_post(&(my_rwlock->allow_readers)); sem_post(&(my_rwlock->no_processes)); return 0; } int my_rwlock_read_lock(my_rwlock_t * my_rwlock) { sem_wait(&(my_rwlock->allow_readers)); _MUTEX_LOCK(my_rwlock->protect_reader_count); if (++my_rwlock->reader_count == 1) { sem_wait(&(my_rwlock->no_processes)); } _MUTEX_UNLOCK(my_rwlock->protect_reader_count); sem_post(&(my_rwlock->allow_readers)); return 0; } int my_rwlock_read_unlock(my_rwlock_t * my_rwlock) { _MUTEX_LOCK(my_rwlock->protect_reader_count); if (--my_rwlock->reader_count == 0) { sem_post(&(my_rwlock->no_processes)); } if(my_rwlock->reader_count < 0) { LOCK_DEBUG("RWLOCK RUNLOCK"); debug_crash(); } _MUTEX_UNLOCK(my_rwlock->protect_reader_count); return 0; } #endif /* EXTENDED_RWLOCK_DEBUG */ #endif /* PTHREAD_RWLOCK */ owfs-3.1p5/module/owlib/src/c/ow_stats.c0000644000175000001440000004463212654730021015147 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Stats are a pseudo-device -- they are a file-system entry and handled as such, but have a different caching type to distiguish their handling */ #include #include "owfs_config.h" #include "ow_stats.h" #include "ow_counters.h" /* ----------------- */ /* ---- Globalss ---- */ /* ----------------- */ UINT cache_flips = 0; UINT cache_adds = 0; struct average old_avg = { 0L, 0L, 0L, 0L, }; struct average new_avg = { 0L, 0L, 0L, 0L, }; struct average store_avg = { 0L, 0L, 0L, 0L, }; struct cache_stats cache_ext = { 0L, 0L, 0L, 0L, 0L, }; struct cache_stats cache_int = { 0L, 0L, 0L, 0L, 0L, }; struct cache_stats cache_dir = { 0L, 0L, 0L, 0L, 0L, }; struct cache_stats cache_pst = { 0L, 0L, 0L, 0L, 0L, }; struct cache_stats cache_dev = { 0L, 0L, 0L, 0L, 0L, }; UINT read_calls = 0; UINT read_cache = 0; UINT read_bytes = 0; UINT read_cachebytes = 0; UINT read_array = 0; UINT read_tries[3] = { 0, 0, 0, }; UINT read_success = 0; struct average read_avg = { 0L, 0L, 0L, 0L, }; UINT write_calls = 0; UINT write_bytes = 0; UINT write_array = 0; UINT write_tries[3] = { 0, 0, 0, }; UINT write_success = 0; struct average write_avg = { 0L, 0L, 0L, 0L, }; struct directory dir_main = { 0L, 0L, }; struct directory dir_dev = { 0L, 0L, }; UINT dir_depth = 0; struct average dir_avg = { 0L, 0L, 0L, 0L, }; /* max delay between a write and when reading first char */ struct timeval max_delay = { 0, 0, }; // ow_locks.c UINT total_bus_locks = 0; UINT total_bus_unlocks = 0; // ow_crc.c UINT CRC8_tries = 0; UINT CRC8_errors = 0; UINT CRC16_tries = 0; UINT CRC16_errors = 0; // ow_net.c UINT NET_accept_errors = 0; UINT NET_connection_errors = 0; UINT NET_read_errors = 0; // ow_bus.c UINT BUS_send_data_errors = 0; UINT BUS_send_data_memcmp_errors = 0; UINT BUS_readin_data_errors = 0; UINT BUS_detect_errors = 0; UINT BUS_level_errors = 0; UINT BUS_next_errors = 0; UINT BUS_next_alarm_errors = 0; UINT BUS_bit_errors = 0; UINT BUS_byte_errors = 0; UINT BUS_echo_errors = 0; UINT BUS_tcsetattr_errors = 0; UINT BUS_status_errors = 0; // ow_ds9097U.c UINT DS2480_read_fd_isset = 0; UINT DS2480_read_null = 0; UINT DS2480_read_read = 0; UINT DS2480_level_docheck_errors = 0; struct average all_avg = { 0L, 0L, 0L, 0L, }; /* ------- Prototypes ----------- */ /* Statistics reporting */ READ_FUNCTION(FS_stat); READ_FUNCTION(FS_time); READ_FUNCTION(FS_return_code); /* -------- Structures ---------- */ static struct filetype stats_cache[] = { {"flips", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_flips}, }, {"additions", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_adds}, }, {"primary", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"primary/now", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&new_avg.current}, }, {"primary/sum", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&new_avg.sum}, }, {"primary/num", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&new_avg.count}, }, {"primary/max", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&new_avg.max}, }, {"secondary", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"secondary/now", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&old_avg.current}, }, {"secondary/sum", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&old_avg.sum}, }, {"secondary/num", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&old_avg.count}, }, {"secondary/max", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&old_avg.max}, }, {"persistent", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"persistent/now", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&store_avg.current,}, }, {"persistent/sum", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&store_avg.sum}, }, {"persistent/num", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&store_avg.count}, }, {"persistent/max", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&store_avg.max}, }, {"external", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"external/tries", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_ext.tries}, }, {"external/hits", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_ext.hits}, }, {"external/added", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_ext.adds,}, }, {"external/expired", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_ext.expires,}, }, {"external/deleted", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_ext.deletes,}, }, {"internal", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"internal/tries", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_int.tries}, }, {"internal/hits", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_int.hits}, }, {"internal/added", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_int.adds,}, }, {"internal/expired", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_int.expires,}, }, {"internal/deleted", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_int.deletes,}, }, {"directory", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"directory/tries", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dir.tries}, }, {"directory/hits", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dir.hits}, }, {"directory/added", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dir.adds}, }, {"directory/expired", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dir.expires,}, }, {"directory/deleted", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dir.deletes,}, }, {"device", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"device/tries", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dev.tries}, }, {"device/hits", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dev.hits}, }, {"device/added", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dev.adds}, }, {"device/expired", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dev.expires,}, }, {"device/deleted", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&cache_dev.deletes,}, }, }; struct device d_stats_cache = { "cache", "cache", 0, COUNT_OF_FILETYPES(stats_cache), stats_cache, NO_GENERIC_READ, NO_GENERIC_WRITE }; // Note, the store hit rate and deletions are not shown -- too much information! static struct aggregate Aread = { 3, ag_numbers, ag_separate, }; static struct filetype stats_read[] = { {"calls", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_calls}, }, {"cachesuccess", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_cache}, }, {"cachebytes", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_cachebytes}, }, {"success", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_success}, }, {"bytes", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_bytes}, }, {"tries", PROPERTY_LENGTH_UNSIGNED, &Aread, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_tries}, }, }; struct device d_stats_read = { "read", "read", 0, COUNT_OF_FILETYPES(stats_read), stats_read, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct filetype stats_write[] = { {"calls", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&write_calls}, }, {"success", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&write_success}, }, {"bytes", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&write_bytes}, }, {"tries", PROPERTY_LENGTH_UNSIGNED, &Aread, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&write_tries}, }, }; struct device d_stats_write = { "write", "write", 0, COUNT_OF_FILETYPES(stats_write), stats_write, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct filetype stats_directory[] = { {"maxdepth", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&dir_depth}, }, {"bus", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"bus/calls", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&dir_main.calls}, }, {"bus/entries", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&dir_main.entries}, }, {"device", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"device/calls", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&dir_dev.calls}, }, {"device/entries", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&dir_dev.entries}, }, } ; struct device d_stats_directory = { "directory", "directory", 0, COUNT_OF_FILETYPES(stats_directory), stats_directory, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct filetype stats_thread[] = { {"directory", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"directory/now", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&dir_avg.current}, }, {"directory/sum", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&dir_avg.sum}, }, {"directory/num", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&dir_avg.count}, }, {"directory/max", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&dir_avg.max}, }, {"overall", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"overall/now", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&all_avg.current}, }, {"overall/sum", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&all_avg.sum}, }, {"overall/num", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&all_avg.count}, }, {"overall/max", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&all_avg.max}, }, {"read", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"read/now", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_avg.current}, }, {"read/sum", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_avg.sum}, }, {"read/num", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_avg.count}, }, {"read/max", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&read_avg.max}, }, {"write", PROPERTY_LENGTH_SUBDIR, NON_AGGREGATE, ft_subdir, fc_subdir, NO_READ_FUNCTION, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"write/now", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&write_avg.current,}, }, {"write/sum", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&write_avg.sum}, }, {"write/num", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&write_avg.count}, }, {"write/max", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v=&write_avg.max}, }, }; struct device d_stats_thread = { "threads", "threads", 0, COUNT_OF_FILETYPES(stats_thread), stats_thread, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct aggregate Areturn_code = { N_RETURN_CODES, ag_numbers, ag_separate, }; static struct filetype stats_return_code[] = { {"responses", PROPERTY_LENGTH_UNSIGNED, &Areturn_code, ft_unsigned, fc_statistic, FS_return_code, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; struct device d_stats_return_code = { "return_codes", "return_codes", 0, COUNT_OF_FILETYPES(stats_return_code), stats_return_code, NO_GENERIC_READ, NO_GENERIC_WRITE }; #define FS_stat_ROW(var) {"" #var "",PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE , ft_unsigned, fc_statistic, FS_stat, NO_WRITE_FUNCTION, VISIBLE, {.v= & var,}, } static struct filetype stats_errors[] = { {"max_delay", PROPERTY_LENGTH_FLOAT, NON_AGGREGATE, ft_float, fc_statistic, FS_time, NO_WRITE_FUNCTION, VISIBLE, {.v=&max_delay}, }, // ow_net.c FS_stat_ROW(NET_accept_errors), FS_stat_ROW(NET_read_errors), FS_stat_ROW(NET_connection_errors), // ow_bus.c FS_stat_ROW(BUS_readin_data_errors), FS_stat_ROW(BUS_detect_errors), FS_stat_ROW(BUS_level_errors), FS_stat_ROW(BUS_next_errors), FS_stat_ROW(BUS_next_alarm_errors), FS_stat_ROW(BUS_bit_errors), FS_stat_ROW(BUS_byte_errors), FS_stat_ROW(BUS_echo_errors), FS_stat_ROW(BUS_tcsetattr_errors), FS_stat_ROW(BUS_status_errors), // ow_ds9097U.c FS_stat_ROW(DS2480_read_fd_isset), FS_stat_ROW(DS2480_read_null), FS_stat_ROW(DS2480_read_read), FS_stat_ROW(DS2480_level_docheck_errors), FS_stat_ROW(CRC8_errors), FS_stat_ROW(CRC8_tries), FS_stat_ROW(CRC16_errors), FS_stat_ROW(CRC16_tries), } ; struct device d_stats_errors = { "errors", "errors", 0, COUNT_OF_FILETYPES(stats_errors), stats_errors, NO_GENERIC_READ, NO_GENERIC_WRITE }; /* ------- Functions ------------ */ static ZERO_OR_ERROR FS_stat(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int dindex = pn->extension; if (dindex < 0) { dindex = 0; } if (pn->selected_filetype == NO_FILETYPE) { return -ENOENT; } if (pn->selected_filetype->data.v == NULL) { return -ENOENT; } STATLOCK; OWQ_U(owq) = ((UINT *) pn->selected_filetype->data.v)[dindex]; STATUNLOCK; return 0; } static ZERO_OR_ERROR FS_time(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int dindex = pn->extension; struct timeval *tv; if (dindex < 0) { dindex = 0; } if (pn->selected_filetype == NO_FILETYPE) { return -ENOENT; } tv = (struct timeval *) pn->selected_filetype->data.v; if (tv == NULL) { return -ENOENT; } STATLOCK; OWQ_F(owq) = TVfloat( &(tv[dindex]) ) ; STATUNLOCK; return 0; } static ZERO_OR_ERROR FS_return_code( struct one_wire_query * owq) { OWQ_U(owq) = return_code_calls[PN(owq)->extension] ; return 0 ; } owfs-3.1p5/module/owlib/src/c/ow_search.c0000644000175000001440000001613012654730021015246 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" static void BUS_first_both(struct device_search *ds); static enum search_status BUS_next_3try(struct device_search *ds, const struct parsedname *pn) ; //-------------------------------------------------------------------------- /** The 'owFirst' doesn't find the first device on the 1-Wire Net. instead, it sets up for BUS_next interator. serialnumber -- 8byte (64 bit) serial number found Returns: 0-device found 1-no dev or error */ enum search_status BUS_first(struct device_search *ds, const struct parsedname *pn) { LEVEL_DEBUG("Start of directory path=%s device=" SNformat, SAFESTRING(pn->path), SNvar(pn->sn)); // reset the search state BUS_first_both(ds); ds->search = _1W_SEARCH_ROM; return BUS_next(ds, pn); } enum search_status BUS_first_alarm(struct device_search *ds, const struct parsedname *pn) { LEVEL_DEBUG("Start of directory path=%s device=" SNformat, SAFESTRING(pn->path), SNvar(pn->sn)); // reset the search state BUS_first_both(ds); ds->search = _1W_CONDITIONAL_SEARCH_ROM; return BUS_next(ds, pn); } static void BUS_first_both(struct device_search *ds) { // reset the search state memset(ds->sn, 0, 8); // clear the serial number ds->LastDiscrepancy = -1; ds->LastDevice = 0; ds->index = -1; // true place in dirblob /* Initialize dir-at-once structure */ DirblobInit(&(ds->gulp)); } //-------------------------------------------------------------------------- /** The BUS_next function does a general search. This function continues from the previous search state (held in struct device_search). The search state can be reset by using the BUS_first function. Returns: 0=No problems, 1=Problems Sets LastDevice=1 if no more */ enum search_status BUS_next(struct device_search *ds, const struct parsedname *pn) { switch ( BUS_next_3try(ds, pn) ) { case search_good: // found a device in a directory search, add to "presence" cache LEVEL_DEBUG("Device found: " SNformat, SNvar(ds->sn)); Cache_Add_Device(pn->selected_connection->index,ds->sn) ; return search_good ; case search_done: BUS_next_cleanup(ds); return search_done; case search_error: default: BUS_next_cleanup(ds); return search_error; } } void BUS_next_cleanup( struct device_search *ds ) { DirblobClear(&(ds->gulp)); } /* try the directory search 3 times. * Since ds->LastDescrepancy is altered only on success a repeat is legal * */ static enum search_status BUS_next_3try(struct device_search *ds, const struct parsedname *pn) { switch (BUS_next_both(ds, pn) ) { case search_good: return search_good ; case search_done: return search_done; case search_error: break ; } STAT_ADD1_BUS(e_bus_search_errors1, pn->selected_connection); switch (BUS_next_both(ds, pn) ) { case search_good: return search_good ; case search_done: return search_done; case search_error: break ; } STAT_ADD1_BUS(e_bus_search_errors2, pn->selected_connection); switch (BUS_next_both(ds, pn) ) { case search_good: return search_good ; case search_done: return search_done; case search_error: break ; } STAT_ADD1_BUS(e_bus_search_errors3, pn->selected_connection); return search_error ; } /* Call either master-specific search routine, or the bit-banging one */ enum search_status BUS_next_both(struct device_search *ds, const struct parsedname *pn) { enum search_status next_both ; if ( pn->selected_connection->iroutines.next_both != NO_NEXT_BOTH_ROUTINE ) { next_both = (pn->selected_connection->iroutines.next_both) (ds, pn); } else { next_both = BUS_next_both_bitbang( ds, pn ) ; } switch ( next_both ) { case search_good: if ((ds->sn[0] & 0x7F) == 0x04) { /* We found a DS1994/DS2404 which requires longer delays */ pn->selected_connection->ds2404_found = 1; } break ; default : break ; } return next_both ; } /* Low level search routines -- bit banging */ /* Not used by more advanced adapters */ enum search_status BUS_next_both_bitbang(struct device_search *ds, const struct parsedname *pn) { if ( BAD( BUS_select(pn) ) ) { return search_error ; } else { int search_direction = 0; /* initialization just to forestall incorrect compiler warning */ int bit_number; int last_zero = -1; BYTE bits[3]; // initialize for search // if the last call was not the last one if (ds->LastDevice) { return search_done; } /* Appropriate search command */ if ( BAD( BUS_send_data(&(ds->search), 1, pn)) ) { return search_error ; } // Need data from a reset for AnyDevices -- obtained from BUS_data_send above if (pn->selected_connection->AnyDevices == anydevices_no) { ds->LastDevice = 1; return search_done; } // loop to do the search for (bit_number = 0;; ++bit_number) { bits[1] = bits[2] = 0xFF; if (bit_number == 0) { /* First bit */ /* get two bits (AND'ed bit and AND'ed complement) */ if ( BAD( BUS_sendback_bits(&bits[1], &bits[1], 2, pn) ) ) { return search_error; } } else { bits[0] = search_direction; if (bit_number < 64) { /* Send chosen bit path, then check match on next two */ if ( BAD( BUS_sendback_bits(bits, bits, 3, pn) ) ) { return search_error; } } else { /* last bit */ if ( BAD( BUS_sendback_bits(bits, bits, 1, pn) ) ) { return search_error; } break; } } if (bits[1]) { if (bits[2]) { /* 1,1 */ /* No devices respond */ ds->LastDevice = 1; return search_done; } else { /* 1,0 */ search_direction = 1; // bit write value for search } } else if (bits[2]) { /* 0,1 */ search_direction = 0; // bit write value for search } else if (bit_number > ds->LastDiscrepancy) { /* 0,0 looking for last discrepancy in this new branch */ // Past branch, select zeros for now search_direction = 0; last_zero = bit_number; } else if (bit_number == ds->LastDiscrepancy) { /* 0,0 -- new branch */ // at branch (again), select 1 this time search_direction = 1; // if equal to last pick 1, if not then pick 0 } else if (UT_getbit(ds->sn, bit_number)) { /* 0,0 -- old news, use previous "1" bit */ // this discrepancy is before the Last Discrepancy search_direction = 1; } else { /* 0,0 -- old news, use previous "0" bit */ // this discrepancy is before the Last Discrepancy search_direction = 0; last_zero = bit_number; } UT_setbit(ds->sn, bit_number, search_direction); } // loop until through serial number bits if ( (CRC8(ds->sn, SERIAL_NUMBER_SIZE)!=0) || (bit_number < 64) || (ds->sn[0] == 0)) { /* A minor "error" */ return search_error; } // if the search was successful then ds->LastDiscrepancy = last_zero; // printf("Post, lastdiscrep=%d\n",si->LastDiscrepancy) ; ds->LastDevice = (last_zero < 0); return search_good; } } owfs-3.1p5/module/owlib/src/c/ow_serial_free.c0000644000175000001440000000250112654730021016256 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif /* ---------------------------------------------- */ /* raw COM port interface routines */ /* ---------------------------------------------- */ //free serial port and restore attributes /* Called on head of multibus group */ void serial_free(struct connection_in *connection) { FILE_DESCRIPTOR_OR_ERROR fd ; struct port_in * pin = connection->pown ; fd = pin->file_descriptor ; if ( FILE_DESCRIPTOR_NOT_VALID( fd ) ) { // reopen to restore attributes fd = open( pin->init_data, O_RDWR | O_NONBLOCK | O_NOCTTY ) ; } // restore tty settings if ( FILE_DESCRIPTOR_VALID( fd ) ) { LEVEL_DEBUG("COM_close: flush"); tcflush( fd, TCIOFLUSH); LEVEL_DEBUG("COM_close: restore"); if ( tcsetattr( fd, TCSANOW, &(pin->dev.serial.oldSerialTio) ) < 0) { ERROR_CONNECT("Cannot restore port attributes: %s", pin->init_data); } } pin->file_descriptor = fd ; Test_and_Close( &( pin->file_descriptor) ) ; } owfs-3.1p5/module/owlib/src/c/ow_serial_open.c0000644000175000001440000001176612654730021016313 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif // Fix an OpenWRT error found by Patryk #ifndef CMSPAR #define CMSPAR 010000000000 #endif /* ---------------------------------------------- */ /* raw COM port interface routines */ /* ---------------------------------------------- */ //open serial port ( called on head of connection_in group from com_open ) GOOD_OR_BAD serial_open(struct connection_in *connection) { struct port_in * pin = connection->pown ; FILE_DESCRIPTOR_OR_ERROR fd = open( DEVICENAME(connection), O_RDWR | O_NONBLOCK | O_NOCTTY) ; pin->file_descriptor = fd ; if ( FILE_DESCRIPTOR_NOT_VALID( fd ) ) { // state doesn't change ERROR_DEFAULT("Cannot open port: %s Permissions problem?", SAFESTRING(DEVICENAME(connection))); return gbBAD; } if ( pin->state == cs_virgin ) { // valgrind warns about uninitialized memory in tcsetattr(), so clear all. memset( &(pin->dev.serial.oldSerialTio), 0, sizeof(struct termios)); if ((tcgetattr( fd, &(pin->dev.serial.oldSerialTio) ) < 0)) { ERROR_CONNECT("Cannot get old port attributes: %s", SAFESTRING(DEVICENAME(connection))); // proceed anyway } pin->state = cs_deflowered ; } return serial_change( connection ) ; } //change serial port settings GOOD_OR_BAD serial_change(struct connection_in *connection) { struct port_in * pin = connection->pown ; struct termios newSerialTio; /*new serial port settings */ FILE_DESCRIPTOR_OR_ERROR fd = pin->file_descriptor ; size_t baud = pin->baud ; // read the attribute structure // valgrind warns about uninitialized memory in tcsetattr(), so clear all. memset(&newSerialTio, 0, sizeof(struct termios)); if ((tcgetattr( fd, &newSerialTio) < 0)) { ERROR_CONNECT("Cannot get existing port attributes: %s", SAFESTRING(DEVICENAME(connection))); } // set baud in structure if (cfsetospeed(&newSerialTio, baud) < 0 || cfsetispeed(&newSerialTio, baud) < 0) { ERROR_CONNECT("Trouble setting port speed: %s", SAFESTRING(DEVICENAME(connection))); cfsetospeed(&newSerialTio, B9600) ; cfsetispeed(&newSerialTio, B9600) ; pin->baud = B9600 ; } // Set to non-canonical mode, and no RTS/CTS handshaking newSerialTio.c_iflag &= ~(BRKINT | ICRNL | IGNCR | INLCR | INPCK | ISTRIP | IXON | IXOFF | PARMRK); newSerialTio.c_iflag |= IGNBRK | IGNPAR; newSerialTio.c_oflag &= ~(OPOST); newSerialTio.c_cflag &= ~ HUPCL ; newSerialTio.c_cflag |= (CLOCAL | CREAD); switch( pin->flow ) { case flow_hard: newSerialTio.c_cflag |= CRTSCTS ; break ; case flow_none: newSerialTio.c_cflag &= ~CRTSCTS; break ; case flow_soft: default: LEVEL_DEBUG("Unsupported COM port flow control"); return -ENOTSUP ; } // set bit length newSerialTio.c_cflag &= ~ CSIZE ; switch (pin->bits) { case 5: newSerialTio.c_cflag |= CS5 ; break ; case 6: newSerialTio.c_cflag |= CS6 ; break ; case 7: newSerialTio.c_cflag |= CS7 ; break ; case 8: default: newSerialTio.c_cflag |= CS8 ; break ; } // parity switch (pin->parity) { case parity_none: newSerialTio.c_cflag &= ~PARENB ; break ; case parity_even: newSerialTio.c_cflag |= PARENB ; newSerialTio.c_cflag &= ~( PARODD | CMSPAR ) ; break ; case parity_odd: newSerialTio.c_cflag |= PARENB | PARODD; newSerialTio.c_cflag &= ~CMSPAR ; break ; case parity_mark: newSerialTio.c_cflag |= PARENB | PARODD | CMSPAR; break ; } // stop bits switch (pin->stop) { case stop_15: LEVEL_DEBUG("1.5 Stop bits not supported"); pin->stop = stop_1 ; // fall through case stop_1: newSerialTio.c_cflag &= ~CSTOPB ; break ; case stop_2: newSerialTio.c_cflag |= CSTOPB ; break ; } newSerialTio.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL | ICANON | IEXTEN | ISIG); newSerialTio.c_cc[VMIN] = pin->vmin; newSerialTio.c_cc[VTIME] = pin->vtime; if (tcsetattr( fd, TCSAFLUSH, &newSerialTio)) { ERROR_CONNECT("Cannot set port attributes: %s", SAFESTRING(DEVICENAME(connection))); return gbBAD; } tcflush( fd, TCIOFLUSH); return gbGOOD; } //change set to 0 baud for 1 second GOOD_OR_BAD serial_powercycle(struct connection_in *connection) { struct port_in * pin = connection->pown ; FILE_DESCRIPTOR_OR_ERROR fd = pin->file_descriptor ; size_t baud = pin->baud ; if ( pin->type != ct_serial ) { return gbGOOD ; } if ( FILE_DESCRIPTOR_NOT_VALID(fd) ) { LEVEL_DEBUG("Cannot power cycle a closed serial port"); return gbBAD ; } // temporary pin->baud = B0 ; if ( GOOD(serial_change( connection )) ) { LEVEL_DEBUG("Sleep after setting DTR/RTS pins off"); sleep(2) ; } // restore pin->baud = baud ; // Close for good measure Test_and_Close( &( pin->file_descriptor) ) ; return serial_open( connection ) ; } owfs-3.1p5/module/owlib/src/c/ow_server.c0000644000175000001440000000607212654730021015313 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" static void Server_setroutines(struct interface_routines *f); static void Zero_setroutines(struct interface_routines *f); static void Server_close(struct connection_in *in); static void Server_setroutines(struct interface_routines *f) { f->detect = Server_detect; f->reset = NO_RESET_ROUTINE; f->next_both = NO_NEXT_BOTH_ROUTINE ; f->PowerByte = NO_POWERBYTE_ROUTINE; f->ProgramPulse = NO_PROGRAMPULSE_ROUTINE; f->sendback_data = NO_SENDBACKDATA_ROUTINE; f->sendback_bits = NO_SENDBACKBITS_ROUTINE; f->select = NO_SELECT_ROUTINE; f->select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; f->set_config = NO_SET_CONFIG_ROUTINE; f->get_config = NO_GET_CONFIG_ROUTINE; f->reconnect = NO_RECONNECT_ROUTINE; f->close = Server_close; f->flags = 0 ; } static void Zero_setroutines(struct interface_routines *f) { f->detect = Server_detect; f->reset = NO_RESET_ROUTINE; f->next_both = NO_NEXT_BOTH_ROUTINE ; f->PowerByte = NO_POWERBYTE_ROUTINE; f->ProgramPulse = NO_PROGRAMPULSE_ROUTINE; f->sendback_data = NO_SENDBACKDATA_ROUTINE; f->sendback_bits = NO_SENDBACKBITS_ROUTINE; f->select = NO_SELECT_ROUTINE; f->select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; f->set_config = NO_SET_CONFIG_ROUTINE; f->get_config = NO_GET_CONFIG_ROUTINE; f->reconnect = NO_RECONNECT_ROUTINE; f->close = Server_close; f->flags = 0 ; } // bus_zero is a server found by zeroconf/Bonjour // It differs in that the server must respond GOOD_OR_BAD Zero_detect(struct port_in *pin) { struct connection_in * in = pin->first ; if ( in==NO_CONNECTION ) { return gbBAD ; } pin->type = ct_tcp ; pin->state = cs_virgin ; pin->busmode = bus_zero; if (pin->init_data == NULL) { return gbBAD; } RETURN_BAD_IF_BAD( COM_open(in) ) ; in->Adapter = adapter_tcp; in->adapter_name = "tcp"; Zero_setroutines(&(in->iroutines)); return gbGOOD; } // Set up inbound connection to an owserver // Actual tcp connection created as needed GOOD_OR_BAD Server_detect(struct port_in *pin) { struct connection_in * in = pin->first ; if (pin->init_data == NULL) { return gbBAD; } pin->type = ct_tcp ; pin->state = cs_virgin ; RETURN_BAD_IF_BAD( COM_open(in) ) ; in->Adapter = adapter_tcp; in->adapter_name = "tcp"; pin->busmode = bus_server; Server_setroutines(&(in->iroutines)); return gbGOOD; } // Free up the owserver inbound connection // actual connections opened and closed independently static void Server_close(struct connection_in *in) { SAFEFREE(in->master.server.type) ; SAFEFREE(in->master.server.domain) ; SAFEFREE(in->master.server.name) ; } owfs-3.1p5/module/owlib/src/c/ow_server_message.c0000644000175000001440000006433012654730021017020 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_server talks to the server, sending and recieving messages */ /* this is an alternative to direct bus communication */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_standard.h" // for FS_?_alias struct server_connection_state { FILE_DESCRIPTOR_OR_ERROR file_descriptor ; enum persistent_state { persistent_yes, persistent_no, } persistence ; struct connection_in * in ; } ; struct directory_element_structure { const struct parsedname * pn_whole_directory ; struct dirblob db ; void (*dirfunc) (void *, const struct parsedname * const) ; void * v ; } ; static uint32_t SetupControlFlags(const struct parsedname *pn); static ZERO_OR_ERROR ServerDIRALL(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn_whole_directory, uint32_t * flags); static ZERO_OR_ERROR ServerDIR(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn_whole_directory, uint32_t * flags); static void Directory_Element_Init( struct directory_element_structure * des ); static void Directory_Element_Finish( struct directory_element_structure * des ); static ZERO_OR_ERROR Directory_Element( char * current_file, struct directory_element_structure * des ); static void Close_Persistent( struct server_connection_state * scs) ; static void Release_Persistent( struct server_connection_state * scs, int granted ) ; static GOOD_OR_BAD To_Server( struct server_connection_state * scs, struct server_msg * sm, struct serverpackage *sp) ; static SIZE_OR_ERROR WriteToServer(int file_descriptor, struct server_msg *sm, struct serverpackage *sp); static SIZE_OR_ERROR From_Server( struct server_connection_state * scs, struct client_msg *cm, char *msg, size_t size) ; static void *From_ServerAlloc(struct server_connection_state * scs, struct client_msg *cm) ; // Send to an owserver using the READ message SIZE_OR_ERROR ServerRead(struct one_wire_query *owq) { struct server_msg sm; struct client_msg cm; struct parsedname *pn_file_entry = PN(owq); struct serverpackage sp = { pn_file_entry->path_to_server, NULL, 0, pn_file_entry->tokenstring, pn_file_entry->tokens, }; struct server_connection_state scs ; // initialization scs.in = pn_file_entry->selected_connection ; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_read; sm.size = OWQ_size(owq); sm.offset = OWQ_offset(owq); // Alias should show local understanding except if bus.x specified if ( (pn_file_entry->selected_filetype != NULL) && (pn_file_entry->selected_filetype->format == ft_alias && ! SpecifiedRemoteBus(pn_file_entry) )) { ignore_result = FS_r_alias( owq ) ; return OWQ_length(owq) ; } LEVEL_CALL("SERVER(%d) path=%s", pn_file_entry->selected_connection->index, SAFESTRING(pn_file_entry->path_to_server)); // Send to owserver sm.control_flags = SetupControlFlags(pn_file_entry); if ( BAD( To_Server( &scs, &sm, &sp) ) ) { Release_Persistent( &scs, 0); return -EIO ; } // Receive from owserver if ( From_Server( &scs, &cm, OWQ_buffer(owq), OWQ_size(owq)) < 0 ) { Release_Persistent( &scs, 0); return -EIO ; } Release_Persistent( &scs, cm.control_flags & PERSISTENT_MASK); return cm.ret; } // Send to an owserver using the PRESENT message INDEX_OR_ERROR ServerPresence( struct parsedname *pn_file_entry) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { pn_file_entry->path_to_server, NULL, 0, pn_file_entry->tokenstring, pn_file_entry->tokens, }; BYTE * serial_number ; struct server_connection_state scs ; // initialization scs.in = pn_file_entry->selected_connection ; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_presence; LEVEL_CALL("SERVER(%d) path=%s", pn_file_entry->selected_connection->index, SAFESTRING(pn_file_entry->path_to_server)); // Send to owserver sm.control_flags = SetupControlFlags( pn_file_entry); if ( BAD( To_Server( &scs, &sm, &sp) ) ) { Release_Persistent( &scs, 0 ) ; return INDEX_BAD ; } // Receive from owserver serial_number = (BYTE *) From_ServerAlloc( &scs, &cm) ; if (cm.ret < 0) { Release_Persistent(&scs, 0 ); return INDEX_BAD ; } // Newer owservers return the serial number -- relevant for alias propagation if ( serial_number ) { memcpy( pn_file_entry->sn, serial_number, SERIAL_NUMBER_SIZE ) ; owfree( serial_number) ; } Release_Persistent(&scs, cm.control_flags & PERSISTENT_MASK); return INDEX_VALID(cm.ret) ? pn_file_entry->selected_connection->index : INDEX_BAD; } // Send to an owserver using the WRITE message ZERO_OR_ERROR ServerWrite(struct one_wire_query *owq) { struct server_msg sm; struct client_msg cm; struct parsedname *pn_file_entry = PN(owq); struct serverpackage sp = { pn_file_entry->path_to_server, (BYTE *) OWQ_buffer(owq), OWQ_size(owq), pn_file_entry->tokenstring, pn_file_entry->tokens, }; struct server_connection_state scs ; // initialization scs.in = pn_file_entry->selected_connection ; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_write; sm.size = OWQ_size(owq); sm.offset = OWQ_offset(owq); LEVEL_CALL("SERVER(%d) path=%s", pn_file_entry->selected_connection->index, SAFESTRING(pn_file_entry->path_to_server)); // Send to owserver sm.control_flags = SetupControlFlags( pn_file_entry); if ( BAD( To_Server( &scs, &sm, &sp) ) ) { Release_Persistent( &scs, 0 ) ; return -EIO ; } // Receive from owserver if ( From_Server( &scs, &cm, NULL, 0) < 0) { Release_Persistent( &scs, 0 ) ; return -EIO ; } { int32_t control_flags = cm.control_flags & ~(SHOULD_RETURN_BUS_LIST | PERSISTENT_MASK | SAFEMODE); // keep current safemode control_flags |= LocalControlFlags & SAFEMODE ; CONTROLFLAGSLOCK; if (LocalControlFlags != control_flags) { // replace control flags (except safemode persists) //printf("ServerRead: cm.control_flags changed! controlflags=%X cm.control_flags=%X\n", SemiGlobal, cm.control_flags); LocalControlFlags = control_flags; } CONTROLFLAGSUNLOCK; } Release_Persistent(&scs, cm.control_flags & PERSISTENT_MASK); return cm.ret; } // Send to an owserver using either the DIR or DIRALL message ZERO_OR_ERROR ServerDir(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn_whole_directory, uint32_t * flags) { ZERO_OR_ERROR ret; struct connection_in * in = pn_whole_directory->selected_connection ; // Do we know this server doesn't support DIRALL? if (in->master.server.no_dirall) { return ServerDIR(dirfunc, v, pn_whole_directory, flags); } // Did we ask for no DIRALL explicitly? if (Globals.no_dirall) { return ServerDIR(dirfunc, v, pn_whole_directory, flags); } // device directories have lower latency with DIR if (IsRealDir(pn_whole_directory) || IsAlarmDir(pn_whole_directory)) { return ServerDIR(dirfunc, v, pn_whole_directory, flags); } // try DIRALL and see if supported if ((ret = ServerDIRALL(dirfunc, v, pn_whole_directory, flags)) == -ENOMSG) { in->master.server.no_dirall = 1; return ServerDIR(dirfunc, v, pn_whole_directory, flags); } return ret; } // Send to an owserver using the DIR message static ZERO_OR_ERROR ServerDIR(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn_whole_directory, uint32_t * flags) { struct server_msg sm; struct client_msg cm; struct serverpackage sp = { pn_whole_directory->path_to_server, NULL, 0, pn_whole_directory->tokenstring, pn_whole_directory->tokens, }; struct server_connection_state scs ; struct directory_element_structure des ; char *return_path; // initialization scs.in = pn_whole_directory->selected_connection ; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_dir; LEVEL_CALL("SERVER(%d) path=%s path_to_server=%s", scs.in->index, SAFESTRING(pn_whole_directory->path), SAFESTRING(pn_whole_directory->path_to_server)); // Send to owserver sm.control_flags = SetupControlFlags( pn_whole_directory); if ( BAD( To_Server( &scs, &sm, &sp) ) ) { Release_Persistent( &scs, 0 ) ; return -EIO ; } des.dirfunc = dirfunc ; des.v = v ; des.pn_whole_directory = pn_whole_directory ; Directory_Element_Init( &des ) ; // Receive from owserver -- in a loop for each directory entry while ( (return_path = From_ServerAlloc(&scs, &cm)) != NO_PATH ) { ZERO_OR_ERROR ret; return_path[cm.payload - 1] = '\0'; /* Ensure trailing null */ ret = Directory_Element( return_path, &des ) ; owfree(return_path); if (ret) { cm.ret = ret; break; } } Directory_Element_Finish( &des ) ; DIRLOCK; /* flags are sent back in "offset" of final blank entry */ flags[0] |= cm.offset; DIRUNLOCK; Release_Persistent(&scs, cm.control_flags & PERSISTENT_MASK); return cm.ret; } // Send to an owserver using the DIRALL message static ZERO_OR_ERROR ServerDIRALL(void (*dirfunc) (void *, const struct parsedname * const), void *v, const struct parsedname *pn_whole_directory, uint32_t * flags) { ASCII *comma_separated_list; struct server_msg sm; struct client_msg cm; struct serverpackage sp = { pn_whole_directory->path_to_server, NULL, 0, pn_whole_directory->tokenstring, pn_whole_directory->tokens, }; struct connection_in * in = pn_whole_directory->selected_connection ; struct server_connection_state scs ; // initialization scs.in = in ; memset(&sm, 0, sizeof(struct server_msg)); memset(&cm, 0, sizeof(struct client_msg)); sm.type = msg_dirall; LEVEL_CALL("SERVER(%d) path=%s path_to_server=%s", in->index, SAFESTRING(pn_whole_directory->path), SAFESTRING(pn_whole_directory->path_to_server)); // Send to owserver sm.control_flags = SetupControlFlags( pn_whole_directory); if ( BAD( To_Server( &scs, &sm, &sp) ) ) { Release_Persistent( &scs, 0 ) ; return -EIO ; } // Receive from owserver comma_separated_list = From_ServerAlloc(&scs, &cm); LEVEL_DEBUG("got %s", SAFESTRING(comma_separated_list)); if (cm.ret == 0) { ASCII *current_file; ASCII *rest_of_comma_list = comma_separated_list; struct directory_element_structure des ; des.dirfunc = dirfunc ; des.v = v ; des.pn_whole_directory = pn_whole_directory ; Directory_Element_Init( &des ) ; while ((current_file = strsep(&rest_of_comma_list, ",")) != NULL) { ZERO_OR_ERROR ret = Directory_Element( current_file, &des ); if (ret) { cm.ret = ret; break; } } Directory_Element_Finish( &des ) ; DIRLOCK; /* flags are sent back in "offset" */ flags[0] |= cm.offset; DIRUNLOCK; } // free the allocated memory SAFEFREE(comma_separated_list) ; Release_Persistent( &scs, cm.control_flags & PERSISTENT_MASK ); return cm.ret; } static void Directory_Element_Init( struct directory_element_structure * des ) { /* If cacheable, try to allocate a blob for storage */ /* only for "read devices" and not alarm */ DirblobInit(&(des->db) ); if (IsRealDir(des->pn_whole_directory) && NotAlarmDir(des->pn_whole_directory) && !SpecifiedBus(des->pn_whole_directory) && des->pn_whole_directory->selected_device == NO_DEVICE) { if (RootNotBranch(des->pn_whole_directory)) { /* root dir */ BUSLOCK(des->pn_whole_directory); des->db.allocated = des->pn_whole_directory->selected_connection->last_root_devs; // root dir estimated length BUSUNLOCK(des->pn_whole_directory); } } else { DirblobPoison( &(des->db) ); // don't cache other directories } } static void Directory_Element_Finish( struct directory_element_structure * des ) { /* Add to the cache (full list as a single element */ if ( DirblobPure( &(des->db) ) ) { Cache_Add_Dir( &(des->db), des->pn_whole_directory); // end with a null entry if (RootNotBranch(des->pn_whole_directory)) { BUSLOCK(des->pn_whole_directory); des->pn_whole_directory->selected_connection->last_root_devs = DirblobElements( &(des->db) ); // root dir estimated length BUSUNLOCK(des->pn_whole_directory); } } DirblobClear( & (des->db) ); } static ZERO_OR_ERROR Directory_Element( char * current_file, struct directory_element_structure * des ) { struct parsedname s_pn_directory_element; struct parsedname * pn_directory_element = & s_pn_directory_element ; struct connection_in * in = des->pn_whole_directory->selected_connection ; ZERO_OR_ERROR ret ; LEVEL_DEBUG("got=[%s]", current_file); if (SpecifiedRemoteBus(des->pn_whole_directory)) { // Specified remote bus, add the bus to the path (in front) int path_length = strlen(current_file); char BigBuffer[path_length + 12]; int sn_ret ; char * no_leading_slash = ¤t_file[(current_file[0] == '/') ? 1 : 0] ; UCLIBCLOCK ; sn_ret = snprintf(BigBuffer, path_length + 11, "/bus.%d/%s",in->index, no_leading_slash ) ; UCLIBCUNLOCK ; if (sn_ret < 0) { return -EINVAL ; } ret = FS_ParsedName_BackFromRemote(BigBuffer, pn_directory_element); } else { ret = FS_ParsedName_BackFromRemote(current_file, pn_directory_element); } if ( ret < 0 ) { DirblobPoison( &(des->db) ); // don't cache a mistake return ret; } /* we got a device on bus_nr = pn_whole_directory->selected_connection->index. Cache it so we find it quicker next time we want to do read values from the the actual device */ if (IsRealDir(des->pn_whole_directory)) { /* If we get a device then cache the bus_nr */ Cache_Add_Device(in->index, pn_directory_element->sn); } /* Add to cache Blob -- snlist is also a flag for cachable */ if (DirblobPure( &(des->db) ) ) { /* only add if there is a blob allocated successfully */ DirblobAdd(pn_directory_element->sn, &(des->db) ); } // Now actually do the directory function on this element FS_dir_entry_aliased(des->dirfunc,des->v,pn_directory_element) ; // Cleanup FS_ParsedName_destroy(pn_directory_element); // destroy the last parsed name return 0 ; } /* read from server, free return pointer if not Null */ /* Adds an extra null byte at end */ static void *From_ServerAlloc(struct server_connection_state * scs, struct client_msg *cm) { BYTE *msg; struct timeval tv = { Globals.timeout_network + 1, 0, }; size_t actual_size ; do { /* loop until non delay message (payload>=0) */ tcp_read(scs->file_descriptor, (BYTE *) cm, sizeof(struct client_msg), &tv, &actual_size); if (actual_size != sizeof(struct client_msg)) { memset(cm, 0, sizeof(struct client_msg)); cm->ret = -EIO; return NO_PATH; } cm->payload = ntohl(cm->payload); cm->size = ntohl(cm->size); cm->ret = ntohl(cm->ret); cm->control_flags = ntohl(cm->control_flags); cm->offset = ntohl(cm->offset); } while (cm->payload < 0); if (cm->payload == 0) { return NO_PATH; } if (cm->ret < 0) { return NO_PATH; } if (cm->payload > MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE) { return NO_PATH; } msg = owmalloc((size_t) cm->payload + 1) ; if ( msg != NO_PATH ) { tcp_read(scs->file_descriptor, msg, (size_t) (cm->payload), &tv, &actual_size); if ((ssize_t)actual_size != cm->payload) { cm->payload = 0; cm->offset = 0; cm->ret = -EIO; owfree(msg); msg = NO_PATH; } } if(msg != NO_PATH) { msg[cm->payload] = '\0'; // safety NULL } return msg; } /* Read from server -- return negative on error, return 0 or positive giving size of data element */ static SIZE_OR_ERROR From_Server( struct server_connection_state * scs, struct client_msg *cm, char *msg, size_t size) { size_t rtry; size_t actual_read ; struct timeval tv1 = { Globals.timeout_network + 1, 0, }; struct timeval tv2 = { Globals.timeout_network + 1, 0, }; do { // read regular header, or delay (delay when payload<0) tcp_read(scs->file_descriptor, (BYTE *) cm, sizeof(struct client_msg), &tv1, &actual_read); if (actual_read != sizeof(struct client_msg)) { cm->size = 0; cm->ret = -EIO; return -EIO; } cm->payload = ntohl(cm->payload); cm->size = ntohl(cm->size); cm->ret = ntohl(cm->ret); cm->control_flags = ntohl(cm->control_flags); cm->offset = ntohl(cm->offset); } while (cm->payload < 0); // flag to show a delay message if (cm->payload == 0) { return 0; // No payload, done. } rtry = cm->payload < (ssize_t) size ? (size_t) cm->payload : size; tcp_read(scs->file_descriptor, (BYTE *) msg, rtry, &tv2, &actual_read); // read expected payload now. if (actual_read != rtry) { LEVEL_DEBUG("Read only %d of %d\n",(int)actual_read,(int)rtry) ; cm->ret = -EIO; return -EIO; } if (cm->payload > (ssize_t) size) { // Uh oh. payload bigger than expected. close the connection Close_Persistent( scs ) ; return size; } return cm->payload; } static GOOD_OR_BAD To_Server( struct server_connection_state * scs, struct server_msg * sm, struct serverpackage *sp) { struct connection_in * in = scs->in ; // for convenience struct port_in * pin = in->pown ; BYTE test_read[1] ; int old_flags ; ssize_t rcv_value ; int saved_errno ; // initialize the variables scs->file_descriptor = FILE_DESCRIPTOR_BAD ; scs->persistence = Globals.no_persistence ? persistent_no : persistent_yes ; // First set up the file descriptor based on persistent state if (scs->persistence == persistent_no) { // no persistence wanted scs->file_descriptor = ClientConnect(in); } else { // Persistence desired BUSLOCKIN(in); switch ( pin->file_descriptor ) { case FILE_DESCRIPTOR_PERSISTENT_IN_USE: // Currently in use, so make new non-persistent connection scs->file_descriptor = ClientConnect(in); scs->persistence = persistent_no ; break ; case FILE_DESCRIPTOR_BAD: // no conection currently, so make a new one scs->file_descriptor = ClientConnect(in); if ( FILE_DESCRIPTOR_VALID( scs->file_descriptor ) ) { pin->file_descriptor = FILE_DESCRIPTOR_PERSISTENT_IN_USE ; } break ; default: // persistent connection idle and waiting for use // connection_in is locked so this is safe scs->file_descriptor = pin->file_descriptor; pin->file_descriptor = FILE_DESCRIPTOR_PERSISTENT_IN_USE; break ; } BUSUNLOCKIN(in); } // Check if the server closed the connection // This is contributed by Jacob Joseph to fix a timeout problem. // http://permalink.gmane.org/gmane.comp.file-systems.owfs.devel/7306 //rcv_value = recv(scs->file_descriptor, test_read, 1, MSG_DONTWAIT | MSG_PEEK) ; old_flags = fcntl( scs->file_descriptor, F_GETFL, 0 ) ; // save socket flags if ( old_flags == -1 ) { rcv_value = -2 ; } else if ( fcntl( scs->file_descriptor, F_SETFL, old_flags | O_NONBLOCK ) == -1 ) { // set non-blocking rcv_value = -2 ; } else { rcv_value = recv(scs->file_descriptor, test_read, 1, MSG_PEEK) ; // test read the socket to see if closed saved_errno = errno ; if ( fcntl( scs->file_descriptor, F_SETFL, old_flags ) == -1 ) { // restore socket flags rcv_value = -2 ; } } switch ( rcv_value ) { case -1: if ( saved_errno==EAGAIN || saved_errno==EWOULDBLOCK ) { // No data to be read -- so connection healthy break ; } // real error, fall through to close connection case case -2: // fnctl error, fall through again case 0: LEVEL_DEBUG("Server connection was closed. Reconnecting."); Close_Persistent( scs); scs->file_descriptor = ClientConnect(in); if ( FILE_DESCRIPTOR_VALID( scs->file_descriptor ) ) { in->pown->file_descriptor = FILE_DESCRIPTOR_PERSISTENT_IN_USE ; } break ; default: // data to be read, so a good connection break ; } // Now test if ( FILE_DESCRIPTOR_NOT_VALID( scs->file_descriptor ) ) { STAT_ADD1(in->reconnect_state); Close_Persistent( scs ) ; return gbBAD ; } // Do the real work if (WriteToServer(scs->file_descriptor, sm, sp) >= 0) { // successful message return gbGOOD; } // This is where it gets a bit tricky. For non-persistent conections we're done' if ( scs->persistence == persistent_no ) { // not persistent, so no reconnection needed Close_Persistent( scs ) ; return gbBAD ; } // perhaps the persistent connection is stale? // Make a new one scs->file_descriptor = ClientConnect(in) ; // Now retest if ( FILE_DESCRIPTOR_NOT_VALID( scs->file_descriptor ) ) { // couldn't make that new connection -- free everything STAT_ADD1(in->reconnect_state); Close_Persistent( scs ) ; return gbBAD ; } // Leave in->file_descriptor = FILE_DESCRIPTOR_PERSISTENT_IN_USE // Second attempt at the write, now with new connection if (WriteToServer(scs->file_descriptor, sm, sp) >= 0) { // successful message return gbGOOD; } // bad write the second time -- clear everything Close_Persistent( scs ) ; return gbBAD ; } static void Close_Persistent( struct server_connection_state * scs) { // First set up the file descriptor based on persistent state if (scs->persistence == persistent_yes) { // no persistence wanted BUSLOCKIN(scs->in); scs->in->pown->file_descriptor = FILE_DESCRIPTOR_BAD ; BUSUNLOCKIN(scs->in); } scs->persistence = persistent_no ; Test_and_Close( &(scs->file_descriptor) ) ; } // should be const char * data but iovec has problems with const arguments static SIZE_OR_ERROR WriteToServer(int file_descriptor, struct server_msg *sm, struct serverpackage *sp) { int payload = 0; int tokens = 0; int server_type = Globals.program_type==program_type_server || Globals.program_type==program_type_external ; // We use vector write -- several ranges int nio = 0; struct iovec io[5] = { {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, }; struct server_msg net_sm ; // Set the version sm->version = MakeServerprotocol(OWSERVER_PROTOCOL_VERSION); // First block to send, the header // We'll do this last since the header values (e.g. payload) change nio++; // Next block, the path if (sp->path != 0) { // send path (if not null) // writev should take const data pointers, but I can't fix the library #if ( __GNUC__ > 4 ) || (__GNUC__ == 4 && __GNUC_MINOR__ > 4 ) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" io[nio].iov_base = (char *) sp->path ; // gives a spurious compiler error -- constant is OK HERE! #pragma GCC diagnostic pop #else io[nio].iov_base = (char *) sp->path ; // gives a spurious compiler error -- constant is OK HERE! #endif io[nio].iov_len = strlen(sp->path) + 1; // we're adding the null (though it isn't required post 2.9p3) payload = io[nio].iov_len; nio++; } // Next block, data (only for writes) if ((sp->datasize>0) && (sp->data!=NULL)) { // send data only for writes (if datasize not zero) io[nio].iov_base = sp->data ; io[nio].iov_len = sp->datasize ; payload += sp->datasize; nio++; } if ( server_type ) { tokens = sp->tokens; // Next block prior tokens (if an owserver) if (tokens > 0) { // owserver: send prior tags io[nio].iov_base = sp->tokenstring; io[nio].iov_len = tokens * sizeof(struct antiloop); nio++; } // Final block, new token (if an owserver) ++tokens; if ( tokens == MakeServermessage ) { LEVEL_DEBUG( "Too long a list of tokens -- %d owservers in the chain",tokens); return -ELOOP ; } io[nio].iov_base = &(Globals.Token); // owserver: add our tag io[nio].iov_len = sizeof(struct antiloop); // put token information in header (lower 17 bits of version) sm->version |= MakeServermessage; // bit 17 sm->version |= MakeServertokens(tokens); // lower 16 bits nio++; } // First block to send, the header // revisit now that the header values are set // encode in network order (just the header) net_sm.version = htonl( sm->version ); net_sm.payload = htonl( payload ); net_sm.size = htonl( sm->size ); net_sm.type = htonl( sm->type ); net_sm.control_flags = htonl( sm->control_flags ); net_sm.offset = htonl( sm->offset ); // set the header into the first (index=0) block io[0].iov_base = &net_sm; io[0].iov_len = sizeof(struct server_msg); // debug data on packet LEVEL_DEBUG("version=%u payload=%d size=%d type=%d SG=%X offset=%d",sm->version,payload,sm->size,sm->type,sm->control_flags,sm->offset); // Here is some traffic display code { int traffic_counter ; traffic_counter = 0 ; TrafficOutFD("write header" ,io[traffic_counter].iov_base,io[traffic_counter].iov_len,file_descriptor); ++traffic_counter; TrafficOutFD("write path" ,io[traffic_counter].iov_base,io[traffic_counter].iov_len,file_descriptor); if ((sp->datasize>0) && (sp->data!=NULL)) { // send data only for writes (if datasize not zero) ++traffic_counter; TrafficOutFD("write data" ,io[traffic_counter].iov_base,io[traffic_counter].iov_len,file_descriptor); } if ( server_type ) { if (sp->tokens > 0) { // owserver: send prior tags ++traffic_counter; TrafficOutFD("write old tokens" ,io[traffic_counter].iov_base,io[traffic_counter].iov_len,file_descriptor); } ++traffic_counter; TrafficOutFD("write new tokens" ,io[traffic_counter].iov_base,io[traffic_counter].iov_len,file_descriptor); } } // End traffic display code // Actual write of data to owserver return writev(file_descriptor, io, nio) != (ssize_t) (payload + sizeof(struct server_msg) + tokens * sizeof(struct antiloop)); } /* flag the sg for "virtual root" -- the remote bus was specifically requested */ static uint32_t SetupControlFlags(const struct parsedname *pn) { uint32_t control_flags = pn->control_flags; control_flags &= ~PERSISTENT_MASK; if (Globals.no_persistence == 0) { control_flags |= PERSISTENT_MASK; } /* from owlib to owserver never wants alias */ control_flags &= ~ALIAS_REQUEST ; control_flags &= ~SHOULD_RETURN_BUS_LIST; if (SpecifiedBus(pn)) { control_flags |= SHOULD_RETURN_BUS_LIST; } return control_flags; } /* Clean up at end of routine, either leave connection open and persistent flag available, or close */ static void Release_Persistent( struct server_connection_state * scs, int granted ) { if ( granted == 0 ) { Close_Persistent( scs ) ; return ; } if ( FILE_DESCRIPTOR_NOT_VALID( scs->file_descriptor) ) { Close_Persistent( scs ) ; return ; } if (scs->persistence == persistent_no) { // non-persistence from the start Close_Persistent( scs ) ; return ; } // mark as available BUSLOCKIN(scs->in); scs->in->pown->file_descriptor = scs->file_descriptor; BUSUNLOCKIN(scs->in); scs->persistence = persistent_no ; // we no longer own this connection scs->file_descriptor = FILE_DESCRIPTOR_BAD ; } owfs-3.1p5/module/owlib/src/c/ow_server_enet.c0000644000175000001440000003630312654730021016326 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* not our owserver, but a stand-alone device made by EDS called OW-SERVER-ENET */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" #define BYTE_string(x) ((BYTE *)(x)) static RESET_TYPE OWServer_Enet_reset(const struct parsedname *pn); static void OWServer_Enet_close(struct connection_in *in); static enum search_status OWServer_Enet_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD OWServer_Enet_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static void OWServer_Enet_setroutines(struct connection_in *in); static GOOD_OR_BAD OWServer_Enet_select( const struct parsedname * pn ) ; static GOOD_OR_BAD OWServer_Enet_reopen(struct connection_in *in) ; static GOOD_OR_BAD OWServer_Enet_reopen_prompt(struct connection_in *in) ; static GOOD_OR_BAD OWServer_Enet_read( BYTE * buf, size_t size, struct connection_in * in ) ; static GOOD_OR_BAD OWServer_Enet_write(const BYTE * buf, size_t size, struct connection_in *in) ; static GOOD_OR_BAD OWServer_Enet_write_string( char cmd, char * buf, struct connection_in *in) ; static char OWServer_Enet_command( char cmd, char * cmd_string, struct connection_in * in ) ; static RESET_TYPE OWServer_Enet_reset_in(struct connection_in * in); static GOOD_OR_BAD OWServer_Enet_directory(struct device_search *ds, struct connection_in * in) ; static enum ENET_dir OWServer_Enet_directory_loop(struct device_search *ds, struct connection_in * in) ; static GOOD_OR_BAD OWServer_Enet_sendback_part(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) ; #define BAD_CHAR ( (char) -1 ) static void OWServer_Enet_setroutines(struct connection_in *in) { in->iroutines.detect = OWServer_Enet_detect; in->iroutines.reset = OWServer_Enet_reset; in->iroutines.next_both = OWServer_Enet_next_both; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = OWServer_Enet_sendback_data; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = OWServer_Enet_select ; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE ; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = OWServer_Enet_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_dirgulp | ADAP_FLAG_no2409path | ADAP_FLAG_overdrive | ADAP_FLAG_bundle | ADAP_FLAG_no2404delay ; in->bundling_length = ENET_FIFO_SIZE; } GOOD_OR_BAD OWServer_Enet_detect(struct port_in *pin) { struct address_pair ap ; GOOD_OR_BAD gbResult = gbBAD; struct enet_list elist ; struct enet_member * em ; enet_list_init( &elist ) ; Parse_Address( pin->init_data, &ap ) ; switch ( ap.entries ) { case 0: // Minimal specification, so use first USB device Find_ENET_all( &elist ) ; break ; case 1: switch( ap.first.type ) { case address_all: case address_asterix: LEVEL_DEBUG("Look for all ENET adapters"); Find_ENET_all( &elist ) ; break ; case address_scan: // completely change personality! Free_Address( &ap ) ; enet_list_kill( &elist ) ; return ENET_monitor_detect(pin) ; break ; default: Find_ENET_Specific( ap.first.alpha, &elist ) ; break ; } break ; case 2: Find_ENET_Specific( ap.first.alpha, &elist ) ; break ; } Free_Address( &ap ) ; em = elist.head ; if ( em == NULL ) { // no enet's found gbResult = gbBAD ; } else { gbResult = OWServer_Enet_setup( em->name, em->version, pin ) ; em = em->next ; while ( em != NULL ) { struct port_in * pnew = AllocPort( NULL ) ; if ( pnew == NULL ) { break ; } if ( GOOD(OWServer_Enet_setup( em->name, em->version, pnew )) ) { LinkPort(pnew) ; } else { RemovePort( pnew ) ; } em = em->next ; } } enet_list_kill( &elist ) ; return gbResult ; } GOOD_OR_BAD OWServer_Enet_setup(char * enet_name, int enet_version, struct port_in *pin) { struct connection_in * in = pin -> first ; struct port_in * p_index = Inbound_Control.head_port ; while ( p_index != NULL ) { if ( p_index->init_data == NULL ) { } else if ( pin == p_index ) { } else { if ( strcmp( enet_name, p_index->init_data ) == 0 ) { return gbBAD ; } } p_index = p_index->next ; } /* Set up low-level routines */ OWServer_Enet_setroutines(in); pin->busmode = bus_enet ; SAFEFREE(pin->init_data) ; pin->init_data = owstrdup( enet_name ) ; SAFEFREE( DEVICENAME(in) ) ; DEVICENAME(in) = owstrdup( enet_name ) ; in->master.enet.version = enet_version ; // A lot of telnet parameters, really only used // to goose the connection when reconnecting // The ENET tolerates telnet, but isn't really // into RFC2217 COM_set_standard(in) ; pin->timeout.tv_sec = 0 ; pin->timeout.tv_usec = 6000000 ; pin->flow = flow_none; // flow control pin->baud = B115200 ; pin->type = ct_telnet ; RETURN_BAD_IF_BAD( COM_open(in) ) ; memset( in->remembered_sn, 0x00, SERIAL_NUMBER_SIZE ) ; // poison to block match in->Adapter = adapter_ENET; in->adapter_name = "OWServer_Enet"; pin->busmode = bus_enet; if ( in->master.enet.version == 0 ) { LEVEL_DEBUG("Unrecognized ENET firmware version") ; return gbBAD ; } if ( in->master.enet.version == 2 ) { struct connection_in * in2 ; struct connection_in * in3 ; LEVEL_DEBUG("Add 2nd ENET2 port"); in2 = AddtoPort( pin ) ; if ( in2 == NO_CONNECTION ) { return gbBAD ; } in2->master.enet.version = in->master.enet.version ; LEVEL_DEBUG("Add 3rd ENET2 port"); in3 = AddtoPort( pin ) ; if ( in3 == NO_CONNECTION ) { return gbBAD ; } in3->master.enet.version = in->master.enet.version ; } RETURN_GOOD_IF_GOOD( OWServer_Enet_reopen(in)) ; RETURN_GOOD_IF_GOOD( OWServer_Enet_reopen(in)) ; LEVEL_DEFAULT("Problem opening OW_SERVER_ENET on IP address=[%s] port=[%s] -- is the \"1-Wire Setup\" enabled?", pin->dev.tcp.host, pin->dev.tcp.service ); return gbBAD ; } static GOOD_OR_BAD OWServer_Enet_reopen(struct connection_in *in) { // clear "stored" Enet device memset( in->remembered_sn, 0x00, SERIAL_NUMBER_SIZE ) ; RETURN_BAD_IF_BAD( COM_open(in) ) ; telnet_change( in ) ; // Really just to send a prompt if ( BAD( OWServer_Enet_reopen_prompt( in ) ) ) { return OWServer_Enet_reopen_prompt( in ) ; } //printf("IP=%s PORT=%s\n",in->pown->dev.tcp.host,in->pown->dev.tcp.service) ; return gbGOOD; } static GOOD_OR_BAD OWServer_Enet_reopen_prompt(struct connection_in *in) { char cmd_response[1+in->CRLF_size] ; if ( BAD( OWServer_Enet_read( BYTE_string(cmd_response), 1, in )) ) { LEVEL_DEBUG("Error reading inital telnet prompt" ) ; return gbBAD ; } switch( cmd_response[0] ) { case '+': case '?': return gbGOOD ; default: return gbBAD ; } } static RESET_TYPE OWServer_Enet_reset(const struct parsedname *pn) { return OWServer_Enet_reset_in( pn->selected_connection ) ; } static RESET_TYPE OWServer_Enet_reset_in(struct connection_in * in) { char reset_response = OWServer_Enet_command( 'R', "", in ) ; switch ( reset_response ) { case 'P': in->AnyDevices = anydevices_yes; return BUS_RESET_OK; case 'N': in->AnyDevices = anydevices_no; return BUS_RESET_OK; case '!': LEVEL_DEBUG("Problem sending reset character"); return BUS_RESET_ERROR; default: LEVEL_DEBUG("Unrecognized BUS reset character <%c>",reset_response ) ; return BUS_RESET_ERROR; } } static enum search_status OWServer_Enet_next_both(struct device_search *ds, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; //Special case for DS2409 hub, use low-level code if ( pn->ds2409_depth>0 ) { return search_error ; } if (ds->LastDevice) { return search_done; } if (ds->index == -1) { if ( BAD(OWServer_Enet_directory(ds, in)) ) { return search_error; } } // LOOK FOR NEXT ELEMENT ++ds->index; LEVEL_DEBUG("Index %d", ds->index); switch ( DirblobGet(ds->index, ds->sn, &(ds->gulp) ) ) { case 0: LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; case -ENODEV: default: ds->LastDevice = 1; LEVEL_DEBUG("SN finished"); return search_done; } } #define DEVICE_LENGTH 16 #define EXCLAIM_LENGTH 1 enum ENET_dir { ENET_dir_ok, ENET_dir_repeat, ENET_dir_bad } ; static GOOD_OR_BAD OWServer_Enet_directory(struct device_search *ds, struct connection_in * in) { int i ; for ( i=0 ; i<10 ; ++i ) { switch ( OWServer_Enet_directory_loop( ds, in ) ) { case ENET_dir_ok: return gbGOOD ; case ENET_dir_repeat: LEVEL_DEBUG("Repeating directory loop because of communication error"); continue ; case ENET_dir_bad: LEVEL_DEBUG("directory error"); return gbBAD; } } LEVEL_DEBUG("Too many attempts at a directory listing"); return gbBAD ; } static enum ENET_dir OWServer_Enet_directory_loop(struct device_search *ds, struct connection_in * in) { char resp[DEVICE_LENGTH+in->CRLF_size]; char search_first ; char search_next ; if ( ds->search == _1W_CONDITIONAL_SEARCH_ROM ) { search_first = 'C' ; search_next = 'c' ; } else { search_first = 'S' ; search_next = 's' ; } DirblobClear( &(ds->gulp) ); if (ds->search != _1W_CONDITIONAL_SEARCH_ROM) { in->AnyDevices = anydevices_no; } // send the first search if ( BAD( OWServer_Enet_write_string( search_first, "", in)) ) { return ENET_dir_bad ; } do { size_t read_so_far = 0 ; // read first character if ( BAD(OWServer_Enet_read(BYTE_string(resp), EXCLAIM_LENGTH, in)) ) { return ENET_dir_bad ; } switch (resp[0]) { case '!': return ENET_dir_ok ; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': read_so_far = EXCLAIM_LENGTH+in->CRLF_size ; break ; default: return ENET_dir_repeat ; } // read rest of the characters if ( BAD(OWServer_Enet_read(BYTE_string(&resp[read_so_far]), DEVICE_LENGTH-read_so_far, in)) ) { return ENET_dir_bad; } BYTE sn[SERIAL_NUMBER_SIZE]; sn[7] = string2num(&resp[0]); sn[6] = string2num(&resp[2]); sn[5] = string2num(&resp[4]); sn[4] = string2num(&resp[6]); sn[3] = string2num(&resp[8]); sn[2] = string2num(&resp[10]); sn[1] = string2num(&resp[12]); sn[0] = string2num(&resp[14]); LEVEL_DEBUG("SN found: " SNformat, SNvar(sn)); // Set as current "Address" for adapter memcpy( in->remembered_sn, sn, SERIAL_NUMBER_SIZE) ; // CRC check if (CRC8(sn, SERIAL_NUMBER_SIZE) || (sn[0] == 0x00)) { LEVEL_DEBUG("BAD family or CRC8"); return ENET_dir_repeat; } DirblobAdd(sn, &(ds->gulp) ); if (ds->search != _1W_CONDITIONAL_SEARCH_ROM) { in->AnyDevices = anydevices_yes; } // send the subsequent search if ( BAD(OWServer_Enet_write_string( search_next, "", in)) ) { return ENET_dir_bad ; } } while (1) ; } /* select a device for reference */ static GOOD_OR_BAD OWServer_Enet_select( const struct parsedname * pn ) { struct connection_in * in = pn->selected_connection ; char return_char ; // Apparently need to reset before select (Unlike the HA7S) RETURN_BAD_IF_BAD( gbRESET( BUS_reset(pn)) ) ; if ( (pn->selected_device==NO_DEVICE) || (pn->selected_device==DeviceThermostat) ) { return gbGOOD ; } if ( memcmp( pn->sn, in->remembered_sn, SERIAL_NUMBER_SIZE ) != 0 ) { char send_address[SERIAL_NUMBER_SIZE*2+1] ; num2string( &send_address[ 0], pn->sn[7] ) ; num2string( &send_address[ 2], pn->sn[6] ) ; num2string( &send_address[ 4], pn->sn[5] ) ; num2string( &send_address[ 6], pn->sn[4] ) ; num2string( &send_address[ 8], pn->sn[3] ) ; num2string( &send_address[10], pn->sn[2] ) ; num2string( &send_address[12], pn->sn[1] ) ; num2string( &send_address[14], pn->sn[0] ) ; send_address[16] = '\0' ; // Set as current "Address" for adapter memcpy( in->remembered_sn, pn->sn, SERIAL_NUMBER_SIZE) ; return_char = OWServer_Enet_command( 'A', send_address , in ) ; } else { // Serial number already loaded in adapter return_char = OWServer_Enet_command( 'M', "" , in ) ; } return ( return_char == '+') ? gbGOOD : gbBAD ; } /* send a command and get the '+' */ static char OWServer_Enet_command( char cmd, char * cmd_string, struct connection_in * in ) { char cmd_response[1+in->CRLF_size] ; if ( BAD( OWServer_Enet_write_string( cmd, cmd_string, in )) ) { LEVEL_DEBUG("Error sending string <%s>", cmd_string ) ; return BAD_CHAR ; } //printf("ENET: Get Response\n"); if ( BAD( OWServer_Enet_read( BYTE_string(cmd_response), 1, in )) ) { LEVEL_DEBUG("Error reading response to <%s>", cmd_string ) ; return BAD_CHAR ; } return cmd_response[0] ; } static GOOD_OR_BAD OWServer_Enet_read( BYTE * buf, size_t size, struct connection_in * in ) { return COM_read( buf, size+in->CRLF_size, in ) ; } static GOOD_OR_BAD OWServer_Enet_write_string( char cmd, char * buf, struct connection_in *in) { char full_buffer[ENET2_FIFO_SIZE+4] ; int length = 1 ; // cmd full_buffer[0] = cmd ; if ( in->master.enet.version == 2 ) { // add channel char length ++ ; full_buffer[1] = in->channel + '1' ; } strcpy( &full_buffer[length], buf ) ; strcat( full_buffer, "\r" ) ; return OWServer_Enet_write( BYTE_string(full_buffer), strlen(full_buffer), in ) ; } static GOOD_OR_BAD OWServer_Enet_write(const BYTE * buf, size_t size, struct connection_in *in) { RETURN_GOOD_IF_GOOD( COM_write_simple( buf, size, in ) ) ; if ( in->pown->file_descriptor == FILE_DESCRIPTOR_BAD ) { RETURN_BAD_IF_BAD( OWServer_Enet_reopen( in ) ) ; RETURN_GOOD_IF_GOOD( COM_write_simple( buf, size, in ) ) ; } return gbBAD ; } #define MAX_ENET_MEMORY_GULP ENET_FIFO_SIZE/2 // Send data and return response block static GOOD_OR_BAD OWServer_Enet_sendback_part(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; char send_data[ENET_FIFO_SIZE+1] ; char get_data[ENET_FIFO_SIZE+4] ; bytes2string( send_data, data, size ) ; send_data[2*size] = '\0' ; if ( BAD( OWServer_Enet_write_string( 'W', send_data, in)) ) { LEVEL_DEBUG("Error with sending ENET block") ; return gbBAD ; } if ( BAD(OWServer_Enet_read( BYTE_string(get_data), size*2, in)) ) { LEVEL_DEBUG("Error with reading ENET block") ; return gbBAD ; } string2bytes(get_data, resp, size) ; return gbGOOD ; } static GOOD_OR_BAD OWServer_Enet_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { int left; //printf("ENET sendback %d bytes\n",(int) size) ; for ( left=size ; left>0 ; left -= MAX_ENET_MEMORY_GULP ) { size_t pass_start = size - left ; size_t pass_size = (left>MAX_ENET_MEMORY_GULP) ? MAX_ENET_MEMORY_GULP : left ; RETURN_BAD_IF_BAD( OWServer_Enet_sendback_part( &data[pass_start], &resp[pass_start], pass_size, pn ) ) ; } return gbGOOD; } static void OWServer_Enet_close(struct connection_in *in) { // the standard COM_free cleans up the connection (void) in ; } owfs-3.1p5/module/owlib/src/c/ow_select.c0000644000175000001440000001775012654730021015271 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "ow_codes.h" static GOOD_OR_BAD Turnoff(const struct parsedname *pn); static GOOD_OR_BAD BUS_select_branch(const struct ds2409_hubs *bp, const struct parsedname *pn); static GOOD_OR_BAD BUS_Skip_Rom(const struct parsedname *pn); static GOOD_OR_BAD BUS_select_branched_path(const struct parsedname *pn) ; static GOOD_OR_BAD BUS_select_device(BYTE select_byte, const struct parsedname *pn); static GOOD_OR_BAD BUS_clear_this_path(const struct parsedname *pn) ; /* DS2409 commands */ #define _1W_STATUS_READ_WRITE 0x5A #define _1W_ALL_LINES_OFF 0x66 #define _1W_DISCHARGE_LINES 0x99 #define _1W_DIRECT_ON_MAIN 0xA5 #define _1W_SMART_ON_MAIN 0xCC #define _1W_SMART_ON_AUX 0x33 //-------------------------------------------------------------------------- /** Select -- selects a 1-wire device to respond to further commands. First resets, then climbs down the branching tree, finally 'selects' the device. If no device is listed in the parsedname structure, only the reset and branching is done. This allows selective listing. Return 0=good, else reset, send_data, sendback_data */ GOOD_OR_BAD BUS_select(const struct parsedname *pn) { // match Serial Number command 0x55 BYTE select_byte = _1W_MATCH_ROM ; int ds2409_depth = pn->ds2409_depth; struct connection_in * in = pn->selected_connection ; // Select only applicable to local bus -- remote selects for themselves if ( BusIsServer(in) ) { LEVEL_DEBUG("Calling local select on remote bus for <%s>",SAFESTRING(pn->path) ) ; return gbBAD ; } // Single slave device -- use faster routines if (Globals.one_device) { return BUS_Skip_Rom(pn); } // Check generic bus-master support for branching if (!RootNotBranch(pn) && !AdapterSupports2409(pn)) { LEVEL_CALL("Attempt to use a branched path (DS2409 main or aux) when bus master doesn't support it."); return gbBAD; /* cannot do branching with eg. LINK ascii */ } LEVEL_DEBUG("Selecting a path (and device) path=%s SN=" SNformat " last path=" SNformat, SAFESTRING(pn->path), SNvar(pn->sn), SNvar(in->branch.sn)); /* Adapter-specific select routine? */ if ( in->iroutines.select != NO_SELECT_ROUTINE ) { LEVEL_DEBUG("Use adapter-specific select routine"); return (in->iroutines.select) (pn); } /* Very messy, we may need to clear all the DS2409 couplers up the the current branch */ if (RootNotBranch(pn)) { /* no branches, overdrive possible */ if (in->branch.branch != eBranch_cleared ) { // need clear root branch */ LEVEL_DEBUG("Clearing root branch"); RETURN_BAD_IF_BAD( BUS_clear_this_path(pn) ) ; } else { LEVEL_DEBUG("Continuing root branch"); } if (in->overdrive) { // overdrive? select_byte = _1W_OVERDRIVE_MATCH_ROM; } } else { // a branch requested if ( (memcmp(in->branch.sn, pn->bp[ds2409_depth - 1].sn, SERIAL_NUMBER_SIZE) != 0) || ( in->branch.branch != pn->bp[ds2409_depth - 1].branch) ) { /* different path */ LEVEL_DEBUG("Clearing all branches to level %d", ds2409_depth); BUS_clear_this_path(pn) ; // Load the branch into the "last branch" space to ease addressing next time memcpy(in->branch.sn, pn->bp[ds2409_depth - 1].sn, SERIAL_NUMBER_SIZE); in->branch.branch = pn->bp[ds2409_depth - 1].branch; } else { LEVEL_DEBUG("Reselecting branch at level %d", ds2409_depth); } } // Everything cleared and ready if ( BAD( BUS_select_branched_path(pn) ) ) { // Mark this branch as needing a reset in->branch.branch = eBranch_bad ; return gbBAD ; } /* proper path now "turned on" */ if ((pn->selected_device != NO_DEVICE) && (pn->selected_device != DeviceThermostat)) { // select a particular slave as well RETURN_BAD_IF_BAD( BUS_select_device( select_byte, pn ) ) ; } return gbGOOD; } static GOOD_OR_BAD BUS_Skip_Rom(const struct parsedname *pn) { BYTE skip[1]; struct transaction_log t[] = { TRXN_RESET, TRXN_WRITE1(skip), TRXN_END, }; skip[0] = pn->selected_connection->overdrive ? _1W_OVERDRIVE_SKIP_ROM : _1W_SKIP_ROM; return BUS_transaction_nolock(t, pn); } /* All the railroad switches need to be opened in order */ static GOOD_OR_BAD BUS_select_branched_path(const struct parsedname *pn) { int level ; int branch_depth = pn->ds2409_depth ; // initial reset RETURN_BAD_IF_BAD( gbRESET( BUS_reset(pn) ) ) ; for ( level=0 ; levelsn)); if ( BAD(BUS_transaction_nolock(t, pn)) ) { STAT_ADD1_BUS(e_bus_select_errors, pn->selected_connection); LEVEL_CONNECT("Select subbranch error on bus %s", DEVICENAME(pn->selected_connection)); return gbBAD; } return gbGOOD; } /* Select the specific branch */ /* Already reset has been called */ static GOOD_OR_BAD BUS_select_device(BYTE select_byte, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; BYTE sent[1+SERIAL_NUMBER_SIZE] ; struct transaction_log t[] = { TRXN_WRITE(sent, 1+SERIAL_NUMBER_SIZE), TRXN_END, }; sent[0] = select_byte ; memcpy(&sent[1], pn->sn, SERIAL_NUMBER_SIZE); LEVEL_DEBUG("Selecting device " SNformat, SNvar(pn->sn)); if ( BAD(BUS_transaction_nolock(t, pn)) ) { STAT_ADD1_BUS(e_bus_select_errors, in); LEVEL_CONNECT("Select error for %s on bus %s", pn->selected_device->readable_name, DEVICENAME(in)); return gbBAD; } return gbGOOD; } /* find every DS2409 (family code 1F) and switch off, at this depth */ static GOOD_OR_BAD Turnoff(const struct parsedname *pn) { BYTE sent[2] = { _1W_SKIP_ROM, _1W_ALL_LINES_OFF, }; BYTE get[1] ; struct transaction_log t[] = { TRXN_WRITE2(sent), TRXN_READ1(get), TRXN_END, }; GOOD_OR_BAD ret = BUS_transaction_nolock(t, pn); if ( get[0] != sent[1] ) { LEVEL_DEBUG("No DS2409 microlan hub found at this level"); } return ret ; } owfs-3.1p5/module/owlib/src/c/ow_set_telnet.c0000644000175000001440000000771412654730021016157 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "telnet.h" GOOD_OR_BAD telnet_change(struct connection_in *in) { #pragma pack(push) /* Save current */ #pragma pack(1) /* byte alignment */ struct { BYTE do_sga[3] ; BYTE do_echo[3] ; BYTE i_will[3] ; BYTE you_do[3] ; BYTE pre_baud[4] ; uint32_t baud ; BYTE post_baud[2] ; BYTE pre_size[4] ; BYTE size ; BYTE post_size[2] ; BYTE pre_parity[4] ; BYTE parity ; BYTE post_parity[2] ; BYTE pre_stop[4] ; BYTE stop ; BYTE post_stop[2] ; BYTE pre_flow[4] ; BYTE flow ; BYTE post_flow[2] ; } telnet_string = { .do_sga = { TELNET_IAC, TELNET_DO, TELOPT_SGA, } , .do_echo = { TELNET_IAC, TELNET_DO, TELOPT_ECHO, } , .i_will = { TELNET_IAC, TELNET_WILL, TELOPT_COM_PORT, } , .you_do = { TELNET_IAC, TELNET_DO, TELOPT_COM_PORT, } , .pre_baud = { TELNET_IAC, TELNET_SB, TELOPT_COM_PORT, COMOPT_BAUDRATE, } , .post_baud = {TELNET_IAC, TELNET_SE, } , .pre_size = { TELNET_IAC, TELNET_SB, TELOPT_COM_PORT, COMOPT_DATASIZE, } , .post_size = {TELNET_IAC, TELNET_SE, } , .pre_parity = { TELNET_IAC, TELNET_SB, TELOPT_COM_PORT, COMOPT_PARITY, } , .post_parity = {TELNET_IAC, TELNET_SE, } , .pre_stop = { TELNET_IAC, TELNET_SB, TELOPT_COM_PORT, COMOPT_STOPSIZE, } , .post_stop = {TELNET_IAC, TELNET_SE, } , .pre_flow = { TELNET_IAC, TELNET_SB, TELOPT_COM_PORT, COMOPT_CONTROL, } , .post_flow = {TELNET_IAC, TELNET_SE, } , } ; #pragma pack(pop) /* restore */ struct port_in * pin = in->pown ; switch ( pin->baud ) { case B115200: telnet_string.baud = htonl( 115200 ) ; break ; case B57600: telnet_string.baud = htonl( 57600 ) ; break ; case B19200: telnet_string.baud = htonl( 19200 ) ; break ; case B9600: default: telnet_string.baud = htonl( 9600 ) ; pin->baud = B9600 ; break ; } telnet_string.size = pin->bits ; switch ( pin->parity ) { case parity_none: telnet_string.parity = 1 ; break ; case parity_odd: telnet_string.parity = 2 ; break ; case parity_even: telnet_string.parity = 3 ; break ; case parity_mark: telnet_string.parity = 4 ; break ; } switch ( pin->stop ) { case stop_1 : telnet_string.stop = 1 ; break ; case stop_2 : telnet_string.stop = 2 ; break ; case stop_15 : telnet_string.stop = 3 ; break ; } switch ( pin->flow ) { case flow_none : telnet_string.flow = 1 ; break ; case flow_soft : telnet_string.flow = 2 ; break ; case flow_hard : telnet_string.flow = 3 ; break ; } return COM_write_simple( (const BYTE *) &telnet_string, sizeof( telnet_string ) , in ) ; } GOOD_OR_BAD telnet_purge(struct connection_in *in) { #pragma pack(push) /* Save current */ #pragma pack(1) /* byte alignment */ struct { BYTE pre_purge[4] ; BYTE purge ; BYTE post_purge[2] ; } telnet_string = { .pre_purge = { TELNET_IAC, TELNET_SB, TELOPT_COM_PORT, COMOPT_PURGE, } , .post_purge = {TELNET_IAC, TELNET_SE, } , } ; #pragma pack(pop) /* restore */ /* * Purge both the access server receive data * buffer and the access server transmit data * buffer * See: http://www.ietf.org/rfc/rfc2217.txt * */ telnet_string.purge = 0x03 ; return COM_write_simple( (const BYTE *) &telnet_string, sizeof( telnet_string ) , in ) ; } GOOD_OR_BAD telnet_break(struct connection_in *in) { #pragma pack(push) /* Save current */ #pragma pack(1) /* byte alignment */ struct { BYTE send_break[2]; } telnet_string = { .send_break = { TELNET_IAC, TELNET_BREAK, } , } ; #pragma pack(pop) /* restore */ /* * See: http://www.ietf.org/rfc/rfc2217.txt * */ return COM_write_simple( (const BYTE *) &telnet_string, sizeof( telnet_string ) , in ) ; } owfs-3.1p5/module/owlib/src/c/ow_settings.c0000644000175000001440000001533512654730021015647 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* Settings are a pseudo-device -- used to dynamicalls change timeouts and the like * these settings can also be changed at the command line * Except for performance, none of these settings has security implications * */ #include #include "owfs_config.h" #include "ow_settings.h" /* ------- Prototypes ----------- */ /* Statistics reporting */ READ_FUNCTION(FS_r_timeout); WRITE_FUNCTION(FS_w_timeout); READ_FUNCTION(FS_r_yesno); WRITE_FUNCTION(FS_w_yesno); READ_FUNCTION(FS_r_TS); WRITE_FUNCTION(FS_w_TS); READ_FUNCTION(FS_r_PS); WRITE_FUNCTION(FS_w_PS); READ_FUNCTION(FS_aliaslist); READ_FUNCTION(FS_return_code); /* -------- Structures ---------- */ static struct filetype set_timeout[] = { {"volatile", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_volatile}, }, {"stable", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_stable}, }, {"directory", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_directory}, }, {"presence", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_presence}, }, {"serial", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_serial}, }, {"usb", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_usb}, }, {"network", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_network}, }, {"server", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_server}, }, {"ftp", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_ftp}, }, {"ha7", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_ha7}, }, {"w1", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_r_timeout, FS_w_timeout, VISIBLE, {.v=&Globals.timeout_w1}, }, {"uncached", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE, {.v=&Globals.uncached}, }, }; struct device d_set_timeout = { "timeout", "timeout", ePN_settings, COUNT_OF_FILETYPES(set_timeout), set_timeout, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct filetype set_units[] = { {"temperature_scale", 1, NON_AGGREGATE, ft_ascii, fc_static, FS_r_TS, FS_w_TS, VISIBLE, NO_FILETYPE_DATA, }, {"pressure_scale", 12, NON_AGGREGATE, ft_ascii, fc_static, FS_r_PS, FS_w_PS, VISIBLE, NO_FILETYPE_DATA, }, }; struct device d_set_units = { "units", "units", ePN_settings, COUNT_OF_FILETYPES(set_units), set_units, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct filetype set_alias[] = { {"list", MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE, NON_AGGREGATE, ft_ascii, fc_static, FS_aliaslist, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"unaliased", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_r_yesno, FS_w_yesno, VISIBLE, {.v=&Globals.unaliased}, }, }; struct device d_set_alias = { "alias", "alias", ePN_settings, COUNT_OF_FILETYPES(set_alias), set_alias, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct aggregate Areturn_code = { N_RETURN_CODES, ag_numbers, ag_separate, }; static struct filetype set_return_code[] = { {"text", 128, &Areturn_code, ft_ascii, fc_static, FS_return_code, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; struct device d_set_return_code = { "return_codes", "return_codes", 0, COUNT_OF_FILETYPES(set_return_code), set_return_code, NO_GENERIC_READ, NO_GENERIC_WRITE }; /* ------- Functions ------------ */ static ZERO_OR_ERROR FS_r_timeout(struct one_wire_query *owq) { CACHE_RLOCK; OWQ_U(owq) = ((UINT *) OWQ_pn(owq).selected_filetype->data.v)[0]; CACHE_RUNLOCK; return 0; } static ZERO_OR_ERROR FS_w_timeout(struct one_wire_query *owq) { UINT previous; struct parsedname *pn = PN(owq); CACHE_WLOCK; //printf("FS_w_timeout!!!\n"); previous = ((UINT *) pn->selected_filetype->data.v)[0]; ((UINT *) pn->selected_filetype->data.v)[0] = OWQ_U(owq); CACHE_WUNLOCK; if (previous > OWQ_U(owq)) { Cache_Clear(); } return 0; } static ZERO_OR_ERROR FS_r_yesno(struct one_wire_query *owq) { OWQ_Y(owq) = ((UINT *) OWQ_pn(owq).selected_filetype->data.v)[0]; return 0; } static ZERO_OR_ERROR FS_w_yesno(struct one_wire_query *owq) { ((UINT *) OWQ_pn(owq).selected_filetype->data.v)[0] = OWQ_Y(owq); SetLocalControlFlags() ; return 0; } static ZERO_OR_ERROR FS_w_TS(struct one_wire_query *owq) { ZERO_OR_ERROR ret = 0; if (OWQ_size(owq) == 0 || OWQ_offset(owq) > 0) { return 0; /* do nothing */ } switch (OWQ_buffer(owq)[0]) { case 'C': case 'c': Globals.temp_scale = temp_celsius ; break; case 'F': case 'f': Globals.temp_scale = temp_fahrenheit ; break; case 'R': case 'r': Globals.temp_scale = temp_rankine ; break; case 'K': case 'k': Globals.temp_scale = temp_kelvin ; break; default: ret = -EINVAL; } SetLocalControlFlags() ; return ret; } static ZERO_OR_ERROR FS_w_PS(struct one_wire_query *owq) { int ret = -EINVAL ; enum pressure_type pindex ; if (OWQ_size(owq) < 2 || OWQ_offset(owq) > 0) { return -EINVAL ; /* do nothing */ } for ( pindex = 0 ; pindex < pressure_end_mark ; ++pindex ) { if ( strncasecmp( OWQ_buffer(owq), PressureScaleName(pindex), 2 ) == 0 ) { Globals.pressure_scale = pindex ; SetLocalControlFlags() ; ret = 0 ; break; } } return ret; } static ZERO_OR_ERROR FS_r_TS(struct one_wire_query *owq) { return OWQ_format_output_offset_and_size_z(TemperatureScaleName(Globals.temp_scale), owq); } static ZERO_OR_ERROR FS_r_PS(struct one_wire_query *owq) { return OWQ_format_output_offset_and_size_z(PressureScaleName(Globals.pressure_scale), owq); } static ZERO_OR_ERROR FS_aliaslist( struct one_wire_query * owq ) { struct memblob mb ; ZERO_OR_ERROR zoe ; MemblobInit( &mb, PATH_MAX ) ; Aliaslist( &mb ) ; if ( MemblobPure( &mb ) ) { zoe = OWQ_format_output_offset_and_size( (char *) MemblobData( &mb ), MemblobLength( &mb ), owq ) ; } else { zoe = -EINVAL ; } MemblobClear( &mb ) ; return zoe ; } static ZERO_OR_ERROR FS_return_code(struct one_wire_query *owq) { return OWQ_format_output_offset_and_size_z(return_code_strings[PN(owq)->extension], owq); } owfs-3.1p5/module/owlib/src/c/ow_sibling.c0000644000175000001440000000447112654730021015435 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow.h" ZERO_OR_ERROR FS_w_sibling_bitwork(UINT set, UINT mask, const char * sibling, struct one_wire_query *owq) { ZERO_OR_ERROR write_error = -EINVAL ; struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return -EINVAL ; } if ( FS_read_local(owq_sibling) == 0 ) { // UINT bitfield = OWQ_U(owq) ; //the original state does not come from owq, but from owq_sibling UINT bitfield = OWQ_U(owq_sibling) ; // clear mask: bitfield &= ~mask ; // set bits: bitfield |= (set & mask) ; OWQ_U(owq_sibling) = bitfield ; LEVEL_DEBUG("w sibling bit work set=%04X mask=%04X, sibling=%s, bitfield=%04X", set,mask, sibling,bitfield) ; write_error = FS_write_local(owq_sibling); } OWQ_destroy(owq_sibling) ; return write_error; } /* Delete entry in cache */ void FS_del_sibling(const char * sibling, struct one_wire_query *owq) { struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return ; } OWQ_Cache_Del(owq_sibling) ; OWQ_destroy(owq_sibling) ; } owfs-3.1p5/module/owlib/src/c/ow_sibling_binary.c0000644000175000001440000000467312654730021017005 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow.h" ZERO_OR_ERROR FS_r_sibling_binary(BYTE * data, size_t * size, const char * sibling, struct one_wire_query *owq) { struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; SIZE_OR_ERROR sib_status ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return -EINVAL ; } if ( GOOD( OWQ_allocate_read_buffer(owq_sibling)) ) { OWQ_offset(owq_sibling) = 0 ; sib_status = FS_read_local(owq_sibling) ; if ( (sib_status >= 0) && (OWQ_length(owq_sibling) <= size[0]) ) { memset(data, 0, size[0] ) ; size[0] = OWQ_length(owq_sibling) ; memcpy( data, OWQ_buffer(owq_sibling), size[0] ) ; sib_status = 0 ; } else { sib_status = -ENOMEM ; } } else { sib_status = -ENOMEM ; } OWQ_destroy(owq_sibling) ; return sib_status ; } ZERO_OR_ERROR FS_w_sibling_binary(BYTE * data, size_t size, off_t offset, const char * sibling, struct one_wire_query *owq) { struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; SIZE_OR_ERROR write_error ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return -EINVAL ; } OWQ_assign_write_buffer( (ASCII *) data, size, offset, owq_sibling) ; write_error = FS_write_local(owq_sibling) ; OWQ_destroy(owq_sibling) ; return write_error ; } owfs-3.1p5/module/owlib/src/c/ow_sibling_float.c0000644000175000001440000000402012654730021016610 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow.h" /* FLOAT */ ZERO_OR_ERROR FS_r_sibling_F(_FLOAT *F, const char * sibling, struct one_wire_query *owq) { struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; SIZE_OR_ERROR sib_status ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return -EINVAL ; } sib_status = FS_read_local(owq_sibling) ; F[0] = OWQ_F(owq_sibling) ; OWQ_destroy(owq_sibling) ; return sib_status >= 0 ? 0 : -EINVAL ; } ZERO_OR_ERROR FS_w_sibling_F(_FLOAT F, const char * sibling, struct one_wire_query *owq) { ZERO_OR_ERROR write_error; struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return -EINVAL ; } OWQ_F(owq_sibling) = F ; write_error = FS_write_local(owq_sibling) ; OWQ_destroy(owq_sibling) ; return write_error ; } owfs-3.1p5/module/owlib/src/c/ow_sibling_uint.c0000644000175000001440000000377712654730021016504 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow.h" ZERO_OR_ERROR FS_r_sibling_U(UINT *U, const char * sibling, struct one_wire_query *owq) { struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; SIZE_OR_ERROR sib_status ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return -EINVAL ; } sib_status = FS_read_local(owq_sibling) ; U[0] = OWQ_U(owq_sibling) ; OWQ_destroy(owq_sibling) ; return sib_status >= 0 ? 0 : -EINVAL; } ZERO_OR_ERROR FS_w_sibling_U(UINT U, const char * sibling, struct one_wire_query *owq) { ZERO_OR_ERROR write_error; struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return -EINVAL ; } OWQ_U(owq_sibling) = U ; write_error = FS_write_local(owq_sibling) ; OWQ_destroy(owq_sibling) ; return write_error ; } owfs-3.1p5/module/owlib/src/c/ow_sibling_yesno.c0000644000175000001440000000377612654730021016661 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow.h" ZERO_OR_ERROR FS_r_sibling_Y(INT *Y, const char * sibling, struct one_wire_query *owq) { struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; SIZE_OR_ERROR sib_status ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return -EINVAL ; } sib_status = FS_read_local(owq_sibling) ; Y[0] = OWQ_Y(owq_sibling) ; OWQ_destroy(owq_sibling) ; return sib_status >= 0 ? 0 : -EINVAL ; } ZERO_OR_ERROR FS_w_sibling_Y(INT Y, const char * sibling, struct one_wire_query *owq) { ZERO_OR_ERROR write_error; struct one_wire_query * owq_sibling = OWQ_create_sibling( sibling, owq ) ; if ( owq_sibling == NO_ONE_WIRE_QUERY ) { return -EINVAL ; } OWQ_Y(owq_sibling) = Y ; write_error = FS_write_local(owq_sibling) ; OWQ_destroy(owq_sibling) ; return write_error ; } owfs-3.1p5/module/owlib/src/c/ow_sig_handlers.c0000644000175000001440000000322212654730021016441 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" static void DefaultSignalHandler(int signo, siginfo_t * info, void *context) { (void) context; if (info) { LEVEL_DEBUG ("Signal handler for %d, errno %d, code %d, pid=%ld, self=%lu", signo, info->si_errno, info->si_code, (long int) info->si_pid, pthread_self()); } else { LEVEL_DEBUG("Signal handler for %d, self=%lu", signo, pthread_self()); } return; } void set_signal_handlers(void (*handler) (int signo, siginfo_t * info, void *context)) { struct sigaction sa; int sigs[] = { SIGHUP, 0 }; int i = 0; memset(&sa, 0, sizeof(struct sigaction)); sigemptyset(&(sa.sa_mask)); while(sigs[i] > 0) { sa.sa_flags = SA_SIGINFO; if(handler != NULL) { sa.sa_sigaction = handler; } else { sa.sa_sigaction = DefaultSignalHandler; } if (sigaction(sigs[i], &sa, NULL) == -1) { LEVEL_DEFAULT("Cannot handle signal %d", sigs[i]); exit(1); } i++; } } void set_exit_signal_handlers(void (*ex_handler) (int signo, siginfo_t * info, void *context)) { struct sigaction sa; int sigs[] = { SIGINT, SIGTERM, 0 }; int i = 0; memset(&sa, 0, sizeof(struct sigaction)); sigemptyset(&(sa.sa_mask)); while(sigs[i] > 0) { sa.sa_flags = SA_SIGINFO; sa.sa_sigaction = ex_handler; if (sigaction(sigs[i], &sa, NULL) == -1) { LEVEL_DEFAULT("Cannot handle signal %d", sigs[i]); exit(1); } i++; } } owfs-3.1p5/module/owlib/src/c/ow_simultaneous.c0000644000175000001440000002463612656171550016553 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Simultaneous is a trigger to do a mass conversion on all the devices in the specified path */ /* Added "present" From Jan Kandziora to search for any devices */ #include #include "owfs_config.h" #include "ow_simultaneous.h" /* ------- Prototypes ----------- */ /* Statistics reporting */ READ_FUNCTION(FS_r_convert); WRITE_FUNCTION(FS_w_convert_temp); WRITE_FUNCTION(FS_w_convert_volt); READ_FUNCTION(FS_r_present); READ_FUNCTION(FS_r_single); /* Internal properties */ Make_SlaveSpecificTag_exportable(S_T, fc_volatile); // simultaneous temperature Make_SlaveSpecificTag_exportable(S_V, fc_volatile); // simultaneous voltage /* -------- Structures ---------- */ static struct filetype simultaneous[] = { {"temperature", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_convert, FS_w_convert_temp, VISIBLE, {.v=SlaveSpecificTag(S_T)}, }, {"voltage", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_link, FS_r_convert, FS_w_convert_volt, VISIBLE, {.v=SlaveSpecificTag(S_V)}, }, {"present", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_present, NO_WRITE_FUNCTION, VISIBLE, {.i=_1W_READ_ROM}, }, {"present_ds2400", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_volatile, FS_r_present, NO_WRITE_FUNCTION, VISIBLE, {.i=_1W_OLD_READ_ROM}, }, {"single", 18, NON_AGGREGATE, ft_ascii, fc_volatile, FS_r_single, NO_WRITE_FUNCTION, VISIBLE, {.i=_1W_READ_ROM}, }, {"single_ds2400", 18, NON_AGGREGATE, ft_ascii, fc_volatile, FS_r_single, NO_WRITE_FUNCTION, VISIBLE, {.i=_1W_OLD_READ_ROM}, }, }; DeviceEntry(simultaneous, simultaneous, NO_GENERIC_READ, NO_GENERIC_WRITE); #define _1W_CONVERT_T 0x44 #define _1W_READ_POWERMODE 0xB4 /* ------- Functions ------------ */ //static void OW_single2cache(BYTE * sn, const struct parsedname *pn2); GOOD_OR_BAD FS_Test_Simultaneous( const struct internal_prop *ip, UINT delay, const struct parsedname * pn) { time_t dwell_time ; time_t remaining_delay ; //LEVEL_DEBUG("TEST Simultaneous valid?"); if( BAD( Cache_Get_Simul_Time( ip, &dwell_time, pn)) ) { LEVEL_DEBUG("No simultaneous conversion currently valid"); return gbBAD ; // No simultaneous valid } remaining_delay = delay - 1000 * dwell_time ; LEVEL_DEBUG("TEST remaining delay=%ld, delay=%ld, 1000*dwelltime=%ld",(long int)remaining_delay,(long int)delay, (long int)(1000*dwell_time)); if ( remaining_delay > 0 ) { LEVEL_DEBUG("Simultaneous conversion requires %d msec delay",(int) remaining_delay); UT_delay(remaining_delay) ; } else { LEVEL_DEBUG("Simultaneous conversion, no delay"); } return gbGOOD ; } static ZERO_OR_ERROR FS_w_convert_temp(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); struct parsedname s_pn_directory; struct parsedname * pn_directory = &s_pn_directory ; struct connection_in * in = pn->selected_connection ; const BYTE cmd_temp[] = { _1W_SKIP_ROM, _1W_CONVERT_T }; const BYTE cmd_powermode[] = { _1W_READ_POWERMODE, }; BYTE pow[1] ; struct transaction_log tpower[] = { TRXN_START, TRXN_WRITE1(cmd_powermode), TRXN_READ1(pow), TRXN_END, }; struct transaction_log t_powered_convert[] = { TRXN_START, TRXN_WRITE2(cmd_temp), TRXN_END, }; struct transaction_log t_unpowered_convert[] = { TRXN_START, TRXN_WRITE2(cmd_temp), TRXN_DELAY(1000), TRXN_END, }; if (OWQ_Y(owq) == 0) { return 0; // don't send convert } switch (in->Adapter) { case adapter_Bad: case adapter_w1_monitor: case adapter_browse_monitor: case adapter_usb_monitor: case adapter_fake: case adapter_tester: case adapter_mock: /* Since writing to /simultaneous/temperature is done recursive to all * adapters, we have to fake a successful write even if it's detected * as an unsupported adapter. */ return gbGOOD ; default: break ; } FS_LoadDirectoryOnly(pn_directory, pn); // setup up for full directory message // Get Power status LEVEL_DEBUG("TEST if bus powered"); RETURN_BAD_IF_BAD(BUS_transaction(tpower, pn_directory)) ; Cache_Add_Simul(pn->selected_filetype->data.v, pn_directory); // Mark start time if ( pow[0] != 0 ) { // powered // Send the conversion and let the timing work out when the actual // temperature reading is requested if ( GOOD(BUS_transaction(t_powered_convert, pn_directory) ) ) { return 0 ; } } else { // Unpowered prohibits other bus traffic. // This is at the port level, so could be all channels of the DS2482-800, etc if ( GOOD(BUS_transaction(t_unpowered_convert, pn_directory) )) { return 0 ; } } Cache_Del_Simul(pn->selected_filetype->data.v, pn_directory); // Clear start time LEVEL_DEBUG("Trouble setting simultaneous for %s",pn_directory->path); return -EINVAL ; } static ZERO_OR_ERROR FS_w_convert_volt(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); struct parsedname pn_directory; struct connection_in * in = pn->selected_connection ; BYTE cmd_volt[] = { _1W_SKIP_ROM, 0x3C, 0x0F, 0x00, 0xFF, 0xFF }; struct transaction_log t[] = { TRXN_START, TRXN_WR_CRC16(cmd_volt, 4, 0), TRXN_DELAY(5), TRXN_END, }; if (OWQ_Y(owq) == 0) { return 0; // don't send convert } FS_LoadDirectoryOnly(&pn_directory, pn); Cache_Del_Internal(pn->selected_filetype->data.v, &pn_directory); // remove existing entry switch (in->Adapter) { case adapter_Bad: case adapter_w1_monitor: case adapter_browse_monitor: case adapter_usb_monitor: case adapter_fake: case adapter_tester: case adapter_mock: /* Since writing to /simultaneous/voltage is done recursive to all * adapters, we have to fake a successful write even if it's detected * as an unsupported adapter. */ return gbGOOD ; default: break ; } if ( GOOD(BUS_transaction(t, &pn_directory)) ) { Cache_Add_SlaveSpecific(NULL, 0, pn->selected_filetype->data.v, &pn_directory); } return 0; } static ZERO_OR_ERROR FS_r_convert(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); struct parsedname pn_directory; FS_LoadDirectoryOnly(&pn_directory, pn); OWQ_Y(owq) = GOOD (Cache_Get_SlaveSpecific(NULL, 0, pn->selected_filetype->data.v, &pn_directory) ); return 0; } static ZERO_OR_ERROR FS_r_present(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); switch (pn->selected_connection->Adapter) { case adapter_fake: case adapter_mock: case adapter_tester: // fake adapter -- simple memory look-up OWQ_Y(owq) = (DirblobElements(&(pn->selected_connection->master.fake.main)) > 0); /* fall through */ default: { struct parsedname pn_directory; BYTE read_ROM[1] ; BYTE resp[SERIAL_NUMBER_SIZE]; BYTE collisions[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; BYTE match[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(read_ROM), TRXN_READ(resp, 8), TRXN_END, }; /* check if DS2400 compatibility is needed */ read_ROM[0] = _1W_READ_ROM; FS_LoadDirectoryOnly(&pn_directory, pn); RETURN_ERROR_IF_BAD(BUS_transaction(t, &pn_directory)) ; if (memcmp(resp, collisions, SERIAL_NUMBER_SIZE)) { // all devices OWQ_Y(owq) = 1; // YES present } else if (memcmp(resp, match, SERIAL_NUMBER_SIZE)) { // some device(s) complained OWQ_Y(owq) = 1; // YES present if (CRC8(resp, SERIAL_NUMBER_SIZE)) { return 0; // crc8 error -- more than one device } // OW_single2cache(resp, &pn_directory); } else { // no devices OWQ_Y(owq) = 0; } } break ; } return 0; } static ZERO_OR_ERROR FS_r_single(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); ASCII ad[30] = { 0x00, }; // long enough -- default "blank" BYTE resp[SERIAL_NUMBER_SIZE]; switch (pn->selected_connection->Adapter) { case adapter_fake: case adapter_tester: case adapter_mock: if (DirblobElements(&(pn->selected_connection->master.fake.main)) == 1) { DirblobGet(0, resp, &(pn->selected_connection->master.fake.main)); FS_devicename(ad, sizeof(ad), resp, pn); } break ; default: { struct parsedname pn_directory; BYTE read_ROM[1] ; BYTE match[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; BYTE collisions[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; struct transaction_log t[] = { TRXN_START, TRXN_WRITE1(read_ROM), TRXN_READ(resp, SERIAL_NUMBER_SIZE), TRXN_END, }; /* check if DS2400 compatibility is needed */ read_ROM[0] = pn->selected_filetype->data.i; FS_LoadDirectoryOnly(&pn_directory, pn); RETURN_ERROR_IF_BAD(BUS_transaction(t, &pn_directory)) ; LEVEL_DEBUG("dat=" SNformat " crc8=%02x", SNvar(resp), CRC8(resp, 7)); if ((memcmp(resp, collisions, SERIAL_NUMBER_SIZE) != 0) && (memcmp(resp, match, SERIAL_NUMBER_SIZE) != 0) && (CRC8(resp, SERIAL_NUMBER_SIZE) == 0)) { // non-empty, and no CRC error // OW_single2cache(resp, &pn_directory); /* Return device id. */ FS_devicename(ad, sizeof(ad), resp, pn); } else { /* Jan Kandziora: I think it's not really an error if no iButton is connected to a lock. As EINVAL is given if something went wrong with the host adapter (e.g. pulled from the host), too, those errors are then obscured by catching the "no key connected" EINVAL. */ ad[0] = '\0' ; } } break ; } return OWQ_format_output_offset_and_size_z(ad, owq); } owfs-3.1p5/module/owlib/src/c/ow_slurp.c0000644000175000001440000000441012672234566015161 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_ftdi.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif static void Slurp( FILE_DESCRIPTOR_OR_ERROR file_descriptor, unsigned long usec ) ; void COM_slurp( struct connection_in * connection ) { unsigned long usec = 0 ; // just to suppress compiler warning if ( connection == NO_CONNECTION ) { return ; } switch ( connection->pown->type ) { case ct_unknown: case ct_none: LEVEL_DEBUG("Unknown type"); return ; case ct_telnet: // see if we can tell the port to dump all pending data if ( connection->pown->dev.telnet.telnet_negotiated == completed_negotiation ) { if ( BAD( COM_test(connection) ) ) { return ; } telnet_purge( connection ) ; } // now do it the old fashioned way of swallowing the pending data // fall through case ct_tcp: case ct_netlink: usec = 100000 ; break ; case ct_i2c: case ct_usb: LEVEL_DEBUG("Unimplemented"); return ; case ct_serial: case ct_ftdi: usec = 100000 ; // timeout increased for slurp based on Johan Strom's recommendation break ; } if ( BAD( COM_test(connection) ) ) { return ; } if( connection->pown->type == ct_ftdi ) { #if OW_FTDI owftdi_slurp(connection, 1000); #endif return; } Slurp( connection->pown->file_descriptor, usec ) ; } /* slurp up any pending chars -- used at the start to clear the com buffer */ static void Slurp( FILE_DESCRIPTOR_OR_ERROR file_descriptor, unsigned long usec ) { BYTE data[1] ; while (1) { fd_set readset; // very short timeout struct timeval tv = { 0, usec } ; /* Initialize readset */ FD_ZERO(&readset); FD_SET(file_descriptor, &readset); /* Read if it doesn't timeout first */ if ( select(file_descriptor + 1, &readset, NULL, NULL, &tv) < 1 ) { return ; } if (FD_ISSET(file_descriptor, &readset) == 0) { return ; } if ( read(file_descriptor, data, 1) < 1 ) { return ; } TrafficInFD("slurp",data,1,file_descriptor); } } owfs-3.1p5/module/owlib/src/c/ow_stateinfo.c0000644000175000001440000000071012654730021015772 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" struct stateinfo StateInfo = { .owlib_state = lib_state_pre, .start_time = 0, .dir_time = 0, .shutting_down = 0, }; owfs-3.1p5/module/owlib/src/c/ow_system.c0000644000175000001440000001161212654730021015325 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ /* Stats are a pseudo-device -- they are a file-system entry and handled as such, but have a different caching type to distiguish their handling */ #include #include "owfs_config.h" #include "ow_system.h" #include "ow_pid.h" #include "ow_connection.h" /* ------- Prototypes ----------- */ /* Statistics reporting */ READ_FUNCTION(FS_pidfile); READ_FUNCTION(FS_pid); READ_FUNCTION(FS_in); READ_FUNCTION(FS_out); READ_FUNCTION(FS_define); READ_FUNCTION(FS_trim); READ_FUNCTION(FS_version); #define VERSION_LENGTH 20 /* -------- Structures ---------- */ /* special entry -- picked off by parsing before filetypes tried */ static struct filetype sys_process[] = { {"pidfile", 128, NON_AGGREGATE, ft_vascii, fc_static, FS_pidfile, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA,}, // variable length {"pid", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_pid, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; struct device d_sys_process = { "process", "process", ePN_system, COUNT_OF_FILETYPES(sys_process), sys_process, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct filetype sys_connections[] = { {"count_current_buses", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_in, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"count_outbound_connections", PROPERTY_LENGTH_UNSIGNED, NON_AGGREGATE, ft_unsigned, fc_static, FS_out, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; struct device d_sys_connections = { "connections", "connections", ePN_system, COUNT_OF_FILETYPES(sys_connections), sys_connections, NO_GENERIC_READ, NO_GENERIC_WRITE }; static struct filetype sys_configure[] = { {"parport", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_static, FS_define, NO_WRITE_FUNCTION, VISIBLE, {.i=OW_PARPORT}, }, {"USB", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_static, FS_define, NO_WRITE_FUNCTION, VISIBLE, {.i=OW_USB}, }, {"i2c", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_static, FS_define, NO_WRITE_FUNCTION, VISIBLE, {.i=OW_I2C}, }, {"DebugInfo", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_static, FS_define, NO_WRITE_FUNCTION, VISIBLE, {.i=OW_DEBUG}, }, {"zeroconf", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_integer, fc_static, FS_define, NO_WRITE_FUNCTION, VISIBLE, {.i=1}, }, {"trim", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno, fc_static, FS_trim, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, {"version", VERSION_LENGTH, NON_AGGREGATE, ft_ascii, fc_static, FS_version, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, }, }; struct device d_sys_configure = { "configuration", "configuration", ePN_system, COUNT_OF_FILETYPES(sys_configure), sys_configure, NO_GENERIC_READ, NO_GENERIC_WRITE }; /* ------- Functions ------------ */ static ZERO_OR_ERROR FS_pidfile(struct one_wire_query *owq) { char *name = ""; if (pid_file) { name = pid_file; } return OWQ_format_output_offset_and_size_z(name, owq); } static ZERO_OR_ERROR FS_pid(struct one_wire_query *owq) { OWQ_U(owq) = getpid(); return 0; } static ZERO_OR_ERROR FS_version( struct one_wire_query *owq) { char ver[VERSION_LENGTH+1] ; memset(ver,0,VERSION_LENGTH+1); strncpy(ver,VERSION,VERSION_LENGTH) ; return OWQ_format_output_offset_and_size_z(ver, owq); } static ZERO_OR_ERROR FS_trim(struct one_wire_query *owq) { OWQ_Y(owq) = ShouldTrim(PN(owq)); return 0; } static ZERO_OR_ERROR FS_in(struct one_wire_query *owq) { OWQ_U(owq) = Inbound_Control.active; return 0; } static ZERO_OR_ERROR FS_out(struct one_wire_query *owq) { OWQ_U(owq) = Outbound_Control.active; return 0; } static ZERO_OR_ERROR FS_define(struct one_wire_query *owq) { OWQ_Y(owq) = OWQ_pn(owq).selected_filetype->data.i; return 0; } owfs-3.1p5/module/owlib/src/c/ow_systemd.c0000644000175000001440000000170012711737666015506 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "sd-daemon.h" /* Test systemd existence * Sets up the connection_out as well * */ void Setup_Systemd( void ) { int fds = sd_listen_fds(0) ; int fd_count = 0 ; int i ; for ( i = 0 ; i < fds ; ++i ) { struct connection_out *out = NewOut(); if (out == NULL) { break ; } out->file_descriptor = i + SD_LISTEN_FDS_START ; ++ fd_count ; out->name = owstrdup("systemd"); out->inet_type = inet_systemd ; } if ( fd_count > 0 ) { Globals.daemon_status = e_daemon_sd ; Globals.inet_type = inet_systemd ; } } // Announce systemd is ready void Announce_Systemd( void ) { sd_notify( 0,"READY=1" ) ; } owfs-3.1p5/module/owlib/src/c/ow_tcp_free.c0000644000175000001440000000137512654730021015575 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif /* ---------------------------------------------- */ /* raw COM port interface routines */ /* ---------------------------------------------- */ //free serial port and restore attributes /* Called on head of multigroup bus */ void tcp_free(struct connection_in *connection) { COM_close( connection ) ; FreeClientAddr( connection ) ; } owfs-3.1p5/module/owlib/src/c/ow_tcp_open.c0000644000175000001440000000300012654730021015600 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #ifdef HAVE_LINUX_LIMITS_H #include #endif //open tcp port /* Called on head of multibus group */ GOOD_OR_BAD tcp_open(struct connection_in *connection) { struct port_in * pin = connection->pown ; if ( pin->state == cs_virgin ) { char * def_port = "" ; switch( get_busmode(connection) ) { case bus_link: def_port = DEFAULT_LINK_PORT ; break ; case bus_server: case bus_zero: def_port = DEFAULT_SERVER_PORT ; break ; case bus_ha7net: def_port = DEFAULT_HA7_PORT ; break ; case bus_xport: case bus_serial: def_port = DEFAULT_XPORT_PORT ; break ; case bus_etherweather: def_port = DEFAULT_ETHERWEATHER_PORT ; break ; case bus_enet: def_port = DEFAULT_ENET_PORT ; break ; case bus_xport_control: def_port = DEFAULT_XPORT_CONTROL_PORT ; break ; default: break ; } RETURN_BAD_IF_BAD( ClientAddr( DEVICENAME(connection), def_port, connection ) ) ; pin->file_descriptor = FILE_DESCRIPTOR_BAD ; } pin->state = cs_deflowered ; pin->file_descriptor = ClientConnect(connection) ; if ( FILE_DESCRIPTOR_NOT_VALID(pin->file_descriptor) ) { return gbBAD; } return gbGOOD ; } owfs-3.1p5/module/owlib/src/c/ow_tcp_read.c0000644000175000001440000000767612654730021015601 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_net holds the network utility routines. Many stolen unashamedly from Steven's Book */ /* Much modification by Christian Magnusson especially for Valgrind and embedded */ /* non-threaded fixes by Jerry Scharf */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" /* Wait for something to be readable or timeout */ GOOD_OR_BAD tcp_wait(FILE_DESCRIPTOR_OR_ERROR file_descriptor, const struct timeval *ptv) { int select_result; fd_set readset; struct timeval tv ; /* Initialize readset */ FD_ZERO(&readset); FD_SET(file_descriptor, &readset); while (1) { // Read if it doesn't timeout first timercpy( &tv, ptv ) ; select_result = select(file_descriptor + 1, &readset, NULL, NULL, &tv); if (select_result < 0) { if (errno == EINTR) { continue; /* interrupted */ } return gbBAD; /* error */ } else if (select_result == 0) { return gbBAD; /* timeout */ } else { // Is there something to read? if (FD_ISSET(file_descriptor, &readset)) { break; } } } return gbGOOD; } /* Read "n" bytes from a descriptor. */ /* Stolen from Unix Network Programming by Stevens, Fenner, Rudoff p89 */ /* return < 0 if failure */ ZERO_OR_ERROR tcp_read(FILE_DESCRIPTOR_OR_ERROR file_descriptor, BYTE * buffer, size_t requested_size, const struct timeval * ptv, size_t * chars_in) { size_t to_be_read = requested_size ; if ( FILE_DESCRIPTOR_NOT_VALID( file_descriptor ) ) { return -EBADF ; } LEVEL_DEBUG("attempt %d bytes Time: "TVformat,(int)requested_size, TVvar(ptv) ) ; *chars_in = 0 ; while (to_be_read > 0) { int select_result; fd_set readset; struct timeval tv ; /* Initialize readset */ FD_ZERO(&readset); FD_SET(file_descriptor, &readset); /* Read if it doesn't timeout first */ timercpy( &tv, ptv ) ; select_result = select(file_descriptor + 1, &readset, NULL, NULL, &tv); if (select_result > 0) { ssize_t read_result; /* Is there something to read? */ if (FD_ISSET(file_descriptor, &readset) == 0) { LEVEL_DEBUG("tcp_error -- nothing avialable to read"); return -EBADF ; /* error */ } errno = 0 ; read_result = read(file_descriptor, &buffer[*chars_in], to_be_read) ; if ( read_result < 0 ) { if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { read_result = 0; /* and call read() again */ } else { LEVEL_DATA("Network data read error errno=%d %s", errno, strerror(errno)); STAT_ADD1(NET_read_errors); return -EBADF ; } } else if (read_result == 0) { break; /* EOF */ } TrafficInFD("NETREAD", &buffer[*chars_in], read_result, file_descriptor ) ; to_be_read -= read_result; *chars_in += read_result ; } else if (select_result < 0) { /* select error */ if (errno == EINTR) { /* select() was interrupted, try again */ continue; } ERROR_DATA("Select error"); return -EBADF; } else { /* timed out */ LEVEL_CONNECT("TIMEOUT after %d bytes", requested_size - to_be_read); return -EAGAIN; } } LEVEL_DEBUG("read: %d - %d = %d",(int)requested_size, (int) to_be_read, (int) (requested_size-to_be_read) ) ; return 0; } void tcp_read_flush( FILE_DESCRIPTOR_OR_ERROR file_descriptor) { BYTE buffer[16]; ssize_t nread; int flags = fcntl(file_descriptor, F_GETFL, 0); // Apparently you can test for GET_FL success like this // see http://www.informit.com/articles/article.asp?p=99706&seqNum=13&rl=1 if (flags < 0) { return; } if (fcntl(file_descriptor, F_SETFL, flags | O_NONBLOCK) < 0) { return; } while ((nread = read(file_descriptor, buffer, 16)) > 0) { Debug_Bytes("tcp_read_flush", buffer, nread); continue; } if ( fcntl(file_descriptor, F_SETFL, flags) < 0 ) { LEVEL_DEBUG("Can't flush"); } } owfs-3.1p5/module/owlib/src/c/ow_telnet_write.c0000644000175000001440000000351612654730021016512 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include "telnet.h" /* Telnet handling concepts from Jerry Scharf: You should request the number of bytes you expect. When you scan it, start looking for FF FA codes. If that shows up, see if the F0 is in the read buffer. If so, move the char pointer back to where the FF point was and ask for the rest of the string (expected - FF...F0 bytes.) If the F0 isn't in the read buffer, start reading byte by byte into a separate variable looking for F0. Once you find that, then do the move the pointer and read the rest piece as above. Finally, don't forget to scan the rest of the strings for more FF FA blocks. It's most sloppy when the FF is the last character of the initial read buffer... You can also scan and remove the patterns FF F1 - FF F9 as these are 2 byte commands that the transmitter can send at any time. It is also possible that you could see FF FB xx - FF FE xx 3 byte codes, but this would be in response to FF FA codes that you would send, so that seems unlikely. Handling these would be just the same as the FF FA codes above. */ /* Write to a telnet device */ GOOD_OR_BAD telnet_write_binary( const BYTE * buf, const size_t size, struct connection_in *in) { size_t new_size = 0 ; size_t i = 0 ; // temporary buffer (add some extra space) BYTE new_buf[2*size] ; while ( i < size ) { if ( buf[i] == TELNET_IAC ) { new_buf[ new_size++ ] = TELNET_IAC ; // to double it } new_buf[ new_size++ ] = buf[ i++ ] ; } return COM_write( new_buf, new_size, in ) ; } owfs-3.1p5/module/owlib/src/c/ow_temp.c0000644000175000001440000000335012654730021014746 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" const char *tempscale[4] = { "Celsius", "Fahrenheit", "Kelvin", "Rankine", }; const char *TemperatureScaleName(enum temp_type t) { return tempscale[t]; } /* Temperture Conversion routines */ /* convert internal (Centigrade) to external format */ _FLOAT Temperature(_FLOAT C, const struct parsedname * pn) { switch (TemperatureScale(pn)) { case temp_fahrenheit: return 1.8 * C + 32.; case temp_kelvin: return C + 273.15; case temp_rankine: return 1.8 * C + 32. + 459.67; default: /* Centigrade */ return C; } } /* convert internal (Centigrade) to external format */ _FLOAT TemperatureGap(_FLOAT C, const struct parsedname * pn) { switch (TemperatureScale(pn)) { case temp_fahrenheit: case temp_rankine: return 1.8 * C; default: /* Centigrade, Kelvin */ return C; } } /* convert to internal (Centigrade) from external format */ _FLOAT fromTemperature(_FLOAT T, const struct parsedname * pn) { switch (TemperatureScale(pn)) { case temp_fahrenheit: return (T - 32.) / 1.8; case temp_kelvin: return T - 273.15; case temp_rankine: return (T - 32. - 459.67) / 1.8; default: /* Centigrade */ return T; } } /* convert to internal (Centigrade) from external format */ _FLOAT fromTempGap(_FLOAT T, const struct parsedname * pn) { switch (TemperatureScale(pn)) { case temp_fahrenheit: case temp_rankine: return (T) / 1.8; default: /* Centigrade, Kelvin */ return T; } } owfs-3.1p5/module/owlib/src/c/ow_testerread.c0000644000175000001440000001116712654730021016150 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor $ID: $ */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" /* ------- Prototypes ----------- */ static ZERO_OR_ERROR FS_read_tester_single(struct one_wire_query *owq); static ZERO_OR_ERROR FS_read_tester_array(struct one_wire_query *owq); /* ---------------------------------------------- */ /* Filesystem callback functions */ /* ---------------------------------------------- */ ZERO_OR_ERROR FS_read_tester(struct one_wire_query *owq) { switch (OWQ_pn(owq).extension) { case EXTENSION_ALL: /* array */ if (OWQ_offset(owq)) { return 0; } if (OWQ_size(owq) < FullFileLength(PN(owq))) { return -ERANGE; } return FS_read_tester_array(owq); case EXTENSION_BYTE: /* bitfield */ default: return FS_read_tester_single(owq); } } static ZERO_OR_ERROR FS_read_tester_single(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); int tester_bus = (pn->sn[2] << 8) + pn->sn[1]; int device = (pn->sn[6] << 8) + pn->sn[5]; int family_code = pn->sn[0]; int calculated_value = family_code + tester_bus + device + pn->extension; switch (OWQ_pn(owq).selected_filetype->format) { case ft_integer: OWQ_I(owq) = calculated_value; break; case ft_yesno: OWQ_Y(owq) = calculated_value & 0x1; break; case ft_bitfield: if (OWQ_pn(owq).extension == EXTENSION_BYTE) { OWQ_U(owq) = calculated_value; } else { OWQ_Y(owq) = calculated_value & 0x1; } break; case ft_unsigned: OWQ_U(owq) = calculated_value; break; case ft_pressure: case ft_temperature: case ft_tempgap: case ft_float: OWQ_F(owq) = (_FLOAT) calculated_value *0.1;; break; case ft_date: OWQ_D(owq) = 1174622400; break; case ft_alias: case ft_vascii: case ft_ascii: { ASCII address[16]; size_t length_left = OWQ_size(owq); size_t buffer_index; size_t length = FileLength(PN(owq)); ASCII return_chars[length]; bytes2string(address, pn->sn, SERIAL_NUMBER_SIZE); OWQ_length(owq) = OWQ_size(owq); for (buffer_index = 0; buffer_index < length; buffer_index += sizeof(address)) { size_t copy_length = length_left; if (copy_length > sizeof(address)) { copy_length = sizeof(address); } memcpy(&return_chars[buffer_index], address, copy_length); length_left -= copy_length; } return OWQ_format_output_offset_and_size(return_chars, length, owq); } case ft_binary: { size_t length_left = OWQ_size(owq); size_t buffer_index; size_t length = FileLength(PN(owq)); ASCII return_chars[length]; OWQ_length(owq) = OWQ_size(owq); for (buffer_index = 0; buffer_index < length; buffer_index += SERIAL_NUMBER_SIZE) { size_t copy_length = length_left; if (copy_length > SERIAL_NUMBER_SIZE) { copy_length = SERIAL_NUMBER_SIZE; } memcpy(&return_chars[buffer_index], pn->sn, copy_length); length_left -= copy_length; } return OWQ_format_output_offset_and_size(return_chars, length, owq); } case ft_directory: case ft_subdir: case ft_unknown: return -ENOENT; } return 0; // put data as string into buffer and return length } /* Read each array element independently, but return as one long string */ /* called when pn->extension==EXTENSION_ALL and pn->selected_filetype->ag->combined==ag_separate */ static ZERO_OR_ERROR FS_read_tester_array(struct one_wire_query *owq) { size_t elements = OWQ_pn(owq).selected_filetype->ag->elements; size_t extension; size_t entry_length = FileLength(PN(owq)); for (extension = 0; extension < elements; ++extension) { struct one_wire_query * owq_single = OWQ_create_separate( extension, owq ) ; if ( owq_single == NO_ONE_WIRE_QUERY ) { return -ENOMEM ; } switch (OWQ_pn(owq).selected_filetype->format) { case ft_integer: case ft_yesno: case ft_bitfield: case ft_unsigned: case ft_pressure: case ft_temperature: case ft_tempgap: case ft_float: case ft_date: break; case ft_vascii: case ft_alias: case ft_ascii: case ft_binary: OWQ_assign_read_buffer(&OWQ_buffer(owq)[extension * entry_length],entry_length,0,owq_single) ; break; case ft_directory: case ft_subdir: case ft_unknown: OWQ_destroy(owq_single) ; return -ENOENT; } if (FS_read_tester_single(owq_single)) { OWQ_destroy(owq_single) ; return -EINVAL; } memcpy(&OWQ_array(owq)[extension], &OWQ_val(owq_single), sizeof(union value_object)); OWQ_destroy(owq_single) ; } return 0; } owfs-3.1p5/module/owlib/src/c/ow_thermocouple.c0000644000175000001440000002125012654730021016506 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_thermocouple.h" /* ------- Structures ----------- */ // Note: highest order polynomial coefficient comes first struct thermocouple_data { _FLOAT mV_low, mV_high; _FLOAT temperature_low, temperature_high; struct { _FLOAT mV_upper; _FLOAT C[6]; } temperature[4]; _FLOAT mV_coldjunction[6]; }; struct thermocouple_data Thermocouple_data[e_type_last] = { { // Type_B -0.003, 13.82, // mV limits 0, 1820, // temperature limits { // mV -> temperature in ranges {-0.003, {-2.51221e+27, 2.13758e+24, 7.56308e+22, 1.74246e+20, 1.03265e+17, 0.826153,},}, // range 0 upper bound and coefficients {0.012, {-8.4706e+10, 6.47141e+08, 2.78322e+07, -474183, 4758.86, 41.6374,},}, // range 1 upper bound and coefficients {0.857, {2945.94, -7382.24, 7128.12, -3466.34, 1209.28, 62.3706,},}, // range 2 upper bound and coefficients {13.82, {0.00494198, -0.213432, 3.71517, -34.0892, 260.462, 221.702,},}, // range 3 upper bound and coefficients }, {-6.88408e-13, 2.15015e-10, -2.50994e-08, 7.0516e-06, -0.000269267, 0.000146246,}, // cold junction temperature -> mV }, // end Type_B { // Type_E -9.835, 76.373, // mV limits -270, 1000, // temperature limits { // mV -> temperature in ranges {-9.688, {3.26265, 138.271, 2343.84, 19858.7, 84111.6, 142368,},}, // range 0 upper bound and coefficients {-7.733, {3.26265, 138.271, 2343.84, 19858.7, 84111.6, 142368,},}, // range 1 upper bound and coefficients {6.93, {0.000149705, -0.00165641, 0.0119336, -0.249013, 17.1028, -0.0143392,},}, // range 2 upper bound and coefficients {76.373, {6.43417e-08, -1.81489e-05, 0.00220796, -0.130036, 15.9906, 3.96364,},}, // range 3 upper bound and coefficients }, {-3.75653e-12, 9.62809e-10, -1.02812e-07, 5.02521e-05, 0.0586085, -0.000287881,}, // cold junction temperature -> mV }, // end Type_E { // Type_J -8.095, 69.553, // mV limits -210, 1200, // temperature limits { // mV -> temperature in ranges {-5.194, {0.159313, 4.91673, 60.9921, 377.93, 1191.69, 1450.19,},}, // range 0 upper bound and coefficients {10.168, {6.32835e-05, -0.00164631, 0.0216838, -0.238347, 19.8278, 0.00456731,},}, // range 1 upper bound and coefficients {42.472, {2.94912e-06, -0.000385821, 0.017553, -0.358286, 21.3912, -6.15873,},}, // range 2 upper bound and coefficients {69.553, {4.61439e-06, -0.00139572, 0.166449, -9.73731, 294.793, -3051.08,},}, // range 3 upper bound and coefficients }, {-3.89357e-13, 1.87325e-10, -8.86007e-08, 3.04136e-05, 0.0503854, 9.80857e-06,}, // cold junction temperature -> mV }, // end Type_J { // Type_K -6.458, 54.819, // mV limits -270, 1370, // temperature limits { // mV -> temperature in ranges {-6.351, {16.5881, 450.901, 4901.84, 26628.6, 72304.4, 78407.2,},}, // range 0 upper bound and coefficients {-4.865, {16.5881, 450.901, 4901.84, 26628.6, 72304.4, 78407.2,},}, // range 1 upper bound and coefficients {6.981, {0.00061062, -0.00863106, 0.0728312, -0.405757, 25.3032, -0.0401767,},}, // range 2 upper bound and coefficients {54.819, {6.64007e-07, -0.00011542, 0.00927615, -0.338909, 29.0458, -18.483,},}, // range 3 upper bound and coefficients }, {-1.11057e-12, 2.31125e-10, -1.22507e-07, 2.63207e-05, 0.0394385, -0.000247425,}, // cold junction temperature -> mV }, // end Type_K { // Type_N -4.345, 47.513, // mV limits -270, 1300, // temperature limits { // mV -> temperature in ranges {-4.336, {0., 0., 0., 0., 1033.1, 4220.4,},}, // range 0 upper bound and coefficients {-3.85, {9667.39, 195822, 1.58634e+06, 6.42413e+06, 1.30051e+07, 1.05287e+07,},}, // range 1 upper bound and coefficients {2.48, {0.0255197, -0.0353939, -0.0717555, -0.864733, 38.5024, 0.116269,},}, // range 2 upper bound and coefficients {47.513, {1.93299e-06, -0.000295976, 0.0192512, -0.640613, 36.1391, 4.78696,},}, // range 3 upper bound and coefficients }, {-1.47913e-12, 1.35741e-10, 3.80869e-08, 1.33212e-05, 0.0260551, -0.0012884,}, // cold junction temperature -> mV }, // end Type_N { // Type_R -0.226, 21.003, // mV limits -50, 1760, // temperature limits { // mV -> temperature in ranges {0.284, {539.652, -288.34, 116.45, -91.4751, 189.1, -0.0232359,},}, // range 0 upper bound and coefficients {3.171, {0.313262, -3.48528, 16.2165, -43.8973, 173.888, 1.99571,},}, // range 1 upper bound and coefficients {15.348, {0.000132637, -0.00573544, 0.144438, -3.21251, 113.782, 44.5935,},}, // range 2 upper bound and coefficients {21.003, {0.0121004, -1.07146, 37.9227, -670.36, 5987.36, -20588.8,},}, // range 3 upper bound and coefficients }, {-2.54783e-16, 2.74148e-11, -2.2995e-08, 1.38489e-05, 0.00528974, 0.000102828,}, // cold junction temperature -> mV }, // end Type_R { // Type_S -0.236, 18.609, // mV limits -50, 1760, // temperature limits { // mV -> temperature in ranges {0.248, {72.7836, -147.497, 109.389, -80.6029, 184.799, 0.00485658,},}, // range 0 upper bound and coefficients {3.269, {0.268567, -3.07068, 14.6172, -39.81, 172.739, 1.58909,},}, // range 1 upper bound and coefficients {14.263, {4.55662e-05, 0.0011306, -0.0225231, -1.39047, 113.605, 45.2409,},}, // range 2 upper bound and coefficients {18.609, {0.0462634, -3.71475, 119.221, -1911.17, 15382.2, -48710.7,},}, // range 3 upper bound and coefficients }, {-3.13954e-13, 1.03e-10, -2.77745e-08, 1.25481e-05, 0.00541035, 1.19149e-05,}, // cold junction temperature -> mV }, // end Type_S { // Type_T -6.258, 20.872, // mV limits -270, 400, // temperature limits { // mV -> temperature in ranges {-6.236, {0, 0, 479.89, 8507, 50338, 99203,},}, // range 0 upper bound and coefficients {-5.739, {0, 0, 479.89, 8507, 50338, 99203,},}, // range 1 upper bound and coefficients {-1.545, {0.0589872, 0.884043, 5.49725, 15.4262, 49.2583, 13.1116,},}, // range 2 upper bound and coefficients {20.872, {1.77361e-05, -0.00124183, 0.0374592, -0.723968, 25.8858, -0.0114384,},}, // range 3 upper bound and coefficients }, {-3.30676e-12, 6.45333e-10, -3.91012e-08, 4.19966e-05, 0.0386665, -0.000360973,}, // cold junction temperature -> mV }, // end Type_T }; /* ------- Prototypes ----------- */ static _FLOAT Poly4Value(_FLOAT * c, _FLOAT x); static _FLOAT Temperature_from_mV(_FLOAT mV, enum e_thermocouple_type etype); _FLOAT Thermocouple_range_low(enum e_thermocouple_type etype) { return Thermocouple_data[etype].temperature_low; } _FLOAT Thermocouple_range_high(enum e_thermocouple_type etype) { return Thermocouple_data[etype].temperature_high; } _FLOAT ThermocoupleTemperature(_FLOAT mV_reading, _FLOAT temperature_coldjunction, enum e_thermocouple_type etype) { _FLOAT mV_coldjunction = Poly4Value(Thermocouple_data[etype].mV_coldjunction, temperature_coldjunction); return Temperature_from_mV(mV_reading + mV_coldjunction, etype); } // Find right range and calculate the temperature from (corrected) mV static _FLOAT Temperature_from_mV(_FLOAT mV, enum e_thermocouple_type etype) { if (mV < Thermocouple_data[etype].temperature[1].mV_upper) { if (mV < Thermocouple_data[etype].temperature[0].mV_upper) { return Poly4Value(Thermocouple_data[etype].temperature[0].C, mV); } else { return Poly4Value(Thermocouple_data[etype].temperature[1].C, mV); } } else { if (mV < Thermocouple_data[etype].temperature[2].mV_upper) { return Poly4Value(Thermocouple_data[etype].temperature[2].C, mV); } else { return Poly4Value(Thermocouple_data[etype].temperature[3].C, mV); } } } // Calculate 4th order polynomial using Homer's rule // Of form c0 + c1*x + c2*x^2 + c3*x^3 + c4*x^4 static _FLOAT Poly4Value(_FLOAT * c, _FLOAT x) { return c[5] + x * (c[4] + x * (c[3] + x * (c[2] + x * (c[1] + c[0] * x)))); } #ifdef THERMOCOUPLE_TEST #include void Thermotest(char type, enum e_thermocouple_type etype) { _FLOAT mV; printf("OWFS_%c = [\n", type); for (mV = Thermocouple_data[etype].mV_low; mV < Thermocouple_data[etype].mV_high; mV += .1) { printf("%g , %g \n", mV, Temperature_from_mV(mV, etype)); } printf("] ; \n"); } int main(void) { Thermotest('b', e_type_b); Thermotest('e', e_type_e); Thermotest('j', e_type_j); Thermotest('k', e_type_k); Thermotest('n', e_type_n); Thermotest('r', e_type_r); Thermotest('s', e_type_s); Thermotest('t', e_type_t); return 0; } #endif /* THERMOCOUPLE_TEST */ owfs-3.1p5/module/owlib/src/c/ow_traffic.c0000644000175000001440000000432412654730021015421 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_connection.h" /* Debugging interface to showing all bus traffic * You need to configure compile with */ static struct connection_in * Bus_from_file_descriptor( FILE_DESCRIPTOR_OR_ERROR file_descriptor ) { struct port_in * pin ; for ( pin=Inbound_Control.head_port ; pin != NULL ; pin=pin->next ) { if ( pin->file_descriptor == file_descriptor ) { return pin->first ; } } return NO_CONNECTION ; } void TrafficOut( const char * data_type, const BYTE * data, size_t length, const struct connection_in * in ) { if (Globals.traffic) { fprintf(stderr, "TRAFFIC OUT <%s> bus=%d (%s)\n", SAFESTRING(data_type), in->index, DEVICENAME(in) ) ; _Debug_Bytes( in->adapter_name, data, length ) ; } } void TrafficIn( const char * data_type, const BYTE * data, size_t length, const struct connection_in * in ) { if (Globals.traffic) { fprintf(stderr, "TRAFFIC IN <%s> bus=%d (%s)\n", SAFESTRING(data_type), in->index, DEVICENAME(in) ) ; _Debug_Bytes( in->adapter_name, data, length ) ; } } void TrafficOutFD( const char * data_type, const BYTE * data, size_t length, FILE_DESCRIPTOR_OR_ERROR file_descriptor ) { if (Globals.traffic) { struct connection_in * in = Bus_from_file_descriptor( file_descriptor ) ; if ( in != NO_CONNECTION ) { TrafficOut( data_type, data, length, in ) ; } else { fprintf(stderr, "TRAFFIC OUT <%s> file descriptor=%d\n", SAFESTRING(data_type), file_descriptor ) ; _Debug_Bytes( "FD", data, length ) ; } } } void TrafficInFD( const char * data_type, const BYTE * data, size_t length, FILE_DESCRIPTOR_OR_ERROR file_descriptor ) { if (Globals.traffic) { struct connection_in * in = Bus_from_file_descriptor( file_descriptor ) ; if ( in != NO_CONNECTION ) { TrafficIn( data_type, data, length, in ) ; } else { fprintf(stderr, "TRAFFIC IN <%s> file descriptor=%d\n", SAFESTRING(data_type), file_descriptor ) ; _Debug_Bytes( "FD", data, length ) ; } } } owfs-3.1p5/module/owlib/src/c/ow_transaction.c0000644000175000001440000003420212654730021016326 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" #include /* Transactions of a sequence of commands to the bus master * usually they can't be interrupted (at least for this bus master) so are locked * they are sent as a sequence of individual commands in an array that has to be processed. * There is some attempt to aggregate them for better efficiency * */ struct transaction_bundle { const struct transaction_log *start; int packets; size_t max_size; struct memblob mb; int select_first; }; // static int BUS_transaction_length( const struct transaction_log * tl, const struct parsedname * pn ) ; static GOOD_OR_BAD BUS_transaction_single(const struct transaction_log *t, const struct parsedname *pn); static GOOD_OR_BAD Bundle_pack(const struct transaction_log *tl, const struct parsedname *pn); static GOOD_OR_BAD Pack_item(const struct transaction_log *tl, struct transaction_bundle *tb); static GOOD_OR_BAD Bundle_ship(struct transaction_bundle *tb, const struct parsedname *pn); static GOOD_OR_BAD Bundle_enroute(struct transaction_bundle *tb, const struct parsedname *pn); static GOOD_OR_BAD Bundle_unpack(struct transaction_bundle *tb); static void Bundle_init(struct transaction_bundle *tb, const struct parsedname *pn); #define TRANSACTION_INCREMENT 1000 /* Bus transaction */ /* Encapsulates communication with a device, including locking the bus, reset and selection */ /* Then a series of bytes is sent and returned, including sending data and reading the return data */ GOOD_OR_BAD BUS_transaction(const struct transaction_log *tl, const struct parsedname *pn) { GOOD_OR_BAD ret ; if (tl == NULL) { return gbGOOD; } BUSLOCK(pn); ret = BUS_transaction_nolock(tl, pn); BUSUNLOCK(pn); return ret; } /* A few sequences start with teh bus already locked */ GOOD_OR_BAD BUS_transaction_nolock(const struct transaction_log *tl, const struct parsedname *pn) { const struct transaction_log *t = tl; GOOD_OR_BAD ret = gbGOOD; if (pn->selected_connection->iroutines.flags & ADAP_FLAG_bundle) { return Bundle_pack(tl, pn); } do { //printf("Transact type=%d\n",t->type) ; ret = BUS_transaction_single(t, pn); if (ret == gbOTHER) { // trxn_done flag ret = gbGOOD; // restore no error code break; // but stop looping anyways } ++t; } while ( GOOD(ret) ); return ret; } static GOOD_OR_BAD BUS_transaction_single(const struct transaction_log *t, const struct parsedname *pn) { GOOD_OR_BAD ret = gbGOOD; switch (t->type) { case trxn_select: // select a 1-wire device (by unique ID) ret = BUS_select(pn); LEVEL_DEBUG("select = %d", ret); break; case trxn_compare: // match two strings -- no actual 1-wire if ((t->in == NULL) || (t->out == NULL) || (memcmp(t->in, t->out, t->size) != 0)) { ret = gbBAD; } LEVEL_DEBUG("compare = %d", ret); break; case trxn_bitcompare: // match two strings -- no actual 1-wire if ((t->in == NULL) || (t->out == NULL) || BAD( BUS_compare_bits( t->in, t->out, t->size)) ) { ret = gbBAD; } LEVEL_DEBUG("compare = %d", ret); break; case trxn_match: // send data and compare response assert(t->in == NULL); // else use trxn_compare if (t->size == 0) { /* ignore for both cases */ break; } else { ret = BUS_send_data(t->out, t->size, pn); LEVEL_DEBUG("send = %d", ret); } break; case trxn_bitmatch: // send data and compare response assert(t->in == NULL); // else use trxn_compare if (t->size == 0) { /* ignore for both cases */ break; } else { ret = BUS_send_bits(t->out, t->size, pn); LEVEL_DEBUG("send bits = %d", ret); } break; case trxn_read: assert(t->out == NULL); // pure read if (t->size == 0) { /* ignore for all cases */ break; } else if (t->out == NULL) { ret = BUS_readin_data(t->in, t->size, pn); LEVEL_DEBUG("readin = %d", ret); } break; case trxn_bitread: assert(t->out == NULL); // pure read if (t->size == 0) { /* ignore for all cases */ break; } else if (t->out == NULL) { ret = BUS_readin_bits(t->in, t->size, pn); LEVEL_DEBUG("readin bits = %d", ret); } break; case trxn_modify: // write data and read response. No match needed ret = BUS_sendback_data(t->out, t->in, t->size, pn); LEVEL_DEBUG("modify = %d", ret); break; case trxn_bitmodify: // write data and read response. No match needed ret = BUS_sendback_bits(t->out, t->in, t->size, pn); LEVEL_DEBUG("bit modify = %d", ret); break; case trxn_blind: // write data ignore response { BYTE *dummy = owmalloc(t->size); if (dummy != NULL) { ret = BUS_sendback_data(t->out, dummy, t->size, pn); owfree(dummy); } else { ret = gbBAD; } } LEVEL_DEBUG("blind = %d", ret); break; case trxn_power: ret = BUS_PowerByte(t->out[0], t->in, t->size, pn); LEVEL_DEBUG("power (%d usec) = %d", t->size, ret); break; case trxn_bitpower: ret = BUS_PowerBit(t->out[0], t->in, t->size, pn); LEVEL_DEBUG("power bit (%d usec) = %d", t->size, ret); break; case trxn_program: ret = BUS_ProgramPulse(pn); LEVEL_DEBUG("program pulse = %d", ret); break; case trxn_crc8: ret = CRC8(t->out, t->size); LEVEL_DEBUG("CRC8 = %d", ret); break; case trxn_crc8seeded: ret = CRC8seeded(t->out, t->size, ((UINT *) (t->in))[0]); LEVEL_DEBUG("seeded CRC8 = %d", ret); break; case trxn_crc16: ret = CRC16(t->out, t->size); LEVEL_DEBUG("CRC16 = %d", ret); break; case trxn_crc16seeded: ret = CRC16seeded(t->out, t->size, ((UINT *) (t->in))[0]); LEVEL_DEBUG("seeded CRC16 = %d", ret); break; case trxn_delay: if (t->size > 0) { UT_delay(t->size); } LEVEL_DEBUG("Delay %d", t->size); break; case trxn_udelay: if (t->size > 0) { UT_delay_us(t->size); } LEVEL_DEBUG("Micro Delay %d", t->size); break; case trxn_reset: ret = BUS_reset(pn)==BUS_RESET_OK ? gbGOOD : gbBAD; LEVEL_DEBUG("reset = %d", ret); break; case trxn_end: LEVEL_DEBUG("end = %d", ret); return gbOTHER; // special "end" flag case trxn_verify: { struct parsedname pn2; memcpy(&pn2, pn, sizeof(struct parsedname)); //shallow copy pn2.selected_device = NO_DEVICE; if ( BAD( BUS_select(&pn2) )) { ret = gbBAD ; } else if ( BAD(BUS_verify(t->size, pn) )) { ret = gbBAD ; } else { ret = gbGOOD; } LEVEL_DEBUG("verify = %d", ret); } break; case trxn_nop: ret = gbGOOD; break; } return ret; } // initialize the bundle static void Bundle_init(struct transaction_bundle *tb, const struct parsedname *pn) { memset(tb, 0, sizeof(struct transaction_bundle)); MemblobInit(&tb->mb, TRANSACTION_INCREMENT); tb->max_size = pn->selected_connection->bundling_length; } static GOOD_OR_BAD Bundle_pack(const struct transaction_log *tl, const struct parsedname *pn) { const struct transaction_log *t_index; struct transaction_bundle s_tb; struct transaction_bundle *tb = &s_tb; Bundle_init(tb, pn); for (t_index = tl; t_index->type != trxn_end; ++t_index) { switch (Pack_item(t_index, tb)) { case gbGOOD: LEVEL_DEBUG("Item added"); break; case gbBAD: LEVEL_DEBUG("Item cannot be bundled"); RETURN_BAD_IF_BAD(Bundle_ship(tb, pn)) ; RETURN_BAD_IF_BAD(BUS_transaction_single(t_index, pn)) ; break; case gbOTHER: LEVEL_DEBUG("Item too big"); RETURN_BAD_IF_BAD(Bundle_ship(tb, pn)) ; if ( GOOD( Pack_item(t_index, tb) ) ) { break; } RETURN_BAD_IF_BAD(BUS_transaction_single(t_index, pn)) ; break; } } return Bundle_ship(tb, pn); } // Take a bundle, execute the transaction, unpack, and clear the memoblob static GOOD_OR_BAD Bundle_ship(struct transaction_bundle *tb, const struct parsedname *pn) { LEVEL_DEBUG("Ship Packets=%d", tb->packets); if (tb->packets == 0) { return gbGOOD; } if ( BAD( Bundle_enroute(tb, pn) ) ) { // clear the bundle MemblobClear(&tb->mb); tb->packets = 0; tb->select_first = 0; return gbBAD; } return Bundle_unpack(tb); } // Execute a bundle transaction (actual bytes on 1-wire bus) static GOOD_OR_BAD Bundle_enroute(struct transaction_bundle *tb, const struct parsedname *pn) { if (tb->select_first) { return BUS_select_and_sendback(MemblobData(&(tb->mb)), MemblobData(&(tb->mb)), MemblobLength(&(tb->mb)), pn); } else { return BUS_sendback_data(MemblobData(&(tb->mb)), MemblobData(&(tb->mb)), MemblobLength(&(tb->mb)), pn); } } /* See if the item can be packed return gbBAD -- cannot be packed at all return gbOTHER -- should be at start return gbGOOD -- added successfully */ static GOOD_OR_BAD Pack_item(const struct transaction_log *tl, struct transaction_bundle *tb) { GOOD_OR_BAD ret = 0; //default return value for good packets; //printf("PACK_ITEM used=%d size=%d max=%d\n",MemblobLength(&(tl>mb)),tl->size,tb->max_size); switch (tl->type) { case trxn_select: // select a 1-wire device (by unique ID) LEVEL_DEBUG("pack=SELECT"); if (tb->packets != 0) { return gbOTHER; // select must be first } tb->select_first = 1; break; case trxn_compare: // match two strings -- no actual 1-wire case trxn_bitcompare: // match two strings -- no actual 1-wire LEVEL_DEBUG("pack=COMPARE"); break; case trxn_read: case trxn_bitread: LEVEL_DEBUG(" pack=READ"); if (tl->size > tb->max_size) { return gbBAD; // too big for any bundle } if (tl->size + MemblobLength(&(tb->mb)) > tb->max_size) { return gbOTHER; // too big for this partial bundle } if (MemblobAddChar(0xFF, tl->size, &tb->mb)) { return gbBAD; } break; case trxn_match: // write data and match response case trxn_bitmatch: // write data and match response case trxn_modify: // write data and read response. No match needed case trxn_bitmodify: // write data and read response. No match needed case trxn_blind: // write data and ignore response LEVEL_DEBUG("pack=MATCH MODIFY BLIND"); if (tl->size > tb->max_size) { return gbBAD; // too big for any bundle } if (tl->size + MemblobLength(&(tb->mb)) > tb->max_size) { return gbOTHER; // too big for this partial bundle } if (MemblobAdd(tl->out, tl->size, &tb->mb)) { return gbBAD; } break; case trxn_power: case trxn_bitpower: case trxn_program: LEVEL_DEBUG("pack=POWER PROGRAM"); if (1 > tb->max_size) { return gbBAD; // too big for any bundle } if (1 + MemblobLength(&(tb->mb)) > tb->max_size) { return gbOTHER; // too big for this partial bundle } if (MemblobAdd(tl->out, 1, &tb->mb)) { return gbBAD; } ret = gbGOOD; // needs delay break; case trxn_crc8: case trxn_crc8seeded: case trxn_crc16: case trxn_crc16seeded: LEVEL_DEBUG("pack=CRC*"); break; case trxn_delay: case trxn_udelay: LEVEL_DEBUG("pack=(U)DELAYS"); ret = gbGOOD; break; case trxn_reset: case trxn_end: case trxn_verify: LEVEL_DEBUG("pack=RESET END VERIFY"); return gbBAD; case trxn_nop: LEVEL_DEBUG("pack=NOP"); break; } if (tb->packets == 0) { tb->start = tl; } ++tb->packets; return ret; } static GOOD_OR_BAD Bundle_unpack(struct transaction_bundle *tb) { int packet_index; const struct transaction_log *tl; BYTE *data = MemblobData(&(tb->mb)); GOOD_OR_BAD ret = gbGOOD; LEVEL_DEBUG("unpacking"); for (packet_index = 0, tl = tb->start; packet_index < tb->packets; ++packet_index, ++tl) { switch (tl->type) { case trxn_compare: // match two strings -- no actual 1-wire LEVEL_DEBUG("unpacking #%d COMPARE", packet_index); if ((tl->in == NULL) || (tl->out == NULL) || (memcmp(tl->in, tl->out, tl->size) != 0)) { ret = gbBAD; } break; case trxn_bitcompare: // match two strings -- no actual 1-wire if ((tl->in == NULL) || (tl->out == NULL) || BAD( BUS_compare_bits( tl->in, tl->out, tl->size)) ) { ret = gbBAD; } break ; case trxn_match: // send data and compare response LEVEL_DEBUG("unpacking #%d MATCH", packet_index); if (memcmp(tl->out, data, tl->size) != 0) { ret = gbBAD; } data += tl->size; break; case trxn_read: case trxn_modify: // write data and read response. No match needed LEVEL_DEBUG("unpacking #%d READ MODIFY", packet_index); memmove(tl->in, data, tl->size); data += tl->size; break; case trxn_blind: LEVEL_DEBUG("unpacking #%d BLIND", packet_index); data += tl->size; break; case trxn_power: case trxn_program: LEVEL_DEBUG("unpacking #%d POWER PROGRAM", packet_index); memmove(tl->in, data, 1); data += 1; UT_delay(tl->size); break; case trxn_crc8: LEVEL_DEBUG("unpacking #%d CRC8", packet_index); if (CRC8(tl->out, tl->size) != 0) { ret = gbBAD; } break; case trxn_crc8seeded: LEVEL_DEBUG("unpacking #%d CRC8 SEEDED", packet_index); if (CRC8seeded(tl->out, tl->size, ((UINT *) (tl->in))[0]) != 0) { ret = gbBAD; } break; case trxn_crc16: LEVEL_DEBUG("unpacking #%d CRC16", packet_index); if (CRC16(tl->out, tl->size) != 0) { ret = gbBAD; } break; case trxn_crc16seeded: LEVEL_DEBUG("unpacking #%d CRC16 SEEDED", packet_index); if (CRC16seeded(tl->out, tl->size, ((UINT *) (tl->in))[0]) != 0) { ret = gbBAD; } break; case trxn_delay: LEVEL_DEBUG("unpacking #%d DELAY", packet_index); UT_delay(tl->size); break; case trxn_udelay: LEVEL_DEBUG("unpacking #%d UDELAY", packet_index); UT_delay_us(tl->size); break; case trxn_reset: case trxn_end: case trxn_verify: // should never get here LEVEL_DEBUG("unpacking #%d RESET END VERIFY", packet_index); ret = gbBAD; break; case trxn_nop: case trxn_select: LEVEL_DEBUG("unpacking #%d NOP or SELECT", packet_index); break; case trxn_bitmatch: LEVEL_DEBUG("Unsupported transaction request trxn_bitmatch"); break ; case trxn_bitmodify: LEVEL_DEBUG("Unsupported transaction request trxn_bitmodify"); break ; case trxn_bitread: LEVEL_DEBUG("Unsupported transaction request trxn_bitread"); break ; case trxn_bitpower: LEVEL_DEBUG("Unsupported transaction request trxn_bitpower"); break ; } if ( BAD(ret) ) { break; } } // clear the bundle MemblobClear(&tb->mb); tb->packets = 0; tb->select_first = 0; return ret; } owfs-3.1p5/module/owlib/src/c/ow_tree.c0000644000175000001440000002462712654730021014752 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_devices.h" #include "ow_external.h" static int device_compare(const void *a, const void *b); static int file_compare(const void *a, const void *b); static void Device2Tree(const struct device *d, enum ePN_type type); static void External_Process(void); struct device *DeviceSimultaneous; struct device *DeviceThermostat; static int device_compare(const void *a, const void *b) { return strcmp(((const struct device *) a)->family_code, ((const struct device *) b)->family_code); } static int file_compare(const void *a, const void *b) { return strcmp(((const struct filetype *) a)->name, ((const struct filetype *) b)->name); } void *Tree[ePN_max_type]; #ifdef __FreeBSD__ static void Device2Tree(const struct device *d, enum ePN_type type) { // FreeBSD fix from Robert Nilsson /* In order for DeviceDestroy to work on FreeBSD we must copy the keys. Otherwise, tdestroy will attempt to free implicitly allocated structures. */ // Note, I'm not using owmalloc since owfree is probably not calledby FreeBSD's tdestroy // struct device *d_copy ; if ((d_copy = (struct device *) malloc(sizeof(struct device)))) { memmove(d_copy, d, sizeof(struct device)); } else { LEVEL_DATA("Could not allocate memory for device %s", d->readable_name); return ; } // Add in the device into the appropriate red/black tree tsearch(d_copy, &Tree[type], device_compare); // Sort all the file types alphabetically for search and listing if (d_copy->filetype_array != NULL) { qsort(d_copy->filetype_array, (size_t) d_copy->count_of_filetypes, sizeof(struct filetype), file_compare); } } #else /* not FreeBSD */ static void Device2Tree(const struct device *d, enum ePN_type type) { // Add in the device into the appropriate red/black tree tsearch(d, &Tree[type], device_compare); // Sort all the file types alphabetically for search and listing if (d->filetype_array != NULL) { qsort(d->filetype_array, (size_t) d->count_of_filetypes, sizeof(struct filetype), file_compare); } } #endif /* __FreeBSD__ */ static void free_node(void *nodep) { (void) nodep; /* nothing to free */ return; } void DeviceDestroy(void) { UINT i; // clear external trees tdestroy( sensor_tree, owfree_func ) ; tdestroy( family_tree, owfree_func ) ; tdestroy( property_tree, owfree_func ) ; // clear these trees -- have static data for (i = 0; i < (sizeof(Tree) / sizeof(void *)); i++) { /* ePN_structure is just a duplicate of ePN_real */ if (i != ePN_structure) { SAFETDESTROY( Tree[i], free_node); } else { /* ePN_structure (will be cleared in ePN_real) */ Tree[i] = NULL; } } } void DeviceSort(void) { memset(Tree, 0, sizeof(void *) * ePN_max_type); /* Sort the filetypes for the unrecognized device */ qsort(UnknownDevice.filetype_array, (size_t) UnknownDevice.count_of_filetypes, sizeof(struct filetype), file_compare); Device2Tree( & d_Example_slave, ePN_real); Device2Tree( & d_BAE, ePN_real); Device2Tree( & d_DS1420, ePN_real); Device2Tree( & d_DS1425, ePN_real); Device2Tree( & d_DS18S20, ePN_real); Device2Tree( & d_DS18B20, ePN_real); Device2Tree( & d_DS1821, ePN_real); Device2Tree( & d_DS1822, ePN_real); Device2Tree( & d_DS1825, ePN_real); Device2Tree( & d_DS1921, ePN_real); Device2Tree( & d_DS1923, ePN_real); Device2Tree( & d_DS1977, ePN_real); Device2Tree( & d_DS1963S, ePN_real); Device2Tree( & d_DS1963L, ePN_real); Device2Tree( & d_DS1982U, ePN_real); Device2Tree( & d_DS1985U, ePN_real); Device2Tree( & d_DS1986U, ePN_real); Device2Tree( & d_DS1991, ePN_real); Device2Tree( & d_DS1992, ePN_real); Device2Tree( & d_DS1993, ePN_real); Device2Tree( & d_DS1995, ePN_real); Device2Tree( & d_DS1996, ePN_real); Device2Tree( & d_DS2401, ePN_real); Device2Tree( & d_DS2404, ePN_real); Device2Tree( & d_DS2405, ePN_real); Device2Tree( & d_DS2406, ePN_real); Device2Tree( & d_DS2408, ePN_real); Device2Tree( & d_DS2409, ePN_real); Device2Tree( & d_DS2413, ePN_real); Device2Tree( & d_DS2415, ePN_real); Device2Tree( & d_DS2417, ePN_real); Device2Tree( & d_DS2423, ePN_real); Device2Tree( & d_DS2430A, ePN_real); Device2Tree( & d_DS2431, ePN_real); Device2Tree( & d_DS2433, ePN_real); Device2Tree( & d_DS2436, ePN_real); Device2Tree( & d_DS2437, ePN_real); Device2Tree( & d_DS2438, ePN_real); Device2Tree( & d_DS2450, ePN_real); Device2Tree( & d_DS2502, ePN_real); Device2Tree( & d_DS2505, ePN_real); Device2Tree( & d_DS2506, ePN_real); Device2Tree( & d_DS2720, ePN_real); Device2Tree( & d_DS2740, ePN_real); Device2Tree( & d_DS2751, ePN_real); Device2Tree( & d_DS2755, ePN_real); Device2Tree( & d_DS2760, ePN_real); Device2Tree( & d_DS2770, ePN_real); Device2Tree( & d_DS2780, ePN_real); Device2Tree( & d_DS2781, ePN_real); Device2Tree( & d_DS2890, ePN_real); Device2Tree( & d_DS28EA00, ePN_real); Device2Tree( & d_DS28EC20, ePN_real); Device2Tree( & d_DS28E04, ePN_real); Device2Tree( & d_EDS, ePN_real); Device2Tree( & d_HobbyBoards_EE, ePN_real); Device2Tree( & d_HobbyBoards_EF, ePN_real); Device2Tree( & d_LCD, ePN_real); Device2Tree( & d_mAM001, ePN_real); Device2Tree( & d_mCM001, ePN_real); Device2Tree( & d_mRS001, ePN_real); Device2Tree( & d_mTS017, ePN_real); Device2Tree( & d_mDI001, ePN_real); Device2Tree( & d_simultaneous, ePN_real); Device2Tree( & d_stats_cache, ePN_statistics); Device2Tree( & d_stats_directory, ePN_statistics); Device2Tree( & d_stats_errors, ePN_statistics); Device2Tree( & d_stats_read, ePN_statistics); Device2Tree( & d_stats_thread, ePN_statistics); Device2Tree( & d_stats_write, ePN_statistics); Device2Tree( & d_stats_return_code, ePN_statistics); Device2Tree( & d_set_timeout, ePN_settings); Device2Tree( & d_set_units, ePN_settings); Device2Tree( & d_set_alias, ePN_settings); Device2Tree( & d_set_return_code, ePN_settings); Device2Tree( & d_sys_process, ePN_system); Device2Tree( & d_sys_connections, ePN_system); Device2Tree( & d_sys_configure, ePN_system); Device2Tree( & d_interface_settings, ePN_interface); Device2Tree( & d_interface_statistics, ePN_interface); /* Add external devices */ External_Process() ; /* Match simultaneous for special processing */ { struct parsedname pn; pn.type = ePN_real; FS_devicefind("simultaneous", &pn); DeviceSimultaneous = pn.selected_device; } /* Match thermostat for special processing */ { struct parsedname pn; pn.type = ePN_real; FS_devicefind("thermostat", &pn); DeviceThermostat = pn.selected_device; } /* structure uses same tree as real */ Tree[ePN_structure] = Tree[ePN_real]; } struct device * FS_devicefindhex(BYTE f, struct parsedname *pn) { char ID[] = "XX"; const struct device d = { ID, NULL, 0, 0, NULL, NO_GENERIC_READ, NO_GENERIC_WRITE }; struct device_opaque *p; num2string(ID, f); if ((p = tfind(&d, &Tree[pn->type], device_compare))) { return p->key; } else { num2string(ID, f ^ 0x80); if ((p = tfind(&d, &Tree[pn->type], device_compare))) { return p->key; } } return &UnknownDevice ; } void FS_devicefind(const char *code, struct parsedname *pn) { const struct device d = { code, NULL, 0, 0, NULL, NO_GENERIC_READ, NO_GENERIC_WRITE }; struct device_opaque *p = tfind(&d, &Tree[pn->type], device_compare); if (p) { pn->selected_device = p->key; } else { pn->selected_device = &UnknownDevice; } } /* Need to lock struct global_namefind_struct since twalk requires global data -- can't pass void pointer */ /* Except all *_detect routines are done sequentially, not concurrently */ struct { const struct family_node * f ; int count ; } global_externalcount_struct; static void External_propertycount_action(const void *nodep, const VISIT which, const int depth) { const struct property_node *p = *(struct property_node * const *) nodep; (void) depth; switch (which) { case leaf: case postorder: if (strcmp(p->family, global_externalcount_struct.f->family) == 0 ) { ++global_externalcount_struct.count; } case preorder: case endorder: break; } } static void External_propertycopy_action(const void *nodep, const VISIT which, const int depth) { const struct property_node *p = *(struct property_node * const *) nodep; (void) depth; switch (which) { case leaf: case postorder: if (strcmp(p->family, global_externalcount_struct.f->family) == 0 ) { memcpy( & (global_externalcount_struct.f->dev.filetype_array[global_externalcount_struct.count]), &(p->ft), sizeof(struct filetype) ) ; ++global_externalcount_struct.count; } case preorder: case endorder: break; } } // First loop through families -- to count properties and allocate filetype array. static void External_family_action(const void *nodep, const VISIT which, const int depth) { const struct family_node *p = *(struct family_node * const *) nodep; struct family_node * non_const_f ; // to allow assignments (void) depth; switch (which) { case leaf: case postorder: // First count global_externalcount_struct.f = p ; global_externalcount_struct.count = 0 ; twalk( property_tree, External_propertycount_action); // Refind this node to allow assignment non_const_f = Find_External_Family( p->family ) ; non_const_f->dev.filetype_array = owcalloc( global_externalcount_struct.count, sizeof( struct filetype) ) ; non_const_f->dev.count_of_filetypes = global_externalcount_struct.count ; // Next copy global_externalcount_struct.count = 0 ; twalk( property_tree, External_propertycopy_action); // Finally add to tree Device2Tree( & (p->dev), ePN_real); break ; case preorder: case endorder: break; } } static void External_Process(void) { EXTERNALCOUNTLOCK; twalk( family_tree, External_family_action); EXTERNALCOUNTUNLOCK; } owfs-3.1p5/module/owlib/src/c/ow_udp_read.c0000644000175000001440000000371612654730021015572 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* ow_net holds the network utility routines. Many stolen unashamedly from Steven's Book */ /* Much modification by Christian Magnusson especially for Valgrind and embedded */ /* non-threaded fixes by Jerry Scharf */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" /* Read "n" bytes from a descriptor. */ /* Stolen from Unix Network Programming by Stevens, Fenner, Rudoff p89 */ /* return < 0 if failure */ ssize_t udp_read(FILE_DESCRIPTOR_OR_ERROR file_descriptor, void *vptr, size_t n, const struct timeval * ptv, struct sockaddr_in *from, socklen_t *fromlen) { while ( 1 ) { int select_result; fd_set readset; struct timeval tv ; /* Initialize readset */ FD_ZERO(&readset); FD_SET(file_descriptor, &readset); /* Read if it doesn't timeout first */ timercpy( &tv, ptv ) ; select_result = select(file_descriptor + 1, &readset, NULL, NULL, &tv); if (select_result > 0) { ssize_t read_or_error = 0 ; /* Is there something to read? */ if (FD_ISSET(file_descriptor, &readset) == 0) { return -EIO; /* error */ } read_or_error = recvfrom(file_descriptor, vptr, n, 0, (struct sockaddr *)from, fromlen) ; if ( read_or_error < 0 ) { errno = 0; // clear errno. We never use it anyway. ERROR_DATA("udp read error"); return -EIO; } else { //Debug_Bytes( "UDPread",ptr, nread ) ; return read_or_error ; } } else if (select_result < 0) { /* select error */ if (errno == EINTR) { /* select() was interrupted, try again */ continue; } ERROR_DATA("udp read selection error (network)"); return -EIO; } else { /* timed out */ LEVEL_CONNECT("udp read timeout"); return -EAGAIN; } } } owfs-3.1p5/module/owlib/src/c/ow_usb_msg.c0000644000175000001440000003426012654730021015444 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* DS9490R-W USB 1-Wire master USB parameters: Vendor ID: 04FA ProductID: 2490 Dallas controller DS2490 */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_usb_cycle.h" #include "ow_usb_msg.h" #if OW_USB /* conditional inclusion of USB */ #define CONTROL_REQUEST_TYPE 0x40 /** EP1 -- control read */ #define DS2490_EP1 0x81 /** EP2 -- bulk write */ #define DS2490_EP2 0x02 /** EP3 -- bulk read */ #define DS2490_EP3 0x83 char badUSBname[] = "-1:-1"; static int usb_transfer( int (*transfer_function) (struct libusb_device_handle *dev_handle, unsigned char endpoint, BYTE *data, int length, int *transferred, unsigned int timeout), unsigned char endpoint, BYTE * data, int length, int * transferred, struct connection_in * in ) ; static void usb_buffer_traffic( BYTE * buffer ) ; /* ------------------------------------------------------------ */ /* --- USB low-level communication -----------------------------*/ // Call to USB EP1 (control channel) // Names (bRequest, wValue wIndex) are from datasheet http://datasheets.maxim-ic.com/en/ds/DS2490.pdf // libusb version. GOOD_OR_BAD USB_Control_Msg(BYTE bRequest, UINT wValue, UINT wIndex, const struct parsedname *pn) { struct connection_in * in = pn->selected_connection ; libusb_device_handle *usb = in->master.usb.lusb_handle; int ret ; if (usb == NULL) { return gbBAD; } ret = libusb_control_transfer(usb, CONTROL_REQUEST_TYPE, bRequest, wValue, wIndex, NULL, 0, in->master.usb.timeout); if (Globals.traffic) { fprintf(stderr, "TRAFFIC OUT bus=%d (%s)\n", in->index, DEVICENAME(in) ) ; fprintf(stderr, "\tbus name=%s request type=0x%.2X, wValue=0x%X, wIndex=0x%X, return code=%d\n",in->adapter_name, bRequest, wValue, wIndex, ret) ; } if( ret < 0 ) { LEVEL_DEBUG("<%s> USB control problem", libusb_error_name(ret)) ; return gbBAD ; } return gbGOOD ; } RESET_TYPE DS9490_getstatus(BYTE * buffer, int * readlen, const struct parsedname *pn) { int ret ; int loops = 0; struct connection_in * in = pn->selected_connection ; int transferred ; memset(buffer, 0, DS9490_getstatus_BUFFER_LENGTH ); // should not be needed do { ret = usb_transfer( libusb_interrupt_transfer, DS2490_EP1, buffer, DS9490_getstatus_BUFFER_LENGTH, &transferred, in ) ; if ( ret < 0 ) { LEVEL_DATA("<%s> USB_INTERRUPT_READ error reading", libusb_error_name(ret)); STAT_ADD1_BUS(e_bus_status_errors, in); return BUS_RESET_ERROR; } else if (transferred > DS9490_getstatus_BUFFER_LENGTH ) { LEVEL_DATA("Bad DS2490 status %d > 32",transferred) ; return BUS_RESET_ERROR; } else if ( transferred > DS9490_getstatus_BUFFER ) { int i ; if ( transferred == DS9490_getstatus_BUFFER_LENGTH ) { // FreeBSD buffers the input, so this could just be two readings if (!memcmp(buffer, &buffer[DS9490_getstatus_BUFFER], 6)) { memmove(buffer, &buffer[DS9490_getstatus_BUFFER], DS9490_getstatus_BUFFER); transferred = DS9490_getstatus_BUFFER; LEVEL_DATA("Corrected buffer 32 byte read"); } } for (i = DS9490_getstatus_BUFFER; i < transferred; i++) { BYTE val = buffer[i]; if (val != ONEWIREDEVICEDETECT) { LEVEL_DATA("Status byte[%X]: %X", i - DS9490_getstatus_BUFFER, val); } if (val & COMMCMDERRORRESULT_SH) { // short detected LEVEL_DATA("short detected"); return BUS_RESET_SHORT; } } } if (readlen[0] < 0) { break; /* Don't wait for STATUSFLAGS_IDLE if length==-1 */ } usb_buffer_traffic( buffer ) ; if (buffer[8] & STATUSFLAGS_IDLE) { if (readlen[0] > 0) { // we have enough bytes to read now! // buffer[13] == (ReadBufferStatus) if (buffer[13] >= readlen[0]) { break; } LEVEL_DEBUG("Problem with buffer[13]=%d and readlen[0]=%d",(int) buffer[13], (int) readlen[0] ) ; } else { break; } } // this value might be decreased later... if (++loops > 100) { LEVEL_DATA("never got idle StatusFlags=%X read=%X", buffer[8], buffer[13]); //reset USB device // probably should reset speed and any other parameters. USB_Control_Msg(CONTROL_CMD, CTL_RESET_DEVICE, 0x0000, pn) ; return BUS_RESET_ERROR; // adapter never got idle } /* Since result seem to be on the usb bus very quick, I sleep * sleep 0.1ms or something like that instead... It seems like * result is there after 0.2-0.3ms */ UT_delay_us(100); } while (1); if (transferred < DS9490_getstatus_BUFFER) { LEVEL_DATA("incomplete packet size=%d", transferred); return BUS_RESET_ERROR; // incomplete packet?? } readlen[0] = transferred ; // pass this data back (used by reset) return BUS_RESET_OK ; } static void usb_buffer_traffic( BYTE * buffer ) { if (Globals.traffic) { // See note below for register info LEVEL_DEBUG("USB status registers (Idle) EFlags:%u->SPU:%u Dspeed:%u,Speed:%u,SPUdur:%u, PDslew:%u, W1lowtime:%u, W0rectime:%u, DevState:%u, CC1:%u, CC2:%u, CCState:%u, DataOutState:%u, DataInState:%u", buffer[0], (buffer[0]&0x01), (buffer[0]&0x04 ? 1 : 0), buffer[1], buffer[2], buffer[4], buffer[5], buffer[6], buffer[8], buffer[9], buffer[10], buffer[11], buffer[12], buffer[13] ); } } // libusb version // dev already set GOOD_OR_BAD DS9490_open( struct connection_in *in ) { libusb_device_handle * usb ; libusb_device * dev = in->master.usb.lusb_dev ; int usb_err ; if ( dev == NULL ) { return gbBAD ; } if ( (usb_err=libusb_open( dev, &usb )) != 0 ) { // intentional print to console fprintf(stderr, "<%s> Could not open the USB bus master. Is there a problem with permissions?\n",libusb_error_name(usb_err)); // And log LEVEL_DEFAULT("<%s> Could not open the USB bus master. Is there a problem with permissions?",libusb_error_name(usb_err)); STAT_ADD1_BUS(e_bus_open_errors, in); return gbBAD ; } in->master.usb.lusb_handle = usb; in->master.usb.bus_number = libusb_get_bus_number( dev ) ; in->master.usb.address = libusb_get_device_address( dev ) ; // if ( libusb_set_auto_detach_kernel_driver( usb, 1) != 0 ) { // LEVEL_CONNECT( "Could not set automatic USB driver management option" ) ; // } if ( (usb_err=libusb_detach_kernel_driver( usb, 0))!= 0 ) { LEVEL_DEBUG( "<%s> Could not release kernel module",libusb_error_name(usb_err) ) ; } // store timeout value -- sec -> msec in->master.usb.timeout = 1000 * Globals.timeout_usb; if ( (usb_err=libusb_set_configuration(usb, 1)) != 0 ) { LEVEL_CONNECT("<%s> Failed to set configuration on USB DS9490 bus master at %s", libusb_error_name(usb_err), DEVICENAME(in) ); } else if ( (usb_err=libusb_claim_interface(usb, 0)) != 0 ) { LEVEL_CONNECT("<%s> Failed to claim interface on USB DS9490 bus master at %s", libusb_error_name(usb_err), DEVICENAME(in) ); } else { if ( (usb_err=libusb_set_interface_alt_setting(usb, 0, 3)) != 0 ) { LEVEL_CONNECT("<%s> Failed to set alt interface on USB DS9490 bus master at %s", libusb_error_name(usb_err), DEVICENAME(in) ); } else { LEVEL_DEFAULT("Opened USB DS9490 bus master at %s.", DEVICENAME(in)); // clear endpoints if ( (usb_err=libusb_clear_halt(usb, DS2490_EP3)) || (usb_err=libusb_clear_halt(usb, DS2490_EP2)) || (usb_err=libusb_clear_halt(usb, DS2490_EP1)) ) { LEVEL_DEFAULT("<%s> USB_CLEAR_HALT failed",libusb_error_name(usb_err)); } else { /* All GOOD */ return gbGOOD; } } if ((usb_err=libusb_release_interface(usb, 0)) != 0 ) { LEVEL_DEBUG("<%s>",libusb_error_name(usb_err)) ; } if ((usb_err=libusb_attach_kernel_driver( usb,0 )) != 0 ) { LEVEL_DEBUG("<%s>",libusb_error_name(usb_err)); } } libusb_close(usb); in->master.usb.lusb_dev = NULL; LEVEL_DEBUG("Did not successfully open DS9490 %s -- permission problem?",DEVICENAME(in)) ; STAT_ADD1_BUS(e_bus_open_errors, in); return gbBAD; } void DS9490_close(struct connection_in *in) { libusb_device_handle *usb = in->master.usb.lusb_handle; if (usb != NULL) { int ret = libusb_release_interface(usb, 0); if ( ret != 0 ) { in->master.usb.lusb_dev = NULL; // force a re-scan LEVEL_CONNECT("<%s> Release interface (USB) failed", libusb_error_name(ret)); } ret =libusb_attach_kernel_driver( usb,0 ) ; if ( ret != 0 ) { LEVEL_DEBUG("<%s> Linux kernel driver reattach problem",libusb_error_name(ret)) ; } libusb_close(usb); in->master.usb.lusb_handle = NULL ; LEVEL_CONNECT("Closed USB DS9490 bus master at %s", DEVICENAME(in)); } in->master.usb.lusb_dev = NULL; SAFEFREE(DEVICENAME(in)) ; DEVICENAME(in) = owstrdup(badUSBname); } /* ------------------------------------------------------------ */ /* --- USB read and write --------------------------------------*/ // libusb version SIZE_OR_ERROR DS9490_read(BYTE * buf, size_t size, const struct parsedname *pn) { int ret; int transferred ; struct connection_in * in = pn->selected_connection ; ret = usb_transfer( libusb_bulk_transfer, DS2490_EP3, buf, size, &transferred, in ) ; if ( ret == 0 ) { TrafficIn("read",buf,size,pn->selected_connection) ; return transferred; } LEVEL_DATA("<%s> Failed DS9490 read", libusb_error_name(ret)); STAT_ADD1_BUS(e_bus_read_errors, in); return ret; } /* Fills the EP2 buffer in the USB adapter returns number of bytes (size) or <0 for an error */ // libusb version SIZE_OR_ERROR DS9490_write(BYTE * buf, size_t size, const struct parsedname *pn) { int ret; int transferred ; struct connection_in * in = pn->selected_connection ; if (size == 0) { return 0; } // usb library doesn't require a const data type for writing ret = usb_transfer( libusb_bulk_transfer, DS2490_EP2, buf, size, &transferred, in ) ; TrafficOut("write",buf,size,pn->selected_connection); if ( ret != 0 ) { LEVEL_DATA("<%s> Failed DS9490 write", libusb_error_name(ret)); STAT_ADD1_BUS(e_bus_write_errors, in); return ret ; } return transferred ; } // Notes from Michael Markstaller: /* Datasheet DS2490 page 29 table 16 0: Enable Flags: SPUE=1(bit0) If set to 1, the strong pullup to 5V is enabled, if set to 0, it is disabled. bit1 should be 0 but is 1 ?! SPCE = 4(bit2) If set to 1, a dynamic 1-Wire bus speed change through a Communication command is enabled, if set to 0, it is disabled. 1: 1-Wire Speed 2: Strong Pullup Duration 3: (Reserved) 4: Pulldown Slew Rate 5: Write-1 Low Time 6: Data Sample Offset / Write-0 Recovery Time 7: reserved 8: Device Status Flags: bit0: SPUA if set to 1, the strong pullup to 5V is currently active, if set to 0, it is inactive. bit3(8): PMOD if set to 1, the DS2490 is powered from USB and external sources, if set to 0, all DS2490 power is provided from USB. FIXME: expose this to clients to check! bit4(16): HALT if set to 1, the DS2490 is currently halted, if set to 0, the device is not halted. bit5(32): IDLE if set to 1, the DS2490 is currently idle, if set to 0, the device is not idle. bit5(64): EPOF: Endpoint 0 FIFO status, see: If EP0F is set to 1, the Endpoint 0 FIFO was full when a new control transfer setup packet was received. This is an error condition in that the setup packet received is discarded due to the full condition. To recover from this state the USB host must send a CTL_RESET_DEVICE command; the device will also recover with a power on reset cycle. Note that the DS2490 will accept and process a CTL_RESET_DEVICE command if the EP0F = 1 state occurs. If EP0F = 0, no FIFO error condition exists. 9: Communication Command, Byte 1 10: Communication Command, Byte 2 11: Communication Command Buffer Status 12: 1-Wire Data Out Buffer Status 13: 1-Wire Data In Buffer Status */ static int usb_transfer( int (*transfer_function) (struct libusb_device_handle *dev_handle, unsigned char endpoint, BYTE *data, int length, int *transferred, unsigned int timeout), unsigned char endpoint, BYTE * data, int length, int * transferred_return, struct connection_in * in ) { libusb_device_handle *usb = in->master.usb.lusb_handle; int timeout = in->master.usb.timeout ; int libusb_err ; transferred_return[0] = 0 ; do { int transferred ; int ret = transfer_function(usb, endpoint, data, length, &transferred, timeout) ; switch (ret ) { case 0: transferred_return[0] += transferred ; return 0 ; case LIBUSB_ERROR_TIMEOUT: if ( transferred == 0 ) { // timeout with no data if ( (libusb_err=libusb_clear_halt( usb, endpoint )) != 0 ) { LEVEL_DEBUG("Synchronous IO error %s",libusb_error_name(libusb_err)) ; } return ret ; } // partial transfer transferred_return[0] += transferred ; length -= transferred ; // decrease remaining length data += transferred ; // move pointer break ; default: // error if ( (libusb_err=libusb_clear_halt( usb, endpoint )) != 0 ) { LEVEL_DEBUG("<%s> Synchronous IO error", libusb_error_name(libusb_err)) ; } return ret ; } } while (1) ; } void DS9490_port_setup( libusb_device * dev, struct port_in * pin ) { struct connection_in * in = pin->first ; in->master.usb.lusb_handle = NULL ; in->master.usb.lusb_dev = dev ; pin->type = ct_usb ; pin->busmode = bus_usb; in->flex = 1 ; // Michael Markstaller suggests this in->Adapter = adapter_DS9490; /* OWFS assigned value */ in->adapter_name = "DS9490"; memset( in->master.usb.ds1420_address, 0, SERIAL_NUMBER_SIZE ) ; SAFEFREE(DEVICENAME(in)) ; if ( dev == NULL ) { in->master.usb.address = -1 ; in->master.usb.bus_number = -1 ; DEVICENAME(in) = owstrdup("") ; } else { size_t len = 32 ; int sn_ret ; in->master.usb.address = libusb_get_device_address( dev ) ; in->master.usb.bus_number = libusb_get_bus_number( dev ) ; DEVICENAME(in) = owmalloc( len+1 ) ; if ( DEVICENAME(in) == NULL ) { return ; } UCLIBCLOCK ; sn_ret = snprintf(DEVICENAME(in), len, "%.d:%.d", in->master.usb.bus_number, in->master.usb.address) ; UCLIBCUNLOCK ; if (sn_ret <= 0) { DEVICENAME(in)[0] = '\0' ; } } } #endif /* OW_USB */ owfs-3.1p5/module/owlib/src/c/ow_usb_cycle.c0000644000175000001440000001254312654730021015755 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* DS9490R-W USB 1-Wire master USB parameters: Vendor ID: 04FA ProductID: 2490 Dallas controller DS2490 */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_usb_msg.h" #include "ow_usb_cycle.h" #if OW_USB static void DS9490_dir_callback( void * v, const struct parsedname * pn_entry ); static GOOD_OR_BAD lusbdevice_in_use(int address, int bus_number); /* ------------------------------------------------------------ */ /* --- USB bus scaning -----------------------------------------*/ GOOD_OR_BAD USB_match(libusb_device * dev) { struct libusb_device_descriptor lusbd ; int libusb_err ; if ( (libusb_err=libusb_get_device_descriptor( dev, &lusbd )) != 0 ) { LEVEL_DEBUG("<%s> Cannot get descriptor",libusb_error_name(libusb_err)); return gbBAD ; } if ( lusbd.idVendor != DS2490_USB_VENDOR ) { return gbBAD ; } if ( lusbd.idProduct != DS2490_USB_PRODUCT ) { return gbBAD ; } return lusbdevice_in_use( libusb_get_device_address(dev), libusb_get_bus_number(dev) ) ; } /* Used only in root_dir */ static void DS9490_dir_callback( void * v, const struct parsedname * pn_entry ) { struct dirblob * db = v ; LEVEL_DEBUG("Callback on %s",SAFESTRING(pn_entry->path)); if ( pn_entry->sn[0] != '\0' ) { DirblobAdd( pn_entry->sn, db ) ; } } /* Get the root directory listing for finding a 1-wire tag for a DS9490 */ /* Only error is if parsename fails */ GOOD_OR_BAD DS9490_root_dir( struct dirblob * db, struct connection_in * in ) { ASCII path[PATH_MAX] ; struct parsedname pn_root ; UCLIBCLOCK; /* Force this adapter with bus.n path */ snprintf(path, PATH_MAX, "/uncached/bus.%d", in->index); UCLIBCUNLOCK; if ( FS_ParsedName(path, &pn_root) != 0 ) { LEVEL_DATA("Cannot get root directory on [%s] Parsing %s error.", SAFESTRING(DEVICENAME(in)), path); return gbBAD ; } DirblobInit( db ) ; /* First time pretend there are devices */ pn_root.selected_connection->changed_bus_settings |= CHANGED_USB_SPEED ; // Trigger needing new configuration pn_root.selected_connection->overdrive = 0 ; // not overdrive at start pn_root.selected_connection->flex = Globals.usb_flextime ; SetReconnect(&pn_root) ; FS_dir( DS9490_dir_callback, db, &pn_root ) ; LEVEL_DEBUG("Finished FS_dir"); FS_ParsedName_destroy(&pn_root) ; return gbGOOD ; // Dirblob must be cleared by recipient. } /* Found a DS9490 that seems good, now check list and find a device to ID for reconnects */ /* Choose in order: * (first) 0x81 * (first) 0x01 * first other family * 0x00 * */ GOOD_OR_BAD DS9490_ID_this_master(struct connection_in *in) { struct dirblob db ; BYTE sn[SERIAL_NUMBER_SIZE] ; int device_number ; RETURN_BAD_IF_BAD( DS9490_root_dir( &db, in ) ) ; // Use 0x00 if no devices (homegrown adapters?) if ( DirblobElements( &db) == 0 ) { DirblobClear( &db ) ; memset( in->master.usb.ds1420_address, 0, SERIAL_NUMBER_SIZE ) ; LEVEL_DEFAULT("Set DS9490 %s unique id 0x00 (no devices at all)", SAFESTRING(DEVICENAME(in))) ; return gbGOOD ; } // look for the special 0x81 device device_number = 0 ; while ( DirblobGet( device_number, sn, &db ) == 0 ) { if (sn[0] == 0x81) { // 0x81 family code memcpy(in->master.usb.ds1420_address, sn, SERIAL_NUMBER_SIZE); LEVEL_DEFAULT("Set DS9490 %s unique id to " SNformat, SAFESTRING(DEVICENAME(in)), SNvar(in->master.usb.ds1420_address)); DirblobClear( &db ) ; return gbGOOD ; } ++device_number ; } // look for the (less specific, for older DS9490s) 0x01 device device_number = 0 ; while ( DirblobGet( device_number, sn, &db ) == 0 ) { if (sn[0] == 0x01) { // 0x01 family code memcpy(in->master.usb.ds1420_address, sn, SERIAL_NUMBER_SIZE); LEVEL_DEFAULT("Set DS9490 %s unique id to " SNformat, SAFESTRING(DEVICENAME(in)), SNvar(in->master.usb.ds1420_address)); DirblobClear( &db ) ; return gbGOOD ; } ++device_number ; } // Take the first device, whatever it is DirblobGet( 0, sn, &db ) ; memcpy(in->master.usb.ds1420_address, sn, SERIAL_NUMBER_SIZE); LEVEL_DEFAULT("Set DS9490 %s unique id to " SNformat, SAFESTRING(DEVICENAME(in)), SNvar(in->master.usb.ds1420_address)); DirblobClear( &db ) ; return gbGOOD; } // return bad if already exists and is open // matches usb bus and usb address static GOOD_OR_BAD lusbdevice_in_use(int address, int bus_number) { struct port_in * pin ; for ( pin = Inbound_Control.head_port ; pin != NULL ; pin = pin->next ) { struct connection_in *cin; if ( pin->busmode != bus_usb ) { continue ; } // cycle through connections (although there is only one each for DS9490) for (cin = pin->first; cin != NO_CONNECTION; cin = cin->next) { LEVEL_DEBUG("Compare (add,bus) (%d,%d) with (%d,%d) handle %p\n",address,bus_number,cin->master.usb.address,cin->master.usb.bus_number,cin->master.usb.lusb_handle); if ( ( cin->master.usb.bus_number == bus_number ) && ( cin->master.usb.address == address ) ) { if ( cin->master.usb.lusb_handle == NULL ) { return gbGOOD ; } return gbBAD; // It seems to be in use already } } } return gbGOOD; // not found in the current inbound list } #endif /* OW_USB */ owfs-3.1p5/module/owlib/src/c/ow_usb_monitor.c0000644000175000001440000001410112654730021016335 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_usb_msg.h" #if OW_USB /* This "adapter" is actually a thread that intermittently looks for new USB bus masters */ static void USB_monitor_close(struct connection_in *in); static GOOD_OR_BAD usb_monitor_in_use(const struct connection_in * in_selected) ; static void USB_scan_for_adapters(void) ; static void * USB_monitor_loop( void * v ); /* Device-specific functions */ GOOD_OR_BAD USB_monitor_detect(struct port_in *pin) { struct connection_in * in = pin->first ; struct address_pair ap ; pthread_t thread ; /* init_data has form "scan" or "scan:15" (15 seconds) */ Parse_Address( pin->init_data, &ap ) ; switch ( ap.entries ) { case 0: in->master.usb_monitor.usb_scan_interval = DEFAULT_USB_SCAN_INTERVAL ; break ; case 1: switch( ap.first.type ) { case address_numeric: in->master.usb_monitor.usb_scan_interval = ap.first.number ; break ; default: in->master.usb_monitor.usb_scan_interval = DEFAULT_USB_SCAN_INTERVAL ; break ; } break ; case 2: switch( ap.second.type ) { case address_numeric: in->master.usb_monitor.usb_scan_interval = ap.second.number ; break ; default: in->master.usb_monitor.usb_scan_interval = DEFAULT_USB_SCAN_INTERVAL ; break ; } break ; } Free_Address( &ap ) ; pin->type = ct_none ; // Device name will not be init_data copy SAFEFREE(DEVICENAME(in)) ; DEVICENAME(in) = owstrdup("USB bus monitor") ; pin->file_descriptor = FILE_DESCRIPTOR_BAD; in->iroutines.detect = USB_monitor_detect; in->Adapter = adapter_usb_monitor; in->iroutines.reset = NO_RESET_ROUTINE; in->iroutines.next_both = NO_NEXT_BOTH_ROUTINE; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = NO_SENDBACKDATA_ROUTINE; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE ; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = USB_monitor_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_sham; in->adapter_name = "USB scan"; pin->busmode = bus_usb_monitor ; // repeat since can come via usb=scan Init_Pipe( in->master.usb_monitor.shutdown_pipe ) ; if ( pipe( in->master.usb_monitor.shutdown_pipe ) != 0 ) { ERROR_DEFAULT("Cannot allocate a shutdown pipe. The program shutdown may be messy"); Init_Pipe( in->master.usb_monitor.shutdown_pipe ) ; } if ( BAD( usb_monitor_in_use(in) ) ) { LEVEL_CONNECT("Second call for USB scanning ignored") ; return gbBAD ; } if ( pthread_create(&thread, DEFAULT_THREAD_ATTR, USB_monitor_loop, (void *) in) != 0 ) { ERROR_CALL("Cannot create the USB monitoring program thread"); return gbBAD ; } return gbGOOD ; } static GOOD_OR_BAD usb_monitor_in_use(const struct connection_in * in_selected) { struct port_in * pin ; for ( pin = Inbound_Control.head_port ; pin != NULL ; pin = pin->next ) { if ( pin->busmode != bus_usb_monitor ) { continue ; } if ( pin->first != in_selected ) { return gbBAD ; } } return gbGOOD; // not found in the current inbound list } static void USB_monitor_close(struct connection_in *in) { if ( FILE_DESCRIPTOR_VALID( in->master.usb_monitor.shutdown_pipe[fd_pipe_write] ) ) { ignore_result = write( in->master.usb_monitor.shutdown_pipe[fd_pipe_write],"X",1) ; //dummy payload } Test_and_Close_Pipe(in->master.usb_monitor.shutdown_pipe) ; } static void * USB_monitor_loop( void * v ) { struct connection_in * in = v ; FILE_DESCRIPTOR_OR_ERROR file_descriptor = in->master.usb_monitor.shutdown_pipe[fd_pipe_read] ; DETACH_THREAD; do { fd_set readset; struct timeval tv = { in->master.usb_monitor.usb_scan_interval, 0, }; /* Initialize readset */ FD_ZERO(&readset); if ( FILE_DESCRIPTOR_VALID( file_descriptor ) ) { FD_SET(file_descriptor, &readset); } if ( select( file_descriptor+1, &readset, NULL, NULL, &tv ) != 0 ) { break ; // don't scan any more -- perhaps a close? } USB_scan_for_adapters() ; } while (1) ; return VOID_RETURN ; } /* Open a DS9490 -- low level code (to allow for repeats) */ static void USB_scan_for_adapters(void) { // discover devices libusb_device **device_list; int n_devices = libusb_get_device_list( Globals.luc, &device_list) ; int i_device ; if ( n_devices < 1 ) { LEVEL_CONNECT("Could not find a list of USB devices"); if ( n_devices<0 ) { LEVEL_DEBUG("<%s>",libusb_error_name(n_devices)); } return ; } LEVEL_DEBUG("USB SCAN! %d total entries",n_devices); MONITOR_RLOCK ; for ( i_device = 0 ; i_device < n_devices ; ++i_device ) { libusb_device * current = device_list[i_device] ; if ( GOOD( USB_match( current ) ) ) { // Create a port and connection, fill in with name and then test for function and uniqueness struct port_in * pin = AllocPort(NULL) ; if ( pin == NULL ) { break ; } DS9490_port_setup( current, pin ) ; // Can do detect. Because the name makes this a specific adapter (USB pair) // we won't do a directory and won't add the directory and devices with the wrong index if ( BAD( DS9490_detect(pin)) ) { // Remove the extra connection RemovePort(pin); } else { // Add the device, but no need to check for bad match Add_InFlight( NULL, pin ) ; if ( BAD(DS9490_ID_this_master(pin->first)) ) { Del_InFlight( NULL, pin ) ; } } } } MONITOR_RUNLOCK ; libusb_free_device_list(device_list, 1); } #else /* OW_USB */ GOOD_OR_BAD USB_monitor_detect(struct port_in *pin) { (void) pin ; LEVEL_CALL( "USB monitoring support not enabled" ) ; return gbBAD ; } #endif /* OW_USB */ owfs-3.1p5/module/owlib/src/c/ow_util.c0000644000175000001440000000441612654730021014762 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" /* * HEXVALUE() is defined in , but since it's more * common with 0-9 I changed compare-order in the define */ #define _HEXVALUE(c) \ (((c) >= '0' && (c) <= '9') \ ? (c)-'0' \ : (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'a'+10 ) /* 2 hex digits to number. This is the most used function in owfs for the LINK */ BYTE string2num(const char *s) { if (s == NULL) { return 0; } return (_HEXVALUE(s[0]) << 4) + _HEXVALUE(s[1]); } //#define _TOHEXCHAR(c) (((c) >= 0 && (c) <= 9) ? '0'+(c) : 'A'+(c)-10 ) // we only use a nibble #define _TOHEXCHAR(c) (((c) <= 9) ? '0'+(c) : ('A'-10)+(c) ) #if 0 /* number to a hex digit */ char num2char(const BYTE n) { return _TOHEXCHAR(n); } #endif /* number to 2 hex digits */ void num2string(char *s, const BYTE n) { s[0] = _TOHEXCHAR(n >> 4); s[1] = _TOHEXCHAR(n & 0x0F); } /* 2x hex digits to x number bytes */ void string2bytes(const char *str, BYTE * b, const int bytes) { int i; for (i = 0; i < bytes; ++i) { b[i] = string2num(&str[i << 1]); } } /* number(x bytes) to 2x hex digits */ void bytes2string(char *str, const BYTE * b, const int bytes) { int i; for (i = 0; i < bytes; ++i) { num2string(&str[i << 1], b[i]); } } void UT_fromDate(const _DATE d, BYTE * data) { data[0] = BYTE_MASK(d); data[1] = BYTE_MASK(d >> 8); data[2] = BYTE_MASK(d >> 16); data[3] = BYTE_MASK(d >> 24); } _DATE UT_toDate(const BYTE * data) { return (_DATE) UT_uint32(data); } void Test_and_Close( FILE_DESCRIPTOR_OR_ERROR * file_descriptor ) { if ( file_descriptor == NULL ) { return ; } if ( FILE_DESCRIPTOR_VALID( *file_descriptor ) ) { close( *file_descriptor ) ; } *file_descriptor = FILE_DESCRIPTOR_BAD ; } void Test_and_Close_Pipe( FILE_DESCRIPTOR_OR_ERROR * pipe_fd ) { Test_and_Close( &pipe_fd[fd_pipe_read]) ; Test_and_Close( &pipe_fd[fd_pipe_write]) ; } void Init_Pipe( FILE_DESCRIPTOR_OR_ERROR * pipe_fd ) { pipe_fd[fd_pipe_read] = pipe_fd[fd_pipe_write] = FILE_DESCRIPTOR_BAD ; } owfs-3.1p5/module/owlib/src/c/ow_verify.c0000644000175000001440000000330112654730021015301 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include "ow_standard.h" /* ------- Prototypes ----------- */ /* ------- Functions ------------ */ // BUS_verify tests if device is present in requested mode // serialnumber is 1-wire device address (64 bits) GOOD_OR_BAD BUS_verify(BYTE search, const struct parsedname *pn) { BYTE buffer[25]; int i, goodbits = 0; struct connection_in * in = pn->selected_connection ; /* Adapter-specific verify routine? */ if ( in->iroutines.verify != NO_VERIFY_ROUTINE ) { LEVEL_DEBUG("Use adapter-specific verify routine"); return (in->iroutines.verify) (pn); } // set all bits at first memset(buffer, 0xFF, 25); buffer[0] = search; // now set or clear apropriate bits for search for (i = 0; i < 64; i++) { UT_setbit(buffer, 3 * i + 10, UT_getbit(pn->sn, i)); } // send/receive the transfer buffer RETURN_BAD_IF_BAD(BUS_sendback_data(buffer, buffer, 25, pn) ) ; if (buffer[0] != search) { return gbBAD; } for (i = 0; (i < 64) && (goodbits < 64); i++) { switch (UT_getbit(buffer, 3 * i + 8) << 1 | UT_getbit(buffer, 3 * i + 9)) { case 0: break; case 1: if (!UT_getbit(pn->sn, i)) { goodbits++; } break; case 2: if (UT_getbit(pn->sn, i)){ goodbits++; } break; case 3: // No device on line return gbBAD; } } // check to see if there were enough good bits to be successful return ( goodbits < 8 ) ? gbBAD : gbGOOD; } owfs-3.1p5/module/owlib/src/c/ow_visibility.c0000644000175000001440000000453212654730021016173 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* General Device File format: This device file corresponds to a specific 1wire/iButton chip type ( or a closely related family of chips ) The connection to the larger program is through the "device" data structure, which must be declared in the acompanying header file. The device structure holds the family code, name, device type (chip, interface or pseudo) number of properties, list of property structures, called "filetype". Each filetype structure holds the name, estimated length (in bytes), aggregate structure pointer, data format, read function, write funtion, generic data pointer The aggregate structure, is present for properties that several members (e.g. pages of memory or entries in a temperature log. It holds: number of elements whether the members are lettered or numbered whether the elements are stored together and split, or separately and joined */ #include #include "owfs_config.h" #include "ow.h" /* ------- Prototypes ------------ */ enum e_visibility AlwaysVisible( const struct parsedname * pn ) { (void) pn ; return visible_always ; } enum e_visibility NeverVisible( const struct parsedname * pn ) { (void) pn ; return visible_never ; } /* Internal files */ Make_SlaveSpecificTag(VIS, fc_persistent); // used for all visibility work GOOD_OR_BAD GetVisibilityCache( int * visibility_parameter, const struct parsedname * pn ) { return Cache_Get_SlaveSpecific( visibility_parameter, sizeof(int), SlaveSpecificTag(VIS), pn) ; } void SetVisibilityCache( int visibility_parameter, const struct parsedname * pn ) { Cache_Add_SlaveSpecific( &visibility_parameter, sizeof(int), SlaveSpecificTag(VIS), pn) ; } enum e_visibility FS_visible( const struct parsedname * pn ) { struct filetype * ft = pn->selected_filetype ; if ( ft != NO_FILETYPE ) { // filetype exists return ft->visible(pn) ; } ft = pn->subdir ; if ( ft != NO_SUBDIR ) { // this is a subdir return ft->visible(pn) ; } // default is to show return visible_always ; } owfs-3.1p5/module/owlib/src/c/ow_w1.c0000644000175000001440000002062212654730021014331 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow_connection.h" #if OW_W1 #include "ow_w1.h" #include "ow_codes.h" #include "ow_counters.h" struct toW1 { ASCII *command; ASCII lock[10]; ASCII conditional[1]; ASCII address[16]; const BYTE *data; size_t length; }; //static void byteprint( const BYTE * b, int size ) ; static RESET_TYPE W1_reset(const struct parsedname *pn); static enum search_status W1_next_both(struct device_search *ds, const struct parsedname *pn); static GOOD_OR_BAD W1_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static GOOD_OR_BAD W1_select_and_sendback(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); static void W1_setroutines(struct connection_in *in); static void W1_close(struct connection_in *in); static SEQ_OR_ERROR w1_send_touch( const BYTE * data, size_t size, const struct parsedname *pn ); static SEQ_OR_ERROR w1_send_selecttouch( const BYTE * data, size_t size, const struct parsedname *pn ); static SEQ_OR_ERROR w1_send_search( struct device_search *ds, const struct parsedname *pn ); static SEQ_OR_ERROR w1_send_reset( const struct parsedname *pn ); static void W1_setroutines(struct connection_in *in) { in->iroutines.detect = W1_detect; in->iroutines.reset = W1_reset; in->iroutines.next_both = W1_next_both; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.select_and_sendback = W1_select_and_sendback; in->iroutines.sendback_data = W1_sendback_data; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = W1_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; // Directory obtained in a single gulp (W1_LIST_SLAVES) // Bundle transactions // in->iroutines.flags = ADAP_FLAG_dirgulp | ADAP_FLAG_bundle | ADAP_FLAG_dir_auto_reset | ADAP_FLAG_no2404delay ; in->bundling_length = W1_FIFO_SIZE; // arbitrary number } GOOD_OR_BAD W1_detect(struct port_in *pin) { struct connection_in * in = pin->first ; /* Set up low-level routines */ pin->type = ct_none ; W1_setroutines(in); Init_Pipe( in->master.w1.netlink_pipe ) ; if ( pipe( in->master.w1.netlink_pipe ) != 0 ) { ERROR_CONNECT("W1 pipe creation error"); Init_Pipe( in->master.w1.netlink_pipe ) ; return gbBAD ; } in->Adapter = adapter_w1; in->adapter_name = "w1"; pin->busmode = bus_w1; in->master.w1.seq = SEQ_INIT; return gbGOOD; } /* Send blindly, no response expected */ static SEQ_OR_ERROR w1_send_reset( const struct parsedname *pn ) { struct w1_netlink_msg w1m; struct w1_netlink_cmd w1c; memset(&w1m, 0, W1_W1M_LENGTH); w1m.type = W1_MASTER_CMD; w1m.id.mst.id = pn->selected_connection->master.w1.id ; memset(&w1c, 0, W1_W1C_LENGTH); w1c.cmd = W1_CMD_RESET ; w1c.len = 0 ; LEVEL_DEBUG("Sending w1 reset message"); return W1_send_msg( pn->selected_connection, &w1m, &w1c, NULL ); } static RESET_TYPE W1_reset(const struct parsedname *pn) { return W1_Process_Response( NULL, w1_send_reset(pn), NULL, pn ) == nrs_complete ? BUS_RESET_OK : BUS_RESET_ERROR ; } static SEQ_OR_ERROR w1_send_search( struct device_search *ds, const struct parsedname *pn ) { struct w1_netlink_msg w1m; struct w1_netlink_cmd w1c; memset(&w1m, 0, W1_W1M_LENGTH); w1m.type = W1_MASTER_CMD; w1m.id.mst.id = pn->selected_connection->master.w1.id ; memset(&w1c, 0, W1_W1C_LENGTH); w1c.cmd = (ds->search==_1W_CONDITIONAL_SEARCH_ROM) ? W1_CMD_ALARM_SEARCH : W1_CMD_SEARCH ; w1c.len = 0 ; LEVEL_DEBUG("Sending w1 search (list devices) message"); return W1_send_msg( pn->selected_connection, &w1m, &w1c, NULL ); } // Work around for omap hdq driver bug which reverses the slave address // We check the CRC8 and use reversed if forward is incorrect. static void search_callback( struct netlink_parse * nlp, void * v, const struct parsedname * pn ) { int i ; struct connection_in * in = pn->selected_connection ; struct device_search *ds = v ; BYTE sn[SERIAL_NUMBER_SIZE] ; BYTE * sn_pointer ; for ( i = 0 ; i < nlp->w1c->len ; i += SERIAL_NUMBER_SIZE ) { switch( in->master.w1.w1_slave_order ) { case w1_slave_order_forward: sn_pointer = &nlp->data[i] ; break ; case w1_slave_order_reversed: // reverse bytes sn[0] = nlp->data[i+7] ; sn[1] = nlp->data[i+6] ; sn[2] = nlp->data[i+5] ; sn[3] = nlp->data[i+4] ; sn[4] = nlp->data[i+3] ; sn[5] = nlp->data[i+2] ; sn[6] = nlp->data[i+1] ; sn[7] = nlp->data[i+0] ; sn_pointer = sn ; break ; case w1_slave_order_unknown: default: sn_pointer = &nlp->data[i] ; if ( CRC8(sn_pointer, SERIAL_NUMBER_SIZE) == 0 ) { in->master.w1.w1_slave_order = w1_slave_order_forward ; break ; } // reverse bytes sn[0] = nlp->data[i+7] ; sn[1] = nlp->data[i+6] ; sn[2] = nlp->data[i+5] ; sn[3] = nlp->data[i+4] ; sn[4] = nlp->data[i+3] ; sn[5] = nlp->data[i+2] ; sn[6] = nlp->data[i+1] ; sn[7] = nlp->data[i+0] ; sn_pointer = sn ; in->master.w1.w1_slave_order = w1_slave_order_reversed ; LEVEL_DEBUG( "w1 bus master%d uses reversed slave order", in->master.w1.id ) ; break ; } DirblobAdd(sn_pointer, &(ds->gulp) ); } } static enum search_status W1_next_both(struct device_search *ds, const struct parsedname *pn) { if (ds->LastDevice) { return search_done; } if (++(ds->index) == 0) { // first pass, load the directory DirblobClear( &(ds->gulp) ); if ( W1_Process_Response( search_callback, w1_send_search(ds,pn), ds, pn ) != nrs_complete) { return search_error; } } switch ( DirblobGet(ds->index, ds->sn, &(ds->gulp) ) ) { case 0: LEVEL_DEBUG("SN found: " SNformat, SNvar(ds->sn)); return search_good; case -ENODEV: default: ds->LastDevice = 1; LEVEL_DEBUG("SN finished"); return search_done; } } static SEQ_OR_ERROR w1_send_selecttouch( const BYTE * data, size_t size, const struct parsedname *pn ) { struct w1_netlink_msg w1m; struct w1_netlink_cmd w1c; memset(&w1m, 0, W1_W1M_LENGTH); w1m.type = W1_SLAVE_CMD; memcpy( w1m.id.id, pn->sn, 8) ; memset(&w1c, 0, W1_W1C_LENGTH); w1c.cmd = W1_CMD_TOUCH ; w1c.len = size ; LEVEL_DEBUG("Sending w1 select message for "SNformat,SNvar(pn->sn)); return W1_send_msg( pn->selected_connection, &w1m, &w1c, data ); } struct touch_struct { BYTE * resp ; size_t size ; } ; static void touch( struct netlink_parse * nlp, void * v, const struct parsedname * pn ) { struct touch_struct * ts = v ; (void) pn ; if ( nlp->data == NULL ) { return ; } if ( ts->size == (size_t)nlp->data_size ) { memcpy( ts->resp, nlp->data, nlp->data_size ) ; } } // Reset, select, and read/write data static GOOD_OR_BAD W1_select_and_sendback(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { struct touch_struct ts = { resp, size, } ; return W1_Process_Response( touch, w1_send_selecttouch(data,size,pn), &ts, pn)==nrs_complete ? gbGOOD : gbBAD ; } static SEQ_OR_ERROR w1_send_touch( const BYTE * data, size_t size, const struct parsedname *pn ) { struct w1_netlink_msg w1m; struct w1_netlink_cmd w1c; memset(&w1m, 0, W1_W1M_LENGTH); w1m.type = W1_MASTER_CMD; w1m.id.mst.id = pn->selected_connection->master.w1.id ; memset(&w1c, 0, W1_W1C_LENGTH); w1c.cmd = W1_CMD_TOUCH ; w1c.len = size ; LEVEL_DEBUG("Sending w1 send/receive data message for "SNformat,SNvar(pn->sn)); return W1_send_msg( pn->selected_connection, &w1m, &w1c, data ); } // Send data and return response block static GOOD_OR_BAD W1_sendback_data(const BYTE * data, BYTE * resp, const size_t size, const struct parsedname *pn) { struct touch_struct ts = { resp, size, } ; return W1_Process_Response( touch, w1_send_touch(data,size,pn), &ts, pn)==nrs_complete ? gbGOOD : gbBAD ; } static void W1_close(struct connection_in *in) { Test_and_Close_Pipe( in->master.w1.netlink_pipe ); } #else /* OW_W1 */ GOOD_OR_BAD W1_detect(struct port_in *pin) { (void) pin ; LEVEL_CONNECT("Kernel 1-wire support was not configured in") ; return gbBAD ; } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_addremove.c0000644000175000001440000000416312654730021016361 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #if OW_W1 #include "ow_w1.h" #include "ow_connection.h" static struct port_in * CreateW1Port(int bus_master) ; static GOOD_OR_BAD W1_nomatch( struct port_in * trial, struct port_in * existing ) ; // Create a new bus master (W1 type) static struct port_in * CreateW1Port(int bus_master) { struct port_in * pin = AllocPort(NULL) ; struct connection_in * in ; char name[63] ; int sn_ret ; if ( pin == NO_CONNECTION ) { return NULL ; } in = pin->first ; UCLIBCLOCK ; sn_ret = snprintf(name,62,"w1_bus_master%d",bus_master) ; UCLIBCUNLOCK ; if ( sn_ret < 0 ) { RemovePort(pin) ; return NULL ; } pin->init_data = owstrdup(name) ; DEVICENAME(in) = owstrdup(name) ; in->master.w1.id = bus_master ; pin->busmode = bus_w1 ; in->master.w1.w1_slave_order = w1_slave_order_unknown ; Init_Pipe( in->master.w1.netlink_pipe ) ; if ( BAD( W1_detect(pin)) ) { RemovePort(pin) ; return NULL ; } LEVEL_DEBUG("Setup structure for %s",DEVICENAME(in)) ; return pin ; } // GOOD means no match static GOOD_OR_BAD W1_nomatch( struct port_in * trial, struct port_in * existing ) { if ( get_busmode(existing->first) != bus_w1 ) { return gbGOOD ; } if ( trial->first->master.w1.id != existing->first->master.w1.id ) { return gbGOOD ; } return gbBAD; } void AddW1Bus( int bus_master ) { struct port_in * new_pin = CreateW1Port(bus_master) ; if ( new_pin == NULL ) { LEVEL_DEBUG("cannot create a new W1 master"); return ; } LEVEL_DEBUG("Request master be added: w1_bus_master%d.", bus_master); new_pin->type = ct_none ; Add_InFlight( W1_nomatch, new_pin ) ; } void RemoveW1Bus( int bus_master ) { struct port_in * pin = CreateW1Port( bus_master ) ; // example port if ( pin != NULL ) { Del_InFlight( W1_nomatch, pin ) ; // tolerant of pin==NULL RemovePort( pin ) ; // remove example } } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_bind.c0000644000175000001440000000464012654730021015327 00000000000000/* $Id$ W1 Announce -- daemon for showing w1 busmasters using Avahi Written 2008 Paul H Alfille email: paul.alfille@gmail.com Released under the GPLv2 Much thanks to Evgeniy Polyakov This file itself is amodestly modified version of w1d by Evgeniy Polyakov */ /* * w1d.c * * Copyright (c) 2004 Evgeniy Polyakov * * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "owfs_config.h" #if OW_W1 #include "ow_w1.h" #include "ow_connection.h" // Bind the master netlink socket for all communication // responses will have to be routed to appropriate bus master GOOD_OR_BAD w1_bind( struct connection_in * in ) { struct port_in * pin = in->pown ; struct sockaddr_nl l_local ; pin->type = ct_netlink ; Test_and_Close( &(pin->file_descriptor) ) ; // just in case // Example from http://lxr.linux.no/linux+v3.0/Documentation/connector/ucon.c#L114 //pin->file_descriptor = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); // pin->file_descriptor = socket(PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC , NETLINK_CONNECTOR); pin->file_descriptor = socket(PF_NETLINK, SOCK_RAW , NETLINK_CONNECTOR); if ( FILE_DESCRIPTOR_NOT_VALID( pin->file_descriptor ) ) { ERROR_CONNECT("Netlink (w1) socket (are you root?)"); return gbBAD; } // fcntl (pin->file_descriptor, F_SETFD, FD_CLOEXEC); // for safe forking l_local.nl_pid = in->master.w1_monitor.pid = getpid() ; l_local.nl_pad = 0; l_local.nl_family = AF_NETLINK; l_local.nl_groups = 23; if ( bind( pin->file_descriptor, (struct sockaddr *)&l_local, sizeof(struct sockaddr_nl) ) == -1 ) { ERROR_CONNECT("Netlink (w1) bind (are you root?)"); Test_and_Close( &( pin->file_descriptor) ); return gbBAD ; } pin->state = cs_deflowered ; return gbGOOD ; } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_browse.c0000644000175000001440000000147312654730021015715 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* w1 browse for existing and new bus masters * w1 is different: it is a dynamic list of adapters * the scanning starts with "W1_Browse" in LibStart and continues in it's own thread */ #include #include "owfs_config.h" #include "ow_connection.h" #if OW_W1 #include "ow_w1.h" GOOD_OR_BAD W1_Browse( void ) { pthread_t thread_dispatch ; if ( pthread_create(&thread_dispatch, DEFAULT_THREAD_ATTR, W1_Dispatch, NULL ) != 0 ) { ERROR_DEBUG("Couldn't create netlink monitoring thread"); return gbBAD ; } return gbGOOD ; } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_dispatch.c0000644000175000001440000001310212654730021016203 00000000000000/* W1 Announce -- daemon for showing w1 busmasters using Avahi Written 2008 Paul H Alfille email: paul.alfille@gmail.com Released under the GPLv2 Much thanks to Evgeniy Polyakov This file itself is a modestly modified version of w1d by Evgeniy Polyakov */ /* * w1d.c * * Copyright (c) 2004 Evgeniy Polyakov * * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "owfs_config.h" #if OW_W1 #include "ow_w1.h" #include "ow_connection.h" static GOOD_OR_BAD W1_write_pipe( FILE_DESCRIPTOR_OR_ERROR file_descriptor, struct netlink_parse * nlp ) ; static void Dispatch_Packet( struct netlink_parse * nlp) ; static void Dispatch_Packet_root( struct netlink_parse * nlp) ; static void Dispatch_Packet_nonroot( struct netlink_parse * nlp) ; // write to an internal pipe (in another thread). Use a timepout in case that thread has terminated. static GOOD_OR_BAD W1_write_pipe( FILE_DESCRIPTOR_OR_ERROR file_descriptor, struct netlink_parse * nlp ) { do { int select_value ; struct timeval tv = { Globals.timeout_w1, 0 } ; fd_set writeset ; FD_ZERO(&writeset) ; FD_SET(file_descriptor,&writeset) ; select_value = select(file_descriptor+1,NULL,&writeset,NULL,&tv) ; if ( select_value == -1 ) { if (errno != EINTR) { ERROR_CONNECT("Netlink dispatch error"); return gbBAD ; } // repeat path for EINTR } else if ( select_value == 0 ) { LEVEL_DEBUG("Netlink dispatch timeout"); return gbBAD; } else { int write_ret = write( file_descriptor, (const void *)nlp->nlm, nlp->nlm->nlmsg_len ) ; if (write_ret < 0 ) { ERROR_DEBUG("Netlink dispatch write error"); } else if ( (size_t) write_ret < nlp->nlm->nlmsg_len ) { LEVEL_DEBUG("Only able to write %d of %d bytes to pipe",write_ret, nlp->nlm->nlmsg_len); return gbBAD ; } return gbGOOD ; } } while (1) ; } // Get the w1 bus id from the nlm sequence number and dispatch to that bus static void Dispatch_Packet( struct netlink_parse * nlp) { int bus = NL_BUS(nlp->nlm->nlmsg_seq) ; // root w1 master message -- add and remove if ( bus == 0 ) { // root w1 master message -- add and remove LEVEL_DEBUG("Netlink message directed to root W1 master"); Dispatch_Packet_root( nlp ) ; } else { // non-root w1 message -- individual bus master messages LEVEL_DEBUG("Netlink message directed to W1 bus master %d",bus); CONNIN_RLOCK ; Dispatch_Packet_nonroot( nlp ) ; CONNIN_RUNLOCK ; } } // Get the w1 bus id from the nlm sequence number and dispatch to that bus static void Dispatch_Packet_root( struct netlink_parse * nlp) { // root w1 master message -- add and remove /* Need to run the add/remove in a separate thread so that netlink messages can still be parsed and CONNIN_RLOCK won't deadlock */ pthread_t thread ; // make a copy for the new thread (which we will have to destroy) // the copy includes the packet // and the actual message appended to the end struct netlink_parse * nlp_copy = owmalloc( sizeof(struct netlink_parse) + NLMSG_SPACE(nlp->nlm->nlmsg_len) ) ; if ( nlp_copy == NULL ) { return ; } memcpy( nlp_copy, nlp, sizeof(struct netlink_parse) ) ; nlp_copy->nlm = (struct nlmsghdr *) nlp_copy->follow ; memcpy( nlp_copy->follow, nlp->nlm, nlp->nlm->nlmsg_len ) ; // Need run through parser to set pointers to new buffer if ( BAD( Netlink_Parse_Buffer(nlp_copy) ) ) { owfree( nlp_copy ) ; return ; } // Now send if ( pthread_create( &thread, DEFAULT_THREAD_ATTR, w1_master_command, (void *) nlp_copy ) == 0 ) { LEVEL_DEBUG("Sending this packet to root bus"); } else { owfree( nlp_copy ) ; LEVEL_DEBUG("Thread creation problem"); } return ; } // Get the w1 bus id from the nlm sequence number and dispatch to that bus static void Dispatch_Packet_nonroot( struct netlink_parse * nlp) { int bus = NL_BUS(nlp->nlm->nlmsg_seq) ; struct port_in * pin ; for ( pin = Inbound_Control.head_port ; pin != NULL ; pin = pin->next ) { struct connection_in * cin ; if ( pin->busmode != bus_w1 ) { continue ; } for ( cin = pin->first ; cin != NO_CONNECTION ; cin = cin->next ) { if ( cin->master.w1.id == bus ) { if ( GOOD( W1_write_pipe(cin->master.w1.netlink_pipe[fd_pipe_write], nlp) ) ) { LEVEL_DEBUG("Sending this packet to w1_bus_master%d",bus); } else { LEVEL_DEBUG("Error sending w1_bus_master%d",bus); } return ; } } } LEVEL_DEBUG("W1 netlink message for non-existent bus %d",bus); } // Infinite loop waiting for netlink packets, to be sent to internal pipes as appropriate void * W1_Dispatch( void * v ) { (void) v ; DETACH_THREAD; w1_list_masters() ; // ask for master list while ( FILE_DESCRIPTOR_VALID( Inbound_Control.w1_monitor->pown->file_descriptor ) ) { struct netlink_parse nlp ; nlp.nlm = NULL ; LEVEL_DEBUG("Dispatch loop"); if ( GOOD ( Netlink_Parse_Get( &nlp ) ) ) { Dispatch_Packet( &nlp ) ; } SAFEFREE( nlp.nlm ) ; } LEVEL_DEBUG("Normal completion."); return VOID_RETURN; } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_list.c0000644000175000001440000000355612654730021015373 00000000000000/* $Id$ W1 Announce -- daemon for showing w1 busmasters using Avahi Written 2008 Paul H Alfille email: paul.alfille@gmail.com Released under the GPLv2 Much thanks to Evgeniy Polyakov This file itself is amodestly modified version of w1d by Evgeniy Polyakov */ /* * w1d.c * * Copyright (c) 2004 Evgeniy Polyakov * * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* w1 list * Routines to read the list of w1 masters * This is called from ow_w1_browse */ #include #include "owfs_config.h" #if OW_W1 #include "ow_w1.h" #include "ow_connection.h" SEQ_OR_ERROR w1_list_masters( void ) { struct w1_netlink_msg w1m; memset(&w1m, 0, W1_W1M_LENGTH); w1m.type = W1_LIST_MASTERS; w1m.len = 0; w1m.id.mst.id = 0; LEVEL_DEBUG("Sending w1 bus master list message"); return W1_send_msg( NULL, &w1m, NULL, NULL ); } void w1_parse_master_list(struct netlink_parse * nlp) { int * bus_master = (int32_t *) nlp->data ; int num_masters = nlp->data_size / 4 ; int i ; LEVEL_DEBUG("W1 List %d masters",num_masters); for ( i=0 ;idata_size); AddW1Bus( bus_master[i] ) ; } } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_monitor.c0000644000175000001440000000635412654730021016106 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #if OW_W1 #include "ow_w1.h" static void W1_monitor_close(struct connection_in *in); static GOOD_OR_BAD w1_monitor_in_use(const struct connection_in * in_selected) ; /* Device-specific functions */ GOOD_OR_BAD W1_monitor_detect(struct port_in *pin) { struct connection_in * in = pin->first ; struct timeval tvslack = { 1, 0 } ; // 1 second pin->file_descriptor = FILE_DESCRIPTOR_BAD; pin->type = ct_none ; in->iroutines.detect = W1_monitor_detect; in->Adapter = adapter_w1_monitor; /* OWFS assigned value */ in->iroutines.reset = NO_RESET_ROUTINE; in->iroutines.next_both = NO_NEXT_BOTH_ROUTINE; in->iroutines.PowerByte = NO_POWERBYTE_ROUTINE; in->iroutines.ProgramPulse = NO_PROGRAMPULSE_ROUTINE; in->iroutines.sendback_data = NO_SENDBACKDATA_ROUTINE; in->iroutines.sendback_bits = NO_SENDBACKBITS_ROUTINE; in->iroutines.select = NO_SELECT_ROUTINE; in->iroutines.select_and_sendback = NO_SELECTANDSENDBACK_ROUTINE; in->iroutines.set_config = NO_SET_CONFIG_ROUTINE; in->iroutines.get_config = NO_GET_CONFIG_ROUTINE; in->iroutines.reconnect = NO_RECONNECT_ROUTINE; in->iroutines.close = W1_monitor_close; in->iroutines.verify = NO_VERIFY_ROUTINE ; in->iroutines.flags = ADAP_FLAG_sham; in->adapter_name = "W1 monitor"; pin->busmode = bus_w1_monitor ; RETURN_BAD_IF_BAD( w1_monitor_in_use(in) ) ; // Initial setup Inbound_Control.w1_monitor = in ; // essentially a global pointer to the w1_monitor entry _MUTEX_INIT(in->master.w1_monitor.seq_mutex); _MUTEX_INIT(in->master.w1_monitor.read_mutex); timernow( &(in->master.w1_monitor.last_read) ); timeradd( &(in->master.w1_monitor.last_read), &tvslack, &(in->master.w1_monitor.last_read) ); in->master.w1_monitor.seq = SEQ_INIT ; in->master.w1_monitor.pid = 0 ; w1_bind(in) ; // sets in->file_descriptor if ( FILE_DESCRIPTOR_NOT_VALID( in->pown->file_descriptor ) ) { ERROR_DEBUG("Netlink problem -- are you root?"); Inbound_Control.w1_monitor = NO_CONNECTION ; return gbBAD ; } return W1_Browse() ; // creates thread that runs forever. } // is there already a W! monitor in the Inbound list? You only need one. static GOOD_OR_BAD w1_monitor_in_use(const struct connection_in * in_selected) { struct port_in * pin ; for ( pin = Inbound_Control.head_port ; pin != NULL ; pin = pin->next ) { struct connection_in *cin; if ( pin->busmode != bus_w1_monitor ) { continue ; } for (cin = pin->first; cin != NO_CONNECTION; cin = cin->next) { if ( cin == in_selected ) { continue ; } return gbBAD ; } } return gbGOOD; // not found in the current inbound list } static void W1_monitor_close(struct connection_in *in) { _MUTEX_DESTROY(in->master.w1_monitor.seq_mutex); _MUTEX_DESTROY(in->master.w1_monitor.read_mutex); } #else /* OW_W1 */ GOOD_OR_BAD W1_monitor_detect(struct port_in *pin) { (void) pin ; LEVEL_DEFAULT("W1 (the linux kernel 1-wire system) is not supported"); return gbBAD ; } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_parse.c0000644000175000001440000001767013013637732015541 00000000000000/* W1 Announce -- daemon for showing w1 busmasters using Avahi Written 2008 Paul H Alfille email: paul.alfille@gmail.com Released under the GPLv2 Much thanks to Evgeniy Polyakov This file itself is a modestly modified version of w1d by Evgeniy Polyakov */ /* * Copyright (c) 2004 Evgeniy Polyakov * * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "owfs_config.h" #if OW_W1 #include "ow_w1.h" #include "ow_connection.h" static void Netlink_Parse_Show( struct netlink_parse * nlp ) ; static GOOD_OR_BAD Get_and_Parse_Pipe( FILE_DESCRIPTOR_OR_ERROR file_descriptor, struct netlink_parse * nlp ) ; GOOD_OR_BAD Netlink_Parse_Buffer( struct netlink_parse * nlp ) { /* NLM Netlink header */ struct nlmsghdr * nlm = nlp->nlm ; // test message if ( ! NLMSG_OK(nlm,nlm->nlmsg_len) ) { LEVEL_DEBUG("Netlink message truncated"); // non-peek return gbBAD ; } // test pid if ( nlm->nlmsg_pid != 0 ) { LEVEL_DEBUG("Netlink (w1) Not from kernel"); // non-peek return gbBAD ; } // test type if ( nlm->nlmsg_type != NLMSG_DONE ) { LEVEL_DEBUG("Netlink (w1) Bad message type"); return gbBAD ; } // test length if ( nlm->nlmsg_len < W1_NLM_LENGTH + W1_CN_LENGTH + W1_W1M_LENGTH ) { LEVEL_DEBUG("Netlink (w1) Bad message length (%d)",nlm->nlmsg_len ); return gbBAD ; } /* CONNECTOR MESSAGE */ nlp->cn = (struct cn_msg *) NLMSG_DATA(nlm) ; // sequence numbers if ( nlm->nlmsg_seq != nlp->cn->seq ) { LEVEL_DEBUG("Netlink (w1) sequence numbers internally inconsistent nlm_seq=%u|%u cn_seq=%u|%u", NL_BUS(nlm->nlmsg_seq), NL_SEQ(nlm->nlmsg_seq),NL_BUS(nlp->cn->seq),NL_SEQ(nlp->cn->seq)); return gbBAD ; } /* W1_NETLINK_MESSAGE */ nlp->w1m = (struct w1_netlink_msg *) nlp->cn->data ; //printf("w1m=%p nlm=%p \n" , nlp->w1m, nlm ) ; /* W1_NETLINK_COMMAND -- optional depending on w1_netlink_message type */ switch (nlp->w1m->type) { case W1_SLAVE_ADD: case W1_SLAVE_REMOVE: case W1_MASTER_ADD: case W1_MASTER_REMOVE: case W1_LIST_MASTERS: nlp->w1c = NULL ; nlp->data = nlp->w1m->data ; nlp->data_size = nlp->w1m->len ; break ; case W1_MASTER_CMD: case W1_SLAVE_CMD: nlp->w1c = (struct w1_netlink_cmd *) nlp->w1m->data ; nlp->data = nlp->w1c->data ; nlp->data_size = nlp->w1c->len ; } if ( nlp->data_size == 0 ) { nlp->data = NULL ; } return gbGOOD ; } GOOD_OR_BAD Netlink_Parse_Get( struct netlink_parse * nlp ) { struct nlmsghdr peek_nlm ; // first peek at message to get length and details LEVEL_DEBUG("Wait to peek at message"); int recv_len = recv( Inbound_Control.w1_monitor->pown->file_descriptor, &peek_nlm, W1_NLM_LENGTH, MSG_PEEK ); // Set time of last read _MUTEX_LOCK(Inbound_Control.w1_monitor->master.w1_monitor.read_mutex) ; timernow( &(Inbound_Control.w1_monitor->master.w1_monitor.last_read) ); _MUTEX_UNLOCK(Inbound_Control.w1_monitor->master.w1_monitor.read_mutex) ; LEVEL_DEBUG("Pre-parse header: %u bytes len=%u type=%u seq=%u|%u pid=%u",recv_len,peek_nlm.nlmsg_len,peek_nlm.nlmsg_type,NL_BUS(peek_nlm.nlmsg_seq),NL_SEQ(peek_nlm.nlmsg_seq),peek_nlm.nlmsg_pid); if (recv_len < 0) { ERROR_DEBUG("Netlink (w1) recv header error"); return gbBAD ; } // allocate space nlp->nlm = owmalloc( peek_nlm.nlmsg_len ) ; if ( nlp->nlm == NULL ) { LEVEL_DEBUG("Netlink (w1) Cannot allocate %d byte buffer for data",peek_nlm.nlmsg_len) ; return gbBAD ; } // read whole packet recv_len = recv( Inbound_Control.w1_monitor->pown->file_descriptor, &(nlp->nlm[0]), peek_nlm.nlmsg_len, 0 ); if (recv_len == -1) { ERROR_DEBUG("Netlink (w1) recv body error"); return gbBAD ; } if ( GOOD( Netlink_Parse_Buffer( nlp )) ) { LEVEL_DEBUG("Netlink read -----------------"); Netlink_Parse_Show( nlp ) ; return gbGOOD ; } return gbBAD ; } /* Reads a packet from a pipe that was originally a netlink packet */ /* allocate buffer but free unless able to read and parse nlm fully */ static GOOD_OR_BAD Get_and_Parse_Pipe( FILE_DESCRIPTOR_OR_ERROR file_descriptor, struct netlink_parse * nlp ) { struct nlmsghdr peek_nlm ; struct nlmsghdr * nlm ; size_t payload_length ; // first read start of message to get length and details if ( read( file_descriptor, &peek_nlm, W1_NLM_LENGTH ) != W1_NLM_LENGTH ) { ERROR_DEBUG("Pipe (w1) read header error"); return gbBAD ; } LEVEL_DEBUG("Pipe header: len=%u type=%u seq=%u|%u pid=%u ",peek_nlm.nlmsg_len,peek_nlm.nlmsg_type,NL_BUS(peek_nlm.nlmsg_seq),NL_SEQ(peek_nlm.nlmsg_seq),peek_nlm.nlmsg_pid); // allocate space nlm = owmalloc( peek_nlm.nlmsg_len ) ; nlp->nlm = nlm ; if ( nlm == NULL ) { LEVEL_DEBUG("Netlink (w1) Cannot allocate %d byte buffer for data", peek_nlm.nlmsg_len ) ; return gbBAD ; } memcpy( nlm, &peek_nlm, W1_NLM_LENGTH ) ; // copy header // read rest of packet if ( peek_nlm.nlmsg_len <= W1_NLM_LENGTH ) { owfree(nlm) ; LEVEL_DEBUG( "W1 packet error. Length is too short." ) ; return gbBAD ; } payload_length = peek_nlm.nlmsg_len - W1_NLM_LENGTH ; if ( read( file_descriptor, NLMSG_DATA(nlm), payload_length ) != (ssize_t) payload_length ) { owfree(nlm) ; nlp->nlm = NULL ; ERROR_DEBUG("Pipe (w1) read payload error"); return gbBAD ; } if ( BAD( Netlink_Parse_Buffer( nlp )) ) { LEVEL_DEBUG("Buffer parsing error"); owfree(nlm) ; nlp->nlm = NULL ; return gbBAD ; } // Good, the receiving routine should owfree buffer LEVEL_DEBUG("Pipe read --------------------"); Netlink_Parse_Show( nlp ) ; return gbGOOD ; } static void Netlink_Parse_Show( struct netlink_parse * nlp ) { Netlink_Print( nlp->nlm, nlp->cn, nlp->w1m, nlp->w1c, nlp->data, nlp->data_size ) ; } enum Netlink_Read_Status W1_Process_Response( void (* nrs_callback)( struct netlink_parse * nlp, void * v, const struct parsedname * pn), SEQ_OR_ERROR seq, void * v, const struct parsedname * pn ) { struct connection_in * in = pn->selected_connection ; FILE_DESCRIPTOR_OR_ERROR file_descriptor ; int bus ; if ( seq == SEQ_BAD ) { return nrs_bad_send ; } if ( in == NO_CONNECTION ) { // Send to main netlink rather than a particular bus file_descriptor = FILE_DESCRIPTOR_BAD ; bus = 0 ; } else { // Bus-specifc file_descriptor = in->master.w1.netlink_pipe[fd_pipe_read] ; bus = in->master.w1.id ; } while ( GOOD( W1PipeSelect_timeout(file_descriptor)) ) { struct netlink_parse nlp ; nlp.nlm = NULL ; LEVEL_DEBUG("Loop waiting for netlink piped message"); if ( BAD( Get_and_Parse_Pipe( file_descriptor, &nlp )) ) { LEVEL_DEBUG("Error reading pipe for w1_bus_master%d",bus); // Don't need to free since nlm not set if BAD return nrs_error ; } if ( NL_SEQ(nlp.nlm->nlmsg_seq) != NL_SEQ(seq) ) { LEVEL_DEBUG("Netlink sequence number out of order"); owfree(nlp.nlm) ; continue ; } if ( nlp.w1m->status != 0) { owfree(nlp.nlm) ; return nrs_nodev ; } if ( nrs_callback == NULL ) { // bus reset owfree(nlp.nlm) ; return nrs_complete ; } LEVEL_DEBUG("About to call nrs_callback"); nrs_callback( &nlp, v, pn ) ; LEVEL_DEBUG("Called nrs_callback"); owfree(nlp.nlm) ; if ( nlp.cn->seq != nlp.cn->ack ) { if ( nlp.w1m->type == W1_LIST_MASTERS ) { continue ; // look for more data } if ( nlp.w1c && (nlp.w1c->cmd==W1_CMD_SEARCH || nlp.w1c->cmd==W1_CMD_ALARM_SEARCH) ) { continue ; // look for more data } } return nrs_complete ; // status message } return nrs_timeout ; } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_print.c0000644000175000001440000000726312654730021015553 00000000000000/* $Id$ W1 Announce -- daemon for showing w1 busmasters using Avahi Written 2008 Paul H Alfille email: paul.alfille@gmail.com Released under the GPLv2 Much thanks to Evgeniy Polyakov This file itself is amodestly modified version of w1d by Evgeniy Polyakov */ /* * Copyright (c) 2004 Evgeniy Polyakov * * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "owfs_config.h" #if OW_W1 #include "ow_w1.h" #include "ow_connection.h" #define printcase( flag ) case flag: printf(#flag); break static void NLM_print( struct nlmsghdr * nlm ) { if ( nlm == NULL ) { printf("NLMSGHDR: NULL nlm field\n") ; return ; } printf("NLMSGHDR: len=%u type=%u (",nlm->nlmsg_len, nlm->nlmsg_type) ; switch ( nlm->nlmsg_type ) { printcase( NLMSG_NOOP ); printcase( NLMSG_ERROR ); printcase( NLMSG_DONE ); printcase( NLMSG_OVERRUN ); default: printf("NLMSG unknown message type %d",nlm->nlmsg_type); break ; } printf(") flags=%u seq=%u|%u pid=%u\n",nlm->nlmsg_flags, NL_BUS(nlm->nlmsg_seq), NL_SEQ(nlm->nlmsg_seq), nlm->nlmsg_pid ) ; } static void CN_print( struct cn_msg * cn ) { if ( cn == NULL ) { printf("CN_MSG: NULL cn field\n") ; return ; } printf("CN_MSG: idx/val=%u/%u (",cn->id.idx,cn->id.val) ; switch(cn->id.idx) { printcase( CN_IDX_PROC ); printcase( CN_IDX_CIFS ); printcase( CN_W1_IDX ); printcase( CN_IDX_V86D ); default: printf("CN unknown message type %d",cn->id.idx); break ; } printf(") seq=%u|%u ack=%u len=%u flags=%u\n",NL_BUS(cn->seq),NL_SEQ(cn->seq),cn->ack,cn->len,cn->flags) ; } static void W1M_print( struct w1_netlink_msg * w1m ) { if ( w1m == NULL ) { printf("W1_NETLINK_MSG: NULL w1m field\n") ; return ; } printf("W1_NETLINK_MSG: type=%u (",w1m->type) ; switch(w1m->type) { printcase( W1_SLAVE_ADD ); printcase( W1_SLAVE_REMOVE ); printcase( W1_MASTER_ADD ); printcase( W1_MASTER_REMOVE ); printcase( W1_MASTER_CMD ); printcase( W1_SLAVE_CMD ); printcase( W1_LIST_MASTERS ); default: printf("W1_NETLINK_MSG unknown message type %d",w1m->type); break ; } printf(") len=%u id=%u\n",w1m->len, w1m->id.mst.id ) ; } static void W1C_print( struct w1_netlink_cmd * w1c ) { if ( w1c == NULL ) { printf("W1_NETLINK_CMD: NULL w1c field\n") ; return ; } printf("W1_NETLINK_CMD: cmd=%u (",w1c->cmd ) ; switch(w1c->cmd) { printcase( W1_CMD_READ ); printcase( W1_CMD_WRITE ); printcase( W1_CMD_SEARCH ); printcase( W1_CMD_ALARM_SEARCH ); printcase( W1_CMD_TOUCH ); printcase( W1_CMD_RESET ); default: printf("W1_NETLINK_CMD unknown message type %d",w1c->cmd); break ; } printf(") len=%u\n", w1c->len) ; } void Netlink_Print( struct nlmsghdr * nlm, struct cn_msg * cn, struct w1_netlink_msg * w1m, struct w1_netlink_cmd * w1c, unsigned char * data, int length ) { if ( Globals.error_level>=e_err_call ) { NLM_print( nlm ) ; CN_print( cn ) ; W1M_print( w1m ) ; W1C_print( w1c ) ; if ( data != NULL ) { _Debug_Bytes("Data", data, length) ; } else { printf("NULL data\n"); } } } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_scan.c0000644000175000001440000000454412654730021015342 00000000000000/* $Id$ W1 Announce -- daemon for showing w1 busmasters using Avahi Written 2008 Paul H Alfille email: paul.alfille@gmail.com Released under the GPLv2 Much thanks to Evgeniy Polyakov This file itself is amodestly modified version of w1d by Evgeniy Polyakov */ /* * w1d.c * * Copyright (c) 2004 Evgeniy Polyakov * * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "owfs_config.h" #if OW_W1 #include "ow_w1.h" #include "ow_connection.h" void * w1_master_command(void * v) { struct netlink_parse * nlp = v ; // This is a structure that was allocated in Dispatch_Packet() // It needs to be destroyed before this (detached) thread is finished. DETACH_THREAD; if ( nlp->nlm->nlmsg_pid != 0 ) { LEVEL_DEBUG("Netlink packet PID not from kernel"); } else if (nlp->w1m) { int bus_master = nlp->w1m->id.mst.id ; switch (nlp->w1m->type) { case W1_LIST_MASTERS: LEVEL_DEBUG("Netlink (w1) list all bus masters"); w1_parse_master_list( nlp ); break; case W1_MASTER_ADD: LEVEL_DEBUG("Netlink (w1) add a bus master"); AddW1Bus(bus_master) ; break; case W1_MASTER_REMOVE: LEVEL_DEBUG("Netlink (w1) remove a bus master"); RemoveW1Bus(bus_master) ; break; case W1_SLAVE_ADD: case W1_SLAVE_REMOVE: // ignored since there is no bus attribution and real use will discover the change. // at some point we could make the w1 master lists static and only changed when triggered by one of these messages. LEVEL_DEBUG("Netlink (w1) Slave announcements (ignored)"); break ; default: LEVEL_DEBUG("Netlink (w1) Other command."); break ; } } owfree(nlp) ; return VOID_RETURN ; } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_select.c0000644000175000001440000000435012654730021015670 00000000000000/* W1 Announce -- daemon for showing w1 busmasters using Avahi Written 2008 Paul H Alfille email: paul.alfille@gmail.com Released under the GPLv2 Much thanks to Evgeniy Polyakov This file itself is amodestly modified version of w1d by Evgeniy Polyakov */ /* * w1d.c * * Copyright (c) 2004 Evgeniy Polyakov * * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "owfs_config.h" #if OW_W1 #include "ow_w1.h" #include "ow_connection.h" /* Wait for a netlink packet */ GOOD_OR_BAD W1PipeSelect_timeout( FILE_DESCRIPTOR_OR_ERROR file_descriptor ) { do { int select_value ; struct timeval tv = { Globals.timeout_w1, 0 } ; fd_set readset ; FD_ZERO(&readset) ; FD_SET(file_descriptor,&readset) ; select_value = select(file_descriptor+1,&readset,NULL,NULL,&tv) ; if ( select_value == -1 ) { if (errno != EINTR) { ERROR_CONNECT("Netlink (w1) Select error"); return gbBAD ; } } else if ( select_value == 0 ) { struct timeval now ; struct timeval diff ; timernow( &now ); // Set time of last read _MUTEX_LOCK(Inbound_Control.w1_monitor->master.w1_monitor.read_mutex) ; timersub( &now, &(Inbound_Control.w1_monitor->master.w1_monitor.last_read), &diff ); _MUTEX_UNLOCK(Inbound_Control.w1_monitor->master.w1_monitor.read_mutex) ; if ( diff.tv_sec <= Globals.timeout_w1 ) { LEVEL_DEBUG("Select legal timeout -- try again"); continue ; } LEVEL_DEBUG("Select returned zero (timeout)"); return gbBAD; } else { return gbGOOD ; } } while (1) ; } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_w1_send.c0000644000175000001440000001113112654730021015335 00000000000000/* $Id$ W1 Announce -- daemon for showing w1 busmasters using Avahi Written 2008 Paul H Alfille email: paul.alfille@gmail.com Released under the GPLv2 Much thanks to Evgeniy Polyakov This file itself is amodestly modified version of w1d by Evgeniy Polyakov */ /* * w1d.c * * Copyright (c) 2004 Evgeniy Polyakov * * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "owfs_config.h" #if OW_W1 #include "ow_w1.h" #include "ow_connection.h" /* If cmd is specified, msg length will be adjusted */ /* Build a netlink message, rather tediously, from all the components * making the internal flags, length fields and headers be correct */ SEQ_OR_ERROR W1_send_msg( struct connection_in * in, struct w1_netlink_msg *msg, struct w1_netlink_cmd *cmd, const unsigned char * data) { // outer structure -- nlm = netlink message struct nlmsghdr *nlm; // second structure -- cn = connection message struct cn_msg *cn; // third structure w1m = w1 message to the bus master struct w1_netlink_msg *w1m; // optional fourth w1c = w1 command to a device struct w1_netlink_cmd *w1c; unsigned char * pdata ; int data_size ; SEQ_OR_ERROR seq ; int bus ; int nlm_payload; // NULL connection for initial LIST_MASTERS, not assigned to a specific bus if ( in == NO_CONNECTION ) { // w1 root bus (scanner) // need to lock master w1 before incrementing _MUTEX_LOCK(Inbound_Control.w1_monitor->master.w1_monitor.seq_mutex) ; seq = ++Inbound_Control.w1_monitor->master.w1_monitor.seq ; _MUTEX_UNLOCK(Inbound_Control.w1_monitor->master.w1_monitor.seq_mutex) ; bus = 0 ; } else { // w1 subsidiary bus // this bus is locked seq = ++in->master.w1.seq ; bus = in->master.w1.id; } // figure out the full message length and allocate space nlm_payload = W1_CN_LENGTH + W1_W1M_LENGTH ; // default length before data if ( cmd == NULL ) { // no command data_size = msg->len ; } else { data_size = cmd->len ; // command data length // add command field nlm_payload += W1_W1C_LENGTH ; } // add data length nlm_payload += data_size ; nlm = owmalloc( NLMSG_SPACE(nlm_payload) ); if (nlm==NULL) { // memory allocation error return SEQ_BAD; } // set the nlm fields memset(nlm, 0, NLMSG_SPACE(nlm_payload) ); nlm->nlmsg_seq = MAKE_NL_SEQ( bus, seq ); nlm->nlmsg_type = NLMSG_DONE; nlm->nlmsg_len = NLMSG_LENGTH(nlm_payload) ; // full message //nlm->nlmsg_flags = NLM_F_REQUEST ; // required for userspace -> kernel nlm->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK ; // respond, please nlm->nlmsg_pid = Inbound_Control.w1_monitor->master.w1_monitor.pid ; // set the cn fields cn = (struct cn_msg *) NLMSG_DATA(nlm) ; // just after nlm field cn->id.idx = CN_W1_IDX; cn->id.val = CN_W1_VAL; cn->seq = nlm->nlmsg_seq; cn->ack = cn->seq; // intentionally non-zero ; cn->flags = 0 ; cn->len = nlm_payload - W1_CN_LENGTH ; // size not including nlm or cn // set the w1m (and optionally w1c) fields w1m = (struct w1_netlink_msg *)(cn + 1); // just after cn field memcpy(w1m, msg, W1_W1M_LENGTH); w1m->len = cn->len - W1_W1M_LENGTH ; // size minus nlm, cn and w1m if ( cmd == NULL ) { // no command w1c = NULL ; pdata = (unsigned char *)(w1m + 1); // data just after w1m } else { w1c = (struct w1_netlink_cmd *)(w1m + 1); // just after w1m pdata = (unsigned char *)(w1c + 1); // data just after w1c memcpy(w1c, cmd, W1_W1C_LENGTH); // set command } if ( data_size > 0 ) { memcpy(pdata, data, data_size); } else { pdata = NULL ; // no data } LEVEL_DEBUG("Netlink send -----------------"); Netlink_Print( nlm, cn, w1m, w1c, pdata, data_size ) ; if ( send( Inbound_Control.w1_monitor->pown->file_descriptor, nlm, NLMSG_SPACE(nlm_payload), 0) == -1 ) { //err = COM_write( nlm, nlm_size, Inbound_Control.w1.monitor ) ; owfree(nlm); ERROR_CONNECT("Failed to send w1 netlink message"); return SEQ_BAD ; } owfree(nlm); LEVEL_DEBUG("NETLINK sent seq=%d", (int) seq); return seq; } #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/c/ow_write.c0000644000175000001440000004767312711737666015173 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_counters.h" #include "ow_connection.h" /* ------- Prototypes ----------- */ static ZERO_OR_ERROR FS_w_given_bus(struct one_wire_query *owq); static ZERO_OR_ERROR FS_w_settings(struct one_wire_query *owq); static ZERO_OR_ERROR FS_w_interface(struct one_wire_query *owq); static ZERO_OR_ERROR FS_w_local(struct one_wire_query *owq); static ZERO_OR_ERROR FS_w_simultaneous(struct one_wire_query *owq); static ZERO_OR_ERROR FS_write_owq(struct one_wire_query *owq); static ZERO_OR_ERROR FS_write_all( struct one_wire_query *owq_all ) ; static ZERO_OR_ERROR FS_write_all_bits( struct one_wire_query *owq_all ); static ZERO_OR_ERROR FS_write_a_bit(struct one_wire_query *owq_bit); static ZERO_OR_ERROR FS_write_in_parts( struct one_wire_query *owq_all ); static ZERO_OR_ERROR FS_write_a_part( struct one_wire_query *owq_part ); static ZERO_OR_ERROR FS_write_as_bits( struct one_wire_query *owq_byte ) ; static ZERO_OR_ERROR FS_write_real(int depth, struct one_wire_query *owq) ; static ZERO_OR_ERROR FS_write_post_stats(struct one_wire_query *owq) ; static ZERO_OR_ERROR FS_write_post_input(struct one_wire_query *owq) ; /* ---------------------------------------------- */ /* Filesystem callback functions */ /* ---------------------------------------------- */ /* Note on return values: */ /* Top level FS_write will return size if ok, else a negative number */ /* Each lower level function called will return 0 if ok, else non-zero */ /* Note on size and offset: */ /* Buffer length (and requested data) is size bytes */ /* writing should start after offset bytes in original data */ /* only binary, and ascii data support offset in single data points */ /* only binary supports offset in array data */ /* size and offset are vetted against specification data size and calls */ /* outside of this module will not have buffer overflows */ /* I.e. the rest of owlib can trust size and buffer to be legal */ /* Format of input, Depends on "filetype" type function format Handled as integer strol decimal integer integer array unsigned strou decimal integer unsigned array bitfield strou decimal integer unsigned array yesno strcmp "0" "1" "yes" "no" "on" "off" unsigned array float strod decimal floating point double array date strptime "Jan 01, 1901", etc date array ascii strcpy string without "," or null comma-separated-strings binary memcpy fixed length binary string binary "string" */ /* return size if ok, else negative */ SIZE_OR_ERROR FS_write(const char *path, const char *buf, const size_t size, const off_t offset) { ZERO_OR_ERROR write_return; OWQ_allocate_struct_and_pointer(owq); LEVEL_CALL("path=%s size=%d offset=%d", SAFESTRING(path), (int) size, (int) offset); // parsable path? if ( OWQ_create(path, owq) != 0 ) { // for write return -ENOENT; } OWQ_assign_write_buffer(buf, size, offset, owq) ; write_return = FS_write_postparse(owq); OWQ_destroy(owq); return write_return; /* here's where the size is used! */ } /* return size if ok, else negative */ SIZE_OR_ERROR FS_write_postparse(struct one_wire_query *owq) { ZERO_OR_ERROR write_or_error; struct parsedname *pn = PN(owq); if (Globals.readonly) { LEVEL_DEBUG("Attempt to write but readonly set on command line."); return -EROFS; // read-only invokation } if (IsDir(pn) && !(BusIsServer(pn->selected_connection))) { LEVEL_DEBUG("Attempt to write to a directory."); return -EISDIR; // not a file } STATLOCK; AVERAGE_IN(&write_avg); AVERAGE_IN(&all_avg); ++write_calls; /* statistics */ STATUNLOCK; write_or_error = FS_write_post_stats( owq ) ; STATLOCK; // write_or_error is still ZERO_OR_ERROR mode if ( write_or_error == 0 ) { LEVEL_DEBUG("Successful write to %s",pn->path) ; } else { LEVEL_DEBUG("Error writing to %s",pn->path) ; } if (write_or_error == 0) { ++write_success; /* statistics */ write_bytes += OWQ_size(owq); /* statistics */ // write_or_error now SIZE_OR_ERROR mode write_or_error = OWQ_size(owq); /* here's where the size is used! */ } AVERAGE_OUT(&write_avg); AVERAGE_OUT(&all_avg); STATUNLOCK; return write_or_error; } /* return 0 if ok, else negative */ /* Handles 3-peat */ static ZERO_OR_ERROR FS_write_post_stats(struct one_wire_query *owq) { // Parse the data to be written ZERO_OR_ERROR input_or_error = OWQ_parse_input(owq); Debug_OWQ(owq); if (input_or_error < 0) { LEVEL_DEBUG("Error interpreting input value.") ; return input_or_error ; } return FS_write_post_input( owq ) ; } /* return 0 if ok, else negative */ /* Handles 3-peat */ static ZERO_OR_ERROR FS_write_post_input(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); // Write differently depending on the type of directory switch (pn->type) { case ePN_structure: case ePN_statistics: case ePN_system: // No writable features here LEVEL_DEBUG("Cannot write in this type of directory.") ; return -ENOTSUP; case ePN_settings: return FS_w_settings(owq); case ePN_real: // ePN_real /* handle DeviceSimultaneous */ if (pn->selected_device == DeviceSimultaneous) { /* writing to /simultaneous/temperature will write to ALL * available bus.?/simultaneous/temperature * not just /simultaneous/temperature */ return FS_w_simultaneous(owq); } else if (pn->selected_connection == NO_CONNECTION) { LEVEL_DEBUG("Attempt to write but no 1-wire bus master."); return -ENODEV; // no buses } else { // Normal path for most writes to actual devices return FS_write_real(0,owq) ; // start with 0 depth } case ePN_interface: return FS_w_interface(owq) ; case ePN_root: default: return -ENOTSUP ; } } /* write to a real 1-wire device */ /* If error, try twice more */ static ZERO_OR_ERROR FS_write_real(int depth, struct one_wire_query *owq) { ZERO_OR_ERROR write_or_error; struct parsedname *pn = PN(owq); struct filetype * ft = pn->selected_filetype ; INDEX_OR_ERROR initial_bus = pn->selected_connection->index ; // current selected bus INDEX_OR_ERROR rechecked_bus ; if ( depth > 1 ) { LEVEL_DEBUG("Too many bus changes for write"); return -ENODEV ; } if ( (ft != NO_FILETYPE) && (ft->write == FS_w_alias) ) { // Special check for alias // it's ok for fake and tester and mock as well // so do this before the fake test // also no need to three-peat. return FS_write_owq(owq) ; } /* Special case for "fake" adapter */ switch (get_busmode(pn->selected_connection)) { case bus_mock: // Mock -- write even "unwritable" to the cache for testing OWQ_Cache_Add(owq) ; // fall through case bus_fake: case bus_tester: return ( ft->write == NO_WRITE_FUNCTION ) ? -ENOTSUP : 0 ; default: // non-virtual devices get handled below break ; } /* First try */ /* in and bus_nr already set */ STAT_ADD1(write_tries[0]); write_or_error = FS_w_given_bus(owq); if ( write_or_error ==0 ) { return 0 ; } /* Second Try */ STAT_ADD1(write_tries[1]); if (SpecifiedBus(pn)) { // The bus number casn't be changed -- it was specified in the path write_or_error = FS_w_given_bus(owq); if ( write_or_error == 0 ) { return 0 ; } // The bus number casn't be changed -- it was specified in the path STAT_ADD1(write_tries[2]); return FS_w_given_bus(owq); } /* Recheck location */ /* if not a specified bus, relook for chip location */ rechecked_bus = ReCheckPresence(pn) ; if ( rechecked_bus < 0 ) { // can't find the location return -ENOENT ; } if ( initial_bus == rechecked_bus ) { // special handling for remote // only repeat if the bus number is wrong // because the remote does the rewrites if (BusIsServer(pn->selected_connection)) { return write_or_error ; } // try again STAT_ADD1(write_tries[1]); write_or_error = FS_w_given_bus(owq); if ( write_or_error == 0 ) { return 0 ; } // third try STAT_ADD1(write_tries[2]); return FS_w_given_bus(owq); } // Changed location retry everything LEVEL_DEBUG("Bus location changed from %d to %d\n",initial_bus,rechecked_bus); return FS_write_real(depth+1,owq); } struct simultaneous_struct { struct port_in * pin ; struct connection_in * cin; struct one_wire_query owq ; }; static void * Simultaneous_write_callback_conn(void * v) { struct simultaneous_struct *ss = (struct simultaneous_struct *) v; struct simultaneous_struct ss_next ; pthread_t thread; int threadbad = 0; if ( ss->cin == NULL ) { return VOID_RETURN; } ss_next.cin = ss->cin->next ; if ( ss_next.cin == NO_CONNECTION ) { threadbad = 1 ; } else { ss_next.pin = ss->pin ; memcpy( &(ss_next.owq), &(ss->owq), sizeof(struct one_wire_query)); // shallow copy threadbad = pthread_create(&thread, DEFAULT_THREAD_ATTR, Simultaneous_write_callback_conn, (void *) (&ss_next)) ; } SetKnownBus(ss->cin->index, PN( &(ss->owq)) ); FS_w_given_bus( &(ss->owq) ); if (threadbad == 0) { /* was a thread created? */ pthread_join(thread, NULL) ; } return VOID_RETURN ; } static void * Simultaneous_write_callback_port(void * v) { struct simultaneous_struct *ss = (struct simultaneous_struct *) v; struct simultaneous_struct ss_next ; pthread_t thread; int threadbad = 0; if ( ss->pin == NULL ) { return VOID_RETURN; } ss_next.pin = ss->pin->next ; if ( ss_next.pin == NULL ) { threadbad = 1 ; } else { memcpy( &(ss_next.owq), &(ss->owq), sizeof(struct one_wire_query)); // shallow copy threadbad = pthread_create(&thread, DEFAULT_THREAD_ATTR, Simultaneous_write_callback_port, (void *) (&ss_next)) ; } ss->cin = ss->pin->first ; Simultaneous_write_callback_conn(v) ; if (threadbad == 0) { /* was a thread created? */ pthread_join(thread, NULL) ; } return VOID_RETURN ; } /* This function is only used by "Simultaneous" */ static ZERO_OR_ERROR FS_w_simultaneous(struct one_wire_query *owq) { if (SpecifiedBus(PN(owq))) { return FS_w_given_bus(owq); } else { struct simultaneous_struct ss ; ss.pin = Inbound_Control.head_port ; memcpy( &(ss.owq), owq, sizeof(struct one_wire_query)); // shallow copy Simultaneous_write_callback_port( (void *) (&ss) ) ; } return 0; } /* Write to interface dir */ static ZERO_OR_ERROR FS_w_interface(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if ( pn->selected_connection == NO_CONNECTION ) { LEVEL_DEBUG("Attempt to write to no bus for /settings"); return -ENODEV ; } else if ( SpecifiedLocalBus(pn) ) { return FS_w_local(owq); } else { return ServerWrite(owq); } } /* Write to settings dir */ static ZERO_OR_ERROR FS_w_settings(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if ( BAD(TestConnection(pn)) ) { // safe for connection_in == NULL return -ECONNABORTED; } else if (KnownBus(pn) && BusIsServer(pn->selected_connection)) { return ServerWrite(owq); } else if ( pn->selected_connection != NO_CONNECTION ) { LEVEL_DEBUG("Attempt to write to local bus for /settings"); return -ENODEV ; } else { return FS_w_local(owq); } } /* Write now that connection is set */ static ZERO_OR_ERROR FS_w_given_bus(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); if ( BAD(TestConnection(pn)) ) { return -ECONNABORTED; } else if (KnownBus(pn) && BusIsServer(pn->selected_connection)) { return ServerWrite(owq); } else if (OWQ_pn(owq).type == ePN_real) { ZERO_OR_ERROR write_or_error = DeviceLockGet(pn); if (write_or_error == 0) { write_or_error = FS_w_local(owq); DeviceLockRelease(pn); } else { LEVEL_DEBUG("Cannot lock device for writing") ; } return write_or_error ; } else if ( IsInterfaceDir(pn) ) { ZERO_OR_ERROR write_or_error; BUSLOCK(pn); write_or_error = FS_w_local(owq); BUSUNLOCK(pn); return write_or_error ; } else { return FS_w_local(owq); } } /* return 0 if ok */ static ZERO_OR_ERROR FS_w_local(struct one_wire_query *owq) { // Device already locked struct parsedname *pn = PN(owq); struct filetype * ft = pn->selected_filetype ; /* Writable? */ if ( ft->write == NO_WRITE_FUNCTION ) { return -ENOTSUP; } /* Special case for "fake" adapter */ switch (get_busmode(pn->selected_connection)) { case bus_mock: case bus_fake: case bus_tester: return 0 ; default: // non-virtual devices get handled below break ; } /* Non-array? */ if ( ft->ag == NON_AGGREGATE ) { LEVEL_DEBUG("Write a non-array element %s",pn->path); return FS_write_owq(owq); } /* array */ switch ( ft->ag->combined ) { case ag_sparse: // avoid cache return (ft->write) (owq); case ag_aggregate: switch (pn->extension) { case EXTENSION_BYTE: LEVEL_DEBUG("Write an aggregate .BYTE %s",pn->path); return FS_write_owq(owq); case EXTENSION_ALL: LEVEL_DEBUG("Write an aggregate .ALL %s",pn->path); return FS_write_all(owq); default: LEVEL_DEBUG("Write an aggregate element %s",pn->path); return FS_write_a_part(owq) ; } case ag_mixed: switch (pn->extension) { case EXTENSION_BYTE: LEVEL_DEBUG("Write a mixed .BYTE %s",pn->path); OWQ_Cache_Del_parts(owq); return FS_write_owq(owq); case EXTENSION_ALL: LEVEL_DEBUG("Write a mixed .ALL %s",pn->path); OWQ_Cache_Del_parts(owq); return FS_write_all(owq); default: LEVEL_DEBUG("Write a mixed element %s",pn->path); OWQ_Cache_Del_ALL(owq); OWQ_Cache_Del_BYTE(owq); return FS_write_owq(owq); } case ag_separate: switch (pn->extension) { case EXTENSION_BYTE: LEVEL_DEBUG("Write a separate .BYTE %s",pn->path); return FS_write_as_bits(owq); case EXTENSION_ALL: LEVEL_DEBUG("Write a separate .ALL %s",pn->path); return FS_write_in_parts(owq); default: LEVEL_DEBUG("Write a separate element %s",pn->path); return FS_write_owq(owq); } default: return -ENOENT ; } } static ZERO_OR_ERROR FS_write_owq(struct one_wire_query *owq) { ZERO_OR_ERROR write_error = (OWQ_pn(owq).selected_filetype->write) (owq); OWQ_Cache_Del(owq) ; // Delete anyways LEVEL_DEBUG("Write %s Extension %d Gives result %d",PN(owq)->path,PN(owq)->extension,write_error); return write_error; } /* Write just one field of an aggregate property -- but a property that is handled as one big object */ // Handles .n static ZERO_OR_ERROR FS_write_a_part( struct one_wire_query *owq_part ) { struct parsedname *pn = PN(owq_part); size_t extension = pn->extension; struct filetype * ft = pn->selected_filetype ; ZERO_OR_ERROR z_or_e ; struct one_wire_query * owq_all ; // bitfield if ( ft->format == ft_bitfield ) { return FS_write_a_bit( owq_part ) ; } // non-bitfield owq_all = OWQ_create_aggregate( owq_part ) ; if ( owq_all == NO_ONE_WIRE_QUERY ) { return -ENOENT ; } // First fill the whole array with current values if ( FS_read_local( owq_all ) < 0 ) { OWQ_destroy( owq_all ) ; return -ENOENT ; } // Copy ascii/binary field switch (ft->format) { case ft_binary: case ft_ascii: case ft_vascii: case ft_alias: { size_t extension_index; size_t elements = ft->ag->elements; char *buffer_pointer = OWQ_buffer(owq_all); char *entry_pointer; char *target_pointer; // All prior elements for (extension_index = 0; extension_index < extension; ++extension) { // move past their buffer position buffer_pointer += OWQ_array_length(owq_all, extension_index); } entry_pointer = buffer_pointer; // this element's buffer start target_pointer = buffer_pointer + OWQ_length(owq_part); // new start next element buffer_pointer = buffer_pointer + OWQ_array_length(owq_all, extension); // current start next element // move rest of elements to new locations for (extension_index = extension + 1; extension_index < elements; ++extension_index ) { size_t this_length = OWQ_array_length(owq_all, extension_index); memmove(target_pointer, buffer_pointer, this_length); target_pointer += this_length; buffer_pointer += this_length; } // now move current element's buffer to location memmove(entry_pointer, OWQ_buffer(owq_part), OWQ_length(owq_part)); OWQ_array_length(owq_all,extension) = OWQ_length(owq_part) ; } break; default: // Copy value field memcpy(&OWQ_array(owq_all)[pn->extension], &OWQ_val(owq_part), sizeof(union value_object)); break; } // Write whole thing out z_or_e = FS_write_owq(owq_all); OWQ_destroy(owq_all); return z_or_e ; } // Write a whole aggregate array (treated as a single large value ) // handles ALL static ZERO_OR_ERROR FS_write_all( struct one_wire_query * owq_all ) { // bitfield, convert to .BYTE format and write ( and delete cache ) as BYTE. if ( OWQ_pn(owq_all).selected_filetype->format == ft_bitfield ) { return FS_write_all_bits( owq_all ) ; } return FS_write_owq( owq_all ) ; } /* Takes ALL to individual, no need for the cache */ // Handles: ALL static ZERO_OR_ERROR FS_write_in_parts( struct one_wire_query *owq_all ) { struct one_wire_query * owq_part = OWQ_create_separate( 0, owq_all ) ; struct parsedname *pn = PN(owq_all); size_t elements = pn->selected_filetype->ag->elements; size_t extension ; char *buffer_pointer; ZERO_OR_ERROR z_or_e = 0 ; // Create a "single" OWQ copy to iterate with if ( owq_part == NO_ONE_WIRE_QUERY ) { return -ENOENT ; } // create a buffer for certain types // point to 0th element's buffer first buffer_pointer = OWQ_buffer(owq_all); size_t fileSize = FileLength(PN(owq_part)); OWQ_offset(owq_part) = 0; // loop through all eloements for (extension = 0; extension < elements; ++extension) { ZERO_OR_ERROR single_write; switch (pn->selected_filetype->format) { case ft_ascii: case ft_vascii: case ft_alias: case ft_binary: OWQ_length(owq_part) = OWQ_size(owq_part) = OWQ_array_length(owq_all,extension) ; OWQ_buffer(owq_part) = buffer_pointer; buffer_pointer += OWQ_size(owq_part); break; default: OWQ_size(owq_part) = fileSize; memcpy(&OWQ_val(owq_part), &OWQ_array(owq_all)[extension], sizeof(union value_object)); break; } OWQ_pn(owq_part).extension = extension; single_write = FS_write_owq(owq_part); if (single_write != 0) { z_or_e = single_write ; } } return z_or_e; } /* Write BYTE to bits */ // handles: BYTE static ZERO_OR_ERROR FS_write_as_bits( struct one_wire_query *owq_byte ) { struct one_wire_query * owq_bit = OWQ_create_separate( 0, owq_byte ) ; size_t elements = OWQ_pn(owq_byte).selected_filetype->ag->elements; size_t extension ; ZERO_OR_ERROR z_or_e = 0 ; if ( owq_bit == NO_ONE_WIRE_QUERY ) { return -ENOENT ; } for ( extension = 0 ; extension < elements ; ++extension ) { ZERO_OR_ERROR z ; OWQ_pn(owq_bit).extension = extension ; OWQ_Y(owq_bit) = UT_getbit_U( OWQ_U(owq_byte), extension ) ; z = FS_write_owq( owq_bit ) ; if ( z != 0 ) { z_or_e = z ; } } OWQ_destroy( owq_bit ) ; return z_or_e ; } /* Write ALL to BYTE */ // Handles: ALL static ZERO_OR_ERROR FS_write_all_bits( struct one_wire_query *owq_all ) { struct one_wire_query * owq_byte = ALLtoBYTE( owq_all ) ; ZERO_OR_ERROR z_or_e = -ENOENT ; if ( owq_byte != NO_ONE_WIRE_QUERY ) { z_or_e = FS_write_owq( owq_byte ) ; OWQ_destroy( owq_byte ) ; } return z_or_e ; } /* Write a bit in a BYTE */ // Handles: .n static ZERO_OR_ERROR FS_write_a_bit(struct one_wire_query *owq_bit) { struct one_wire_query * owq_byte = OWQ_create_separate( EXTENSION_BYTE, owq_bit ) ; ZERO_OR_ERROR z_or_e = -ENOENT ; if ( owq_byte != NO_ONE_WIRE_QUERY ) { if ( FS_read_local( owq_byte ) >= 0 ) { UT_setbit_U( &OWQ_U( owq_byte ), OWQ_pn(owq_bit).extension, OWQ_Y(owq_bit) ) ; z_or_e = FS_write_owq( owq_byte ) ; } OWQ_destroy( owq_byte ) ; } return z_or_e ; } // Used for sibling write -- bus already locked, and it's local ZERO_OR_ERROR FS_write_local(struct one_wire_query *owq) { return FS_w_local(owq); } owfs-3.1p5/module/owlib/src/c/ow_write_external.c0000644000175000001440000001046212654730021017037 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_external.h" /* strategy for external write: A common write function for all communication schemes e.g. script The actual device record and actual family record is obtained from the trees. The script is called (via popen) or other method for other types The device should be locked for the communication arguments include fields from the tree records and owq the returned value is obvious */ static ZERO_OR_ERROR OW_trees_for_write( char * device, char * property, struct one_wire_query * owq ) ; static ZERO_OR_ERROR OW_write_external_script( struct sensor_node * sensor_n, struct property_node * property_n, struct one_wire_query * owq ) ; static ZERO_OR_ERROR OW_script_write( FILE * script_f, struct one_wire_query * owq ) ; // ------------------------ ZERO_OR_ERROR FS_w_external( struct one_wire_query * owq ) { ZERO_OR_ERROR zoe = -ENOENT ; // default char * device_property = owstrdup( PN(owq)->device_name ) ; // copy of device/property part of path if ( device_property != NULL ) { char * property = device_property ; char * device = strsep( &property, "/" ) ; // separate out property char * extension = property ; if ( property != NULL ) { // pare off extension property = strsep( &extension, "." ) ; } zoe = OW_trees_for_write( device, property, owq ) ; owfree( device_property ) ; // clean up } return zoe ; } static ZERO_OR_ERROR OW_trees_for_write( char * device, char * property, struct one_wire_query * owq ) { // find sensor node struct sensor_node * sense_n = Find_External_Sensor( device ) ; if ( sense_n != NULL ) { // found // find property node struct property_node * property_n = Find_External_Property( sense_n->family, property ) ; if ( property_n != NULL ) { switch ( property_n->et ) { case et_none: return 0 ; case et_internal: return -ENOTSUP ; case et_script: return OW_write_external_script( sense_n, property_n, owq ) ; default: return -ENOTSUP ; } } } return -ENOENT ; } static ZERO_OR_ERROR OW_write_external_script( struct sensor_node * sensor_n, struct property_node * property_n, struct one_wire_query * owq ) { char cmd[PATH_MAX+1] ; struct parsedname * pn = PN(owq) ; FILE * script_f ; int snp_return ; ZERO_OR_ERROR zoe ; // load the command script and arguments if ( pn->sparse_name == NULL ) { // not a text sparse name snp_return = snprintf( cmd, PATH_MAX+1, "%s %s %s %d %s %d %d %s %s", property_n->write, // command sensor_n->name, // sensor name property_n->property, // property, pn->extension, // extension "write", // mode (int) OWQ_size(owq), // size (int) OWQ_offset(owq), // offset sensor_n->data, // sensor-specific data property_n->data // property-specific data ) ; } else { snp_return = snprintf( cmd, PATH_MAX+1, "%s %s %s %s %s %d %d %s %s", property_n->write, // command sensor_n->name, // sensor name property_n->property, // property, pn->sparse_name, // extension "write", // mode (int) OWQ_size(owq), // size (int) OWQ_offset(owq), // offset sensor_n->data, // sensor-specific data property_n->data // property-specific data ) ; } if ( snp_return < 0 ) { LEVEL_DEBUG("Problem creating script string for %s/%s",sensor_n->name,property_n->property) ; return -EINVAL ; } script_f = popen( cmd, "w" ) ; if ( script_f == NULL ) { ERROR_DEBUG("Cannot create external program link for writing %s/%s",sensor_n->name,property_n->property); return -EIO ; } zoe = OW_script_write( script_f, owq ) ; pclose( script_f ) ; return zoe ; } static ZERO_OR_ERROR OW_script_write( FILE * script_f, struct one_wire_query * owq ) { size_t fr_return ; int po_return = OWQ_parse_output(owq) ; // load data in buffer if ( po_return < 0 ) { return -EINVAL ; } fr_return = fwrite( OWQ_buffer(owq), po_return, 1, script_f ) ; if ( fr_return == 0 && ferror(script_f) != 0 ) { LEVEL_DEBUG( "Could not write script data back for %s",PN(owq)->path ) ; return -EIO ; } return 0 ; } owfs-3.1p5/module/owlib/src/c/ow_zero.c0000644000175000001440000001035112654730021014757 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #if OW_ZERO #include #include #include static void RegisterBack(DNSServiceRef s, DNSServiceFlags f, DNSServiceErrorType e, const char *name, const char *type, const char *domain, void *v) ; static void Announce_Post_Register(DNSServiceRef sref, DNSServiceErrorType err) ; static void *Announce(void *v) ; /* Sent back from Bonjour -- arbitrarily use it to set the Ref for Deallocation */ static void RegisterBack(DNSServiceRef s, DNSServiceFlags f, DNSServiceErrorType e, const char *name, const char *type, const char *domain, void *v) { struct connection_out * out = v ; LEVEL_DETAIL ("RegisterBack ref=%d flags=%d error=%d name=%s type=%s domain=%s", s, f, e, SAFESTRING(name), SAFESTRING(type), SAFESTRING(domain)); if (e != kDNSServiceErr_NoError) { return ; } out->sref0 = s; SAFEFREE( out->zero.name ) ; out->zero.name = owstrdup(name) ; SAFEFREE( out->zero.type ) ; out->zero.type = owstrdup(type) ; SAFEFREE( out->zero.domain ) ; out->zero.domain = owstrdup(domain) ; } static void Announce_Post_Register(DNSServiceRef sref, DNSServiceErrorType err) { if (err == kDNSServiceErr_NoError) { DNSServiceProcessResult(sref); } else { LEVEL_CONNECT("Unsuccessful call to DNSServiceRegister err = %d", err); } } /* Register the out port with Bonjour -- might block so done in a separate thread */ static void *Announce(void *v) { struct connection_out *out = v; DNSServiceRef sref = 0; DNSServiceErrorType err; struct sockaddr sa; //socklen_t sl = sizeof(sa); socklen_t sl = 128; uint16_t port ; char * service_name ; char name[63] ; DETACH_THREAD; if (getsockname(out->file_descriptor, &sa, &sl)) { LEVEL_CONNECT("Could not get port number of device."); pthread_exit(NULL); return VOID_RETURN; } port = ntohs(((struct sockaddr_in *) (&sa))->sin_port) ; /* Add the service */ switch (Globals.program_type) { case program_type_httpd: service_name = (Globals.announce_name) ? Globals.announce_name : "OWFS (1-wire) Web" ; UCLIBCLOCK; snprintf(name,62,"%s <%d>",service_name,(int)port); UCLIBCUNLOCK; err = DNSServiceRegister(&sref, 0, 0, name,"_http._tcp", NULL, NULL, port, 0, NULL, RegisterBack, out) ; Announce_Post_Register(sref, err) ; err = DNSServiceRegister(&sref, 0, 0, name,"_owhttpd._tcp", NULL, NULL, port, 0, NULL, RegisterBack, out) ; break ; case program_type_server: case program_type_external: service_name = (Globals.announce_name) ? Globals.announce_name : "OWFS (1-wire) Server" ; UCLIBCLOCK; snprintf(name,62,"%s <%d>",service_name,(int)port); UCLIBCUNLOCK; err = DNSServiceRegister(&sref, 0, 0, name,"_owserver._tcp", NULL, NULL, port, 0, NULL, RegisterBack, out) ; break; case program_type_ftpd: service_name = (Globals.announce_name) ? Globals.announce_name : "OWFS (1-wire) FTP" ; UCLIBCLOCK; snprintf(name,62,"%s <%d>",service_name,(int)port); UCLIBCUNLOCK; err = DNSServiceRegister(&sref, 0, 0, name,"_owftp._tcp", NULL, NULL, port, 0, NULL, RegisterBack, out) ; break; default: err = kDNSServiceErr_NoError ; break ; } Announce_Post_Register(sref, err) ; LEVEL_DEBUG("Normal completion"); pthread_exit(NULL); return VOID_RETURN; } void ZeroConf_Announce(struct connection_out *out) { if ( Globals.announce_off) { return; } else if ( Globals.zero == zero_avahi ) { #if OW_AVAHI GOOD_OR_BAD oaa = OW_Avahi_Announce( out ) ; LEVEL_DEBUG( "Avahi (zero-configuration service) broadcast was %s successful",BAD(oaa)?"NOT":"") ; #endif /* OW_AVAHI */ } else if ( Globals.zero == zero_bonjour ) { pthread_t thread; int err = pthread_create(&thread, DEFAULT_THREAD_ATTR, Announce, (void *) out); if (err) { LEVEL_CONNECT("Zeroconf/Bonjour registration thread error %d.", err); } } } #else /* OW_ZERO */ void ZeroConf_Announce(struct connection_out *out) { (void) out; LEVEL_CONNECT("Zeroconf not enabled"); return; } #endif /* OW_ZERO */ owfs-3.1p5/module/owlib/src/c/owlib.c0000644000175000001440000001611012654730021014406 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_devices.h" #include "ow_pid.h" static void IgnoreSignals(void); static void SetupTemperatureLimits( void ); static void SetupInboundConnections(void); static GOOD_OR_BAD SetupSingleInboundConnection( struct port_in * pin ) ; /* Start the owlib process -- already in background */ GOOD_OR_BAD LibStart(void* v) { /* Start configuration monitoring */ Config_Monitor_Watch(v) ; /* Build device and filetype arrays (including externals) */ DeviceSort(); Globals.zero = zero_none ; #if OW_ZERO if ( OW_Load_dnssd_library() == 0 ) { Globals.zero = zero_bonjour ; } #endif /* OW_ZERO */ /* Initialize random number generator, make sure fake devices get the same * id each time */ srand(1); SetupTemperatureLimits() ; MONITOR_WLOCK ; SetupInboundConnections(); MONITOR_WUNLOCK ; // Signal handlers IgnoreSignals(); if ( Inbound_Control.head_port == NULL ) { LEVEL_DEFAULT("No valid 1-wire buses found"); return gbBAD ; } return gbGOOD ; } // only changes FAKE and MOCK temp limits // do it here after options are parsed to allow correction forr temperature scale static void SetupTemperatureLimits( void ) { struct parsedname pn; FS_ParsedName_Placeholder(&pn); // minimal parsename -- no destroy needed if ( Globals.templow < GLOBAL_UNTOUCHED_TEMP_LIMIT + 1 ) { Globals.templow = 0. ; // freezing point } else { Globals.templow = fromTemperature(Globals.templow,&pn) ; // internal scale } if ( Globals.temphigh < GLOBAL_UNTOUCHED_TEMP_LIMIT + 1 ) { Globals.temphigh = 100. ; // boiling point } else { Globals.temphigh = fromTemperature(Globals.temphigh,&pn) ; // internal scale } LEVEL_DEBUG("Global temp limit %gC to %gC (for fake and mock adapters)",Globals.templow,Globals.temphigh); } static void SetupInboundConnections(void) { struct port_in *pin = Inbound_Control.head_port; // cycle through connections analyzing them while (pin != NULL) { struct port_in * next = pin->next ; // read before potential delete if ( BAD( SetupSingleInboundConnection(pin) ) ) { RemovePort( pin ) ; } pin = next ; } } static GOOD_OR_BAD SetupSingleInboundConnection( struct port_in * pin ) { struct connection_in * in = pin->first ; switch (pin->busmode) { case bus_zero: if ( BAD( Zero_detect(pin) )) { LEVEL_CONNECT("Cannot open server at %s", DEVICENAME(in)); return gbBAD ; } break; case bus_server: if (BAD( Server_detect(pin)) ) { LEVEL_CONNECT("Cannot open server at %s -- first attempt.", DEVICENAME(in)); sleep(5); // delay to allow owserver to open it's listen socket if ( GOOD( Server_detect(pin)) ) { break ; } LEVEL_CONNECT("Cannot open server at %s -- second (and final) attempt.", DEVICENAME(in)); return gbBAD ; } break; case bus_serial: /* Set up DS2480/LINK interface */ if ( BAD( DS2480_detect(pin) )) { LEVEL_CONNECT("Cannot detect DS2480 or LINK interface on %s.", DEVICENAME(in)); } else { return gbGOOD ; } // Fall Through in->adapter_name = "DS9097"; // need to set adapter name for this approach to passive adapter case bus_passive: if ( BAD( DS9097_detect(pin) )) { LEVEL_DEFAULT("Cannot detect DS9097 (passive) interface on %s.", DEVICENAME(in)); return gbBAD ; } break; case bus_xport: if ( BAD( DS2480_detect(pin) )) { LEVEL_DEFAULT("Cannot detect DS2480B via telnet interface on %s.", DEVICENAME(in)); return gbBAD ; } break; case bus_i2c: #if OW_I2C if ( BAD( DS2482_detect(pin) )) { LEVEL_CONNECT("Cannot detect an i2c DS2482-x00 on %s", DEVICENAME(in)); return gbBAD ; } #endif /* OW_I2C */ break; case bus_ha7net: if ( BAD( HA7_detect(pin) )) { LEVEL_CONNECT("Cannot detect an HA7net server on %s", DEVICENAME(in)); return gbBAD ; } break; case bus_enet: if ( BAD( OWServer_Enet_detect(pin) )) { LEVEL_CONNECT("Cannot detect an OWServer_Enet on %s", DEVICENAME(in)); return gbBAD ; } break; case bus_ha5: if ( BAD( HA5_detect(pin) )) { LEVEL_CONNECT("Cannot detect an HA5 on %s", DEVICENAME(in)); return gbBAD ; } break; case bus_ha7e: if ( BAD( HA7E_detect(pin) )) { LEVEL_CONNECT("Cannot detect an HA7E/HA7S on %s", DEVICENAME(in)); return gbBAD ; } break; case bus_ds1wm: if ( BAD( DS1WM_detect(pin) )) { LEVEL_CONNECT("Cannot detect an DS1WM synthesized bus master at %s", DEVICENAME(in)); return gbBAD ; } break; case bus_k1wm: if ( BAD( K1WM_detect(pin) )) { LEVEL_CONNECT("Cannot detect an K1WM synthesized bus master at %s", DEVICENAME(in)); return gbBAD ; } break; case bus_parallel: #if OW_PARPORT if ( BAD( DS1410_detect(pin) )) { LEVEL_DEFAULT("Cannot detect the DS1410E parallel bus master"); return gbBAD ; } #endif /* OW_PARPORT */ break; case bus_usb: #if OW_USB /* in->master.usb.ds1420_address should be set to identify the * adapter just in case it's disconnected. It's done in the * DS9490_next_both() if not set. */ if ( BAD( DS9490_detect(pin) )) { LEVEL_DEFAULT("Cannot open USB bus master"); return gbBAD ; } #endif /* OW_USB */ break; case bus_link: if ( BAD( LINK_detect(pin) )) { LEVEL_CONNECT("Cannot open LINK bus master at %s", DEVICENAME(in)); return gbBAD ; } break; case bus_masterhub: if ( BAD( MasterHub_detect(pin) )) { LEVEL_CONNECT("Cannot open Hobby Boards MasterHub bus master at %s", DEVICENAME(in)); return gbBAD ; } break; case bus_pbm: if ( BAD( PBM_detect(pin) )) { LEVEL_CONNECT("Cannot open PBM bus master at %s", DEVICENAME(in)); return gbBAD ; } break; case bus_etherweather: if ( BAD( EtherWeather_detect(pin) )) { LEVEL_CONNECT("Cannot detect an EtherWeather server on %s", DEVICENAME(in)); return gbBAD ; } break; case bus_browse: RETURN_BAD_IF_BAD( Browse_detect(pin) ) ; break; case bus_fake: Fake_detect(pin); // never fails break; case bus_tester: Tester_detect(pin); // never fails break; case bus_mock: Mock_detect(pin); // never fails break; case bus_w1_monitor: RETURN_BAD_IF_BAD( W1_monitor_detect(pin) ) ; break; case bus_usb_monitor: #if OW_USB RETURN_BAD_IF_BAD( USB_monitor_detect(pin) ) ; #endif /* OW_USB */ break; case bus_w1: /* w1 is different: it is a dynamic list of adapters */ /* the scanning starts with "W1_Browse" in LibStart and continues in it's own thread */ /* No connection_in entries should have been created for w1 yet */ break ; case bus_external: RETURN_BAD_IF_BAD( External_detect(pin) ) ; break; case bus_bad: default: return gbBAD ; break; } return gbGOOD ; } static void IgnoreSignals(void) { struct sigaction sa; memset(&sa, 0, sizeof(struct sigaction)); sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; if (sigaction(SIGPIPE, &sa, NULL) == -1) { LEVEL_DEFAULT("Cannot ignore SIGPIPE"); exit(0); } } owfs-3.1p5/module/owlib/src/c/error.c0000644000175000001440000002342212654730021014427 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* error.c stolen nearly verbatim from "Unix Network Programming Volume 1 The Sockets Networking API (3rd Ed)" by W. Richard Stevens, Bill Fenner, Andrew M Rudoff Addison-Wesley Professional Computing Series Addison-Wesley, Boston 2003 http://www.unpbook.com * * Although it's been considerably modified over time -- don't blame the authors'' */ #include #include "owfs_config.h" #include "ow.h" #include #ifdef HAVE_SYS_UIO_H #include #endif /* module/ownet/c/src/c/error.c & module/owlib/src/c/error.c are identical */ const char mutex_init_failed[] = "mutex_init failed rc=%d [%s]\n"; const char mutex_destroy_failed[] = "mutex_destroy failed rc=%d [%s]\n"; const char mutex_lock_failed[] = "mutex_lock failed rc=%d [%s]\n"; const char mutex_unlock_failed[] = "mutex_unlock failed rc=%d [%s]\n"; const char mutexattr_init_failed[] = "mutexattr_init failed rc=%d [%s]\n"; const char mutexattr_destroy_failed[] = "mutexattr_destroy failed rc=%d [%s]\n"; const char mutexattr_settype_failed[] = "mutexattr_settype failed rc=%d [%s]\n"; const char rwlock_init_failed[] = "rwlock_init failed rc=%d [%s]\n"; const char rwlock_read_lock_failed[] = "rwlock_read_lock failed rc=%d [%s]\n"; const char rwlock_read_unlock_failed[] = "rwlock_read_unlock failed rc=%d [%s]\n"; const char cond_timedwait_failed[] = "cond_timedwait failed rc=%d [%s]\n"; const char cond_signal_failed[] = "cond_signal failed rc=%d [%s]\n"; const char cond_broadcast_failed[] = "cond_broadcast failed rc=%d [%s]\n"; const char cond_wait_failed[] = "cond_wait failed rc=%d [%s]\n"; const char cond_init_failed[] = "cond_init failed rc=%d [%s]\n"; const char cond_destroy_failed[] = "cond_destroy failed rc=%d [%s]\n"; const char sem_init_failed[] = "sem_init failed rc=%d [%s]\n"; const char sem_post_failed[] = "sem_post failed rc=%d [%s]\n"; const char sem_wait_failed[] = "sem_wait failed rc=%d [%s]\n"; const char sem_trywait_failed[] = "sem_trywait failed rc=%d [%s]\n"; const char sem_timedwait_failed[] = "sem_timedwait failed rc=%d [%s]\n"; const char sem_destroy_failed[] = "sem_destroy failed rc=%d [%s]\n"; static void err_format(char * format, int errno_save, const char * level_string, const char * file, int line, const char * func, const char * fmt); static void hex_print( const char * buf, int length ) ; static void ascii_print( const char * buf, int length ) ; /* See man page for explanation */ int log_available = 0; /* Limits for prettier byte printing */ #define HEX_PRINT_BYTES_PER_LINE 16 #define HEX_PRINT_MAX_LINES 4 /* Print message and return to caller * Caller specifies "errnoflag" and "level" */ #define MAXLINE 1023 void print_timestamp_(const char * file, int line, const char * func, const char *fmt, ...) { struct timeval tv; char buf[MAXLINE + 3]; char format[MAXLINE + 3]; va_list va; gettimeofday(&tv, NULL); // Add line and file to message snprintf(format, MAXLINE, "%s:%s(%d) %s", file,func,line,fmt); /* safe */ va_start( va, fmt ); // Add print format arguemnts (variable number) #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, va); /* safe */ #else vsprintf(buf, format, va); /* not safe */ #endif va_end( va ) ; //` Now print it out fprintf(stderr, "%ld DEFAULT: %s %ld.%06ld\n", time(NULL), buf, (long int) tv.tv_sec, (long int) tv.tv_usec); fflush(stderr); } void err_msg(enum e_err_type errnoflag, enum e_err_level level, const char * file, int line, const char * func, const char *fmt, ...) { int errno_save = (errnoflag==e_err_type_error)?errno:0; /* value caller might want printed */ char format[MAXLINE + 3]; char buf[MAXLINE + 3]; enum e_err_print sl; // 2=console 1=syslog va_list ap; const char * level_string ; switch (level) { case e_err_default: level_string = "DEFAULT: "; break; case e_err_connect: level_string = "CONNECT: "; break; case e_err_call: level_string = " CALL: "; break; case e_err_data: level_string = " DATA: "; break; case e_err_detail: level_string = " DETAIL: "; break; case e_err_debug: case e_err_beyond: default: level_string = " DEBUG: "; break; } /* Print where? */ switch (Globals.error_print) { case e_err_print_mixed: switch (Globals.daemon_status) { case e_daemon_want_bg: case e_daemon_bg: sl = e_err_print_syslog ; break ; default: sl = e_err_print_console; break ; } break; case e_err_print_syslog: sl = e_err_print_syslog; break; case e_err_print_console: sl = e_err_print_console; break; default: return; } //printf("About to format an error \n"); va_start(ap, fmt); err_format( format, errno_save, level_string, file, line, func, fmt) ; //printf("About to print an error\n"); UCLIBCLOCK; /* Create output string */ #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, ap); /* safe */ #else vsprintf(buf, format, ap); /* not safe */ #endif UCLIBCUNLOCK; va_end(ap); //printf("About to output an error \n"); if (sl == e_err_print_syslog) { /* All output to syslog */ if (!log_available) { openlog("OWFS", LOG_PID, LOG_DAEMON); log_available = 1; } syslog(level <= e_err_default ? LOG_INFO : LOG_NOTICE, "%s\n", buf); } else { fflush(stdout); /* in case stdout and stderr are the same */ fputs(buf, stderr); fputs("\n", stderr); fflush(stderr); } //printf("About to leave an error \n"); return; } /* Purely a debugging routine -- print an arbitrary buffer of bytes */ void _Debug_Bytes(const char *title, const unsigned char *buf, int length) { /* title line */ fprintf(stderr,"Byte buffer %s, length=%d", title ? title : "anonymous", (int) length); if (length < 0) { fprintf(stderr,"\n-- Attempt to write with bad length\n"); return; } else if ( length == 0 ) { fprintf(stderr,"\n"); return ; } if (buf == NULL) { fprintf(stderr,"\n-- NULL buffer\n"); return; } hex_print( (const char *) buf, length ) ; ascii_print( (const char *) buf, length ) ; } /* calls exit() so never returns */ void fatal_error(const char * file, int line, const char * func, const char *fmt, ...) { va_list ap; char format[MAXLINE + 1]; char buf[MAXLINE + 1]; enum e_err_print sl; // 2=console 1=syslog va_start(ap, fmt); err_format( format, 0, "FATAL ERROR: ", file, line, func, fmt) ; #ifdef OWNETC_OW_DEBUG { fprintf(stderr, "%s:%d ", file, line); #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, ap); #else vsprintf(buf, fmt, ap); #endif fprintf(stderr, "%s", buf); } #else /* OWNETC_OW_DEBUG */ if(Globals.fatal_debug) { #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, ap); #else vsprintf(buf, format, ap); #endif /* Print where? */ switch (Globals.error_print) { case e_err_print_mixed: switch (Globals.daemon_status) { case e_daemon_want_bg: case e_daemon_bg: sl = e_err_print_syslog ; break ; default: sl = e_err_print_console; break ; } break; case e_err_print_syslog: sl = e_err_print_syslog; break; case e_err_print_console: sl = e_err_print_console; break; default: va_end(ap); return; } if (sl == e_err_print_syslog) { /* All output to syslog */ if (!log_available) { openlog("OWFS", LOG_PID, LOG_DAEMON); log_available = 1; } syslog(LOG_USER|LOG_INFO, "%s\n", buf); } else { fflush(stdout); /* in case stdout and stderr are the same */ fputs(buf, stderr); fprintf(stderr,"\n"); fflush(stderr); } } if(Globals.fatal_debug_file != NULL) { FILE *fp; char filename[64]; sprintf(filename, "%s.%d", Globals.fatal_debug_file, getpid()); if((fp = fopen(filename, "a")) != NULL) { if(!Globals.fatal_debug) { #ifdef HAVE_VSNPRINTF vsnprintf(buf, MAXLINE, format, ap); #else vsprintf(buf, format, ap); #endif } fprintf(fp, "%s:%d %s\n", file, line, buf); fclose(fp); } } #endif /* OWNETC_OW_DEBUG */ va_end(ap); debug_crash(); // Core-dump to make it possible to trace down the problem! //exit(EXIT_FAILURE) ; } static void err_format(char * format, int errno_save, const char * level_string, const char * file, int line, const char * func, const char * fmt) { UCLIBCLOCK; /* Create output string */ #ifdef HAVE_VSNPRINTF if (errno_save) { snprintf(format, MAXLINE, "%s%s:%s(%d) [%s] %s", level_string,file,func,line,strerror(errno_save),fmt); /* safe */ } else { snprintf(format, MAXLINE, "%s%s:%s(%d) %s", level_string,file,func,line,fmt); /* safe */ } #else if (errno_save) { sprintf(format, "%s%s:%s(%d) [%s] %s", level_string,file,func,line,strerror(errno_save),fmt); /* not safe */ } else { sprintf(format, "%s%s:%s(%d) %s", level_string,file,func,line,fmt); /* not safe */ } #endif UCLIBCUNLOCK; /* Add CR at end */ } static void hex_print( const char * buf, int length ) { int i = 0 ; /* hex lines */ for (i = 0; i < length; ++i) { if ((i % HEX_PRINT_BYTES_PER_LINE) == 0) { // switch lines fprintf(stderr,"\n--%3.3d:",i); } fprintf(stderr," %.2X", (unsigned char)buf[i]); if( i >= ( HEX_PRINT_BYTES_PER_LINE * HEX_PRINT_MAX_LINES -1 ) ) { /* Sorry for this, but I think it's better to strip off all huge 8192 packages in the debug-output. */ fprintf(stderr,"\n--%3.3d: == abridged ==",i); break; } } } static void ascii_print( const char * buf, int length ) { int i ; /* char line -- printable or . */ fprintf(stderr,"\n <"); for (i = 0; i < length; ++i) { char c = buf[i]; fprintf(stderr,"%c", isprint( (int) c) ? c : '.'); if(i >= ( HEX_PRINT_BYTES_PER_LINE * HEX_PRINT_MAX_LINES -1 )) { /* Sorry for this, but I think it's better to strip off all huge 8192 packages in the debug-output. */ break; } } fprintf(stderr,">\n"); } owfs-3.1p5/module/owlib/src/c/sd-daemon.c0000644000175000001440000003311412654730021015144 00000000000000/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** Copyright 2010 Lennart Poettering 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ***/ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(__linux__) && !defined(SD_DAEMON_DISABLE_MQ) # include #endif #ifdef __linux__ #include "sd-daemon.h" #endif #if (__GNUC__ >= 4) # ifdef SD_EXPORT_SYMBOLS /* Export symbols */ # define _sd_export_ __attribute__ ((visibility("default"))) # else /* Don't export the symbols */ # define _sd_export_ __attribute__ ((visibility("hidden"))) # endif #else # define _sd_export_ #endif _sd_export_ int sd_listen_fds(int unset_environment) { #if defined(DISABLE_SYSTEMD) || !defined(__linux__) (void) unset_environment ; return 0; #else int r, fd; const char *e; char *p = NULL; unsigned long l; e = getenv("LISTEN_PID"); if (!e) { r = 0; goto finish; } errno = 0; l = strtoul(e, &p, 10); if (errno > 0) { r = -errno; goto finish; } if (!p || p == e || *p || l <= 0) { r = -EINVAL; goto finish; } /* Is this for us? */ if (getpid() != (pid_t) l) { r = 0; goto finish; } e = getenv("LISTEN_FDS"); if (!e) { r = 0; goto finish; } errno = 0; l = strtoul(e, &p, 10); if (errno > 0) { r = -errno; goto finish; } if (!p || p == e || *p) { r = -EINVAL; goto finish; } for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) { int flags; flags = fcntl(fd, F_GETFD); if (flags < 0) { r = -errno; goto finish; } if (flags & FD_CLOEXEC) continue; if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) { r = -errno; goto finish; } } r = (int) l; finish: if (unset_environment) { unsetenv("LISTEN_PID"); unsetenv("LISTEN_FDS"); } return r; #endif } _sd_export_ int sd_is_fifo(int fd, const char *path) { struct stat st_fd; if (fd < 0) return -EINVAL; if (fstat(fd, &st_fd) < 0) return -errno; if (!S_ISFIFO(st_fd.st_mode)) return 0; if (path) { struct stat st_path; if (stat(path, &st_path) < 0) { if (errno == ENOENT || errno == ENOTDIR) return 0; return -errno; } return st_path.st_dev == st_fd.st_dev && st_path.st_ino == st_fd.st_ino; } return 1; } _sd_export_ int sd_is_special(int fd, const char *path) { struct stat st_fd; if (fd < 0) return -EINVAL; if (fstat(fd, &st_fd) < 0) return -errno; if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode)) return 0; if (path) { struct stat st_path; if (stat(path, &st_path) < 0) { if (errno == ENOENT || errno == ENOTDIR) return 0; return -errno; } if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode)) return st_path.st_dev == st_fd.st_dev && st_path.st_ino == st_fd.st_ino; else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode)) return st_path.st_rdev == st_fd.st_rdev; else return 0; } return 1; } static int sd_is_socket_internal(int fd, int type, int listening) { struct stat st_fd; if (fd < 0 || type < 0) return -EINVAL; if (fstat(fd, &st_fd) < 0) return -errno; if (!S_ISSOCK(st_fd.st_mode)) return 0; if (type != 0) { int other_type = 0; socklen_t l = sizeof(other_type); if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &other_type, &l) < 0) return -errno; if (l != sizeof(other_type)) return -EINVAL; if (other_type != type) return 0; } if (listening >= 0) { int accepting = 0; socklen_t l = sizeof(accepting); if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &accepting, &l) < 0) return -errno; if (l != sizeof(accepting)) return -EINVAL; if (!accepting != !listening) return 0; } return 1; } union sockaddr_union { struct sockaddr sa; struct sockaddr_in in4; struct sockaddr_in6 in6; struct sockaddr_un un; struct sockaddr_storage storage; }; _sd_export_ int sd_is_socket(int fd, int family, int type, int listening) { int r; if (family < 0) return -EINVAL; r = sd_is_socket_internal(fd, type, listening); if (r <= 0) return r; if (family > 0) { union sockaddr_union sockaddr = {}; socklen_t l = sizeof(sockaddr); if (getsockname(fd, &sockaddr.sa, &l) < 0) return -errno; if (l < sizeof(sa_family_t)) return -EINVAL; return sockaddr.sa.sa_family == family; } return 1; } _sd_export_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { union sockaddr_union sockaddr = {}; socklen_t l = sizeof(sockaddr); int r; if (family != 0 && family != AF_INET && family != AF_INET6) return -EINVAL; r = sd_is_socket_internal(fd, type, listening); if (r <= 0) return r; if (getsockname(fd, &sockaddr.sa, &l) < 0) return -errno; if (l < sizeof(sa_family_t)) return -EINVAL; if (sockaddr.sa.sa_family != AF_INET && sockaddr.sa.sa_family != AF_INET6) return 0; if (family > 0) if (sockaddr.sa.sa_family != family) return 0; if (port > 0) { if (sockaddr.sa.sa_family == AF_INET) { if (l < sizeof(struct sockaddr_in)) return -EINVAL; return htons(port) == sockaddr.in4.sin_port; } else { if (l < sizeof(struct sockaddr_in6)) return -EINVAL; return htons(port) == sockaddr.in6.sin6_port; } } return 1; } _sd_export_ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) { union sockaddr_union sockaddr = {}; socklen_t l = sizeof(sockaddr); int r; r = sd_is_socket_internal(fd, type, listening); if (r <= 0) return r; if (getsockname(fd, &sockaddr.sa, &l) < 0) return -errno; if (l < sizeof(sa_family_t)) return -EINVAL; if (sockaddr.sa.sa_family != AF_UNIX) return 0; if (path) { if (length == 0) length = strlen(path); if (length == 0) /* Unnamed socket */ return l == offsetof(struct sockaddr_un, sun_path); if (path[0]) /* Normal path socket */ return (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) && memcmp(path, sockaddr.un.sun_path, length+1) == 0; else /* Abstract namespace socket */ return (l == offsetof(struct sockaddr_un, sun_path) + length) && memcmp(path, sockaddr.un.sun_path, length) == 0; } return 1; } _sd_export_ int sd_is_mq(int fd, const char *path) { #if !defined(__linux__) || defined(SD_DAEMON_DISABLE_MQ) (void) fd ; (void) path ; return 0; #else struct mq_attr attr; if (fd < 0) return -EINVAL; if (mq_getattr(fd, &attr) < 0) return -errno; if (path) { char fpath[PATH_MAX]; struct stat a, b; if (path[0] != '/') return -EINVAL; if (fstat(fd, &a) < 0) return -errno; strncpy(stpcpy(fpath, "/dev/mqueue"), path, sizeof(fpath) - 12); fpath[sizeof(fpath)-1] = 0; if (stat(fpath, &b) < 0) return -errno; if (a.st_dev != b.st_dev || a.st_ino != b.st_ino) return 0; } return 1; #endif } _sd_export_ int sd_notify(int unset_environment, const char *state) { #if defined(DISABLE_SYSTEMD) || !defined(__linux__) || !defined(SOCK_CLOEXEC) (void) unset_environment ; (void) state ; return 0; #else int fd = -1, r; struct msghdr msghdr; struct iovec iovec; union sockaddr_union sockaddr; const char *e; if (!state) { r = -EINVAL; goto finish; } e = getenv("NOTIFY_SOCKET"); if (!e) return 0; /* Must be an abstract socket, or an absolute path */ if ((e[0] != '@' && e[0] != '/') || e[1] == 0) { r = -EINVAL; goto finish; } fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0); if (fd < 0) { r = -errno; goto finish; } memset(&sockaddr, 0, sizeof(sockaddr)); sockaddr.sa.sa_family = AF_UNIX; strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); if (sockaddr.un.sun_path[0] == '@') sockaddr.un.sun_path[0] = 0; memset(&iovec, 0, sizeof(iovec)); iovec.iov_base = (char*) state; iovec.iov_len = strlen(state); memset(&msghdr, 0, sizeof(msghdr)); msghdr.msg_name = &sockaddr; msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e); if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) msghdr.msg_namelen = sizeof(struct sockaddr_un); msghdr.msg_iov = &iovec; msghdr.msg_iovlen = 1; if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) { r = -errno; goto finish; } r = 1; finish: if (unset_environment) unsetenv("NOTIFY_SOCKET"); if (fd >= 0) close(fd); return r; #endif } _sd_export_ int sd_notifyf(int unset_environment, const char *format, ...) { #if defined(DISABLE_SYSTEMD) || !defined(__linux__) (void) unset_environment ; (void) format ; return 0; #else va_list ap; char *p = NULL; int r; va_start(ap, format); r = vasprintf(&p, format, ap); va_end(ap); if (r < 0 || !p) return -ENOMEM; r = sd_notify(unset_environment, p); free(p); return r; #endif } _sd_export_ int sd_booted(void) { #if defined(DISABLE_SYSTEMD) || !defined(__linux__) return 0; #else struct stat st; /* We test whether the runtime unit file directory has been * created. This takes place in mount-setup.c, so is * guaranteed to happen very early during boot. */ if (lstat("/run/systemd/system/", &st) < 0) return 0; return !!S_ISDIR(st.st_mode); #endif } owfs-3.1p5/module/owlib/src/c/globals.c0000644000175000001440000000706512654730021014726 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #include #include "owfs_config.h" #include "ow.h" #include "ow_devices.h" /* Globals for port and bus communication */ /* connections globals stored in ow_connect.c */ /* char * pid_file in ow_opt.c */ // some improbably sub-absolute-zero number #define GLOBAL_UNTOUCHED_TEMP_LIMIT (-999.) /* State information, sent to remote or kept locally */ /* cacheenabled, presencecheck, tempscale, devform */ int32_t LocalControlFlags ; // This structure is defined in ow_global.h // These are all the tunable constants and flags. Usually they have // 1 A command line entry (ow_opt.h) // 2 A help entry (ow_help.c) // An entry in /settings (ow_settings.c) struct global Globals = { .announce_off = 0, .announce_name = NULL, .program_type = program_type_swig, .allow_other = 0 , // for fuse .temp_scale = temp_celsius, .pressure_scale = pressure_mbar, .format = fdi, .uncached = 0, .unaliased = 0, .daemon_status = e_daemon_want_bg , .error_level = e_err_default, .error_level_restore = e_err_default, .error_print = e_err_print_mixed, .fatal_debug = 1, .fatal_debug_file = NULL, .readonly = 0, .max_clients = 250, .cache_size = 0, .one_device = 0, .altUSB = 0, .usb_flextime = 1, .serial_flextime = 1, .serial_reverse = 0, // 1 is "reverse" polarity .serial_hardflow = 0, // hardware flow control .timeout_volatile = 15, .timeout_stable = 300, .timeout_directory = 60, .timeout_presence = 120, .timeout_serial = 5, // serial read and write use the same timeout currently .timeout_usb = 5, // 5 seconds .timeout_network = 1, .timeout_server = 10, .timeout_ftp = 900, .timeout_ha7 = 60, .timeout_w1 = 30, .timeout_persistent_low = 600, .timeout_persistent_high = 3600, .clients_persistent_low = 10, .clients_persistent_high = 20, .pingcrazy = 0, .no_dirall = 0, .no_get = 0, .no_persistence = 0, .eightbit_serial = 0, .trim = 0, // don't whitespace trim results by default .zero = zero_unknown , .i2c_APU = 1 , .i2c_PPM = 0 , // to prevent confusing the DS2483 .baud = B9600 , .traffic = 0, // show bus traffic .locks = 0, // show locks (mutexes) .templow = GLOBAL_UNTOUCHED_TEMP_LIMIT, .temphigh = GLOBAL_UNTOUCHED_TEMP_LIMIT, .argc = 0, .argv = NULL, .inet_type = inet_none, .exitmode = exit_early, // how long to pause after closing sockets before exit .restart_seconds = 5 , // .allow_external = 1 , // for testing .allow_external = 0 , // unless program == owexternal #if OW_USB .luc = NULL , #endif /* OW_USB */ }; // generic value for ignorable function returns int ignore_result ; /* Statistics globals are stored in ow_stats.c */ /* State information, sent to remote or kept locally */ /* cacheenabled, presencecheck, tempscale, devform */ void SetLocalControlFlags( void ) { CONTROLFLAGSLOCK; // Clear LocalControlFlags = 0 ; // Device format LocalControlFlags |= (Globals.format) << DEVFORMAT_BIT ; // Pressure scale LocalControlFlags |= (Globals.pressure_scale) << PRESSURESCALE_BIT ; // Temperature scale LocalControlFlags |= (Globals.temp_scale) << TEMPSCALE_BIT ; // Uncached LocalControlFlags |= Globals.uncached ? UNCACHED : 0 ; // Unaliased LocalControlFlags |= Globals.unaliased ? 0 : ALIAS_REQUEST ; // Trim LocalControlFlags |= Globals.trim ? 0 : TRIM ; // OWNet flag or Presence check LocalControlFlags |= OWNET ; CONTROLFLAGSUNLOCK; } owfs-3.1p5/module/owlib/src/include/0000755000175000001440000000000013022537103014404 500000000000000owfs-3.1p5/module/owlib/src/include/Makefile.am0000644000175000001440000000713012752074623016375 00000000000000noinst_HEADERS = \ compat_getopt.h \ compat.h \ i2c-dev.h \ compat_netdb.h \ connector.h \ jsmn.h \ libusb.h \ ow.h \ ownet.h \ ow_1820.h \ ow_1821.h \ ow_1921.h \ ow_1923.h \ ow_1954.h \ ow_1963.h \ ow_1977.h \ ow_1991.h \ ow_1993.h \ ow_2401.h \ ow_2404.h \ ow_2405.h \ ow_2406.h \ ow_2408.h \ ow_2409.h \ ow_2413.h \ ow_2415.h \ ow_2423.h \ ow_2430.h \ ow_2433.h \ ow_2436.h \ ow_2438.h \ ow_2450.h \ ow_2502.h \ ow_2505.h \ ow_2760.h \ ow_2804.h \ ow_2810.h \ ow_2890.h \ ow_alloc.h \ ow_arg.h \ ow_avahi.h \ ow_bae.h \ ow_bitfield.h \ ow_bitwork.h \ ow_busnumber.h \ ow_bus_routines.h \ ow_cache.h \ ow_charblob.h \ ow_cmciel.h \ ow_codes.h \ ow_communication.h \ ow_connection.h \ ow_connection_in.h \ ow_connection_out.h\ ow_counters.h \ ow_debug.h \ ow_detail.h \ ow_detect.h \ ow_device.h \ ow_devices.h \ ow_dirblob.h \ ow_dl.h \ ow_dnssd.h \ ow_eds.h \ ow_eeef.h \ ow_example_slave.h \ ow_exec.h \ ow_external.h \ ow_fd.h \ ow_filetype.h \ ow_ftdi.h \ ow_functions.h \ ow_generic_read.h \ ow_generic_write.h \ ow_global.h \ ow_inotify.h \ ow_integer.h \ ow_interface.h \ ow_kevent.h \ ow_launchd.h \ ow_localtypes.h \ ow_localreturns.h \ ow_lcd.h \ ow_master.h \ ow_memblob.h \ ow_message.h \ ow_mutex.h \ ow_mutexes.h \ ow_none.h \ ow_onewirequery.h \ ow_opt.h \ ow_parse_address.h \ ow_parsedname.h \ ow_parse_sn.h \ ow_pid.h \ ow_port_in.h \ ow_pressure.h \ ow_programs.h \ ow_regex.h \ ow_reset.h \ ow_return_code.h \ ow_settings.h \ ow_search.h \ ow_sibling.h \ ow_simultaneous.h \ ow_standard.h \ ow_stateinfo.h \ ow_stats.h \ ow_stub.h \ ow_system.h \ ow_temperature.h \ ow_thermocouple.h \ ow_timer.h \ ow_traffic.h \ ow_transaction.h \ ow_usb_cycle.h \ ow_usb_msg.h \ ow_visibility.h \ ow_w1.h \ ow_w1_seq.h \ rwlock.h \ netlink.h \ w1_netlink.h \ sem.h \ sd-daemon.h \ telnet.h owfs-3.1p5/module/owlib/src/include/compat_getopt.h0000644000175000001440000001354512654730021017356 00000000000000/* Declarations for getopt. Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include "owfs_config.h" #ifndef _COMP_GETOPT_H #define _COMP_GETOPT_H /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifdef __cplusplus extern "C" { #endif #ifndef HAVE_GETOPT /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #endif /* HAVE_GETOPT */ #ifndef HAVE_GETOPT_LONG /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* HAVE_GETOPT_LONG */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #ifndef HAVE_GETOPT /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt(int __argc, char *const *__argv, const char *__shortopts); #endif #ifndef HAVE_GETOPT_LONG extern int getopt_long(int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); extern int getopt_long_only(int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal(int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); #endif #ifdef __cplusplus } #endif #endif /* _COMP_GETOPT_H */ owfs-3.1p5/module/owlib/src/include/compat.h0000644000175000001440000001130512673103261015765 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- */ #ifndef COMPAT_H #define COMPAT_H #include #include "owfs_config.h" #ifdef HAVE_FEATURES_H #include #endif #ifndef HAVE_GETADDRINFO #include "compat_netdb.h" #endif #include "compat_getopt.h" #ifndef HAVE_STRSEP char *strsep(char **stringp, const char *delim); #endif #if defined(__UCLIBC__) #if ((__UCLIBC_MAJOR__ << 16)+(__UCLIBC_MINOR__ << 8)+(__UCLIBC_SUBLEVEL__) <= 0x000913) #undef HAVE_TDESTROY #else /* Older than 0.9.19 */ #define HAVE_TDESTROY 1 #endif /* Older than 0.9.19 */ #else #endif /* __UCLIBC__ */ #ifndef HAVE_TDESTROY void tdestroy(void *vroot, void (*freefct) (void *)); #endif #ifndef __COMPAR_FN_T # define __COMPAR_FN_T typedef int (*__compar_fn_t) (__const void *, __const void *); #endif #ifndef HAVE_TSEARCH void *tsearch(__const void *__key, void **__rootp, __compar_fn_t __compar); #endif #ifndef HAVE_TFIND void *tfind(__const void *__key, void *__const * __rootp, __compar_fn_t __compar); #endif #ifndef HAVE_TDELETE void *tdelete(__const void *__restrict __key, void **__restrict __rootp, __compar_fn_t __compar); #endif #if defined(_SEARCH_H) || defined(_SEARCH_H_) /* VISIT is always defined in search.h on MacOSX. */ #else typedef enum { preorder, postorder, endorder, leaf } VISIT; #endif /* SEARCH_H */ #ifndef __ACTION_FN_T # define __ACTION_FN_T typedef void (*__action_fn_t) (__const void *__nodep, VISIT __value, int __level); #endif #ifndef HAVE_TWALK void twalk(__const void *__root, __action_fn_t __action); #endif #ifdef __UCLIBC__ #if defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) && defined(__UCLIBC_SUBLEVEL__) #if ((__UCLIBC_MAJOR__<<16) + (__UCLIBC_MINOR__<<8) + (__UCLIBC_SUBLEVEL__)) <= 0x000913 /* Since syslog will hang forever with uClibc-0.9.19 if syslogd is not * running, then we don't use it unless we really wants it * WRT45G usually have syslogd running. uClinux-dist might not have it. */ #ifndef USE_SYSLOG #define syslog(a,...) { /* ignore_syslog */ } #define openlog(a,...) { /* ignore_openlog */ } #define closelog() { /* ignore_closelog */ } #endif #endif /* __UCLIBC__ */ #endif /* __UCLIBC__ */ #endif /* __UCLIBC__ */ #endif owfs-3.1p5/module/owlib/src/include/i2c-dev.h0000644000175000001440000002351112654730021015734 00000000000000/* i2c-dev.h - i2c-bus driver, char device interface Copyright (C) 1995-97 Simon G. Vogl Copyright (C) 1998-99 Frodo Looijaard 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* $Id$ */ #ifndef LIB_I2CDEV_H #define LIB_I2CDEV_H #ifdef HAVE_LINUX_TYPES_H #include #else #ifndef __u8 typedef unsigned char __u8; #endif #ifndef __u16 typedef unsigned int __u16; #endif #ifndef __s32 typedef signed long __s32; #endif #endif #include /* -- i2c.h -- */ /* * I2C Message - used for pure i2c transaction, also from /dev interface */ struct i2c_msg { __u16 addr; /* slave address */ unsigned short flags; #define I2C_M_TEN 0x10 /* we have a ten bit chip address */ #define I2C_M_RD 0x01 #define I2C_M_NOSTART 0x4000 #define I2C_M_REV_DIR_ADDR 0x2000 #define I2C_M_IGNORE_NAK 0x1000 #define I2C_M_NO_RD_ACK 0x0800 short len; /* msg length */ char *buf; /* pointer to msg data */ }; /* To determine what functionality is present */ #define I2C_FUNC_I2C 0x00000001 #define I2C_FUNC_10BIT_ADDR 0x00000002 #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ #define I2C_FUNC_SMBUS_QUICK 0x00010000 #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 #define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 #define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 #define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 #define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 #define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 #define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 #define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 #define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */ #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ #define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ I2C_FUNC_SMBUS_WRITE_BYTE) #define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \ I2C_FUNC_SMBUS_WRITE_BYTE_DATA) #define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \ I2C_FUNC_SMBUS_WRITE_WORD_DATA) #define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \ I2C_FUNC_SMBUS_WRITE_BLOCK_DATA) #define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) #define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) /* * Data for SMBus Messages */ #define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ #define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */ union i2c_smbus_data { __u8 byte; __u16 word; __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */ /* and one more for PEC */ }; /* smbus_access read or write markers */ #define I2C_SMBUS_READ 1 #define I2C_SMBUS_WRITE 0 /* SMBus transaction types (size parameter in the above functions) Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */ #define I2C_SMBUS_QUICK 0 #define I2C_SMBUS_BYTE 1 #define I2C_SMBUS_BYTE_DATA 2 #define I2C_SMBUS_WORD_DATA 3 #define I2C_SMBUS_PROC_CALL 4 #define I2C_SMBUS_BLOCK_DATA 5 #define I2C_SMBUS_I2C_BLOCK_DATA 6 #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ /* ----- commands for the ioctl like i2c_command call: * note that additional calls are defined in the algorithm and hw * dependent layers - these can be listed here, or see the * corresponding header files. */ /* -> bit-adapter specific ioctls */ #define I2C_RETRIES 0x0701 /* number of times a device address */ /* should be polled when not */ /* acknowledging */ #define I2C_TIMEOUT 0x0702 /* set timeout - call with int */ /* this is for i2c-dev.c */ #define I2C_SLAVE 0x0703 /* Change slave address */ /* Attn.: Slave address is 7 or 10 bits */ #define I2C_SLAVE_FORCE 0x0706 /* Change slave address */ /* Attn.: Slave address is 7 or 10 bits */ /* This changes the address, even if it */ /* is already taken! */ #define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */ #define I2C_FUNCS 0x0705 /* Get the adapter functionality */ #define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only) */ #define I2C_PEC 0x0708 /* != 0 for SMBus PEC */ #define I2C_SMBUS 0x0720 /* SMBus-level access */ /* -- i2c.h -- */ /* Note: 10-bit addresses are NOT supported! */ /* This is the structure as used in the I2C_SMBUS ioctl call */ struct i2c_smbus_ioctl_data { char read_write; __u8 command; int size; union i2c_smbus_data *data; }; /* This is the structure as used in the I2C_RDWR ioctl call */ struct i2c_rdwr_ioctl_data { struct i2c_msg *msgs; /* pointers to i2c_msgs */ int nmsgs; /* number of i2c_msgs */ }; static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command, int size, union i2c_smbus_data *data) { struct i2c_smbus_ioctl_data args; args.read_write = read_write; args.command = command; args.size = size; args.data = data; return ioctl(file, I2C_SMBUS, &args); } static inline __s32 i2c_smbus_write_quick(int file, __u8 value) { return i2c_smbus_access(file, value, 0, I2C_SMBUS_QUICK, NULL); } static inline __s32 i2c_smbus_read_byte(int file) { union i2c_smbus_data data; if (i2c_smbus_access(file, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &data)) return -1; else return 0x0FF & data.byte; } static inline __s32 i2c_smbus_write_byte(int file, __u8 value) { return i2c_smbus_access(file, I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL); } static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command) { union i2c_smbus_data data; if (i2c_smbus_access(file, I2C_SMBUS_READ, command, I2C_SMBUS_BYTE_DATA, &data)) return -1; else return 0x0FF & data.byte; } static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command, __u8 value) { union i2c_smbus_data data; data.byte = value; return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, I2C_SMBUS_BYTE_DATA, &data); } static inline __s32 i2c_smbus_read_word_data(int file, __u8 command) { union i2c_smbus_data data; if (i2c_smbus_access(file, I2C_SMBUS_READ, command, I2C_SMBUS_WORD_DATA, &data)) return -1; else return 0x0FFFF & data.word; } static inline __s32 i2c_smbus_write_word_data(int file, __u8 command, __u16 value) { union i2c_smbus_data data; data.word = value; return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, I2C_SMBUS_WORD_DATA, &data); } static inline __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value) { union i2c_smbus_data data; data.word = value; if (i2c_smbus_access(file, I2C_SMBUS_WRITE, command, I2C_SMBUS_PROC_CALL, &data)) return -1; else return 0x0FFFF & data.word; } /* Returns the number of read bytes */ static inline __s32 i2c_smbus_read_block_data(int file, __u8 command, __u8 * values) { union i2c_smbus_data data; int i; if (i2c_smbus_access(file, I2C_SMBUS_READ, command, I2C_SMBUS_BLOCK_DATA, &data)) return -1; else { for (i = 1; i <= data.block[0]; i++) values[i - 1] = data.block[i]; return data.block[0]; } } static inline __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length, __u8 * values) { union i2c_smbus_data data; int i; if (length > 32) length = 32; for (i = 1; i <= length; i++) data.block[i] = values[i - 1]; data.block[0] = length; return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, I2C_SMBUS_BLOCK_DATA, &data); } /* Returns the number of read bytes */ static inline __s32 i2c_smbus_read_i2c_block_data(int file, __u8 command, __u8 * values) { union i2c_smbus_data data; int i; if (i2c_smbus_access(file, I2C_SMBUS_READ, command, I2C_SMBUS_I2C_BLOCK_DATA, &data)) return -1; else { for (i = 1; i <= data.block[0]; i++) values[i - 1] = data.block[i]; return data.block[0]; } } static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command, __u8 length, __u8 * values) { union i2c_smbus_data data; int i; if (length > 32) length = 32; for (i = 1; i <= length; i++) data.block[i] = values[i - 1]; data.block[0] = length; return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, I2C_SMBUS_I2C_BLOCK_DATA, &data); } /* Returns the number of read bytes */ static inline __s32 i2c_smbus_block_process_call(int file, __u8 command, __u8 length, __u8 * values) { union i2c_smbus_data data; int i; if (length > 32) length = 32; for (i = 1; i <= length; i++) data.block[i] = values[i - 1]; data.block[0] = length; if (i2c_smbus_access(file, I2C_SMBUS_WRITE, command, I2C_SMBUS_BLOCK_PROC_CALL, &data)) return -1; else { for (i = 1; i <= data.block[0]; i++) values[i - 1] = data.block[i]; return data.block[0]; } } #endif /* LIB_I2CDEV_H */ owfs-3.1p5/module/owlib/src/include/compat_netdb.h0000644000175000001440000001432512665167763017170 00000000000000/* Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* All data returned by the network data base library are supplied in host order and returned in network order (suitable for use in system calls). */ #ifndef _COMPAT_NETDB_H #define _COMPAT_NETDB_H 1 #include #include "owfs_config.h" #ifdef HAVE_FEATURES_H #include #endif #ifndef __USE_GNU #define __USE_GNU #endif /* Doesn't exist for Solaris, make a test for it later */ /* #undef HAVE_SA_LEN */ #ifndef __HAS_IPV6__ #define __HAS_IPV6__ 0 #endif #ifndef __USE_POSIX #define __USE_POSIX #endif #ifndef __THROW #define __THROW #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_STDINT_H #include #endif #ifdef __USE_MISC /* This is necessary to make this include file properly replace the Sun version. */ # include #endif #ifdef HAVE_BITS_NETDB_H #include #endif /* Absolute file name for network data base files. */ #define _PATH_HEQUIV "/etc/hosts.equiv" #define _PATH_HOSTS "/etc/hosts" #define _PATH_NETWORKS "/etc/networks" #define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf" #define _PATH_PROTOCOLS "/etc/protocols" #define _PATH_SERVICES "/etc/services" #ifndef __set_errno #define __set_errno(x) (errno = (x)) #endif #ifndef __set_h_errno #define __set_h_errno(x) (h_errno = (x)) #endif #ifndef HAVE_INET_NTOP const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); #endif #ifndef HAVE_INET_PTON int inet_pton(int af, const char *src, void *dst); #endif #ifndef HAVE_GETADDRINFO /* Possible values left in `h_errno'. */ #define NETDB_INTERNAL -1 /* See errno. */ #define NETDB_SUCCESS 0 /* No problem. */ #define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found. */ #define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL. */ #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP. */ #define NO_DATA 4 /* Valid name, no data record of requested type. */ #define NO_ADDRESS NO_DATA /* No address, look for MX record. */ #ifdef __USE_XOPEN2K /* Highest reserved Internet port number. */ # define IPPORT_RESERVED 1024 #endif #ifdef __USE_GNU /* Scope delimiter for getaddrinfo(), getnameinfo(). */ # define SCOPE_DELIMITER '%' #endif /* Extension from POSIX.1g. */ #if defined(__USE_POSIX) && !defined(__CYGWIN__) /* Structure to contain information about address of a service provider. */ struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Protocol family for socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol for socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address for socket. */ char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; # ifdef __USE_GNU /* Lookup mode. */ # define GAI_WAIT 0 # define GAI_NOWAIT 1 # endif /* Possible values for `ai_flags' field in `addrinfo' structure. */ # define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ # define AI_CANONNAME 0x0002 /* Request for canonical name. */ # define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ /* Error values for `getaddrinfo' function. */ # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ # define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ # define EAI_AGAIN -3 /* Temporary failure in name resolution. */ # define EAI_FAIL -4 /* Non-recoverable failure in name res. */ # define EAI_NODATA -5 /* No address associated with NAME. */ # define EAI_FAMILY -6 /* `ai_family' not supported. */ # define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ # define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ # define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ # define EAI_MEMORY -10 /* Memory allocation failure. */ # define EAI_SYSTEM -11 /* System error returned in `errno'. */ # ifdef __USE_GNU # define EAI_INPROGRESS -100 /* Processing request in progress. */ # define EAI_CANCELED -101 /* Request canceled. */ # define EAI_NOTCANCELED -102 /* Request not canceled. */ # define EAI_ALLDONE -103 /* All requests done. */ # define EAI_INTR -104 /* Interrupted by a signal. */ # endif # define NI_MAXHOST 1025 # define NI_MAXSERV 32 # define NI_NUMERICHOST 1 /* Don't try to look up hostname. */ # define NI_NUMERICSERV 2 /* Don't convert port number to name. */ # define NI_NOFQDN 4 /* Only return nodename portion. */ # define NI_NAMEREQD 8 /* Don't return numeric addresses. */ # define NI_DGRAM 16 /* Look up UDP service rather than TCP. */ /* Translate name of a service location and/or a service name to set of socket addresses. */ extern int getaddrinfo(__const char *__restrict __name, __const char *__restrict __service, __const struct addrinfo *__restrict __req, struct addrinfo **__restrict __pai) __THROW; /* Free `addrinfo' structure AI including associated storage. */ extern void freeaddrinfo(struct addrinfo *__ai) __THROW; /* Convert error return from getaddrinfo() to a string. */ extern const char *gai_strerror(int __ecode) __THROW; #endif /* HAVE_GETADDRINFO */ #endif /* POSIX */ #endif /* COMPAT_NETDB_H */ owfs-3.1p5/module/owlib/src/include/connector.h0000644000175000001440000000477712654730021016512 00000000000000/* * connector.h * * 2004-2005 Copyright (c) Evgeniy Polyakov * All rights reserved. * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __CONNECTOR_H #define __CONNECTOR_H #include #include "owfs_config.h" #ifdef HAVE_ASM_TYPES_H #include #endif #define CN_IDX_CONNECTOR 0xffffffff #define CN_VAL_CONNECTOR 0xffffffff /* * Process Events connector unique ids -- used for message routing */ #define CN_IDX_PROC 0x1 #define CN_VAL_PROC 0x1 #define CN_IDX_CIFS 0x2 #define CN_VAL_CIFS 0x1 #define CN_W1_IDX 0x3 /* w1 communication */ #define CN_W1_VAL 0x1 #define CN_IDX_V86D 0x4 #define CN_VAL_V86D_UVESAFB 0x1 #define CN_NETLINK_USERS 5 /* * Maximum connector's message size. */ #define CONNECTOR_MAX_MSG_SIZE 16384 /* * idx and val are unique identifiers which * are used for message routing and * must be registered in connector.h for in-kernel usage. */ #pragma pack(push) /* push current alignment to stack */ #pragma pack(1) /* set alignment to 1 byte boundary */ struct cb_id { __u32 idx; __u32 val; }; struct cn_msg { struct cb_id id; __u32 seq; __u32 ack; __u16 len; /* Length of the following data */ __u16 flags; __u8 data[0]; }; /* * Notify structure - requests notification about * registering/unregistering idx/val in range [first, first+range]. */ struct cn_notify_req { __u32 first; __u32 range; }; /* * Main notification control message * *_notify_num - number of appropriate cn_notify_req structures after * this struct. * group - notification receiver's idx. * len - total length of the attached data. */ struct cn_ctl_msg { __u32 idx_notify_num; __u32 val_notify_num; __u32 group; __u32 len; __u8 data[0]; }; #pragma pack(pop) /* restore original alignment from stack */ #endif /* __CONNECTOR_H */ owfs-3.1p5/module/owlib/src/include/jsmn.h0000644000175000001440000000325512654730021015455 00000000000000/* * jsmn -- a JSON parser * Obtained from http://zserge.bitbucket.org/jsmn.html * MIT licence * written by Serge Zaitsev * Some simplification of original code -- no parents */ #ifndef __JSMN_H_ #define __JSMN_H_ /** * JSON type identifier. Basic types are: * o Object * o Array * o String * o Other primitive: number, boolean (true/false) or null */ typedef enum { JSMN_PRIMITIVE = 0, JSMN_OBJECT = 1, JSMN_ARRAY = 2, JSMN_STRING = 3 } jsmntype_t; typedef enum { /* Not enough tokens were provided */ JSMN_ERROR_NOMEM = -1, /* Invalid character inside JSON string */ JSMN_ERROR_INVAL = -2, /* The string is not a full JSON packet, more bytes expected */ JSMN_ERROR_PART = -3, /* Everything was fine */ JSMN_SUCCESS = 0 } jsmnerr_t; /** * JSON token description. * @param type type (object, array, string etc.) * @param start start position in JSON data string * @param end end position in JSON data string */ typedef struct { jsmntype_t type; int start; int end; int size; } jsmntok_t; /** * JSON parser. Contains an array of token blocks available. Also stores * the string being parsed now and current position in that string */ typedef struct { unsigned int pos; /* offset in the JSON string */ int toknext; /* next token to allocate */ int toksuper; /* suporior token node, e.g parent object or array */ } jsmn_parser; /** * Create JSON parser over an array of tokens */ void jsmn_init(jsmn_parser *parser); /** * Run JSON parser. It parses a JSON data string into and array of tokens, each describing * a single JSON object. */ jsmnerr_t jsmn_parse(jsmn_parser *parser, const char *js, jsmntok_t *tokens, int num_tokens); #endif /* __JSMN_H_ */ owfs-3.1p5/module/owlib/src/include/libusb.h0000644000175000001440000021101412654730021015760 00000000000000/* * Public libusb header file * Copyright © 2001 Johannes Erdfelt * Copyright © 2007-2008 Daniel Drake * Copyright © 2012 Pete Batard * Copyright © 2012 Nathan Hjelm * For more information, please visit: http://libusb.info * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef LIBUSB_H #define LIBUSB_H #ifdef _MSC_VER /* on MS environments, the inline keyword is available in C++ only */ #if !defined(__cplusplus) #define inline __inline #endif /* ssize_t is also not available (copy/paste from MinGW) */ #ifndef _SSIZE_T_DEFINED #define _SSIZE_T_DEFINED #undef ssize_t #ifdef _WIN64 typedef __int64 ssize_t; #else typedef int ssize_t; #endif /* _WIN64 */ #endif /* _SSIZE_T_DEFINED */ #endif /* _MSC_VER */ /* stdint.h is not available on older MSVC */ #if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H)) typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #else #include #endif #if !defined(_WIN32_WCE) #include #endif #if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) #include #endif #include #include /* 'interface' might be defined as a macro on Windows, so we need to * undefine it so as not to break the current libusb API, because * libusb_config_descriptor has an 'interface' member * As this can be problematic if you include windows.h after libusb.h * in your sources, we force windows.h to be included first. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) #include #if defined(interface) #undef interface #endif #if !defined(__CYGWIN__) #include #endif #endif #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) #define LIBUSB_DEPRECATED_FOR(f) \ __attribute__((deprecated("Use " #f " instead"))) #else #define LIBUSB_DEPRECATED_FOR(f) #endif /* __GNUC__ */ /** \def LIBUSB_CALL * \ingroup misc * libusb's Windows calling convention. * * Under Windows, the selection of available compilers and configurations * means that, unlike other platforms, there is not one true calling * convention (calling convention: the manner in which parameters are * passed to funcions in the generated assembly code). * * Matching the Windows API itself, libusb uses the WINAPI convention (which * translates to the stdcall convention) and guarantees that the * library is compiled in this way. The public header file also includes * appropriate annotations so that your own software will use the right * convention, even if another convention is being used by default within * your codebase. * * The one consideration that you must apply in your software is to mark * all functions which you use as libusb callbacks with this LIBUSB_CALL * annotation, so that they too get compiled for the correct calling * convention. * * On non-Windows operating systems, this macro is defined as nothing. This * means that you can apply it to your code without worrying about * cross-platform compatibility. */ /* LIBUSB_CALL must be defined on both definition and declaration of libusb * functions. You'd think that declaration would be enough, but cygwin will * complain about conflicting types unless both are marked this way. * The placement of this macro is important too; it must appear after the * return type, before the function name. See internal documentation for * API_EXPORTED. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) #define LIBUSB_CALL WINAPI #else #define LIBUSB_CALL #endif /** \def LIBUSB_API_VERSION * \ingroup misc * libusb's API version. * * Since version 1.0.13, to help with feature detection, libusb defines * a LIBUSB_API_VERSION macro that gets increased every time there is a * significant change to the API, such as the introduction of a new call, * the definition of a new macro/enum member, or any other element that * libusb applications may want to detect at compilation time. * * The macro is typically used in an application as follows: * \code * #if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01001234) * // Use one of the newer features from the libusb API * #endif * \endcode * * Another feature of LIBUSB_API_VERSION is that it can be used to detect * whether you are compiling against the libusb or the libusb library. * * Internally, LIBUSB_API_VERSION is defined as follows: * (libusb major << 24) | (libusb minor << 16) | (16 bit incremental) */ #define LIBUSB_API_VERSION 0x01000103 /* The following is kept for compatibility, but will be deprecated in the future */ #define LIBUSBX_API_VERSION LIBUSB_API_VERSION #ifdef __cplusplus extern "C" { #endif /** * \ingroup misc * Convert a 16-bit value from host-endian to little-endian format. On * little endian systems, this function does nothing. On big endian systems, * the bytes are swapped. * \param x the host-endian value to convert * \returns the value in little-endian byte order */ static inline uint16_t libusb_cpu_to_le16(const uint16_t x) { union { uint8_t b8[2]; uint16_t b16; } _tmp; _tmp.b8[1] = (uint8_t) (x >> 8); _tmp.b8[0] = (uint8_t) (x & 0xff); return _tmp.b16; } /** \def libusb_le16_to_cpu * \ingroup misc * Convert a 16-bit value from little-endian to host-endian format. On * little endian systems, this function does nothing. On big endian systems, * the bytes are swapped. * \param x the little-endian value to convert * \returns the value in host-endian byte order */ #define libusb_le16_to_cpu libusb_cpu_to_le16 /* standard USB stuff */ /** \ingroup desc * Device and/or Interface Class codes */ enum libusb_class_code { /** In the context of a \ref libusb_device_descriptor "device descriptor", * this bDeviceClass value indicates that each interface specifies its * own class information and all interfaces operate independently. */ LIBUSB_CLASS_PER_INTERFACE = 0, /** Audio class */ LIBUSB_CLASS_AUDIO = 1, /** Communications class */ LIBUSB_CLASS_COMM = 2, /** Human Interface Device class */ LIBUSB_CLASS_HID = 3, /** Physical */ LIBUSB_CLASS_PHYSICAL = 5, /** Printer class */ LIBUSB_CLASS_PRINTER = 7, /** Image class */ LIBUSB_CLASS_PTP = 6, /* legacy name from libusb-0.1 usb.h */ LIBUSB_CLASS_IMAGE = 6, /** Mass storage class */ LIBUSB_CLASS_MASS_STORAGE = 8, /** Hub class */ LIBUSB_CLASS_HUB = 9, /** Data class */ LIBUSB_CLASS_DATA = 10, /** Smart Card */ LIBUSB_CLASS_SMART_CARD = 0x0b, /** Content Security */ LIBUSB_CLASS_CONTENT_SECURITY = 0x0d, /** Video */ LIBUSB_CLASS_VIDEO = 0x0e, /** Personal Healthcare */ LIBUSB_CLASS_PERSONAL_HEALTHCARE = 0x0f, /** Diagnostic Device */ LIBUSB_CLASS_DIAGNOSTIC_DEVICE = 0xdc, /** Wireless class */ LIBUSB_CLASS_WIRELESS = 0xe0, /** Application class */ LIBUSB_CLASS_APPLICATION = 0xfe, /** Class is vendor-specific */ LIBUSB_CLASS_VENDOR_SPEC = 0xff }; /** \ingroup desc * Descriptor types as defined by the USB specification. */ enum libusb_descriptor_type { /** Device descriptor. See libusb_device_descriptor. */ LIBUSB_DT_DEVICE = 0x01, /** Configuration descriptor. See libusb_config_descriptor. */ LIBUSB_DT_CONFIG = 0x02, /** String descriptor */ LIBUSB_DT_STRING = 0x03, /** Interface descriptor. See libusb_interface_descriptor. */ LIBUSB_DT_INTERFACE = 0x04, /** Endpoint descriptor. See libusb_endpoint_descriptor. */ LIBUSB_DT_ENDPOINT = 0x05, /** BOS descriptor */ LIBUSB_DT_BOS = 0x0f, /** Device Capability descriptor */ LIBUSB_DT_DEVICE_CAPABILITY = 0x10, /** HID descriptor */ LIBUSB_DT_HID = 0x21, /** HID report descriptor */ LIBUSB_DT_REPORT = 0x22, /** Physical descriptor */ LIBUSB_DT_PHYSICAL = 0x23, /** Hub descriptor */ LIBUSB_DT_HUB = 0x29, /** SuperSpeed Hub descriptor */ LIBUSB_DT_SUPERSPEED_HUB = 0x2a, /** SuperSpeed Endpoint Companion descriptor */ LIBUSB_DT_SS_ENDPOINT_COMPANION = 0x30 }; /* Descriptor sizes per descriptor type */ #define LIBUSB_DT_DEVICE_SIZE 18 #define LIBUSB_DT_CONFIG_SIZE 9 #define LIBUSB_DT_INTERFACE_SIZE 9 #define LIBUSB_DT_ENDPOINT_SIZE 7 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ #define LIBUSB_DT_HUB_NONVAR_SIZE 7 #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6 #define LIBUSB_DT_BOS_SIZE 5 #define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3 /* BOS descriptor sizes */ #define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7 #define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10 #define LIBUSB_BT_CONTAINER_ID_SIZE 20 /* We unwrap the BOS => define its max size */ #define LIBUSB_DT_BOS_MAX_SIZE ((LIBUSB_DT_BOS_SIZE) +\ (LIBUSB_BT_USB_2_0_EXTENSION_SIZE) +\ (LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) +\ (LIBUSB_BT_CONTAINER_ID_SIZE)) #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ #define LIBUSB_ENDPOINT_DIR_MASK 0x80 /** \ingroup desc * Endpoint direction. Values for bit 7 of the * \ref libusb_endpoint_descriptor::bEndpointAddress "endpoint address" scheme. */ enum libusb_endpoint_direction { /** In: device-to-host */ LIBUSB_ENDPOINT_IN = 0x80, /** Out: host-to-device */ LIBUSB_ENDPOINT_OUT = 0x00 }; #define LIBUSB_TRANSFER_TYPE_MASK 0x03 /* in bmAttributes */ /** \ingroup desc * Endpoint transfer type. Values for bits 0:1 of the * \ref libusb_endpoint_descriptor::bmAttributes "endpoint attributes" field. */ enum libusb_transfer_type { /** Control endpoint */ LIBUSB_TRANSFER_TYPE_CONTROL = 0, /** Isochronous endpoint */ LIBUSB_TRANSFER_TYPE_ISOCHRONOUS = 1, /** Bulk endpoint */ LIBUSB_TRANSFER_TYPE_BULK = 2, /** Interrupt endpoint */ LIBUSB_TRANSFER_TYPE_INTERRUPT = 3, /** Stream endpoint */ LIBUSB_TRANSFER_TYPE_BULK_STREAM = 4, }; /** \ingroup misc * Standard requests, as defined in table 9-5 of the USB 3.0 specifications */ enum libusb_standard_request { /** Request status of the specific recipient */ LIBUSB_REQUEST_GET_STATUS = 0x00, /** Clear or disable a specific feature */ LIBUSB_REQUEST_CLEAR_FEATURE = 0x01, /* 0x02 is reserved */ /** Set or enable a specific feature */ LIBUSB_REQUEST_SET_FEATURE = 0x03, /* 0x04 is reserved */ /** Set device address for all future accesses */ LIBUSB_REQUEST_SET_ADDRESS = 0x05, /** Get the specified descriptor */ LIBUSB_REQUEST_GET_DESCRIPTOR = 0x06, /** Used to update existing descriptors or add new descriptors */ LIBUSB_REQUEST_SET_DESCRIPTOR = 0x07, /** Get the current device configuration value */ LIBUSB_REQUEST_GET_CONFIGURATION = 0x08, /** Set device configuration */ LIBUSB_REQUEST_SET_CONFIGURATION = 0x09, /** Return the selected alternate setting for the specified interface */ LIBUSB_REQUEST_GET_INTERFACE = 0x0A, /** Select an alternate interface for the specified interface */ LIBUSB_REQUEST_SET_INTERFACE = 0x0B, /** Set then report an endpoint's synchronization frame */ LIBUSB_REQUEST_SYNCH_FRAME = 0x0C, /** Sets both the U1 and U2 Exit Latency */ LIBUSB_REQUEST_SET_SEL = 0x30, /** Delay from the time a host transmits a packet to the time it is * received by the device. */ LIBUSB_SET_ISOCH_DELAY = 0x31, }; /** \ingroup misc * Request type bits of the * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control * transfers. */ enum libusb_request_type { /** Standard */ LIBUSB_REQUEST_TYPE_STANDARD = (0x00 << 5), /** Class */ LIBUSB_REQUEST_TYPE_CLASS = (0x01 << 5), /** Vendor */ LIBUSB_REQUEST_TYPE_VENDOR = (0x02 << 5), /** Reserved */ LIBUSB_REQUEST_TYPE_RESERVED = (0x03 << 5) }; /** \ingroup misc * Recipient bits of the * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control * transfers. Values 4 through 31 are reserved. */ enum libusb_request_recipient { /** Device */ LIBUSB_RECIPIENT_DEVICE = 0x00, /** Interface */ LIBUSB_RECIPIENT_INTERFACE = 0x01, /** Endpoint */ LIBUSB_RECIPIENT_ENDPOINT = 0x02, /** Other */ LIBUSB_RECIPIENT_OTHER = 0x03, }; #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C /** \ingroup desc * Synchronization type for isochronous endpoints. Values for bits 2:3 of the * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in * libusb_endpoint_descriptor. */ enum libusb_iso_sync_type { /** No synchronization */ LIBUSB_ISO_SYNC_TYPE_NONE = 0, /** Asynchronous */ LIBUSB_ISO_SYNC_TYPE_ASYNC = 1, /** Adaptive */ LIBUSB_ISO_SYNC_TYPE_ADAPTIVE = 2, /** Synchronous */ LIBUSB_ISO_SYNC_TYPE_SYNC = 3 }; #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30 /** \ingroup desc * Usage type for isochronous endpoints. Values for bits 4:5 of the * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in * libusb_endpoint_descriptor. */ enum libusb_iso_usage_type { /** Data endpoint */ LIBUSB_ISO_USAGE_TYPE_DATA = 0, /** Feedback endpoint */ LIBUSB_ISO_USAGE_TYPE_FEEDBACK = 1, /** Implicit feedback Data endpoint */ LIBUSB_ISO_USAGE_TYPE_IMPLICIT = 2, }; /** \ingroup desc * A structure representing the standard USB device descriptor. This * descriptor is documented in section 9.6.1 of the USB 3.0 specification. * All multiple-byte fields are represented in host-endian format. */ struct libusb_device_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE LIBUSB_DT_DEVICE in this * context. */ uint8_t bDescriptorType; /** USB specification release number in binary-coded decimal. A value of * 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc. */ uint16_t bcdUSB; /** USB-IF class code for the device. See \ref libusb_class_code. */ uint8_t bDeviceClass; /** USB-IF subclass code for the device, qualified by the bDeviceClass * value */ uint8_t bDeviceSubClass; /** USB-IF protocol code for the device, qualified by the bDeviceClass and * bDeviceSubClass values */ uint8_t bDeviceProtocol; /** Maximum packet size for endpoint 0 */ uint8_t bMaxPacketSize0; /** USB-IF vendor ID */ uint16_t idVendor; /** USB-IF product ID */ uint16_t idProduct; /** Device release number in binary-coded decimal */ uint16_t bcdDevice; /** Index of string descriptor describing manufacturer */ uint8_t iManufacturer; /** Index of string descriptor describing product */ uint8_t iProduct; /** Index of string descriptor containing device serial number */ uint8_t iSerialNumber; /** Number of possible configurations */ uint8_t bNumConfigurations; }; /** \ingroup desc * A structure representing the standard USB endpoint descriptor. This * descriptor is documented in section 9.6.6 of the USB 3.0 specification. * All multiple-byte fields are represented in host-endian format. */ struct libusb_endpoint_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_ENDPOINT LIBUSB_DT_ENDPOINT in * this context. */ uint8_t bDescriptorType; /** The address of the endpoint described by this descriptor. Bits 0:3 are * the endpoint number. Bits 4:6 are reserved. Bit 7 indicates direction, * see \ref libusb_endpoint_direction. */ uint8_t bEndpointAddress; /** Attributes which apply to the endpoint when it is configured using * the bConfigurationValue. Bits 0:1 determine the transfer type and * correspond to \ref libusb_transfer_type. Bits 2:3 are only used for * isochronous endpoints and correspond to \ref libusb_iso_sync_type. * Bits 4:5 are also only used for isochronous endpoints and correspond to * \ref libusb_iso_usage_type. Bits 6:7 are reserved. */ uint8_t bmAttributes; /** Maximum packet size this endpoint is capable of sending/receiving. */ uint16_t wMaxPacketSize; /** Interval for polling endpoint for data transfers. */ uint8_t bInterval; /** For audio devices only: the rate at which synchronization feedback * is provided. */ uint8_t bRefresh; /** For audio devices only: the address if the synch endpoint */ uint8_t bSynchAddress; /** Extra descriptors. If libusb encounters unknown endpoint descriptors, * it will store them here, should you wish to parse them. */ const unsigned char *extra; /** Length of the extra descriptors, in bytes. */ int extra_length; }; /** \ingroup desc * A structure representing the standard USB interface descriptor. This * descriptor is documented in section 9.6.5 of the USB 3.0 specification. * All multiple-byte fields are represented in host-endian format. */ struct libusb_interface_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_INTERFACE LIBUSB_DT_INTERFACE * in this context. */ uint8_t bDescriptorType; /** Number of this interface */ uint8_t bInterfaceNumber; /** Value used to select this alternate setting for this interface */ uint8_t bAlternateSetting; /** Number of endpoints used by this interface (excluding the control * endpoint). */ uint8_t bNumEndpoints; /** USB-IF class code for this interface. See \ref libusb_class_code. */ uint8_t bInterfaceClass; /** USB-IF subclass code for this interface, qualified by the * bInterfaceClass value */ uint8_t bInterfaceSubClass; /** USB-IF protocol code for this interface, qualified by the * bInterfaceClass and bInterfaceSubClass values */ uint8_t bInterfaceProtocol; /** Index of string descriptor describing this interface */ uint8_t iInterface; /** Array of endpoint descriptors. This length of this array is determined * by the bNumEndpoints field. */ const struct libusb_endpoint_descriptor *endpoint; /** Extra descriptors. If libusb encounters unknown interface descriptors, * it will store them here, should you wish to parse them. */ const unsigned char *extra; /** Length of the extra descriptors, in bytes. */ int extra_length; }; /** \ingroup desc * A collection of alternate settings for a particular USB interface. */ struct libusb_interface { /** Array of interface descriptors. The length of this array is determined * by the num_altsetting field. */ const struct libusb_interface_descriptor *altsetting; /** The number of alternate settings that belong to this interface */ int num_altsetting; }; /** \ingroup desc * A structure representing the standard USB configuration descriptor. This * descriptor is documented in section 9.6.3 of the USB 3.0 specification. * All multiple-byte fields are represented in host-endian format. */ struct libusb_config_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_CONFIG LIBUSB_DT_CONFIG * in this context. */ uint8_t bDescriptorType; /** Total length of data returned for this configuration */ uint16_t wTotalLength; /** Number of interfaces supported by this configuration */ uint8_t bNumInterfaces; /** Identifier value for this configuration */ uint8_t bConfigurationValue; /** Index of string descriptor describing this configuration */ uint8_t iConfiguration; /** Configuration characteristics */ uint8_t bmAttributes; /** Maximum power consumption of the USB device from this bus in this * configuration when the device is fully opreation. Expressed in units * of 2 mA. */ uint8_t MaxPower; /** Array of interfaces supported by this configuration. The length of * this array is determined by the bNumInterfaces field. */ const struct libusb_interface *interface; /** Extra descriptors. If libusb encounters unknown configuration * descriptors, it will store them here, should you wish to parse them. */ const unsigned char *extra; /** Length of the extra descriptors, in bytes. */ int extra_length; }; /** \ingroup desc * A structure representing the superspeed endpoint companion * descriptor. This descriptor is documented in section 9.6.7 of * the USB 3.0 specification. All multiple-byte fields are represented in * host-endian format. */ struct libusb_ss_endpoint_companion_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_SS_ENDPOINT_COMPANION in * this context. */ uint8_t bDescriptorType; /** The maximum number of packets the endpoint can send or * recieve as part of a burst. */ uint8_t bMaxBurst; /** In bulk EP: bits 4:0 represents the maximum number of * streams the EP supports. In isochronous EP: bits 1:0 * represents the Mult - a zero based value that determines * the maximum number of packets within a service interval */ uint8_t bmAttributes; /** The total number of bytes this EP will transfer every * service interval. valid only for periodic EPs. */ uint16_t wBytesPerInterval; }; /** \ingroup desc * A generic representation of a BOS Device Capability descriptor. It is * advised to check bDevCapabilityType and call the matching * libusb_get_*_descriptor function to get a structure fully matching the type. */ struct libusb_bos_dev_capability_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ uint8_t bDescriptorType; /** Device Capability type */ uint8_t bDevCapabilityType; /** Device Capability data (bLength - 3 bytes) */ uint8_t dev_capability_data #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) [] /* valid C99 code */ #else [0] /* non-standard, but usually working code */ #endif ; }; /** \ingroup desc * A structure representing the Binary Device Object Store (BOS) descriptor. * This descriptor is documented in section 9.6.2 of the USB 3.0 specification. * All multiple-byte fields are represented in host-endian format. */ struct libusb_bos_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_BOS LIBUSB_DT_BOS * in this context. */ uint8_t bDescriptorType; /** Length of this descriptor and all of its sub descriptors */ uint16_t wTotalLength; /** The number of separate device capability descriptors in * the BOS */ uint8_t bNumDeviceCaps; /** bNumDeviceCap Device Capability Descriptors */ struct libusb_bos_dev_capability_descriptor *dev_capability #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) [] /* valid C99 code */ #else [0] /* non-standard, but usually working code */ #endif ; }; /** \ingroup desc * A structure representing the USB 2.0 Extension descriptor * This descriptor is documented in section 9.6.2.1 of the USB 3.0 specification. * All multiple-byte fields are represented in host-endian format. */ struct libusb_usb_2_0_extension_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ uint8_t bDescriptorType; /** Capability type. Will have value * \ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION * LIBUSB_BT_USB_2_0_EXTENSION in this context. */ uint8_t bDevCapabilityType; /** Bitmap encoding of supported device level features. * A value of one in a bit location indicates a feature is * supported; a value of zero indicates it is not supported. * See \ref libusb_usb_2_0_extension_attributes. */ uint32_t bmAttributes; }; /** \ingroup desc * A structure representing the SuperSpeed USB Device Capability descriptor * This descriptor is documented in section 9.6.2.2 of the USB 3.0 specification. * All multiple-byte fields are represented in host-endian format. */ struct libusb_ss_usb_device_capability_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ uint8_t bDescriptorType; /** Capability type. Will have value * \ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY in this context. */ uint8_t bDevCapabilityType; /** Bitmap encoding of supported device level features. * A value of one in a bit location indicates a feature is * supported; a value of zero indicates it is not supported. * See \ref libusb_ss_usb_device_capability_attributes. */ uint8_t bmAttributes; /** Bitmap encoding of the speed supported by this device when * operating in SuperSpeed mode. See \ref libusb_supported_speed. */ uint16_t wSpeedSupported; /** The lowest speed at which all the functionality supported * by the device is available to the user. For example if the * device supports all its functionality when connected at * full speed and above then it sets this value to 1. */ uint8_t bFunctionalitySupport; /** U1 Device Exit Latency. */ uint8_t bU1DevExitLat; /** U2 Device Exit Latency. */ uint16_t bU2DevExitLat; }; /** \ingroup desc * A structure representing the Container ID descriptor. * This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification. * All multiple-byte fields, except UUIDs, are represented in host-endian format. */ struct libusb_container_id_descriptor { /** Size of this descriptor (in bytes) */ uint8_t bLength; /** Descriptor type. Will have value * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY * LIBUSB_DT_DEVICE_CAPABILITY in this context. */ uint8_t bDescriptorType; /** Capability type. Will have value * \ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID * LIBUSB_BT_CONTAINER_ID in this context. */ uint8_t bDevCapabilityType; /** Reserved field */ uint8_t bReserved; /** 128 bit UUID */ uint8_t ContainerID[16]; }; /** \ingroup asyncio * Setup packet for control transfers. */ struct libusb_control_setup { /** Request type. Bits 0:4 determine recipient, see * \ref libusb_request_recipient. Bits 5:6 determine type, see * \ref libusb_request_type. Bit 7 determines data transfer direction, see * \ref libusb_endpoint_direction. */ uint8_t bmRequestType; /** Request. If the type bits of bmRequestType are equal to * \ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD * "LIBUSB_REQUEST_TYPE_STANDARD" then this field refers to * \ref libusb_standard_request. For other cases, use of this field is * application-specific. */ uint8_t bRequest; /** Value. Varies according to request */ uint16_t wValue; /** Index. Varies according to request, typically used to pass an index * or offset */ uint16_t wIndex; /** Number of bytes to transfer */ uint16_t wLength; }; #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup)) /* libusb */ struct libusb_context; struct libusb_device; struct libusb_device_handle; struct libusb_hotplug_callback; /** \ingroup lib * Structure providing the version of the libusb runtime */ struct libusb_version { /** Library major version. */ const uint16_t major; /** Library minor version. */ const uint16_t minor; /** Library micro version. */ const uint16_t micro; /** Library nano version. */ const uint16_t nano; /** Library release candidate suffix string, e.g. "-rc4". */ const char *rc; /** For ABI compatibility only. */ const char* describe; }; /** \ingroup lib * Structure representing a libusb session. The concept of individual libusb * sessions allows for your program to use two libraries (or dynamically * load two modules) which both independently use libusb. This will prevent * interference between the individual libusb users - for example * libusb_set_debug() will not affect the other user of the library, and * libusb_exit() will not destroy resources that the other user is still * using. * * Sessions are created by libusb_init() and destroyed through libusb_exit(). * If your application is guaranteed to only ever include a single libusb * user (i.e. you), you do not have to worry about contexts: pass NULL in * every function call where a context is required. The default context * will be used. * * For more information, see \ref contexts. */ typedef struct libusb_context libusb_context; /** \ingroup dev * Structure representing a USB device detected on the system. This is an * opaque type for which you are only ever provided with a pointer, usually * originating from libusb_get_device_list(). * * Certain operations can be performed on a device, but in order to do any * I/O you will have to first obtain a device handle using libusb_open(). * * Devices are reference counted with libusb_ref_device() and * libusb_unref_device(), and are freed when the reference count reaches 0. * New devices presented by libusb_get_device_list() have a reference count of * 1, and libusb_free_device_list() can optionally decrease the reference count * on all devices in the list. libusb_open() adds another reference which is * later destroyed by libusb_close(). */ typedef struct libusb_device libusb_device; /** \ingroup dev * Structure representing a handle on a USB device. This is an opaque type for * which you are only ever provided with a pointer, usually originating from * libusb_open(). * * A device handle is used to perform I/O and other operations. When finished * with a device handle, you should call libusb_close(). */ typedef struct libusb_device_handle libusb_device_handle; /** \ingroup dev * Speed codes. Indicates the speed at which the device is operating. */ enum libusb_speed { /** The OS doesn't report or know the device speed. */ LIBUSB_SPEED_UNKNOWN = 0, /** The device is operating at low speed (1.5MBit/s). */ LIBUSB_SPEED_LOW = 1, /** The device is operating at full speed (12MBit/s). */ LIBUSB_SPEED_FULL = 2, /** The device is operating at high speed (480MBit/s). */ LIBUSB_SPEED_HIGH = 3, /** The device is operating at super speed (5000MBit/s). */ LIBUSB_SPEED_SUPER = 4, }; /** \ingroup dev * Supported speeds (wSpeedSupported) bitfield. Indicates what * speeds the device supports. */ enum libusb_supported_speed { /** Low speed operation supported (1.5MBit/s). */ LIBUSB_LOW_SPEED_OPERATION = 1, /** Full speed operation supported (12MBit/s). */ LIBUSB_FULL_SPEED_OPERATION = 2, /** High speed operation supported (480MBit/s). */ LIBUSB_HIGH_SPEED_OPERATION = 4, /** Superspeed operation supported (5000MBit/s). */ LIBUSB_SUPER_SPEED_OPERATION = 8, }; /** \ingroup dev * Masks for the bits of the * \ref libusb_usb_2_0_extension_descriptor::bmAttributes "bmAttributes" field * of the USB 2.0 Extension descriptor. */ enum libusb_usb_2_0_extension_attributes { /** Supports Link Power Management (LPM) */ LIBUSB_BM_LPM_SUPPORT = 2, }; /** \ingroup dev * Masks for the bits of the * \ref libusb_ss_usb_device_capability_descriptor::bmAttributes "bmAttributes" field * field of the SuperSpeed USB Device Capability descriptor. */ enum libusb_ss_usb_device_capability_attributes { /** Supports Latency Tolerance Messages (LTM) */ LIBUSB_BM_LTM_SUPPORT = 2, }; /** \ingroup dev * USB capability types */ enum libusb_bos_type { /** Wireless USB device capability */ LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY = 1, /** USB 2.0 extensions */ LIBUSB_BT_USB_2_0_EXTENSION = 2, /** SuperSpeed USB device capability */ LIBUSB_BT_SS_USB_DEVICE_CAPABILITY = 3, /** Container ID type */ LIBUSB_BT_CONTAINER_ID = 4, }; /** \ingroup misc * Error codes. Most libusb functions return 0 on success or one of these * codes on failure. * You can call libusb_error_name() to retrieve a string representation of an * error code or libusb_strerror() to get an end-user suitable description of * an error code. */ enum libusb_error { /** Success (no error) */ LIBUSB_SUCCESS = 0, /** Input/output error */ LIBUSB_ERROR_IO = -1, /** Invalid parameter */ LIBUSB_ERROR_INVALID_PARAM = -2, /** Access denied (insufficient permissions) */ LIBUSB_ERROR_ACCESS = -3, /** No such device (it may have been disconnected) */ LIBUSB_ERROR_NO_DEVICE = -4, /** Entity not found */ LIBUSB_ERROR_NOT_FOUND = -5, /** Resource busy */ LIBUSB_ERROR_BUSY = -6, /** Operation timed out */ LIBUSB_ERROR_TIMEOUT = -7, /** Overflow */ LIBUSB_ERROR_OVERFLOW = -8, /** Pipe error */ LIBUSB_ERROR_PIPE = -9, /** System call interrupted (perhaps due to signal) */ LIBUSB_ERROR_INTERRUPTED = -10, /** Insufficient memory */ LIBUSB_ERROR_NO_MEM = -11, /** Operation not supported or unimplemented on this platform */ LIBUSB_ERROR_NOT_SUPPORTED = -12, /* NB: Remember to update LIBUSB_ERROR_COUNT below as well as the message strings in strerror.c when adding new error codes here. */ /** Other error */ LIBUSB_ERROR_OTHER = -99, }; /* Total number of error codes in enum libusb_error */ #define LIBUSB_ERROR_COUNT 14 /** \ingroup asyncio * Transfer status codes */ enum libusb_transfer_status { /** Transfer completed without error. Note that this does not indicate * that the entire amount of requested data was transferred. */ LIBUSB_TRANSFER_COMPLETED, /** Transfer failed */ LIBUSB_TRANSFER_ERROR, /** Transfer timed out */ LIBUSB_TRANSFER_TIMED_OUT, /** Transfer was cancelled */ LIBUSB_TRANSFER_CANCELLED, /** For bulk/interrupt endpoints: halt condition detected (endpoint * stalled). For control endpoints: control request not supported. */ LIBUSB_TRANSFER_STALL, /** Device was disconnected */ LIBUSB_TRANSFER_NO_DEVICE, /** Device sent more data than requested */ LIBUSB_TRANSFER_OVERFLOW, /* NB! Remember to update libusb_error_name() when adding new status codes here. */ }; /** \ingroup asyncio * libusb_transfer.flags values */ enum libusb_transfer_flags { /** Report short frames as errors */ LIBUSB_TRANSFER_SHORT_NOT_OK = 1<<0, /** Automatically free() transfer buffer during libusb_free_transfer() */ LIBUSB_TRANSFER_FREE_BUFFER = 1<<1, /** Automatically call libusb_free_transfer() after callback returns. * If this flag is set, it is illegal to call libusb_free_transfer() * from your transfer callback, as this will result in a double-free * when this flag is acted upon. */ LIBUSB_TRANSFER_FREE_TRANSFER = 1<<2, /** Terminate transfers that are a multiple of the endpoint's * wMaxPacketSize with an extra zero length packet. This is useful * when a device protocol mandates that each logical request is * terminated by an incomplete packet (i.e. the logical requests are * not separated by other means). * * This flag only affects host-to-device transfers to bulk and interrupt * endpoints. In other situations, it is ignored. * * This flag only affects transfers with a length that is a multiple of * the endpoint's wMaxPacketSize. On transfers of other lengths, this * flag has no effect. Therefore, if you are working with a device that * needs a ZLP whenever the end of the logical request falls on a packet * boundary, then it is sensible to set this flag on every * transfer (you do not have to worry about only setting it on transfers * that end on the boundary). * * This flag is currently only supported on Linux. * On other systems, libusb_submit_transfer() will return * LIBUSB_ERROR_NOT_SUPPORTED for every transfer where this flag is set. * * Available since libusb-1.0.9. */ LIBUSB_TRANSFER_ADD_ZERO_PACKET = 1 << 3, }; /** \ingroup asyncio * Isochronous packet descriptor. */ struct libusb_iso_packet_descriptor { /** Length of data to request in this packet */ unsigned int length; /** Amount of data that was actually transferred */ unsigned int actual_length; /** Status code for this packet */ enum libusb_transfer_status status; }; struct libusb_transfer; /** \ingroup asyncio * Asynchronous transfer callback function type. When submitting asynchronous * transfers, you pass a pointer to a callback function of this type via the * \ref libusb_transfer::callback "callback" member of the libusb_transfer * structure. libusb will call this function later, when the transfer has * completed or failed. See \ref asyncio for more information. * \param transfer The libusb_transfer struct the callback function is being * notified about. */ typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer); /** \ingroup asyncio * The generic USB transfer structure. The user populates this structure and * then submits it in order to request a transfer. After the transfer has * completed, the library populates the transfer with the results and passes * it back to the user. */ struct libusb_transfer { /** Handle of the device that this transfer will be submitted to */ libusb_device_handle *dev_handle; /** A bitwise OR combination of \ref libusb_transfer_flags. */ uint8_t flags; /** Address of the endpoint where this transfer will be sent. */ unsigned char endpoint; /** Type of the endpoint from \ref libusb_transfer_type */ unsigned char type; /** Timeout for this transfer in millseconds. A value of 0 indicates no * timeout. */ unsigned int timeout; /** The status of the transfer. Read-only, and only for use within * transfer callback function. * * If this is an isochronous transfer, this field may read COMPLETED even * if there were errors in the frames. Use the * \ref libusb_iso_packet_descriptor::status "status" field in each packet * to determine if errors occurred. */ enum libusb_transfer_status status; /** Length of the data buffer */ int length; /** Actual length of data that was transferred. Read-only, and only for * use within transfer callback function. Not valid for isochronous * endpoint transfers. */ int actual_length; /** Callback function. This will be invoked when the transfer completes, * fails, or is cancelled. */ libusb_transfer_cb_fn callback; /** User context data to pass to the callback function. */ void *user_data; /** Data buffer */ unsigned char *buffer; /** Number of isochronous packets. Only used for I/O with isochronous * endpoints. */ int num_iso_packets; /** Isochronous packet descriptors, for isochronous transfers only. */ struct libusb_iso_packet_descriptor iso_packet_desc #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) [] /* valid C99 code */ #else [0] /* non-standard, but usually working code */ #endif ; }; /** \ingroup misc * Capabilities supported by an instance of libusb on the current running * platform. Test if the loaded library supports a given capability by calling * \ref libusb_has_capability(). */ enum libusb_capability { /** The libusb_has_capability() API is available. */ LIBUSB_CAP_HAS_CAPABILITY = 0x0000, /** Hotplug support is available on this platform. */ LIBUSB_CAP_HAS_HOTPLUG = 0x0001, /** The library can access HID devices without requiring user intervention. * Note that before being able to actually access an HID device, you may * still have to call additional libusb functions such as * \ref libusb_detach_kernel_driver(). */ LIBUSB_CAP_HAS_HID_ACCESS = 0x0100, /** The library supports detaching of the default USB driver, using * \ref libusb_detach_kernel_driver(), if one is set by the OS kernel */ LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER = 0x0101 }; /** \ingroup lib * Log message levels. * - LIBUSB_LOG_LEVEL_NONE (0) : no messages ever printed by the library (default) * - LIBUSB_LOG_LEVEL_ERROR (1) : error messages are printed to stderr * - LIBUSB_LOG_LEVEL_WARNING (2) : warning and error messages are printed to stderr * - LIBUSB_LOG_LEVEL_INFO (3) : informational messages are printed to stdout, warning * and error messages are printed to stderr * - LIBUSB_LOG_LEVEL_DEBUG (4) : debug and informational messages are printed to stdout, * warnings and errors to stderr */ enum libusb_log_level { LIBUSB_LOG_LEVEL_NONE = 0, LIBUSB_LOG_LEVEL_ERROR, LIBUSB_LOG_LEVEL_WARNING, LIBUSB_LOG_LEVEL_INFO, LIBUSB_LOG_LEVEL_DEBUG, }; int LIBUSB_CALL libusb_init(libusb_context **ctx); void LIBUSB_CALL libusb_exit(libusb_context *ctx); void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level); const struct libusb_version * LIBUSB_CALL libusb_get_version(void); int LIBUSB_CALL libusb_has_capability(uint32_t capability); const char * LIBUSB_CALL libusb_error_name(int errcode); int LIBUSB_CALL libusb_setlocale(const char *locale); const char * LIBUSB_CALL libusb_strerror(enum libusb_error errcode); ssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx, libusb_device ***list); void LIBUSB_CALL libusb_free_device_list(libusb_device **list, int unref_devices); libusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev); void LIBUSB_CALL libusb_unref_device(libusb_device *dev); int LIBUSB_CALL libusb_get_configuration(libusb_device_handle *dev, int *config); int LIBUSB_CALL libusb_get_device_descriptor(libusb_device *dev, struct libusb_device_descriptor *desc); int LIBUSB_CALL libusb_get_active_config_descriptor(libusb_device *dev, struct libusb_config_descriptor **config); int LIBUSB_CALL libusb_get_config_descriptor(libusb_device *dev, uint8_t config_index, struct libusb_config_descriptor **config); int LIBUSB_CALL libusb_get_config_descriptor_by_value(libusb_device *dev, uint8_t bConfigurationValue, struct libusb_config_descriptor **config); void LIBUSB_CALL libusb_free_config_descriptor( struct libusb_config_descriptor *config); int LIBUSB_CALL libusb_get_ss_endpoint_companion_descriptor( struct libusb_context *ctx, const struct libusb_endpoint_descriptor *endpoint, struct libusb_ss_endpoint_companion_descriptor **ep_comp); void LIBUSB_CALL libusb_free_ss_endpoint_companion_descriptor( struct libusb_ss_endpoint_companion_descriptor *ep_comp); int LIBUSB_CALL libusb_get_bos_descriptor(libusb_device_handle *handle, struct libusb_bos_descriptor **bos); void LIBUSB_CALL libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos); int LIBUSB_CALL libusb_get_usb_2_0_extension_descriptor( struct libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension); void LIBUSB_CALL libusb_free_usb_2_0_extension_descriptor( struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension); int LIBUSB_CALL libusb_get_ss_usb_device_capability_descriptor( struct libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap); void LIBUSB_CALL libusb_free_ss_usb_device_capability_descriptor( struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap); int LIBUSB_CALL libusb_get_container_id_descriptor(struct libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_container_id_descriptor **container_id); void LIBUSB_CALL libusb_free_container_id_descriptor( struct libusb_container_id_descriptor *container_id); uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev); uint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev); int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len); LIBUSB_DEPRECATED_FOR(libusb_get_port_numbers) int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t* path, uint8_t path_length); libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev); uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev); int LIBUSB_CALL libusb_get_device_speed(libusb_device *dev); int LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev, unsigned char endpoint); int LIBUSB_CALL libusb_get_max_iso_packet_size(libusb_device *dev, unsigned char endpoint); int LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **handle); void LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle); libusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle); int LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev, int configuration); int LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev, int interface_number); int LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev, int interface_number); libusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid( libusb_context *ctx, uint16_t vendor_id, uint16_t product_id); int LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev, int interface_number, int alternate_setting); int LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev, unsigned char endpoint); int LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev); int LIBUSB_CALL libusb_alloc_streams(libusb_device_handle *dev, uint32_t num_streams, unsigned char *endpoints, int num_endpoints); int LIBUSB_CALL libusb_free_streams(libusb_device_handle *dev, unsigned char *endpoints, int num_endpoints); int LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev, int interface_number); int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev, int interface_number); int LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev, int interface_number); int LIBUSB_CALL libusb_set_auto_detach_kernel_driver( libusb_device_handle *dev, int enable); /* async I/O */ /** \ingroup asyncio * Get the data section of a control transfer. This convenience function is here * to remind you that the data does not start until 8 bytes into the actual * buffer, as the setup packet comes first. * * Calling this function only makes sense from a transfer callback function, * or situations where you have already allocated a suitably sized buffer at * transfer->buffer. * * \param transfer a transfer * \returns pointer to the first byte of the data section */ static inline unsigned char *libusb_control_transfer_get_data( struct libusb_transfer *transfer) { return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE; } /** \ingroup asyncio * Get the control setup packet of a control transfer. This convenience * function is here to remind you that the control setup occupies the first * 8 bytes of the transfer data buffer. * * Calling this function only makes sense from a transfer callback function, * or situations where you have already allocated a suitably sized buffer at * transfer->buffer. * * \param transfer a transfer * \returns a casted pointer to the start of the transfer data buffer */ static inline struct libusb_control_setup *libusb_control_transfer_get_setup( struct libusb_transfer *transfer) { return (struct libusb_control_setup *)(void *) transfer->buffer; } /** \ingroup asyncio * Helper function to populate the setup packet (first 8 bytes of the data * buffer) for a control transfer. The wIndex, wValue and wLength values should * be given in host-endian byte order. * * \param buffer buffer to output the setup packet into * This pointer must be aligned to at least 2 bytes boundary. * \param bmRequestType see the * \ref libusb_control_setup::bmRequestType "bmRequestType" field of * \ref libusb_control_setup * \param bRequest see the * \ref libusb_control_setup::bRequest "bRequest" field of * \ref libusb_control_setup * \param wValue see the * \ref libusb_control_setup::wValue "wValue" field of * \ref libusb_control_setup * \param wIndex see the * \ref libusb_control_setup::wIndex "wIndex" field of * \ref libusb_control_setup * \param wLength see the * \ref libusb_control_setup::wLength "wLength" field of * \ref libusb_control_setup */ static inline void libusb_fill_control_setup(unsigned char *buffer, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength) { struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer; setup->bmRequestType = bmRequestType; setup->bRequest = bRequest; setup->wValue = libusb_cpu_to_le16(wValue); setup->wIndex = libusb_cpu_to_le16(wIndex); setup->wLength = libusb_cpu_to_le16(wLength); } struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(int iso_packets); int LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer); int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer); void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer); void LIBUSB_CALL libusb_transfer_set_stream_id( struct libusb_transfer *transfer, uint32_t stream_id); uint32_t LIBUSB_CALL libusb_transfer_get_stream_id( struct libusb_transfer *transfer); /** \ingroup asyncio * Helper function to populate the required \ref libusb_transfer fields * for a control transfer. * * If you pass a transfer buffer to this function, the first 8 bytes will * be interpreted as a control setup packet, and the wLength field will be * used to automatically populate the \ref libusb_transfer::length "length" * field of the transfer. Therefore the recommended approach is: * -# Allocate a suitably sized data buffer (including space for control setup) * -# Call libusb_fill_control_setup() * -# If this is a host-to-device transfer with a data stage, put the data * in place after the setup packet * -# Call this function * -# Call libusb_submit_transfer() * * It is also legal to pass a NULL buffer to this function, in which case this * function will not attempt to populate the length field. Remember that you * must then populate the buffer and length fields later. * * \param transfer the transfer to populate * \param dev_handle handle of the device that will handle the transfer * \param buffer data buffer. If provided, this function will interpret the * first 8 bytes as a setup packet and infer the transfer length from that. * This pointer must be aligned to at least 2 bytes boundary. * \param callback callback function to be invoked on transfer completion * \param user_data user data to pass to callback function * \param timeout timeout for the transfer in milliseconds */ static inline void libusb_fill_control_transfer( struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) { struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer; transfer->dev_handle = dev_handle; transfer->endpoint = 0; transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL; transfer->timeout = timeout; transfer->buffer = buffer; if (setup) transfer->length = (int) (LIBUSB_CONTROL_SETUP_SIZE + libusb_le16_to_cpu(setup->wLength)); transfer->user_data = user_data; transfer->callback = callback; } /** \ingroup asyncio * Helper function to populate the required \ref libusb_transfer fields * for a bulk transfer. * * \param transfer the transfer to populate * \param dev_handle handle of the device that will handle the transfer * \param endpoint address of the endpoint where this transfer will be sent * \param buffer data buffer * \param length length of data buffer * \param callback callback function to be invoked on transfer completion * \param user_data user data to pass to callback function * \param timeout timeout for the transfer in milliseconds */ static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *buffer, int length, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) { transfer->dev_handle = dev_handle; transfer->endpoint = endpoint; transfer->type = LIBUSB_TRANSFER_TYPE_BULK; transfer->timeout = timeout; transfer->buffer = buffer; transfer->length = length; transfer->user_data = user_data; transfer->callback = callback; } /** \ingroup asyncio * Helper function to populate the required \ref libusb_transfer fields * for a bulk transfer using bulk streams. * * Since version 1.0.19, \ref LIBUSB_API_VERSION >= 0x01000103 * * \param transfer the transfer to populate * \param dev_handle handle of the device that will handle the transfer * \param endpoint address of the endpoint where this transfer will be sent * \param stream_id bulk stream id for this transfer * \param buffer data buffer * \param length length of data buffer * \param callback callback function to be invoked on transfer completion * \param user_data user data to pass to callback function * \param timeout timeout for the transfer in milliseconds */ static inline void libusb_fill_bulk_stream_transfer( struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char endpoint, uint32_t stream_id, unsigned char *buffer, int length, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) { libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length, callback, user_data, timeout); transfer->type = LIBUSB_TRANSFER_TYPE_BULK_STREAM; libusb_transfer_set_stream_id(transfer, stream_id); } /** \ingroup asyncio * Helper function to populate the required \ref libusb_transfer fields * for an interrupt transfer. * * \param transfer the transfer to populate * \param dev_handle handle of the device that will handle the transfer * \param endpoint address of the endpoint where this transfer will be sent * \param buffer data buffer * \param length length of data buffer * \param callback callback function to be invoked on transfer completion * \param user_data user data to pass to callback function * \param timeout timeout for the transfer in milliseconds */ static inline void libusb_fill_interrupt_transfer( struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *buffer, int length, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) { transfer->dev_handle = dev_handle; transfer->endpoint = endpoint; transfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT; transfer->timeout = timeout; transfer->buffer = buffer; transfer->length = length; transfer->user_data = user_data; transfer->callback = callback; } /** \ingroup asyncio * Helper function to populate the required \ref libusb_transfer fields * for an isochronous transfer. * * \param transfer the transfer to populate * \param dev_handle handle of the device that will handle the transfer * \param endpoint address of the endpoint where this transfer will be sent * \param buffer data buffer * \param length length of data buffer * \param num_iso_packets the number of isochronous packets * \param callback callback function to be invoked on transfer completion * \param user_data user data to pass to callback function * \param timeout timeout for the transfer in milliseconds */ static inline void libusb_fill_iso_transfer(struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *buffer, int length, int num_iso_packets, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) { transfer->dev_handle = dev_handle; transfer->endpoint = endpoint; transfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS; transfer->timeout = timeout; transfer->buffer = buffer; transfer->length = length; transfer->num_iso_packets = num_iso_packets; transfer->user_data = user_data; transfer->callback = callback; } /** \ingroup asyncio * Convenience function to set the length of all packets in an isochronous * transfer, based on the num_iso_packets field in the transfer structure. * * \param transfer a transfer * \param length the length to set in each isochronous packet descriptor * \see libusb_get_max_packet_size() */ static inline void libusb_set_iso_packet_lengths( struct libusb_transfer *transfer, unsigned int length) { int i; for (i = 0; i < transfer->num_iso_packets; i++) transfer->iso_packet_desc[i].length = length; } /** \ingroup asyncio * Convenience function to locate the position of an isochronous packet * within the buffer of an isochronous transfer. * * This is a thorough function which loops through all preceding packets, * accumulating their lengths to find the position of the specified packet. * Typically you will assign equal lengths to each packet in the transfer, * and hence the above method is sub-optimal. You may wish to use * libusb_get_iso_packet_buffer_simple() instead. * * \param transfer a transfer * \param packet the packet to return the address of * \returns the base address of the packet buffer inside the transfer buffer, * or NULL if the packet does not exist. * \see libusb_get_iso_packet_buffer_simple() */ static inline unsigned char *libusb_get_iso_packet_buffer( struct libusb_transfer *transfer, unsigned int packet) { int i; size_t offset = 0; int _packet; /* oops..slight bug in the API. packet is an unsigned int, but we use * signed integers almost everywhere else. range-check and convert to * signed to avoid compiler warnings. FIXME for libusb-2. */ if (packet > INT_MAX) return NULL; _packet = (int) packet; if (_packet >= transfer->num_iso_packets) return NULL; for (i = 0; i < _packet; i++) offset += transfer->iso_packet_desc[i].length; return transfer->buffer + offset; } /** \ingroup asyncio * Convenience function to locate the position of an isochronous packet * within the buffer of an isochronous transfer, for transfers where each * packet is of identical size. * * This function relies on the assumption that every packet within the transfer * is of identical size to the first packet. Calculating the location of * the packet buffer is then just a simple calculation: * buffer + (packet_size * packet) * * Do not use this function on transfers other than those that have identical * packet lengths for each packet. * * \param transfer a transfer * \param packet the packet to return the address of * \returns the base address of the packet buffer inside the transfer buffer, * or NULL if the packet does not exist. * \see libusb_get_iso_packet_buffer() */ static inline unsigned char *libusb_get_iso_packet_buffer_simple( struct libusb_transfer *transfer, unsigned int packet) { int _packet; /* oops..slight bug in the API. packet is an unsigned int, but we use * signed integers almost everywhere else. range-check and convert to * signed to avoid compiler warnings. FIXME for libusb-2. */ if (packet > INT_MAX) return NULL; _packet = (int) packet; if (_packet >= transfer->num_iso_packets) return NULL; return transfer->buffer + ((int) transfer->iso_packet_desc[0].length * _packet); } /* sync I/O */ int LIBUSB_CALL libusb_control_transfer(libusb_device_handle *dev_handle, uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, unsigned char *data, uint16_t wLength, unsigned int timeout); int LIBUSB_CALL libusb_bulk_transfer(libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *data, int length, int *actual_length, unsigned int timeout); int LIBUSB_CALL libusb_interrupt_transfer(libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *data, int length, int *actual_length, unsigned int timeout); /** \ingroup desc * Retrieve a descriptor from the default control pipe. * This is a convenience function which formulates the appropriate control * message to retrieve the descriptor. * * \param dev a device handle * \param desc_type the descriptor type, see \ref libusb_descriptor_type * \param desc_index the index of the descriptor to retrieve * \param data output buffer for descriptor * \param length size of data buffer * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure */ static inline int libusb_get_descriptor(libusb_device_handle *dev, uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length) { return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN, LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) ((desc_type << 8) | desc_index), 0, data, (uint16_t) length, 1000); } /** \ingroup desc * Retrieve a descriptor from a device. * This is a convenience function which formulates the appropriate control * message to retrieve the descriptor. The string returned is Unicode, as * detailed in the USB specifications. * * \param dev a device handle * \param desc_index the index of the descriptor to retrieve * \param langid the language ID for the string descriptor * \param data output buffer for descriptor * \param length size of data buffer * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure * \see libusb_get_string_descriptor_ascii() */ static inline int libusb_get_string_descriptor(libusb_device_handle *dev, uint8_t desc_index, uint16_t langid, unsigned char *data, int length) { return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN, LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t)((LIBUSB_DT_STRING << 8) | desc_index), langid, data, (uint16_t) length, 1000); } int LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev, uint8_t desc_index, unsigned char *data, int length); /* polling and timeouts */ int LIBUSB_CALL libusb_try_lock_events(libusb_context *ctx); void LIBUSB_CALL libusb_lock_events(libusb_context *ctx); void LIBUSB_CALL libusb_unlock_events(libusb_context *ctx); int LIBUSB_CALL libusb_event_handling_ok(libusb_context *ctx); int LIBUSB_CALL libusb_event_handler_active(libusb_context *ctx); void LIBUSB_CALL libusb_lock_event_waiters(libusb_context *ctx); void LIBUSB_CALL libusb_unlock_event_waiters(libusb_context *ctx); int LIBUSB_CALL libusb_wait_for_event(libusb_context *ctx, struct timeval *tv); int LIBUSB_CALL libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv); int LIBUSB_CALL libusb_handle_events_timeout_completed(libusb_context *ctx, struct timeval *tv, int *completed); int LIBUSB_CALL libusb_handle_events(libusb_context *ctx); int LIBUSB_CALL libusb_handle_events_completed(libusb_context *ctx, int *completed); int LIBUSB_CALL libusb_handle_events_locked(libusb_context *ctx, struct timeval *tv); int LIBUSB_CALL libusb_pollfds_handle_timeouts(libusb_context *ctx); int LIBUSB_CALL libusb_get_next_timeout(libusb_context *ctx, struct timeval *tv); /** \ingroup poll * File descriptor for polling */ struct libusb_pollfd { /** Numeric file descriptor */ int fd; /** Event flags to poll for from . POLLIN indicates that you * should monitor this file descriptor for becoming ready to read from, * and POLLOUT indicates that you should monitor this file descriptor for * nonblocking write readiness. */ short events; }; /** \ingroup poll * Callback function, invoked when a new file descriptor should be added * to the set of file descriptors monitored for events. * \param fd the new file descriptor * \param events events to monitor for, see \ref libusb_pollfd for a * description * \param user_data User data pointer specified in * libusb_set_pollfd_notifiers() call * \see libusb_set_pollfd_notifiers() */ typedef void (LIBUSB_CALL *libusb_pollfd_added_cb)(int fd, short events, void *user_data); /** \ingroup poll * Callback function, invoked when a file descriptor should be removed from * the set of file descriptors being monitored for events. After returning * from this callback, do not use that file descriptor again. * \param fd the file descriptor to stop monitoring * \param user_data User data pointer specified in * libusb_set_pollfd_notifiers() call * \see libusb_set_pollfd_notifiers() */ typedef void (LIBUSB_CALL *libusb_pollfd_removed_cb)(int fd, void *user_data); const struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds( libusb_context *ctx); void LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx, libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, void *user_data); /** \ingroup hotplug * Callback handle. * * Callbacks handles are generated by libusb_hotplug_register_callback() * and can be used to deregister callbacks. Callback handles are unique * per libusb_context and it is safe to call libusb_hotplug_deregister_callback() * on an already deregisted callback. * * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * For more information, see \ref hotplug. */ typedef int libusb_hotplug_callback_handle; /** \ingroup hotplug * * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * Flags for hotplug events */ typedef enum { /** Arm the callback and fire it for all matching currently attached devices. */ LIBUSB_HOTPLUG_ENUMERATE = 1, } libusb_hotplug_flag; /** \ingroup hotplug * * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * Hotplug events */ typedef enum { /** A device has been plugged in and is ready to use */ LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED = 0x01, /** A device has left and is no longer available. * It is the user's responsibility to call libusb_close on any handle associated with a disconnected device. * It is safe to call libusb_get_device_descriptor on a device that has left */ LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT = 0x02, } libusb_hotplug_event; /** \ingroup hotplug * Wildcard matching for hotplug events */ #define LIBUSB_HOTPLUG_MATCH_ANY -1 /** \ingroup hotplug * Hotplug callback function type. When requesting hotplug event notifications, * you pass a pointer to a callback function of this type. * * This callback may be called by an internal event thread and as such it is * recommended the callback do minimal processing before returning. * * libusb will call this function later, when a matching event had happened on * a matching device. See \ref hotplug for more information. * * It is safe to call either libusb_hotplug_register_callback() or * libusb_hotplug_deregister_callback() from within a callback function. * * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * \param ctx context of this notification * \param device libusb_device this event occurred on * \param event event that occurred * \param user_data user data provided when this callback was registered * \returns bool whether this callback is finished processing events. * returning 1 will cause this callback to be deregistered */ typedef int (LIBUSB_CALL *libusb_hotplug_callback_fn)(libusb_context *ctx, libusb_device *device, libusb_hotplug_event event, void *user_data); /** \ingroup hotplug * Register a hotplug callback function * * Register a callback with the libusb_context. The callback will fire * when a matching event occurs on a matching device. The callback is * armed until either it is deregistered with libusb_hotplug_deregister_callback() * or the supplied callback returns 1 to indicate it is finished processing events. * * If the \ref LIBUSB_HOTPLUG_ENUMERATE is passed the callback will be * called with a \ref LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED for all devices * already plugged into the machine. Note that libusb modifies its internal * device list from a separate thread, while calling hotplug callbacks from * libusb_handle_events(), so it is possible for a device to already be present * on, or removed from, its internal device list, while the hotplug callbacks * still need to be dispatched. This means that when using \ref * LIBUSB_HOTPLUG_ENUMERATE, your callback may be called twice for the arrival * of the same device, once from libusb_hotplug_register_callback() and once * from libusb_handle_events(); and/or your callback may be called for the * removal of a device for which an arrived call was never made. * * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * \param[in] ctx context to register this callback with * \param[in] events bitwise or of events that will trigger this callback. See \ref * libusb_hotplug_event * \param[in] flags hotplug callback flags. See \ref libusb_hotplug_flag * \param[in] vendor_id the vendor id to match or \ref LIBUSB_HOTPLUG_MATCH_ANY * \param[in] product_id the product id to match or \ref LIBUSB_HOTPLUG_MATCH_ANY * \param[in] dev_class the device class to match or \ref LIBUSB_HOTPLUG_MATCH_ANY * \param[in] cb_fn the function to be invoked on a matching event/device * \param[in] user_data user data to pass to the callback function * \param[out] handle pointer to store the handle of the allocated callback (can be NULL) * \returns LIBUSB_SUCCESS on success LIBUSB_ERROR code on failure */ int LIBUSB_CALL libusb_hotplug_register_callback(libusb_context *ctx, libusb_hotplug_event events, libusb_hotplug_flag flags, int vendor_id, int product_id, int dev_class, libusb_hotplug_callback_fn cb_fn, void *user_data, libusb_hotplug_callback_handle *handle); /** \ingroup hotplug * Deregisters a hotplug callback. * * Deregister a callback from a libusb_context. This function is safe to call from within * a hotplug callback. * * Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102 * * \param[in] ctx context this callback is registered with * \param[in] handle the handle of the callback to deregister */ void LIBUSB_CALL libusb_hotplug_deregister_callback(libusb_context *ctx, libusb_hotplug_callback_handle handle); #ifdef __cplusplus } #endif #endif owfs-3.1p5/module/owlib/src/include/ow.h0000644000175000001440000002521712672234566015152 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_H /* tedious wrapper */ #define OW_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif // Define this to avoid some VALGRIND warnings... (just for testing) // Warning: This will partially remove the multithreaded support since ow_net.c // will wait for a thread to complete before executing a new one. //#define VALGRIND 1 #define _FILE_OFFSET_BITS 64 /* For everything */ #define _GNU_SOURCE 1 #ifdef __FreeBSD__ /* from Johan Ström: needed for sys/param.h if sys/types.h sees it */ #define __BSD_VISIBLE 1 #endif /* __FreeBSD__ */ #ifdef __CYGWIN__ #define __BSD_VISIBLE 1 /* for strep and u_int */ #include /* for anything select on newer cygwin */ #endif /* __CYGWIN__ */ #ifdef HAVE_FEATURES_H #include #endif /* HAVE_FEATURES_H */ #ifdef HAVE_FEATURE_TESTS_H #include #endif /* HAVE_FEATURE_TESTS_H */ #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_TYPES_H #include /* for stat */ #endif /* HAVE_SYS_TYPES_H */ #ifdef HAVE_SYS_TIMES_H #include /* for times */ #endif /* HAVE_SYS_TIMES_H */ #include // for getline #include #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include /* for strcasecmp */ #endif #include #include #ifdef HAVE_STDINT_H #include /* for bit twiddling */ #if OW_CYGWIN #define _MSL_STDINT_H #endif /* OW_CYGWIN */ #endif /* HAVE_STDINT_H */ #include #include #include #ifndef __USE_XOPEN #define __USE_XOPEN /* for strptime fuction */ #include #undef __USE_XOPEN /* for strptime fuction */ #else /* __USE_XOPEN */ #include #endif /* __USE_XOPEN */ #ifdef HAVE_TERMIOS_H #include #endif /* HAVE_TERMIOS_H */ #include #ifdef HAVE_SYSLOG_H #include #endif /* HAVE_SYSLOG_H */ #ifdef HAVE_GETOPT_H #include /* for long options */ #endif /* HAVE_GETOPT_H */ #ifdef HAVE_SYS_UIO_H #include #endif /* Include gettimeofday and all the timerX macros */ #include "ow_timer.h" #define NOW_TIME time(NULL) #ifdef HAVE_SYS_STAT_H #include /* for stat */ #endif /* HAVE_SYS_STAT_H */ #ifdef HAVE_SYS_SOCKET_H #include #endif /* HAVE_SYS_SOCKET_H */ #ifdef HAVE_NETINET_IN_H #include #endif /* HAVE_NETINET_IN_H */ #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif #ifdef HAVE_NETDB_H #include /* for getaddrinfo */ #endif /* HAVE_NETDB_H */ #ifdef HAVE_SYS_MKDEV_H #include /* for major() */ #endif /* HAVE_SYS_MKDEV_H */ #include // for offsetof() /* Can't include search.h when compiling owperl on Fedora Core 1. */ #ifndef SKIP_SEARCH_H #include #endif /* SKIP_SEARCH_H */ /* If no getline, use our version */ #ifndef HAVE_GETLINE ssize_t getline (char **lineptr, size_t *n, FILE *stream) ; #endif /* HAVE_GETLINE */ /* If no timegm, use our version */ #if (!defined _BSD_SOURCE && !defined _SVID_SOURCE) #include time_t timegm(struct tm *tm); #endif /* Parport enabled uses two flags (one a holdover from the embedded work) */ #ifdef USE_NO_PARPORT #undef OW_PARPORT #endif /* USE_NO_PARPORT */ /* Include some compatibility functions */ #include "compat.h" /* Debugging and error messages separated out for readability */ #include "ow_debug.h" #ifndef PATH_MAX #define PATH_MAX 2048 #endif /* Some errnos are not defined for MacOSX and gcc3.3 or openbsd */ #ifndef EBADMSG #define EBADMSG ENOMSG #endif /* EBADMSG */ #ifndef EPROTO #define EPROTO EIO #endif /* EPROTO */ #ifndef ENOTSUP #define ENOTSUP EOPNOTSUPP #endif /* ENOTSUP */ /* Bytes in a 1-wire address */ #define SERIAL_NUMBER_SIZE 8 /* Allocation wrappers for debugging */ #include "ow_alloc.h" /* BYTE manipulation macros */ #include "ow_bitwork.h" /* Define our understanding of integers, floats, ... */ #include "ow_localtypes.h" /* Define our understanding of bus numbers ... */ #include "ow_busnumber.h" /* Define our understanding of function returns ... */ #include "ow_localreturns.h" /* Define our understanding of file descriptors ... */ #include "ow_fd.h" /* Include sone byte conversion convenience routines */ #include "ow_integer.h" /* Directory blob separated out for readability */ #include "ow_dirblob.h" /* Directory blob (strings) separated out for readability */ #include "ow_charblob.h" /* memory blob used for bundled transactions */ #include "ow_memblob.h" /* We use our own read-write locks */ #include "rwlock.h" /* Many mutexes separated out for readability */ #include "ow_mutexes.h" // regular expressions #include "ow_regex.h" /* Special checks for config file changes -- OS specific */ #ifdef HAVE_SYS_EVENT_H /* BSD and OSX */ #define WE_HAVE_KEVENT #elif defined( HAVE_SYS_INOTIFY_H ) #define WE_HAVE_INOTIFY #else /* HAVE_SYS_EVENT_H */ // no change notification available #define Config_Monitor_Add(x) #define Config_Monitor_Watch(v) #endif /* HAVE_SYS_EVENT_H */ #include "ow_kevent.h" #include "ow_inotify.h" /* Program startup type */ enum e_inet_type { inet_none, inet_systemd , inet_launchd, } ; #if OW_ZERO /* Zeroconf / Bonjour */ #include "ow_dl.h" #include "ow_dnssd.h" #endif /* OW_ZERO */ #include "ow_avahi.h" #if OW_USB #include #endif /* OW_USB */ /* OW -- One Wire Globals variables -- each invokation will have it's own data */ /* command line options */ #include "ow_opt.h" /* Several different structures: device -- one for each type of 1-wire device filetype -- one for each type of file parsedname -- translates a path into usable form */ /* --------------------------------------------------------- */ /* Filetypes -- directory entries for each 1-wire chip found */ /* predeclare connection_in/out */ struct connection_in; struct connection_out; /* Maximum length of a file or directory name, and extension */ #define OW_NAME_MAX (32) #define OW_EXT_MAX (6) #define OW_FULLNAME_MAX (OW_NAME_MAX+OW_EXT_MAX) #define OW_DEFAULT_LENGTH (128) #include "ow_filetype.h" /* ------------------------------------------- */ /* -------------------------------- */ /* Devices -- types of 1-wire chips */ /* */ #include "ow_device.h" /* Parsedname -- path converted into components */ #include "ow_parsedname.h" /* "Object-type" structure for the anctual owfs query -- holds name, flags, values, and path */ #include "ow_onewirequery.h" /* Delay for clearing buffer */ #define WASTE_TIME (2) /* device display format */ enum deviceformat { fdi, fi, fdidc, fdic, fidc, fic }; /* OWSERVER messages */ #include "ow_message.h" /* Globals information (for local control) */ /* Separated out into ow_global.h for readability */ #include "ow_global.h" /* Allow detail debugging of individual slave */ #include "ow_detail.h" /* State information for the program */ /* Separated out into ow_stateinfo.h for readability */ #include "ow_stateinfo.h" /* -------------------------------------------- */ /* Prototypes */ /* Separated out to ow_functions.h for clarity */ #include "ow_arg.h" #include "ow_functions.h" /* Temperature scale handling */ #include "ow_temperature.h" /* Pressure scale handling */ #include "ow_pressure.h" /* Program control */ #include "ow_programs.h" /* Return and error codes */ #include "ow_return_code.h" /* Launchd -- OSX-specific startup code */ #include "ow_launchd.h" /* Argument and restart */ #include "ow_exec.h" #endif /* OW_H */ owfs-3.1p5/module/owlib/src/include/ownet.h0000644000175000001440000000754212654730021015645 00000000000000/* $Id$ OW -- One-Wire filesystem Written 2008 Paul H Alfille GPL license 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. 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. */ /* This is the libownet header a C programmikng interface to easily access owserver and thus the entore Dallas/Maxim 1-wire system. This header has all the public routines for a program linking in the library */ #ifndef OWNET_H /* tedious wrapper */ #define OWNET_H #include /* OWNET_HANDLE A (non-negative) integer corresponding to a particular owserver connection. It is used for each function call, and allows multiple owservers to be accessed */ typedef int OWNET_HANDLE; /* OWNET_HANDLE OWNET_init( const char * owserver ) Starting routine -- takes a string correspondiong to the tcp address of owserver e.g. "192.168.0.1:5000" or "5001" or even "" for the default localhost:4304 returns a non-negative HANDLE, or <0 for error */ OWNET_HANDLE OWNET_init(const char *owserver_tcp_address_and_port); /* int OWNET_dirlist( OWNET_HANDLE h, const char * onewire_path, char * return_string ) Get the 1-wire directory as a comma-separated list. return_string is allocated by this program, and must be free-ed by your program. return non-negative length of return_string on success return <0 error and NULL on error */ int OWNET_dirlist(OWNET_HANDLE h, const char *onewire_path, char *return_string); /* int OWNET_dirprocess( OWNET_HANDLE h, const char * onewire_path, void (*dirfunc) (void * passed_on_value, const char* directory_element), void * passed_on_value ) Get the 1-wire directory corresponding to the given path Call function dirfunc on each element passed_on_value is an arbitrary pointer that gets included in the dirfunc call to add some state information returns number of elements processed, or <0 for error */ int OWNET_dirprocess(OWNET_HANDLE h, const char *onewire_path, void (*dirfunc) (void *passed_on_value, const char *directory_element), void *passed_on_value); /* int OWNET_read( OWNET_HANDLE h, const char * onewire_path, char * return_string ) Read a value from a one-wire device property return_string has the result but must be free-ed by the calling program. returns length of result on success, returns <0 on error */ int OWNET_read(OWNET_HANDLE h, const char *onewire_path, char *return_string); /* int OWNET_write( OWNET_HANDLE h, const char * onewire_path, const char * value_string, size_t value_length ) Write a value to a one-wire device property return 0 on success return <0 on error */ int OWNET_write(OWNET_HANDLE h, const char *onewire_path, const char *value_string, size_t value_length); /* void OWNET_close( OWNET_HANDLE h) close a particular owserver connection */ void OWNET_close(OWNET_HANDLE h); /* void OWNET_closeall( void ) close all owserver connections */ void OWNET_closeall(void); /* get and set temperature scale Note that temperature scale applies to all HANDLES C - celsius F - farenheit R - rankine K - kelvin 0 -> set default (C) */ void OWNET_set_temperature_scale(char temperature_scale); char OWNET_get_temperature_scale(void); /* get and set device format Note that device format applies to all HANDLES f.i default f.i.c fi.c fi f.ic fic NULL or "" -> set default */ void OWNET_set_device_format(const char *device_format); const char *OWNET_get_device_format(void); #endif /* OWNET_H */ owfs-3.1p5/module/owlib/src/include/ow_1820.h0000644000175000001440000000200412654730021015574 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor LICENSE (As of version 2.5p4 2-Oct-2006) owlib: LGPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): LGPL v2 owperl: GPL v2 owtcl: GPL v2 or later at your discretion owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" */ #ifndef OW_1820_H #define OW_1820_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* -------- Structures ---------- */ DeviceHeader(DS18S20); DeviceHeader(DS18B20); DeviceHeader(DS1822); DeviceHeader(DS1825); DeviceHeader(DS28EA00); #endif owfs-3.1p5/module/owlib/src/include/ow_1821.h0000644000175000001440000000167612654730021015613 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor LICENSE (As of version 2.5p4 2-Oct-2006) owlib: LGPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): LGPL v2 owperl: GPL v2 owtcl: GPL v2 or later at your discretion owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" */ #ifndef OW_1821_H #define OW_1821_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* -------- Structures ---------- */ DeviceHeader(DS1821); #endif /* OW_1821_h */ owfs-3.1p5/module/owlib/src/include/ow_1921.h0000644000175000001440000000076112654730021015606 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_1921_H #define OW_1921_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* -------- Structures ---------- */ DeviceHeader(DS1921); #endif owfs-3.1p5/module/owlib/src/include/ow_1923.h0000644000175000001440000000075612654730021015614 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_1923_H #define OW_1923_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS1923); #endif owfs-3.1p5/module/owlib/src/include/ow_1954.h0000644000175000001440000000076212654730021015615 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_1954_H #define OW_1954_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS1954); #endif owfs-3.1p5/module/owlib/src/include/ow_1963.h0000644000175000001440000000101212654730021015602 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_1963_H #define OW_1963_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS1963S); DeviceHeader(DS1963L); #endif owfs-3.1p5/module/owlib/src/include/ow_1977.h0000644000175000001440000000101012654730021015605 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_1977_H #define OW_1977_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS1977); #endif /* OW_1977_H */ owfs-3.1p5/module/owlib/src/include/ow_1991.h0000644000175000001440000000100412654730021015604 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_1991_H #define OW_1991_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS1991); DeviceHeader(DS1425); #endif owfs-3.1p5/module/owlib/src/include/ow_1993.h0000644000175000001440000000106412654730021015614 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_1993_H #define OW_1993_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS1992); DeviceHeader(DS1993); DeviceHeader(DS1995); DeviceHeader(DS1996); #endif owfs-3.1p5/module/owlib/src/include/ow_2401.h0000644000175000001440000000121612654730021015574 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2401_H #define OW_2401_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* DS2401 Simple ID device */ /* Also needed for all others */ /* ------- Prototypes ----------- */ /* All from ow_xxxx.c file */ /* ------- Structures ----------- */ DeviceHeader(DS2401); DeviceHeader(DS1420); #endif owfs-3.1p5/module/owlib/src/include/ow_2404.h0000644000175000001440000000101012654730021015567 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2404_H #define OW_2404_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2404); #endif /* OW_2404_h */ owfs-3.1p5/module/owlib/src/include/ow_2405.h0000644000175000001440000000075512654730021015607 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2405_H #define OW_2405_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2405); #endif owfs-3.1p5/module/owlib/src/include/ow_2406.h0000644000175000001440000000076212654730021015606 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2406_H #define OW_2406_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2406); #endif owfs-3.1p5/module/owlib/src/include/ow_2408.h0000644000175000001440000000076212654730021015610 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2408_H #define OW_2408_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2408); #endif owfs-3.1p5/module/owlib/src/include/ow_2409.h0000644000175000001440000000076212654730021015611 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2409_H #define OW_2409_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2409); #endif owfs-3.1p5/module/owlib/src/include/ow_2413.h0000644000175000001440000000100312654730021015571 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2413_H #define OW_2413_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2413); #endif /* 2413 code */ owfs-3.1p5/module/owlib/src/include/ow_2415.h0000644000175000001440000000101012654730021015571 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2415_H #define OW_2415_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2415); DeviceHeader(DS2417); #endif owfs-3.1p5/module/owlib/src/include/ow_2423.h0000644000175000001440000000076212654730021015605 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2423_H #define OW_2423_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2423); #endif owfs-3.1p5/module/owlib/src/include/ow_2430.h0000644000175000001440000000076512654730021015606 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2430A_H #define OW_2430A_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2430A); #endif owfs-3.1p5/module/owlib/src/include/ow_2433.h0000644000175000001440000000104012654730021015574 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2433_H #define OW_2433_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2431); DeviceHeader(DS2433); DeviceHeader(DS28EC20); #endif owfs-3.1p5/module/owlib/src/include/ow_2436.h0000644000175000001440000000076212654730021015611 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2436_H #define OW_2436_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2436); #endif owfs-3.1p5/module/owlib/src/include/ow_2438.h0000644000175000001440000000100312654730021015600 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2438_H #define OW_2438_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2437); DeviceHeader(DS2438); #endif owfs-3.1p5/module/owlib/src/include/ow_2450.h0000644000175000001440000000076212654730021015605 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2450_H #define OW_2450_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2450); #endif owfs-3.1p5/module/owlib/src/include/ow_2502.h0000644000175000001440000000101112654730021015567 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2502_H #define OW_2502_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2502); DeviceHeader(DS1982U); #endif owfs-3.1p5/module/owlib/src/include/ow_2505.h0000644000175000001440000000106612654730021015604 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2505_H #define OW_2505_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2505); DeviceHeader(DS1985U); DeviceHeader(DS2506); DeviceHeader(DS1986U); #endif owfs-3.1p5/module/owlib/src/include/ow_2760.h0000644000175000001440000000127012654730021015604 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2760_H #define OW_2760_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2720); DeviceHeader(DS2740); DeviceHeader(DS2751); DeviceHeader(DS2755); DeviceHeader(DS2756); DeviceHeader(DS2760); DeviceHeader(DS2770); DeviceHeader(DS2780); DeviceHeader(DS2781); #endif /* OW_2760_H */ owfs-3.1p5/module/owlib/src/include/ow_2804.h0000644000175000001440000000076312654730021015611 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2804_H #define OW_2804_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS28E04); #endif owfs-3.1p5/module/owlib/src/include/ow_2810.h0000644000175000001440000000101112654730021015571 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2810_H #define OW_2810_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS28E10); #endif /* OW_2810_H */ owfs-3.1p5/module/owlib/src/include/ow_2890.h0000644000175000001440000000076212654730021015615 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_2890_H #define OW_2890_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(DS2890); #endif owfs-3.1p5/module/owlib/src/include/ow_alloc.h0000644000175000001440000000550212654730021016302 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. --------------------------------------------------------------------------- */ //* Special routines for tracking memory leakage */ /* Turned on by * ./configure --enable-owmalloc * */ // Can test also by uncommenting the following line: // #define OW_ALLOC_DEBUG #ifndef OW_ALLOC_H /* tedious wrapper */ #define OW_ALLOC_H #if OW_ALLOC_DEBUG // Special wrapper functions to check memory allocation #define owmalloc(size) OWmalloc( __FILE__, __LINE__, __func__, size ) #define owcalloc(nmemb,size) OWcalloc( __FILE__, __LINE__, __func__, nmemb, size ) #define owfree(ptr) OWfree( __FILE__, __LINE__, __func__, ptr ) #define owrealloc(ptr,size) OWrealloc(__FILE__, __LINE__, __func__, ptr, size ) #define owstrdup(s) OWstrdup( __FILE__, __LINE__, __func__, s ) #define owfree_func OWtreefree void *OWcalloc( const char * file, int line, const char * func, size_t nmemb, size_t size ); void *OWmalloc( const char * file, int line, const char * func, size_t size); void OWfree( const char * file, int line, const char * func, void *ptr); void *OWrealloc(const char * file, int line, const char * func, void *ptr, size_t size); char *OWstrdup( const char * file, int line, const char * func, const char *s); void OWtreefree(void *ptr); #else /* OW_ALLOC_DEBUG */ // Standard C library definitions #define owmalloc(size) malloc(size) #define owcalloc(nmemb,size) calloc(nmemb,size) #define owfree(ptr) free(ptr) #define owrealloc(ptr,size) realloc(ptr,size) #define owstrdup(s) strdup(s) #define owfree_func free #endif /* OW_ALLOC_DEBUG */ #define SAFEFREE(p) do { if ( (p)!= NULL ) { owfree(p) ; p=NULL; } } while (0) #define SAFETDESTROY(p,f) do { if ( (p)!=NULL ) { tdestroy(p,f) ; p=NULL; } } while (0) #endif /* OW_ALLOC_H */ owfs-3.1p5/module/owlib/src/include/ow_arg.h0000644000175000001440000000517312654730021015765 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, // --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Cannot stand alone -- part of ow.h but separated for clarity */ #ifndef OW_ARG_H /* tedious wrapper */ #define OW_ARG_H GOOD_OR_BAD ARG_Net(const char *arg); GOOD_OR_BAD ARG_Server(const char *arg); GOOD_OR_BAD ARG_USB(const char *arg); GOOD_OR_BAD ARG_Device(const char *arg); GOOD_OR_BAD ARG_Generic(const char *arg); GOOD_OR_BAD ARG_Serial(const char *arg); GOOD_OR_BAD ARG_Parallel(const char *arg); GOOD_OR_BAD ARG_I2C(const char *arg); GOOD_OR_BAD ARG_HA5( const char *arg); GOOD_OR_BAD ARG_HA7(const char *arg); GOOD_OR_BAD ARG_HA7E(const char *arg); GOOD_OR_BAD ARG_DS1WM(const char *arg); GOOD_OR_BAD ARG_K1WM(const char *arg); GOOD_OR_BAD ARG_ENET(const char *arg); GOOD_OR_BAD ARG_PBM(const char *arg); GOOD_OR_BAD ARG_EtherWeather(const char *arg); GOOD_OR_BAD ARG_External(const char *arg); GOOD_OR_BAD ARG_Xport(const char *arg); GOOD_OR_BAD ARG_Fake(const char *arg); GOOD_OR_BAD ARG_Tester(const char *arg); GOOD_OR_BAD ARG_Mock(const char *arg); GOOD_OR_BAD ARG_Link(const char *arg); GOOD_OR_BAD ARG_W1_monitor(void); GOOD_OR_BAD ARG_MasterHub(const char *arg); GOOD_OR_BAD ARG_Browse(void); GOOD_OR_BAD ARG_Passive(char *adapter_type_name, const char *arg); #endif /* OW_ARG_H */ owfs-3.1p5/module/owlib/src/include/ow_avahi.h0000644000175000001440000000136412654730021016302 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_AVAHI_H #define OW_AVAHI_H #if OW_AVAHI #include #include #include #include #include struct connection_in ; struct connection_out ; /**********************************************/ /* Prototypes */ GOOD_OR_BAD OW_Avahi_Announce( struct connection_out *out ) ; GOOD_OR_BAD OW_Avahi_Browse(struct connection_in * in) ; #endif /* OW_AVAHI */ #endif /* OW_AVAHI_H */ owfs-3.1p5/module/owlib/src/include/ow_bae.h0000644000175000001440000000077212654730021015743 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_BAE_H #define OW_BAE_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(BAE); #endif /* OW_BAE */ owfs-3.1p5/module/owlib/src/include/ow_bitfield.h0000644000175000001440000000234612654730021016775 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille */ #ifndef OW_BITFIELD_H /* tedious wrapper */ #define OW_BITFIELD_H #include "ow_localreturns.h" // struct bitfield { "alias_link", number_of_bits, shift_left, } struct bitfield { ASCII * link ; // name of property unsigned int size ; // number of bits unsigned int shift ; // bits to shift over } ; ZERO_OR_ERROR FS_r_bitfield(struct one_wire_query *owq) ; ZERO_OR_ERROR FS_w_bitfield(struct one_wire_query *owq) ; ZERO_OR_ERROR FS_r_bit_array(struct one_wire_query *owq) ; ZERO_OR_ERROR FS_w_bit_array(struct one_wire_query *owq) ; #endif /* OW_BITFIELD_H */ owfs-3.1p5/module/owlib/src/include/ow_bitwork.h0000644000175000001440000000541612654730021016675 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* CAnn stand alone -- separated out of ow.h for clarity */ #ifndef OW_BITWORK_H /* tedious wrapper */ #define OW_BITWORK_H #define BYTE_MASK(x) ( (unsigned char) ((x) & 0xFF) ) #define BYTE_INVERSE(x) BYTE_MASK((x) ^ 0xFF) #define LOW_HIGH_ADDRESS(x) BYTE_MASK(x),BYTE_MASK((x)>>8) #endif /* OW_BITWORK_H */ owfs-3.1p5/module/owlib/src/include/ow_busnumber.h0000644000175000001440000000645612654730021017223 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_BUSNUMBER_H /* tedious wrapper */ #define OW_BUSNUMBER_H typedef int INDEX_OR_ERROR ; #define INDEX_BAD -1 #define INDEX_DEFAULT 0 #define INDEX_VALID(bus_nr) ( (bus_nr) != INDEX_BAD ) #define INDEX_NOT_VALID(bus_nr) ( (bus_nr) == INDEX_BAD ) #endif /* OW_BUSNUMBER_H */ owfs-3.1p5/module/owlib/src/include/ow_bus_routines.h0000644000175000001440000001723412654730021017736 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- */ #ifndef OW_BUS_ROUTINES_H /* tedious wrapper */ #define OW_BUS_ROUTINES_H /* -------------------------------------------- */ /* Interface-specific routines ---------------- */ struct interface_routines { /* Detect if adapter is present, and open -- usually called outside of this routine */ GOOD_OR_BAD (*detect) (struct port_in * pin); /* reset the interface -- actually the 1-wire bus */ RESET_TYPE (*reset) (const struct parsedname * pn); /* Bulk of search routine, after set ups for first or alarm or family */ enum search_status (*next_both) (struct device_search * ds, const struct parsedname * pn); /* Send a byte with bus power to follow */ GOOD_OR_BAD (*PowerByte) (const BYTE data, BYTE * resp, const UINT delay, const struct parsedname * pn); /* Send a bit with bus power to follow */ GOOD_OR_BAD (*PowerBit) (const BYTE data, BYTE * resp, const UINT delay, const struct parsedname * pn); /* Send a 12V 480msec pulse to program EEPROM */ GOOD_OR_BAD (*ProgramPulse) (const struct parsedname * pn); /* send and recieve data -- byte at a time */ GOOD_OR_BAD (*sendback_data) (const BYTE * data, BYTE * resp, const size_t len, const struct parsedname * pn); /* send and recieve data -- byte at a time */ GOOD_OR_BAD (*select_and_sendback) (const BYTE * data, BYTE * resp, const size_t len, const struct parsedname * pn); /* send and recieve data -- bit at a time */ GOOD_OR_BAD (*sendback_bits) (const BYTE * databits, BYTE * respbits, const size_t len, const struct parsedname * pn); /* select a device */ GOOD_OR_BAD (*select) (const struct parsedname * pn); /* Set configuration parameters */ GOOD_OR_BAD (*set_config) (void * p, const struct parsedname * pn); /* Get configuration parameters */ GOOD_OR_BAD (*get_config) (void * p, const struct parsedname * pn); /* reconnect with a balky device */ GOOD_OR_BAD (*reconnect) (const struct parsedname * pn); /* Close the connection (port) */ void (*close) (struct connection_in * in); /* Verify a slave is actually on the bus, and address */ GOOD_OR_BAD (*verify) (const struct parsedname * pn ); /* capabilities flags */ UINT flags; }; #define NO_DETECT_ROUTINE NULL #define NO_RESET_ROUTINE NULL #define NO_NEXT_BOTH_ROUTINE NULL #define NO_POWERBYTE_ROUTINE NULL #define NO_POWERBIT_ROUTINE NULL #define NO_PROGRAMPULSE_ROUTINE NULL #define NO_SENDBACKDATA_ROUTINE NULL #define NO_SELECTANDSENDBACK_ROUTINE NULL #define NO_SENDBACKBITS_ROUTINE NULL #define NO_SELECT_ROUTINE NULL #define NO_SET_CONFIG_ROUTINE NULL #define NO_GET_CONFIG_ROUTINE NULL #define NO_RECONNECT_ROUTINE NULL #define NO_CLOSE_ROUTINE NULL #define NO_VERIFY_ROUTINE NULL /* placed in iroutines.flags */ // Adapter is usable #define ADAP_FLAG_default 0x00000000 // Adapter supports overdrive mode #define ADAP_FLAG_overdrive 0x00000001 // Adapter doesn't support the DS2409 microlan hub #define ADAP_FLAG_no2409path 0x00000010 // Adapter doesn't need DS2404 delay (i.e. not a local device) #define ADAP_FLAG_no2404delay 0x00000020 // Adapter gets a directory all at once rather than one at a time #define ADAP_FLAG_dirgulp 0x00000100 // Adapter benefits from coalescing reads and writes into a longer string #define ADAP_FLAG_bundle 0x00001000 // Adapter automatically performs a reset before read/writes #define ADAP_FLAG_dir_auto_reset 0x00002000 // Adapter doesn't support "presence" -- use the last dirblob instead. #define ADAP_FLAG_presence_from_dirblob 0x00004000 // Adapter allows power-byte not to block other channels #define ADAP_FLAG_unlock_during_delay 0x00010000 // Adapter is a sham. #define ADAP_FLAG_sham 0x00008000 #define AdapterSupports2409(pn) (((pn)->selected_connection->iroutines.flags&ADAP_FLAG_no2409path)==0) GOOD_OR_BAD BUS_detect( struct port_in * pin ) ; RESET_TYPE BUS_reset(const struct parsedname *pn); GOOD_OR_BAD BUS_select(const struct parsedname *pn); GOOD_OR_BAD BUS_select_and_sendback(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); GOOD_OR_BAD BUS_sendback_bits( const BYTE * databits, BYTE * respbits, const size_t len, const struct parsedname * pn ); GOOD_OR_BAD BUS_sendback_data(const BYTE * data, BYTE * resp, const size_t len, const struct parsedname *pn); GOOD_OR_BAD BUS_sendback_cmd(const BYTE * cmd, BYTE * resp, const size_t len, const struct parsedname *pn); GOOD_OR_BAD BUS_send_data(const BYTE * data, const size_t len, const struct parsedname *pn); GOOD_OR_BAD BUS_send_bits(const BYTE * data, const size_t len, const struct parsedname *pn); GOOD_OR_BAD BUS_readin_data(BYTE * data, const size_t len, const struct parsedname *pn); GOOD_OR_BAD BUS_readin_bits(BYTE * data, const size_t len, const struct parsedname *pn); GOOD_OR_BAD BUS_verify(BYTE search, const struct parsedname *pn); GOOD_OR_BAD BUS_compare_bits(const BYTE * data1, const BYTE * data2, const size_t len); GOOD_OR_BAD BUS_Set_Config(void * param, const struct parsedname *pn); GOOD_OR_BAD BUS_Get_Config(void * param, const struct parsedname *pn); GOOD_OR_BAD BUS_PowerBit(const BYTE data, BYTE * resp, UINT delay, const struct parsedname *pn); GOOD_OR_BAD BUS_PowerByte(const BYTE data, BYTE * resp, UINT delay, const struct parsedname *pn); GOOD_OR_BAD BUS_ProgramPulse(const struct parsedname *pn); void BUS_close( struct connection_in * in ); #endif /* OW_BUS_ROUTINES_H */ owfs-3.1p5/module/owlib/src/include/ow_cache.h0000644000175000001440000000763312654730021016262 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille GPL license 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. */ #ifndef OWCACHE_H /* tedious wrapper */ #define OWCACHE_H /* Internal properties -- used by some devices */ /* in passing to store state information */ struct internal_prop { char *name; enum fc_change change; }; #define Make_SlaveSpecificTag(tag,change) static char ip_name_##tag[] = #tag ; static struct internal_prop ip_##tag = { ip_name_##tag , change } #define Make_SlaveSpecificTag_exportable(tag,change) char ip_name_##tag[] = #tag ; struct internal_prop ip_##tag = { ip_name_##tag , change } #define SlaveSpecificTag(tag) (& ip_##tag) extern struct internal_prop ip_S_T ; extern struct internal_prop ip_S_V ; /* Cache and Storage functions */ void Cache_Open(void); void Cache_Close(void); void Cache_Clear(void); GOOD_OR_BAD OWQ_Cache_Add(const struct one_wire_query *owq); GOOD_OR_BAD Cache_Add_Dir(const struct dirblob *db, const struct parsedname *pn); GOOD_OR_BAD Cache_Add_Device(const int bus_nr, const BYTE *sn); GOOD_OR_BAD Cache_Add_SlaveSpecific(const void *data, const size_t datasize, const struct internal_prop *ip, const struct parsedname *pn); GOOD_OR_BAD Cache_Add_Alias(const ASCII *name, const BYTE * sn) ; GOOD_OR_BAD Cache_Add_Simul(const struct internal_prop *ip, const struct parsedname *pn); void Cache_Add_Alias_Bus(const ASCII * alias_name, INDEX_OR_ERROR bus); GOOD_OR_BAD OWQ_Cache_Get(struct one_wire_query *owq); GOOD_OR_BAD Cache_Get(void *data, size_t * dsize, const struct parsedname *pn); GOOD_OR_BAD Cache_Get_Dir(struct dirblob *db, const struct parsedname *pn); GOOD_OR_BAD Cache_Get_Device(void *bus_nr, const struct parsedname *pn); GOOD_OR_BAD Cache_Get_SlaveSpecific(void *data, size_t dsize, const struct internal_prop *ip, const struct parsedname *pn); ASCII * Cache_Get_Alias(const BYTE * sn) ; GOOD_OR_BAD Cache_Get_Simul_Time(const struct internal_prop *ip, time_t * dwell_time, const struct parsedname * pn); INDEX_OR_ERROR Cache_Get_Alias_Bus(const ASCII * alias_name) ; GOOD_OR_BAD Cache_Get_Alias_SN(const ASCII * alias_name, BYTE * sn ); void OWQ_Cache_Del(struct one_wire_query *owq); void OWQ_Cache_Del_ALL(struct one_wire_query *owq); void OWQ_Cache_Del_BYTE(struct one_wire_query *owq); void OWQ_Cache_Del_parts(struct one_wire_query *owq); void Cache_Del_Dir(const struct parsedname *pn); void Cache_Del_Device(const struct parsedname *pn); void Cache_Del_Internal(const struct internal_prop *ip, const struct parsedname *pn); void Cache_Del_Simul(const struct internal_prop *ip, const struct parsedname *pn) ; void Cache_Del_Mixed_Aggregate(const struct parsedname *pn); void Cache_Del_Mixed_Individual(const struct parsedname *pn); void Cache_Del_Alias_Bus(const ASCII * alias_name); void Cache_Del_Alias(const BYTE * sn); void Aliaslist( struct memblob * mb ) ; #endif /* OWCACHE_H */ owfs-3.1p5/module/owlib/src/include/ow_charblob.h0000644000175000001440000000274112654730021016766 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, Implementation: 2006 dirblob */ #ifndef OW_CHARBLOB_H /* tedious wrapper */ #define OW_CHARBLOB_H #define NO_CHARBLOB NULL struct charblob { int troubled; size_t allocated; size_t used; ASCII *blob; }; void CharblobClear(struct charblob *cb); void CharblobInit(struct charblob *cb); int CharblobPure(struct charblob *cb); int CharblobAdd(const ASCII * a, size_t s, struct charblob *cb); int CharblobAddChar(const ASCII a, struct charblob *cb); ASCII * CharblobData(struct charblob * cb); size_t CharblobLength( struct charblob * cb ); #endif /* OW_CHARBLOB_H */ owfs-3.1p5/module/owlib/src/include/ow_cmciel.h0000644000175000001440000000114012654730021016436 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_CMCIEL_H #define OW_CMCIEL_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(mTS017); DeviceHeader(mCM001); DeviceHeader(mAM001); DeviceHeader(mRS001); DeviceHeader(mDI001); #endif /* OW_CMCIEL_H */ owfs-3.1p5/module/owlib/src/include/ow_codes.h0000644000175000001440000000142312654730021016303 00000000000000/* Debug and error messages Meant to be included in ow.h Separated just for readability */ /* OWFS source code 1-wire filesystem for linux {c} 2006 Paul H Alfille License GPL2.0 */ #ifndef OW_CODES_H #define OW_CODES_H /* 1-wire ROM commands */ #define _1W_READ_ROM 0x33 #define _1W_OLD_READ_ROM 0x0F #define _1W_MATCH_ROM 0x55 #define _1W_SKIP_ROM 0xCC #define _1W_SEARCH_ROM 0xF0 #define _1W_CONDITIONAL_SEARCH_ROM 0xEC #define _1W_RESUME 0xA5 #define _1W_OVERDRIVE_SKIP_ROM 0x3C #define _1W_OVERDRIVE_MATCH_ROM 0x69 #define _1W_SWAP 0xAA // used by the DS27xx #define _1W_LOCATOR 0x00 // used by the Link Locator #endif /* OW_CODES_H */ owfs-3.1p5/module/owlib/src/include/ow_communication.h0000644000175000001440000000200312654730021020046 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ #ifndef OW_COMMUNICATION_H /* tedious wrapper */ #define OW_COMMUNICATION_H struct communication { char * devicename ; } ; #endif /* OW_COMMUNICATION_H */ owfs-3.1p5/module/owlib/src/include/ow_connection.h0000644000175000001440000001673412654730021017360 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ #ifndef OW_CONNECTION_H /* tedious wrapper */ #define OW_CONNECTION_H /* Jan 21, 2007 from the IANA: owserver 4304/tcp One-Wire Filesystem Server owserver 4304/udp One-Wire Filesystem Server # Paul Alfille January 2007 See: http://www.iana.org/assignments/port-numbers */ #define DEFAULT_SERVER_PORT "4304" #define DEFAULT_FTP_PORT "21" #define DEFAULT_HA7_PORT "80" #define DEFAULT_ENET_PORT "8080" #define DEFAULT_ENET2_PORT "8080" #define DEFAULT_LINK_PORT "10001" #define DEFAULT_XPORT_CONTROL_PORT "9999" #define DEFAULT_XPORT_PORT "10001" #define DEFAULT_ETHERWEATHER_PORT "15862" #define HA7_DISCOVERY_PORT "4567" #define HA7_DISCOVERY_ADDRESS "224.1.2.3" #define ENET2_DISCOVERY_PORT 30303 #define ENET2_DISCOVERY_ADDRESS "255.255.255.255" #include "ow.h" #include "ow_counters.h" #include #include "ow_transaction.h" /* reset types */ #include "ow_reset.h" /* bus serach */ #include "ow_search.h" /* connect to a bus master */ #include "ow_detect.h" /* address for i2c or usb */ #include "ow_parse_address.h" /* w1 sequence defines */ #include "ow_w1_seq.h" #if OW_USB /* conditional inclusion of USB */ /* Special libusb 0.1x search */ #include "ow_usb_cycle.h" #endif /* OW_USB */ /* large enough for arrays of 2048 elements of ~49 bytes each */ #define MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE 100050 /* com port fifo info */ /* The UART_FIFO_SIZE defines the amount of bytes that are written before * reading the reply. Any positive value should work and 16 is probably low * enough to avoid losing bytes in even most extreme situations on all modern * UARTs, and values bigger than that will probably work on almost any * system... The value affects readout performance asymptotically, value of 1 * should give equivalent performance with the old implementation. * -- Jari Kirma * * Note: Each bit sent to the 1-wire net requeires 1 byte to be sent to * the uart. */ #define UART_FIFO_SIZE 160 /** USB bulk endpoint FIFO size Need one for each for read and write This is for alt setting "3" -- 64 bytes, 1msec polling */ #define USB_FIFO_EACH 64 #define USB_FIFO_READ 0 #define USB_FIFO_WRITE USB_FIFO_EACH #define USB_FIFO_SIZE ( USB_FIFO_EACH + USB_FIFO_EACH ) #define HA7_FIFO_SIZE 128 #define W1_FIFO_SIZE 128 #define LINK_FIFO_SIZE UART_FIFO_SIZE #define HA7E_FIFO_SIZE UART_FIFO_SIZE #define ENET_FIFO_SIZE 128 #define ENET2_FIFO_SIZE 128 #define HA5_FIFO_SIZE UART_FIFO_SIZE #define LINKE_FIFO_SIZE 1500 #define I2C_FIFO_SIZE 1 #if USB_FIFO_SIZE > UART_FIFO_SIZE #define MAX_FIFO_SIZE USB_FIFO_SIZE #else #define MAX_FIFO_SIZE UART_FIFO_SIZE #endif /* Debugging interface to showing all bus traffic * You need to configure compile with * ./configure --enable-owtraffic * */ #include "ow_traffic.h" /* -------------------------------------------- */ /* Interface-specific routines ---------------- */ #include "ow_bus_routines.h" /* -------------------------------------------- */ /* Inbound connections (bus masters) ---------- */ #include "ow_port_in.h" #include "ow_connection_in.h" /* -------------------------------------------- */ /* Outbound connections (ownet clients) ---------- */ #include "ow_connection_out.h" /* This bug-fix/workaround function seem to be fixed now... At least on * the platforms I have tested it on... printf() in owserver/src/c/owserver.c * returned very strange result on c->busmode before... but not anymore */ int BusIsServer(struct connection_in *in); // mode bit flags for level #define MODE_NORMAL 0x00 #define MODE_STRONG5 0x01 #define MODE_PROGRAM 0x02 #define MODE_BREAK 0x04 // 1Wire Bus Speed Setting Constants #define ONEWIREBUSSPEED_REGULAR 0x00 #define ONEWIREBUSSPEED_FLEXIBLE 0x01 /* Only used for USB adapter */ #define ONEWIREBUSSPEED_OVERDRIVE 0x02 /* Serial port */ GOOD_OR_BAD COM_open(struct connection_in *in); GOOD_OR_BAD serial_open(struct connection_in *in); GOOD_OR_BAD tcp_open(struct connection_in *in); GOOD_OR_BAD COM_test( struct connection_in * connection ); void COM_set_standard( struct connection_in *connection) ; void COM_close(struct connection_in *in); void COM_free(struct connection_in *in); void serial_free(struct connection_in *in); void tcp_free(struct connection_in *in); void COM_flush( const struct connection_in *in); void COM_break(struct connection_in *in); GOOD_OR_BAD telnet_break(struct connection_in *in) ; GOOD_OR_BAD COM_change( struct connection_in *connection) ; GOOD_OR_BAD serial_change(struct connection_in *connection) ; GOOD_OR_BAD telnet_change(struct connection_in *in) ; GOOD_OR_BAD serial_powercycle(struct connection_in *connection) ; GOOD_OR_BAD COM_write( const BYTE * data, size_t length, struct connection_in *connection); GOOD_OR_BAD COM_write_simple( const BYTE * data, size_t length, struct connection_in *connection); GOOD_OR_BAD telnet_write_binary( const BYTE * buf, const size_t size, struct connection_in *in); GOOD_OR_BAD COM_read( BYTE * data, size_t length, struct connection_in *connection); SIZE_OR_ERROR COM_read_with_timeout( BYTE * data, size_t length, struct connection_in *connection ) ; void COM_slurp( struct connection_in *in); GOOD_OR_BAD telnet_purge(struct connection_in *in) ; GOOD_OR_BAD telnet_read(BYTE * buf, const size_t size, struct connection_in *in) ; void FreeInAll(void); void RemoveIn( struct connection_in * conn ) ; void FreeOutAll(void); void DelIn(struct connection_in *in); struct connection_in *LinkIn(struct connection_in *in, struct port_in * head); void Add_InFlight( GOOD_OR_BAD (*nomatch)(struct port_in * trial,struct port_in * existing), struct port_in * new_pin ); void Del_InFlight( GOOD_OR_BAD (*nomatch)(struct port_in * trial,struct port_in * existing), struct port_in * new_pin ); struct connection_in *find_connection_in(int nr); int SetKnownBus( int bus_number, struct parsedname * pn) ; struct connection_out *NewOut(void); /* Bonjour registration */ void ZeroConf_Announce(struct connection_out *out); void OW_Browse(struct connection_in *in); GOOD_OR_BAD TestConnection(const struct parsedname *pn); void ZeroAdd(const char * name, const char * type, const char * domain, const char * host, const char * service) ; void ZeroDel(const char * name, const char * type, const char * domain ) ; #define STAT_ADD1_BUS( err, in ) STATLOCK; ++((in)->bus_stat[err]) ; STATUNLOCK #endif /* OW_CONNECTION_H */ owfs-3.1p5/module/owlib/src/include/ow_connection_in.h0000644000175000001440000001135212672234566020052 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ #ifndef OW_CONNECTION_IN_H /* tedious wrapper */ #define OW_CONNECTION_IN_H /* struct connection_in (for each bus master) as part of ow_connection.h */ // For forward references struct connection_in; struct port_in ; /* -------------------------------------------- */ /* BUS-MASTER-specific routines ---------------- */ #include "ow_master.h" #define CHANGED_USB_SPEED 0x001 #define CHANGED_USB_SLEW 0x002 #define CHANGED_USB_LOW 0x004 #define CHANGED_USB_OFFSET 0x008 enum adapter_type { adapter_DS9097 = 0, adapter_DS1410 = 1, adapter_DS9097U2 = 2, adapter_DS9097U = 3, adapter_LINK = 7, adapter_DS9490 = 8, adapter_tcp = 9, adapter_Bad = 10, adapter_LINK_10, adapter_LINK_11, adapter_LINK_12, adapter_LINK_13, adapter_LINK_14, adapter_LINK_15, adapter_LINK_other, adapter_LINK_E, adapter_masterhub, adapter_DS2482_100, adapter_DS2482_800, adapter_HA7NET, adapter_HA5, adapter_HA7E, adapter_ENET, adapter_EtherWeather, adapter_fake, adapter_tester, adapter_mock, adapter_w1, adapter_w1_monitor, adapter_browse_monitor, adapter_xport, adapter_usb_monitor, adapter_enet_monitor, adapter_masterhub_monitor, adapter_external, adapter_pbm, adapter_ds1wm, adapter_k1wm, }; enum e_reconnect { reconnect_bad = -1, reconnect_ok = 0, reconnect_error = 2, }; enum e_anydevices { anydevices_no = 0 , anydevices_yes , anydevices_unknown , }; enum e_bus_stat { e_bus_reconnects, e_bus_reconnect_errors, e_bus_locks, e_bus_unlocks, e_bus_errors, e_bus_resets, e_bus_reset_errors, e_bus_short_errors, e_bus_program_errors, e_bus_pullup_errors, e_bus_timeouts, e_bus_read_errors, e_bus_write_errors, e_bus_detect_errors, e_bus_open_errors, e_bus_close_errors, e_bus_search_errors1, e_bus_search_errors2, e_bus_search_errors3, e_bus_status_errors, e_bus_select_errors, e_bus_try_overdrive, e_bus_failed_overdrive, e_bus_stat_last_marker }; // Add serial/tcp/telnet abstraction #include "ow_communication.h" struct connection_in { struct connection_in *next; struct port_in * pown ; // pointer to port_in that owns us. INDEX_OR_ERROR index; // general index number across all ports int channel ; // index (0-based) in this port's channels // Formerly Serial / tcp / telnet / i2c abstraction // Now only holds device name since the port manages communication details struct communication soc ; pthread_mutex_t bus_mutex; pthread_mutex_t dev_mutex; void *dev_db; // dev-lock tree enum e_reconnect reconnect_state; struct timeval last_lock; /* statistics */ UINT bus_stat[e_bus_stat_last_marker]; struct timeval bus_time; struct interface_routines iroutines; enum adapter_type Adapter; char *adapter_name; enum e_anydevices AnyDevices; int overdrive; int flex ; int changed_bus_settings; int ds2404_found; int ProgramAvailable; size_t last_root_devs; struct ds2409_hubs branch; // ds2409 branch currently selected // or the special eBranch_bad and eBranch_cleared // telnet tuning int CRLF_size ; unsigned char remembered_sn[SERIAL_NUMBER_SIZE] ; /* last address */ size_t bundling_length; union master_union master; }; #define DEVICENAME( connection ) ( (&( (connection)->soc))->devicename ) #define NO_CONNECTION NULL /* Defines for flow control */ #define flow_first ( (Globals.serial_hardflow) ? flow_hard : flow_none ) #define flow_second ( (Globals.serial_hardflow) ? flow_none : flow_first ) extern struct inbound_control { int active ; // how many "bus" entries are currently in linked list int next_index ; // increasing sequence number struct port_in * head_port ; // head of a linked list of "bus" entries my_rwlock_t lock; // RW lock of linked list int next_fake ; // count of fake buses int next_tester ; // count tester buses int next_mock ; // count mock buses struct connection_in * w1_monitor ; struct connection_in * external ; } Inbound_Control ; // Single global struct -- see ow_connect.c #endif /* OW_CONNECTION_IN_H */ owfs-3.1p5/module/owlib/src/include/ow_connection_out.h0000644000175000001440000000413612654730021020240 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ #ifndef OW_CONNECTION_OUT_H /* tedious wrapper */ #define OW_CONNECTION_OUT_H /* Outbound connections (to web address or ownet client) */ /* Called in ow_connection.h */ /* Network connection structure */ struct connection_out { struct connection_out *next; void (*HandlerRoutine) (FILE_DESCRIPTOR_OR_ERROR file_descriptor); char *name; char *host; char *service; int index; struct addrinfo *ai; struct addrinfo *ai_ok; FILE_DESCRIPTOR_OR_ERROR file_descriptor; struct { char * type; // for zeroconf char * domain; // for zeroconf char * name; // zeroconf name } zero ; enum e_inet_type inet_type ; pthread_t tid; #if OW_ZERO DNSServiceRef sref0; DNSServiceRef sref1; #endif #if OW_AVAHI AvahiClient * client ; AvahiThreadedPoll * poll ; AvahiEntryGroup * group ; #if __HAS_IPV6__ char avahi_host[INET6_ADDRSTRLEN+1] ; #else char avahi_host[INET_ADDRSTRLEN+1] ; #endif char avahi_service[10] ; #endif /* OW_AVAHI */ }; extern struct outbound_control { int active ; // how many "bus" entries are currently in linked list int next_index ; // increasing sequence number struct connection_out * head ; // head of a linked list of "bus" entries } Outbound_Control ; // Single global struct -- see ow_connect.c #endif /* OW_CONNECTION_OUT_H */ owfs-3.1p5/module/owlib/src/include/ow_counters.h0000644000175000001440000001170612654730021017055 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 All the error and statistics counters are declared here, including handling macros */ /* Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_COUNTERS_H /* tedious wrapper */ #define OW_COUNTERS_H /* ----------------- */ /* -- Statistics --- */ /* ----------------- */ struct average { UINT max; UINT sum; UINT count; UINT current; }; struct cache_stats { UINT tries; UINT hits; UINT adds; UINT expires; UINT deletes; }; struct directory { UINT calls; UINT entries; }; #define AVERAGE_IN(pA) ++(pA)->current; ++(pA)->count; (pA)->sum+=(pA)->current; if ((pA)->current>(pA)->max)++(pA)->max; #define AVERAGE_OUT(pA) --(pA)->current; #define AVERAGE_MARK(pA) ++(pA)->count; (pA)->sum+=(pA)->current; #define AVERAGE_CLEAR(pA) (pA)->current=0; extern UINT cache_flips; extern UINT cache_adds; extern struct average new_avg; extern struct average old_avg; extern struct average store_avg; extern struct cache_stats cache_ext; extern struct cache_stats cache_int; extern struct cache_stats cache_dir; extern struct cache_stats cache_dev; extern struct cache_stats cache_pst; extern UINT read_calls; extern UINT read_cache; extern UINT read_cachebytes; extern UINT read_bytes; extern UINT read_array; extern UINT read_tries[3]; extern UINT read_success; extern struct average read_avg; extern UINT write_calls; extern UINT write_bytes; extern UINT write_array; extern UINT write_tries[3]; extern UINT write_success; extern struct average write_avg; extern struct directory dir_main; extern struct directory dir_dev; extern UINT dir_depth; extern struct average dir_avg; extern struct average all_avg; extern struct timeval max_delay; // ow_locks.c extern UINT total_bus_locks; // total number of locks extern UINT total_bus_unlocks; // total number of unlocks // ow_crc.c extern UINT CRC8_tries; extern UINT CRC8_errors; extern UINT CRC16_tries; extern UINT CRC16_errors; // ow_net.c extern UINT NET_accept_errors; extern UINT NET_connection_errors; extern UINT NET_read_errors; // ow_bus.c extern UINT BUS_readin_data_errors; extern UINT BUS_level_errors; extern UINT BUS_next_errors; extern UINT BUS_next_alarm_errors; extern UINT BUS_detect_errors; extern UINT BUS_bit_errors; extern UINT BUS_byte_errors; extern UINT BUS_echo_errors; extern UINT BUS_tcsetattr_errors; extern UINT BUS_status_errors; // ow_ds9097U.c extern UINT DS2480_read_fd_isset; extern UINT DS2480_read_null; extern UINT DS2480_read_read; extern UINT DS2480_level_docheck_errors; extern UINT DS2480_databit_errors; #define STAT_ADD1(x) STATLOCK ; ++x ; STATUNLOCK #endif /* OW_COUNTERS_H */ owfs-3.1p5/module/owlib/src/include/ow_debug.h0000644000175000001440000001224412711737666016317 00000000000000/* Debug and error messages Meant to be included in ow.h Separated just for readability */ /* OWFS source code 1-wire filesystem for linux {c} 2006 Paul H Alfille License GPL2.0 */ #ifndef OW_DEBUG_H #define OW_DEBUG_H #include #include "owfs_config.h" #ifdef HAVE_SYS_UIO_H #include #endif #include /* rwlocks in pthread is preferred. If not, use own implementation with semaphores. */ #define PTHREAD_RWLOCK 1 #if OW_MUTEX_DEBUG // Allow debugging rwlocks. #define EXTENDED_RWLOCK_DEBUG #else #undef EXTENDED_RWLOCK_DEBUG #endif /* module/ownet/c/src/include/ow_debug.h & module/owlib/src/include/ow_debug.h are identical except this define */ //#define OWNETC_OW_DEBUG 1 /* error functions */ enum e_err_level { e_err_default, e_err_connect, e_err_call, e_err_data, e_err_detail, e_err_debug, e_err_beyond, }; enum e_err_type { e_err_type_level, e_err_type_error, }; enum e_err_print { e_err_print_mixed, e_err_print_syslog, e_err_print_console, }; void err_msg(enum e_err_type errnoflag, enum e_err_level level, const char * file, int line, const char * func, const char *fmt, ...); void _Debug_Bytes(const char *title, const unsigned char *buf, int length); void fatal_error(const char * file, int line, const char * func, const char *fmt, ...); static inline int return_ok(void) { return 0; } void print_timestamp_(const char * file, int line, const char * func, const char *fmt, ...); #define print_timestamp(...) print_timestamp_(__FILE__,__LINE__,__func__,__VA_ARGS__); extern int log_available; #ifndef __clang_analyzer__ #define debug_crash() { \ char *crash_ptr = NULL; \ print_timestamp_(__FILE__,__LINE__,__func__,"debug_crash"); \ *crash_ptr = '\000'; \ } //lint -e413 Force Core-dump to allow debugging the core-file #else // clang outputs alot of uncesseray Null-pointer dereference warnings without this #define debug_crash() #endif #if OW_DEBUG #define LEVEL_DEFAULT(...) if (Globals.error_level>=e_err_default) {\ err_msg(e_err_type_level,e_err_default,__FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_CONNECT(...) if (Globals.error_level>=e_err_connect) {\ err_msg(e_err_type_level,e_err_connect,__FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_CALL(...) if (Globals.error_level>=e_err_call) {\ err_msg(e_err_type_level,e_err_call, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_DATA(...) if (Globals.error_level>=e_err_data) {\ err_msg(e_err_type_level,e_err_data, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_DETAIL(...) if (Globals.error_level>=e_err_detail) {\ err_msg(e_err_type_level,e_err_detail, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define LEVEL_DEBUG(...) if (Globals.error_level>=e_err_debug) {\ err_msg(e_err_type_level,e_err_debug, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_DEFAULT(...) if (Globals.error_level>=e_err_default) {\ err_msg(e_err_type_error,e_err_default,__FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_CONNECT(...) if (Globals.error_level>=e_err_connect) {\ err_msg(e_err_type_error,e_err_connect,__FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_CALL(...) if (Globals.error_level>=e_err_call) {\ err_msg(e_err_type_error,e_err_call, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_DATA(...) if (Globals.error_level>=e_err_data) {\ err_msg(e_err_type_error,e_err_data, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_DETAIL(...) if (Globals.error_level>=e_err_detail) {\ err_msg(e_err_type_error,e_err_detail, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define ERROR_DEBUG(...) if (Globals.error_level>=e_err_debug) {\ err_msg(e_err_type_error,e_err_debug, __FILE__,__LINE__,__func__,__VA_ARGS__); } #define FATAL_ERROR(...) fatal_error(__FILE__, __LINE__, __func__, __VA_ARGS__) #define Debug_OWQ(owq) if (Globals.error_level>=e_err_debug) { _print_owq(owq); } #define Debug_Bytes(title,buf,length) if (Globals.error_level>=e_err_beyond) { _Debug_Bytes(title,buf,length) ; } #else /* not OW_DEBUG */ #define LEVEL_DEFAULT(...) do { } while (0) #define LEVEL_CONNECT(...) do { } while (0) #define LEVEL_CALL(...) do { } while (0) #define LEVEL_DATA(...) do { } while (0) #define LEVEL_DETAIL(...) do { } while (0) #define LEVEL_DEBUG(...) do { } while (0) #define ERROR_DEFAULT(...) do { } while (0) #define ERROR_CONNECT(...) do { } while (0) #define ERROR_CALL(...) do { } while (0) #define ERROR_DATA(...) do { } while (0) #define ERROR_DETAIL(...) do { } while (0) #define ERROR_DEBUG(...) do { } while (0) #define FATAL_ERROR(...) do { exit(EXIT_FAILURE); } while (0) #define Debug_Bytes(title,buf,length) do { } while (0) #define Debug_OWQ(owq) do { } while (0) #endif /* OW_DEBUG */ /* Make sure strings are safe for printf */ #define SAFESTRING(x) ((x!=NULL) ? (x):"") /* Easy way to show 64bit serial numbers */ #define SNformat "%.2X %.2X %.2X %.2X %.2X %.2X %.2X %.2X" #define SNvar(sn) (sn)[0],(sn)[1],(sn)[2],(sn)[3],(sn)[4],(sn)[5],(sn)[6],(sn)[7] #include "ow_mutex.h" #endif /* OW_DEBUG_H */ owfs-3.1p5/module/owlib/src/include/ow_detail.h0000644000175000001440000000363312654730021016455 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- */ /* Cannot stand alone -- part of ow.h but separated for clarity */ #ifndef OW_DETAIL_H /* tedious wrapper */ #define OW_DETAIL_H void Detail_Init( void ) ; void Detail_Close( void ) ; void Detail_Test( struct parsedname * pn ) ; void Detail_Free( struct parsedname * pn ) ; GOOD_OR_BAD Detail_Add( const char *arg ) ; #endif /* OW_DETAIL_H */ owfs-3.1p5/module/owlib/src/include/ow_detect.h0000644000175000001440000001125512654730021016462 00000000000000/* Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_DETECT_H /* tedious wrapper */ #define OW_DETECT_H #include "ow_port_in.h" GOOD_OR_BAD Server_detect(struct port_in * pin); GOOD_OR_BAD Zero_detect(struct port_in * pin); GOOD_OR_BAD DS2480_detect(struct port_in * pin); #if OW_PARPORT GOOD_OR_BAD DS1410_detect(struct port_in * pin); #endif /* OW_PARPORT */ GOOD_OR_BAD DS9097_detect(struct port_in * pin); GOOD_OR_BAD LINK_detect(struct port_in * pin); GOOD_OR_BAD PBM_detect(struct port_in * pin); GOOD_OR_BAD HA7E_detect(struct port_in * pin); GOOD_OR_BAD DS1WM_detect(struct port_in * pin); GOOD_OR_BAD K1WM_detect(struct port_in * pin); GOOD_OR_BAD OWServer_Enet_detect(struct port_in * pin); GOOD_OR_BAD OWServer_Enet2_detect(struct port_in * pin); GOOD_OR_BAD HA5_detect(struct port_in * pin); GOOD_OR_BAD BadAdapter_detect(struct port_in * pin); GOOD_OR_BAD LINKE_detect(struct port_in * pin); GOOD_OR_BAD Fake_detect(struct port_in * pin); GOOD_OR_BAD Tester_detect(struct port_in * pin); GOOD_OR_BAD Mock_detect(struct port_in * pin); GOOD_OR_BAD MasterHub_detect(struct port_in * pin); GOOD_OR_BAD EtherWeather_detect(struct port_in * pin); GOOD_OR_BAD Browse_detect(struct port_in * pin); GOOD_OR_BAD W1_monitor_detect(struct port_in * pin); GOOD_OR_BAD External_detect(struct port_in * pin); struct enet_member ; struct enet_member { int version ; struct enet_member * next ; char name[0] ; }; struct enet_list { int members ; struct enet_member * head ; } ; GOOD_OR_BAD HA7_detect(struct port_in * pin); GOOD_OR_BAD FS_FindHA7(void); void Find_ENET_all( struct enet_list * elist ) ; void Find_ENET_Specific( char * addr, struct enet_list * elist ) ; GOOD_OR_BAD OWServer_Enet_setup(char * enet_name, int enet_version, struct port_in *pin) ; void enet_list_init( struct enet_list * elist ) ; void enet_list_kill( struct enet_list * elist ) ; void enet_list_add( char * ip, char * port, int version, struct enet_list * elist ) ; GOOD_OR_BAD ENET_monitor_detect(struct port_in * pin) ; #if OW_W1 GOOD_OR_BAD W1_detect(struct port_in * pin) ; GOOD_OR_BAD W1_Browse( void ) ; #endif /* OW_W1 */ #if OW_I2C GOOD_OR_BAD DS2482_detect(struct port_in * pin); #endif /* OW_I2C */ #if OW_USB GOOD_OR_BAD DS9490_detect(struct port_in * pin); GOOD_OR_BAD USB_monitor_detect(struct port_in * pin) ; #endif /* OW_USB */ #endif /* OW_DETECT_H */ owfs-3.1p5/module/owlib/src/include/ow_device.h0000644000175000001440000000751312654730021016453 00000000000000/* $Id$ OW -- One-Wire filesystem LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille GPL license 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. */ #ifndef OW_DEVICE_H /* tedious wrapper */ #define OW_DEVICE_H /* Define our understanding of integers, floats, ... */ #include "ow_localtypes.h" #include "ow_parsedname.h" /* Several different structures: device -- one for each type of 1-wire device filetype -- one for each type of file parsedname -- translates a path into usable form */ /* --------------------------------------------------------- */ /* Predeclare struct filetype */ struct filetype; /* -------------------------------- */ /* Devices -- types of 1-wire chips */ /* device structure corresponds to 1-wire device also to virtual devices, like statistical groupings and interfaces (LINK, DS2408, ... ) devices have a list or properties that appear as files under the device directory, they correspond to device features (memory, name, temperature) and bound the allowable files in a device directory */ /* supports RESUME command */ #define DEV_resume 0x0001 /* can trigger an alarm */ #define DEV_alarm 0x0002 /* support OVERDRIVE */ #define DEV_ovdr 0x0004 /* responds to simultaneous temperature convert 0x44 */ #define DEV_temp 0x8000 /* responds to simultaneous voltage convert 0x3C */ #define DEV_volt 0x4000 /* supports CHAIN command */ #define DEV_chain 0x2000 #include "ow_generic_read.h" #include "ow_generic_write.h" struct device { const char *family_code; char *readable_name; uint32_t flags; int count_of_filetypes; struct filetype *filetype_array; struct generic_read * g_read ; struct generic_write * g_write ; }; #define DeviceHeader( chip ) extern struct device d_##chip /* Entries for struct device */ /* Cannot set the 3rd element (number of filetypes) at compile time because filetype arrays aren;t defined at this point */ #define COUNT_OF_FILETYPES(filetype_array) ((int)(sizeof(filetype_array)/sizeof(struct filetype))) #define DeviceEntryExtended( code , chip , flags, gread, gwrite ) struct device d_##chip = {#code,#chip,flags,COUNT_OF_FILETYPES(chip),chip,gread,gwrite} #define DeviceEntry( code , chip, gread, gwrite ) DeviceEntryExtended( code, chip, 0, gread, gwrite ) /* Device tree for matching names */ /* Bianry tree implementation */ /* A separate root for each device type: real, statistics, settings, system, structure */ extern void *Tree[ePN_max_type]; /* Bad bad C library */ /* implementation of tfind, tsearch returns an opaque structure */ /* you have to know that the first element is a pointer to your data */ struct device_opaque { struct device *key; void *other; }; /* Must be sorted for bsearch */ //extern struct device * Devices[] ; //extern size_t nDevices ; extern struct device UnknownDevice; extern struct device RemoteDevice; // returned from remote DIR listing. extern struct device *DeviceSimultaneous; extern struct device *DeviceThermostat; /* ---- end device --------------------- */ #endif /* OW_DEVICE_H */ owfs-3.1p5/module/owlib/src/include/ow_devices.h0000644000175000001440000000432712654730021016636 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_DEVICES_H #define OW_DEVICES_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif // specific read/write code for each device #include "ow_standard.h" // Needed for all devices -- should be before other devices #include "ow_none.h" // Non-existent devices #include "ow_1820.h" // thermometer #include "ow_1821.h" // thermostat #include "ow_1921.h" // thermometer #include "ow_1923.h" // thermometer / humidity #include "ow_1963.h" // ibutton SHA memory #include "ow_1977.h" // password memory #include "ow_1991.h" // ibutton Multikey memory #include "ow_1993.h" // ibutton memory #include "ow_2401.h" // Simple ID and base defines #include "ow_2404.h" // dual port mem and clock #include "ow_2405.h" // switch #include "ow_2406.h" // switch #include "ow_2408.h" // switch #include "ow_2409.h" // hub #include "ow_2413.h" // switch #include "ow_2415.h" // Clock #include "ow_2423.h" // Counter #include "ow_2430.h" // eeprom #include "ow_2433.h" // eeprom #include "ow_2436.h" // Battery #include "ow_2438.h" // Battery #include "ow_2450.h" // A/D convertor #include "ow_2502.h" // write-only memory #include "ow_2505.h" // write-only memory #include "ow_2760.h" // battery #include "ow_2804.h" // switch #include "ow_2890.h" // potentiometer #include "ow_bae.h" // Pascal Baerten's PIC-based device #include "ow_cmciel.h" // CMCIEL like infraread temperature #include "ow_eds.h" // Embedded Data Systems #include "ow_eeef.h" // Hobby Boards UVI etc #include "ow_example_slave.h" // Example of slave programming #include "ow_interface.h" // interface pseudo-device #include "ow_lcd.h" // LCD driver #include "ow_simultaneous.h" // fake entry to address entire directory #include "ow_stats.h" // statistic reporting pseudo-device #include "ow_settings.h" // settings pseudo-device #include "ow_system.h" // system pseudo-device #endif owfs-3.1p5/module/owlib/src/include/ow_dirblob.h0000644000175000001440000000335212654730021016626 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. --------------------------------------------------------------------------- Implementation: 2006 dirblob */ #ifndef OW_DIRBLOB_H /* tedious wrapper */ #define OW_DIRBLOB_H struct dirblob { int troubled; int allocated; int devices; BYTE *snlist; }; void DirblobClear(struct dirblob *db); void DirblobInit(struct dirblob *db); int DirblobPure(const struct dirblob *db); void DirblobPoison(struct dirblob *db); int DirblobElements(const struct dirblob *db); int DirblobAdd(const BYTE * sn, struct dirblob *db); int DirblobGet(int dev, BYTE * sn, const struct dirblob *db); int DirblobSearch(BYTE * sn, const struct dirblob *db); int DirblobRecreate( BYTE * snlist, int size, struct dirblob *db); #endif /* OW_DIRBLOB_H */ owfs-3.1p5/module/owlib/src/include/ow_dl.h0000644000175000001440000000123312654730021015604 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 All the error and statistics counters are declared here, including handling macros */ #ifndef OW_DL_H #define OW_DL_H #include #include "owfs_config.h" #if OW_ZERO #if OW_CYGWIN #include typedef HMODULE DLHANDLE; #elif defined(HAVE_DLOPEN) #include typedef void *DLHANDLE; #endif /* OW_CYGWIN */ DLHANDLE DL_open(const char *pathname); void *DL_sym(DLHANDLE handle, const char *name); int DL_close(DLHANDLE handle); char *DL_error(void); #else /* OW_ZERO */ typedef void *DLHANDLE; #endif /* OW_ZERO */ extern DLHANDLE libdnssd; #endif owfs-3.1p5/module/owlib/src/include/ow_dnssd.h0000644000175000001440000023106212654730021016325 00000000000000/* * Copyright (c) 2003-2004, Apple Computer, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef OW_DNSSD_H #define OW_DNSSD_H #define ORIGINAL_DNSSD_INCLUDE 0 #ifdef __cplusplus extern "C" { #endif /* */ int OW_Load_dnssd_library(void); void OW_Free_dnssd_library(void); /* standard calling convention under Win32 is __stdcall */ /* Note: When compiling Intel EFI (Extensible Firmware Interface) under MS Visual Studio, the */ /* _WIN32 symbol is defined by the compiler even though it's NOT compiling code for Windows32 */ #if defined(_WIN32) && !defined(EFI32) && !defined(EFI64) #define DNSSD_API __stdcall #else /* */ #define DNSSD_API #endif /* */ /* stdint.h does not exist on FreeBSD 4.x; its types are defined in sys/types.h instead */ #if defined(__FreeBSD_version) && (__FreeBSD_version < 500000) #include /* Likewise, on Sun, standard integer types are in sys/types.h */ #elif defined(__sun__) #include /* EFI does not have stdint.h, or anything else equivalent */ #elif defined(EFI32) || defined(EFI64) typedef UINT8 uint8_t; typedef INT8 int8_t; typedef UINT16 uint16_t; typedef INT16 int16_t; typedef UINT32 uint32_t; typedef INT32 int32_t; /* Windows has its own differences */ #elif defined(_WIN32) #include #define _UNUSED #define bzero(a, b) memset(a, 0, b) #ifndef _MSL_STDINT_H typedef UINT8 uint8_t; typedef INT8 int8_t; typedef UINT16 uint16_t; typedef INT16 int16_t; typedef UINT32 uint32_t; typedef INT32 int32_t; #endif /* */ /* All other Posix platforms use stdint.h */ #else /* */ #include #endif /* */ /* DNSServiceRef, DNSRecordRef * * Opaque internal data types. * Note: client is responsible for serializing access to these structures if * they are shared between concurrent threads. */ typedef struct _DNSServiceRef_t *DNSServiceRef; typedef struct _DNSRecordRef_t *DNSRecordRef; /* General flags used in functions defined below */ enum { kDNSServiceFlagsMoreComing = 0x1, /* MoreComing indicates to a callback that at least one more result is * queued and will be delivered following immediately after this one. * Applications should not update their UI to display browse * results when the MoreComing flag is set, because this would * result in a great deal of ugly flickering on the screen. * Applications should instead wait until until MoreComing is not set, * and then update their UI. * When MoreComing is not set, that doesn't mean there will be no more * answers EVER, just that there are no more answers immediately * available right now at this instant. If more answers become available * in the future they will be delivered as usual. */ kDNSServiceFlagsAdd = 0x2, kDNSServiceFlagsDefault = 0x4, /* Flags for domain enumeration and browse/query reply callbacks. * "Default" applies only to enumeration and is only valid in * conjuction with "Add". An enumeration callback with the "Add" * flag NOT set indicates a "Remove", i.e. the domain is no longer * valid. */ kDNSServiceFlagsNoAutoRename = 0x8, /* Flag for specifying renaming behavior on name conflict when registering * non-shared records. By default, name conflicts are automatically handled * by renaming the service. NoAutoRename overrides this behavior - with this * flag set, name conflicts will result in a callback. The NoAutorename flag * is only valid if a name is explicitly specified when registering a service * (i.e. the default name is not used.) */ kDNSServiceFlagsShared = 0x10, kDNSServiceFlagsUnique = 0x20, /* Flag for registering individual records on a connected * DNSServiceRef. Shared indicates that there may be multiple records * with this name on the network (e.g. PTR records). Unique indicates that the * record's name is to be unique on the network (e.g. SRV records). */ kDNSServiceFlagsBrowseDomains = 0x40, kDNSServiceFlagsRegistrationDomains = 0x80, /* Flags for specifying domain enumeration type in DNSServiceEnumerateDomains. * BrowseDomains enumerates domains recommended for browsing, RegistrationDomains * enumerates domains recommended for registration. */ kDNSServiceFlagsLongLivedQuery = 0x100, /* Flag for creating a long-lived unicast query for the DNSServiceQueryRecord call. */ kDNSServiceFlagsAllowRemoteQuery = 0x200, /* Flag for creating a record for which we will answer remote queries * (queries from hosts more than one hop away; hosts not directly connected to the local link). */ kDNSServiceFlagsForceMulticast = 0x400 /* Flag for signifying that a query or registration should be performed exclusively via multicast DNS, * even for a name in a domain (e.g. foo.apple.com.) that would normally imply unicast DNS. */ }; /* * The values for DNS Classes and Types are listed in RFC 1035, and are available * on every OS in its DNS header file. Unfortunately every OS does not have the * same header file containing DNS Class and Type constants, and the names of * the constants are not consistent. For example, BIND 8 uses "T_A", * BIND 9 uses "ns_t_a", Windows uses "DNS_TYPE_A", etc. * For this reason, these constants are also listed here, so that code using * the DNS-SD programming APIs can use these constants, so that the same code * can compile on all our supported platforms. */ enum { kDNSServiceClass_IN = 1 /* Internet */ }; enum { kDNSServiceType_A = 1, /* Host address. */ kDNSServiceType_NS = 2, /* Authoritative server. */ kDNSServiceType_MD = 3, /* Mail destination. */ kDNSServiceType_MF = 4, /* Mail forwarder. */ kDNSServiceType_CNAME = 5, /* Canonical name. */ kDNSServiceType_SOA = 6, /* Start of authority zone. */ kDNSServiceType_MB = 7, /* Mailbox domain name. */ kDNSServiceType_MG = 8, /* Mail group member. */ kDNSServiceType_MR = 9, /* Mail rename name. */ kDNSServiceType_NULL = 10, /* Null resource record. */ kDNSServiceType_WKS = 11, /* Well known service. */ kDNSServiceType_PTR = 12, /* Domain name pointer. */ kDNSServiceType_HINFO = 13, /* Host information. */ kDNSServiceType_MINFO = 14, /* Mailbox information. */ kDNSServiceType_MX = 15, /* Mail routing information. */ kDNSServiceType_TXT = 16, /* One or more text strings. */ kDNSServiceType_RP = 17, /* Responsible person. */ kDNSServiceType_AFSDB = 18, /* AFS cell database. */ kDNSServiceType_X25 = 19, /* X_25 calling address. */ kDNSServiceType_ISDN = 20, /* ISDN calling address. */ kDNSServiceType_RT = 21, /* Router. */ kDNSServiceType_NSAP = 22, /* NSAP address. */ kDNSServiceType_NSAP_PTR = 23, /* Reverse NSAP lookup (deprecated). */ kDNSServiceType_SIG = 24, /* Security signature. */ kDNSServiceType_KEY = 25, /* Security key. */ kDNSServiceType_PX = 26, /* X.400 mail mapping. */ kDNSServiceType_GPOS = 27, /* Geographical position (withdrawn). */ kDNSServiceType_AAAA = 28, /* Ip6 Address. */ kDNSServiceType_LOC = 29, /* Location Information. */ kDNSServiceType_NXT = 30, /* Next domain (security). */ kDNSServiceType_EID = 31, /* Endpoint identifier. */ kDNSServiceType_NIMLOC = 32, /* Nimrod Locator. */ kDNSServiceType_SRV = 33, /* Server Selection. */ kDNSServiceType_ATMA = 34, /* ATM Address */ kDNSServiceType_NAPTR = 35, /* Naming Authority PoinTeR */ kDNSServiceType_KX = 36, /* Key Exchange */ kDNSServiceType_CERT = 37, /* Certification record */ kDNSServiceType_A6 = 38, /* IPv6 address (deprecates AAAA) */ kDNSServiceType_DNAME = 39, /* Non-terminal DNAME (for IPv6) */ kDNSServiceType_SINK = 40, /* Kitchen sink (experimentatl) */ kDNSServiceType_OPT = 41, /* EDNS0 option (meta-RR) */ kDNSServiceType_TKEY = 249, /* Transaction key */ kDNSServiceType_TSIG = 250, /* Transaction signature. */ kDNSServiceType_IXFR = 251, /* Incremental zone transfer. */ kDNSServiceType_AXFR = 252, /* Transfer zone of authority. */ kDNSServiceType_MAILB = 253, /* Transfer mailbox records. */ kDNSServiceType_MAILA = 254, /* Transfer mail agent records. */ kDNSServiceType_ANY = 255 /* Wildcard match. */ }; /* possible error code values */ enum { kDNSServiceErr_NoError = 0, kDNSServiceErr_Unknown = -65537, /* 0xFFFE FFFF */ kDNSServiceErr_NoSuchName = -65538, kDNSServiceErr_NoMemory = -65539, kDNSServiceErr_BadParam = -65540, kDNSServiceErr_BadReference = -65541, kDNSServiceErr_BadState = -65542, kDNSServiceErr_BadFlags = -65543, kDNSServiceErr_Unsupported = -65544, kDNSServiceErr_NotInitialized = -65545, kDNSServiceErr_AlreadyRegistered =-65547, kDNSServiceErr_NameConflict = -65548, kDNSServiceErr_Invalid = -65549, kDNSServiceErr_Firewall = -65550, kDNSServiceErr_Incompatible = -65551, /* client library incompatible with daemon */ kDNSServiceErr_BadInterfaceIndex =-65552, kDNSServiceErr_Refused = -65553, kDNSServiceErr_NoSuchRecord = -65554, kDNSServiceErr_NoAuth = -65555, kDNSServiceErr_NoSuchKey = -65556, kDNSServiceErr_NATTraversal = -65557, kDNSServiceErr_DoubleNAT = -65558, kDNSServiceErr_BadTime = -65559 /* mDNS Error codes are in the range * FFFE FF00 (-65792) to FFFE FFFF (-65537) */ }; /* Maximum length, in bytes, of a service name represented as a */ /* literal C-String, including the terminating NULL at the end. */ #define kDNSServiceMaxServiceName 64 /* Maximum length, in bytes, of a domain name represented as an *escaped* C-String */ /* including the final trailing dot, and the C-String terminating NULL at the end. */ #define kDNSServiceMaxDomainName 1005 /* * Notes on DNS Name Escaping * -- or -- * "Why is kDNSServiceMaxDomainName 1005, when the maximum legal domain name is 255 bytes?" * * All strings used in DNS-SD are UTF-8 strings. * With few exceptions, most are also escaped using standard DNS escaping rules: * * '\\' represents a single literal '\' in the name * '\.' represents a single literal '.' in the name * '\ddd', where ddd is a three-digit decimal value from 000 to 255, * represents a single literal byte with that value. * A bare unescaped '.' is a label separator, marking a boundary between domain and subdomain. * * The exceptions, that do not use escaping, are the routines where the full * DNS name of a resource is broken, for convenience, into servicename/regtype/domain. * In these routines, the "servicename" is NOT escaped. It does not need to be, since * it is, by definition, just a single literal string. Any characters in that string * represent exactly what they are. The "regtype" portion is, technically speaking, * escaped, but since legal regtypes are only allowed to contain letters, digits, * and hyphens, there is nothing to escape, so the issue is moot. The "domain" * portion is also escaped, though most domains in use on the public Internet * today, like regtypes, don't contain any characters that need to be escaped. * As DNS-SD becomes more popular, rich-text domains for service discovery will * become common, so software should be written to cope with domains with escaping. * * The servicename may be up to 63 bytes of UTF-8 text (not counting the C-String * terminating NULL at the end). The regtype is of the form _service._tcp or * _service._udp, where the "service" part is 1-14 characters, which may be * letters, digits, or hyphens. The domain part of the three-part name may be * any legal domain, providing that the resulting servicename+regtype+domain * name does not exceed 255 bytes. * * For most software, these issues are transparent. When browsing, the discovered * servicenames should simply be displayed as-is. When resolving, the discovered * servicename/regtype/domain are simply passed unchanged to DNSServiceResolve(). * When a DNSServiceResolve() succeeds, the returned fullname is already in * the correct format to pass to standard system DNS APIs such as res_query(). * For converting from servicename/regtype/domain to a single properly-escaped * full DNS name, the helper function DNSServiceConstructFullName() is provided. * * The following (highly contrived) example illustrates the escaping process. * Suppose you have an service called "Dr. Smith\Dr. Johnson", of type "_ftp._tcp" * in subdomain "4th. Floor" of subdomain "Building 2" of domain "apple.com." * The full (escaped) DNS name of this service's SRV record would be: * Dr\.\032Smith\\Dr\.\032Johnson._ftp._tcp.4th\.\032Floor.Building\0322.apple.com. */ /* * Constants for specifying an interface index * * Specific interface indexes are identified via a 32-bit unsigned integer returned * by the if_nametoindex() family of calls. * * If the client passes 0 for interface index, that means "do the right thing", * which (at present) means, "if the name is in an mDNS local multicast domain * (e.g. 'local.', '254.169.in-addr.arpa.', '0.8.E.F.ip6.arpa.') then multicast * on all applicable interfaces, otherwise send via unicast to the appropriate * DNS server." Normally, most clients will use 0 for interface index to * automatically get the default sensible behaviour. * * If the client passes a positive interface index, then for multicast names that * indicates to do the operation only on that one interface. For unicast names the * interface index is ignored unless kDNSServiceFlagsForceMulticast is also set. * * If the client passes kDNSServiceInterfaceIndexLocalOnly when registering * a service, then that service will be found *only* by other local clients * on the same machine that are browsing using kDNSServiceInterfaceIndexLocalOnly * or kDNSServiceInterfaceIndexAny. * If a client has a 'private' service, accessible only to other processes * running on the same machine, this allows the client to advertise that service * in a way such that it does not inadvertently appear in service lists on * all the other machines on the network. * * If the client passes kDNSServiceInterfaceIndexLocalOnly when browsing * then it will find *all* records registered on that same local machine. * Clients explicitly wishing to discover *only* LocalOnly services can * accomplish this by inspecting the interfaceIndex of each service reported * to their DNSServiceBrowseReply() callback function, and discarding those * where the interface index is not kDNSServiceInterfaceIndexLocalOnly. */ #define kDNSServiceInterfaceIndexAny 0 #define kDNSServiceInterfaceIndexLocalOnly ( (uint32_t) -1 ) typedef uint32_t DNSServiceFlags; typedef int32_t DNSServiceErrorType; /********************************************************************************************* * * Unix Domain Socket access, DNSServiceRef deallocation, and data processing functions * *********************************************************************************************/ /* DNSServiceRefSockFD() * * Access underlying Unix domain socket for an initialized DNSServiceRef. * The DNS Service Discovery implmementation uses this socket to communicate between * the client and the mDNSResponder daemon. The application MUST NOT directly read from * or write to this socket. Access to the socket is provided so that it can be used as a * run loop source, or in a select() loop: when data is available for reading on the socket, * DNSServiceProcessResult() should be called, which will extract the daemon's reply from * the socket, and pass it to the appropriate application callback. By using a run loop or * select(), results from the daemon can be processed asynchronously. Without using these * constructs, DNSServiceProcessResult() will block until the response from the daemon arrives. * The client is responsible for ensuring that the data on the socket is processed in a timely * fashion - the daemon may terminate its connection with a client that does not clear its * socket buffer. * * sdRef: A DNSServiceRef initialized by any of the DNSService calls. * * return value: The DNSServiceRef's underlying socket descriptor, or -1 on * error. */ #if ORIGINAL_DNSSD_INCLUDE int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdRef); #else /* */ typedef int DNSSD_API(*_DNSServiceRefSockFD) (DNSServiceRef sdRef); extern _DNSServiceRefSockFD DNSServiceRefSockFD; #endif /* */ /* DNSServiceProcessResult() * * Read a reply from the daemon, calling the appropriate application callback. This call will * block until the daemon's response is received. Use DNSServiceRefSockFD() in * conjunction with a run loop or select() to determine the presence of a response from the * server before calling this function to process the reply without blocking. Call this function * at any point if it is acceptable to block until the daemon's response arrives. Note that the * client is responsible for ensuring that DNSServiceProcessResult() is called whenever there is * a reply from the daemon - the daemon may terminate its connection with a client that does not * process the daemon's responses. * * sdRef: A DNSServiceRef initialized by any of the DNSService calls * that take a callback parameter. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns * an error code indicating the specific failure that occurred. */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdRef); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceProcessResult) (DNSServiceRef sdRef); extern _DNSServiceProcessResult DNSServiceProcessResult; #endif /* */ /* DNSServiceRefDeallocate() * * Terminate a connection with the daemon and free memory associated with the DNSServiceRef. * Any services or records registered with this DNSServiceRef will be deregistered. Any * Browse, Resolve, or Query operations called with this reference will be terminated. * * Note: If the reference's underlying socket is used in a run loop or select() call, it should * be removed BEFORE DNSServiceRefDeallocate() is called, as this function closes the reference's * socket. * * Note: If the reference was initialized with DNSServiceCreateConnection(), any DNSRecordRefs * created via this reference will be invalidated by this call - the resource records are * deregistered, and their DNSRecordRefs may not be used in subsequent functions. Similarly, * if the reference was initialized with DNSServiceRegister, and an extra resource record was * added to the service via DNSServiceAddRecord(), the DNSRecordRef created by the Add() call * is invalidated when this function is called - the DNSRecordRef may not be used in subsequent * functions. * * Note: This call is to be used only with the DNSServiceRef defined by this API. It is * not compatible with dns_service_discovery_ref objects defined in the legacy Mach-based * DNSServiceDiscovery.h API. * * sdRef: A DNSServiceRef initialized by any of the DNSService calls. * */ #if ORIGINAL_DNSSD_INCLUDE void DNSSD_API DNSServiceRefDeallocate(DNSServiceRef sdRef); #else /* */ typedef void DNSSD_API(*_DNSServiceRefDeallocate) (DNSServiceRef sdRef); extern _DNSServiceRefDeallocate DNSServiceRefDeallocate; #endif /* */ /********************************************************************************************* * * Domain Enumeration * *********************************************************************************************/ /* DNSServiceEnumerateDomains() * * Asynchronously enumerate domains available for browsing and registration. * * The enumeration MUST be cancelled via DNSServiceRefDeallocate() when no more domains * are to be found. * * Note that the names returned are (like all of DNS-SD) UTF-8 strings, * and are escaped using standard DNS escaping rules. * (See "Notes on DNS Name Escaping" earlier in this file for more details.) * A graphical browser displaying a hierarchical tree-structured view should cut * the names at the bare dots to yield individual labels, then de-escape each * label according to the escaping rules, and then display the resulting UTF-8 text. * * DNSServiceDomainEnumReply Callback Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceEnumerateDomains(). * * flags: Possible values are: * kDNSServiceFlagsMoreComing * kDNSServiceFlagsAdd * kDNSServiceFlagsDefault * * interfaceIndex: Specifies the interface on which the domain exists. (The index for a given * interface is determined via the if_nametoindex() family of calls.) * * errorCode: Will be kDNSServiceErr_NoError (0) on success, otherwise indicates * the failure that occurred (other parameters are undefined if errorCode is nonzero). * * replyDomain: The name of the domain. * * context: The context pointer passed to DNSServiceEnumerateDomains. * */ typedef void (DNSSD_API * DNSServiceDomainEnumReply) ( DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *replyDomain, void *context ); /* DNSServiceEnumerateDomains() Parameters: * * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the enumeration operation will run indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * flags: Possible values are: * kDNSServiceFlagsBrowseDomains to enumerate domains recommended for browsing. * kDNSServiceFlagsRegistrationDomains to enumerate domains recommended * for registration. * * interfaceIndex: If non-zero, specifies the interface on which to look for domains. * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Most applications will pass 0 to enumerate domains on * all interfaces. See "Constants for specifying an interface index" for more details. * * callBack: The function to be called when a domain is found or the call asynchronously * fails. * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is not invoked and the DNSServiceRef * is not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceEnumerateDomains ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceDomainEnumReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceEnumerateDomains) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceDomainEnumReply callBack, void *context /* may be NULL */ ); extern _DNSServiceEnumerateDomains DNSServiceEnumerateDomains; #endif /* */ /********************************************************************************************* * * Service Registration * *********************************************************************************************/ /* Register a service that is discovered via Browse() and Resolve() calls. * * * DNSServiceRegisterReply() Callback Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceRegister(). * * flags: Currently unused, reserved for future use. * * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will * indicate the failure that occurred (including name conflicts, * if the kDNSServiceFlagsNoAutoRename flag was used when registering.) * Other parameters are undefined if errorCode is nonzero. * * name: The service name registered (if the application did not specify a name in * DNSServiceRegister(), this indicates what name was automatically chosen). * * regtype: The type of service registered, as it was passed to the callout. * * domain: The domain on which the service was registered (if the application did not * specify a domain in DNSServiceRegister(), this indicates the default domain * on which the service was registered). * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceRegisterReply) ( DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode, const char *name, const char *regtype, const char *domain, void *context ); /* DNSServiceRegister() Parameters: * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the registration will remain active indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * interfaceIndex: If non-zero, specifies the interface on which to register the service * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Most applications will pass 0 to register on all * available interfaces. See "Constants for specifying an interface index" for more details. * * flags: Indicates the renaming behavior on name conflict (most applications * will pass 0). See flag definitions above for details. * * name: If non-NULL, specifies the service name to be registered. * Most applications will not specify a name, in which case the computer * name is used (this name is communicated to the client via the callback). * If a name is specified, it must be 1-63 bytes of UTF-8 text. * If the name is longer than 63 bytes it will be automatically truncated * to a legal length, unless the NoAutoRename flag is set, * in which case kDNSServiceErr_BadParam will be returned. * * regtype: The service type followed by the protocol, separated by a dot * (e.g. "_ftp._tcp"). The service type must be an underscore, followed * by 1-14 characters, which may be letters, digits, or hyphens. * The transport protocol must be "_tcp" or "_udp". New service types * should be registered at . * * domain: If non-NULL, specifies the domain on which to advertise the service. * Most applications will not specify a domain, instead automatically * registering in the default domain(s). * * host: If non-NULL, specifies the SRV target host name. Most applications * will not specify a host, instead automatically using the machine's * default host name(s). Note that specifying a non-NULL host does NOT * create an address record for that host - the application is responsible * for ensuring that the appropriate address record exists, or creating it * via DNSServiceRegisterRecord(). * * port: The port, in network byte order, on which the service accepts connections. * Pass 0 for a "placeholder" service (i.e. a service that will not be discovered * by browsing, but will cause a name conflict if another client tries to * register that same name). Most clients will not use placeholder services. * * txtLen: The length of the txtRecord, in bytes. Must be zero if the txtRecord is NULL. * * txtRecord: The TXT record rdata. A non-NULL txtRecord MUST be a properly formatted DNS * TXT record, i.e. ... * Passing NULL for the txtRecord is allowed as a synonym for txtLen=1, txtRecord="", * i.e. it creates a TXT record of length one containing a single empty string. * RFC 1035 doesn't allow a TXT record to contain *zero* strings, so a single empty * string is the smallest legal DNS TXT record. * * callBack: The function to be called when the registration completes or asynchronously * fails. The client MAY pass NULL for the callback - The client will NOT be notified * of the default values picked on its behalf, and the client will NOT be notified of any * asynchronous errors (e.g. out of memory errors, etc.) that may prevent the registration * of the service. The client may NOT pass the NoAutoRename flag if the callback is NULL. * The client may still deregister the service at any time via DNSServiceRefDeallocate(). * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is never invoked and the DNSServiceRef * is not initialized.) * */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceRegister ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, /* may be NULL */ const char *regtype, const char *domain, /* may be NULL */ const char *host, /* may be NULL */ uint16_t port, uint16_t txtLen, const void *txtRecord, /* may be NULL */ DNSServiceRegisterReply callBack, /* may be NULL */ void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceRegister) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, /* may be NULL */ const char *regtype, const char *domain, /* may be NULL */ const char *host, /* may be NULL */ uint16_t port, uint16_t txtLen, const void *txtRecord, /* may be NULL */ DNSServiceRegisterReply callBack, /* may be NULL */ void *context /* may be NULL */ ); extern _DNSServiceRegister DNSServiceRegister; #endif /* */ /* DNSServiceAddRecord() * * Add a record to a registered service. The name of the record will be the same as the * registered service's name. * The record can later be updated or deregistered by passing the RecordRef initialized * by this function to DNSServiceUpdateRecord() or DNSServiceRemoveRecord(). * * * Parameters; * * sdRef: A DNSServiceRef initialized by DNSServiceRegister(). * * RecordRef: A pointer to an uninitialized DNSRecordRef. Upon succesfull completion of this * call, this ref may be passed to DNSServiceUpdateRecord() or DNSServiceRemoveRecord(). * If the above DNSServiceRef is passed to DNSServiceRefDeallocate(), RecordRef is also * invalidated and may not be used further. * * flags: Currently ignored, reserved for future use. * * rrtype: The type of the record (e.g. kDNSServiceType_TXT, kDNSServiceType_SRV, etc) * * rdlen: The length, in bytes, of the rdata. * * rdata: The raw rdata to be contained in the added resource record. * * ttl: The time to live of the resource record, in seconds. Pass 0 to use a default value. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns an * error code indicating the error that occurred (the RecordRef is not initialized). */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceAddRecord ( DNSServiceRef sdRef, DNSRecordRef * RecordRef, DNSServiceFlags flags, uint16_t rrtype, uint16_t rdlen, const void *rdata, uint32_t ttl ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceAddRecord) ( DNSServiceRef sdRef, DNSRecordRef * RecordRef, DNSServiceFlags flags, uint16_t rrtype, uint16_t rdlen, const void *rdata, uint32_t ttl ); extern _DNSServiceAddRecord DNSServiceAddRecord; #endif /* */ /* DNSServiceUpdateRecord * * Update a registered resource record. The record must either be: * - The primary txt record of a service registered via DNSServiceRegister() * - A record added to a registered service via DNSServiceAddRecord() * - An individual record registered by DNSServiceRegisterRecord() * * * Parameters: * * sdRef: A DNSServiceRef that was initialized by DNSServiceRegister() * or DNSServiceCreateConnection(). * * RecordRef: A DNSRecordRef initialized by DNSServiceAddRecord, or NULL to update the * service's primary txt record. * * flags: Currently ignored, reserved for future use. * * rdlen: The length, in bytes, of the new rdata. * * rdata: The new rdata to be contained in the updated resource record. * * ttl: The time to live of the updated resource record, in seconds. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns an * error code indicating the error that occurred. */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceUpdateRecord ( DNSServiceRef sdRef, DNSRecordRef RecordRef, /* may be NULL */ DNSServiceFlags flags, uint16_t rdlen, const void *rdata, uint32_t ttl ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceUpdateRecord) ( DNSServiceRef sdRef, DNSRecordRef RecordRef, /* may be NULL */ DNSServiceFlags flags, uint16_t rdlen, const void *rdata, uint32_t ttl ); extern _DNSServiceUpdateRecord DNSServiceUpdateRecord; #endif /* */ /* DNSServiceRemoveRecord * * Remove a record previously added to a service record set via DNSServiceAddRecord(), or deregister * an record registered individually via DNSServiceRegisterRecord(). * * Parameters: * * sdRef: A DNSServiceRef initialized by DNSServiceRegister() (if the * record being removed was registered via DNSServiceAddRecord()) or by * DNSServiceCreateConnection() (if the record being removed was registered via * DNSServiceRegisterRecord()). * * recordRef: A DNSRecordRef initialized by a successful call to DNSServiceAddRecord() * or DNSServiceRegisterRecord(). * * flags: Currently ignored, reserved for future use. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns an * error code indicating the error that occurred. */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceRemoveRecord ( DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceRemoveRecord) ( DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags ); extern _DNSServiceRemoveRecord DNSServiceRemoveRecord; #endif /* */ /********************************************************************************************* * * Service Discovery * *********************************************************************************************/ /* Browse for instances of a service. * * * DNSServiceBrowseReply() Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceBrowse(). * * flags: Possible values are kDNSServiceFlagsMoreComing and kDNSServiceFlagsAdd. * See flag definitions for details. * * interfaceIndex: The interface on which the service is advertised. This index should * be passed to DNSServiceResolve() when resolving the service. * * errorCode: Will be kDNSServiceErr_NoError (0) on success, otherwise will * indicate the failure that occurred. Other parameters are undefined if * the errorCode is nonzero. * * serviceName: The discovered service name. This name should be displayed to the user, * and stored for subsequent use in the DNSServiceResolve() call. * * regtype: The service type, which is usually (but not always) the same as was passed * to DNSServiceBrowse(). One case where the discovered service type may * not be the same as the requested service type is when using subtypes: * The client may want to browse for only those ftp servers that allow * anonymous connections. The client will pass the string "_ftp._tcp,_anon" * to DNSServiceBrowse(), but the type of the service that's discovered * is simply "_ftp._tcp". The regtype for each discovered service instance * should be stored along with the name, so that it can be passed to * DNSServiceResolve() when the service is later resolved. * * domain: The domain of the discovered service instance. This may or may not be the * same as the domain that was passed to DNSServiceBrowse(). The domain for each * discovered service instance should be stored along with the name, so that * it can be passed to DNSServiceResolve() when the service is later resolved. * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceBrowseReply) ( DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *serviceName, const char *regtype, const char *replyDomain, void *context ); /* DNSServiceBrowse() Parameters: * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the browse operation will run indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * flags: Currently ignored, reserved for future use. * * interfaceIndex: If non-zero, specifies the interface on which to browse for services * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Most applications will pass 0 to browse on all available * interfaces. See "Constants for specifying an interface index" for more details. * * regtype: The service type being browsed for followed by the protocol, separated by a * dot (e.g. "_ftp._tcp"). The transport protocol must be "_tcp" or "_udp". * * domain: If non-NULL, specifies the domain on which to browse for services. * Most applications will not specify a domain, instead browsing on the * default domain(s). * * callBack: The function to be called when an instance of the service being browsed for * is found, or if the call asynchronously fails. * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is not invoked and the DNSServiceRef * is not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceBrowse ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *regtype, const char *domain, /* may be NULL */ DNSServiceBrowseReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceBrowse) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *regtype, const char *domain, /* may be NULL */ DNSServiceBrowseReply callBack, void *context /* may be NULL */ ); extern _DNSServiceBrowse DNSServiceBrowse; #endif /* */ /* DNSServiceResolve() * * Resolve a service name discovered via DNSServiceBrowse() to a target host name, port number, and * txt record. * * Note: Applications should NOT use DNSServiceResolve() solely for txt record monitoring - use * DNSServiceQueryRecord() instead, as it is more efficient for this task. * * Note: When the desired results have been returned, the client MUST terminate the resolve by calling * DNSServiceRefDeallocate(). * * Note: DNSServiceResolve() behaves correctly for typical services that have a single SRV record * and a single TXT record. To resolve non-standard services with multiple SRV or TXT records, * DNSServiceQueryRecord() should be used. * * DNSServiceResolveReply Callback Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceResolve(). * * flags: Currently unused, reserved for future use. * * interfaceIndex: The interface on which the service was resolved. * * errorCode: Will be kDNSServiceErr_NoError (0) on success, otherwise will * indicate the failure that occurred. Other parameters are undefined if * the errorCode is nonzero. * * fullname: The full service domain name, in the form ... * (This name is escaped following standard DNS rules, making it suitable for * passing to standard system DNS APIs such as res_query(), or to the * special-purpose functions included in this API that take fullname parameters. * See "Notes on DNS Name Escaping" earlier in this file for more details.) * * hosttarget: The target hostname of the machine providing the service. This name can * be passed to functions like gethostbyname() to identify the host's IP address. * * port: The port, in network byte order, on which connections are accepted for this service. * * txtLen: The length of the txt record, in bytes. * * txtRecord: The service's primary txt record, in standard txt record format. * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceResolveReply) ( DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *fullname, const char *hosttarget, uint16_t port, uint16_t txtLen, const unsigned char *txtRecord, void *context ); /* DNSServiceResolve() Parameters * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the resolve operation will run indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * flags: Currently ignored, reserved for future use. * * interfaceIndex: The interface on which to resolve the service. If this resolve call is * as a result of a currently active DNSServiceBrowse() operation, then the * interfaceIndex should be the index reported in the DNSServiceBrowseReply * callback. If this resolve call is using information previously saved * (e.g. in a preference file) for later use, then use interfaceIndex 0, because * the desired service may now be reachable via a different physical interface. * See "Constants for specifying an interface index" for more details. * * name: The name of the service instance to be resolved, as reported to the * DNSServiceBrowseReply() callback. * * regtype: The type of the service instance to be resolved, as reported to the * DNSServiceBrowseReply() callback. * * domain: The domain of the service instance to be resolved, as reported to the * DNSServiceBrowseReply() callback. * * callBack: The function to be called when a result is found, or if the call * asynchronously fails. * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is never invoked and the DNSServiceRef * is not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceResolve ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, const char *regtype, const char *domain, DNSServiceResolveReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceResolve) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *name, const char *regtype, const char *domain, DNSServiceResolveReply callBack, void *context /* may be NULL */ ); extern _DNSServiceResolve DNSServiceResolve; #endif /* */ /********************************************************************************************* * * Special Purpose Calls (most applications will not use these) * *********************************************************************************************/ /* DNSServiceCreateConnection() * * Create a connection to the daemon allowing efficient registration of * multiple individual records. * * * Parameters: * * sdRef: A pointer to an uninitialized DNSServiceRef. Deallocating * the reference (via DNSServiceRefDeallocate()) severs the * connection and deregisters all records registered on this connection. * * return value: Returns kDNSServiceErr_NoError on success, otherwise returns * an error code indicating the specific failure that occurred (in which * case the DNSServiceRef is not initialized). */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceCreateConnection(DNSServiceRef * sdRef); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceCreateConnection) (DNSServiceRef * sdRef); extern _DNSServiceCreateConnection DNSServiceCreateConnection; #endif /* */ /* DNSServiceRegisterRecord * * Register an individual resource record on a connected DNSServiceRef. * * Note that name conflicts occurring for records registered via this call must be handled * by the client in the callback. * * * DNSServiceRegisterRecordReply() parameters: * * sdRef: The connected DNSServiceRef initialized by * DNSServiceDiscoveryConnect(). * * RecordRef: The DNSRecordRef initialized by DNSServiceRegisterRecord(). If the above * DNSServiceRef is passed to DNSServiceRefDeallocate(), this DNSRecordRef is * invalidated, and may not be used further. * * flags: Currently unused, reserved for future use. * * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will * indicate the failure that occurred (including name conflicts.) * Other parameters are undefined if errorCode is nonzero. * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceRegisterRecordReply) ( DNSServiceRef sdRef, DNSRecordRef RecordRef, DNSServiceFlags flags, DNSServiceErrorType errorCode, void *context ); /* DNSServiceRegisterRecord() Parameters: * * sdRef: A DNSServiceRef initialized by DNSServiceCreateConnection(). * * RecordRef: A pointer to an uninitialized DNSRecordRef. Upon succesfull completion of this * call, this ref may be passed to DNSServiceUpdateRecord() or DNSServiceRemoveRecord(). * (To deregister ALL records registered on a single connected DNSServiceRef * and deallocate each of their corresponding DNSServiceRecordRefs, call * DNSServiceRefDealloocate()). * * flags: Possible values are kDNSServiceFlagsShared or kDNSServiceFlagsUnique * (see flag type definitions for details). * * interfaceIndex: If non-zero, specifies the interface on which to register the record * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Passing 0 causes the record to be registered on all interfaces. * See "Constants for specifying an interface index" for more details. * * fullname: The full domain name of the resource record. * * rrtype: The numerical type of the resource record (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) * * rrclass: The class of the resource record (usually kDNSServiceClass_IN) * * rdlen: Length, in bytes, of the rdata. * * rdata: A pointer to the raw rdata, as it is to appear in the DNS record. * * ttl: The time to live of the resource record, in seconds. Pass 0 to use a default value. * * callBack: The function to be called when a result is found, or if the call * asynchronously fails (e.g. because of a name conflict.) * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is never invoked and the DNSRecordRef is * not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceRegisterRecord ( DNSServiceRef sdRef, DNSRecordRef * RecordRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, DNSServiceRegisterRecordReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceRegisterRecord) ( DNSServiceRef sdRef, DNSRecordRef * RecordRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, DNSServiceRegisterRecordReply callBack, void *context /* may be NULL */ ); extern _DNSServiceRegisterRecord DNSServiceRegisterRecord; #endif /* */ /* DNSServiceQueryRecord * * Query for an arbitrary DNS record. * * * DNSServiceQueryRecordReply() Callback Parameters: * * sdRef: The DNSServiceRef initialized by DNSServiceQueryRecord(). * * flags: Possible values are kDNSServiceFlagsMoreComing and * kDNSServiceFlagsAdd. The Add flag is NOT set for PTR records * with a ttl of 0, i.e. "Remove" events. * * interfaceIndex: The interface on which the query was resolved (the index for a given * interface is determined via the if_nametoindex() family of calls). * See "Constants for specifying an interface index" for more details. * * errorCode: Will be kDNSServiceErr_NoError on success, otherwise will * indicate the failure that occurred. Other parameters are undefined if * errorCode is nonzero. * * fullname: The resource record's full domain name. * * rrtype: The resource record's type (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) * * rrclass: The class of the resource record (usually kDNSServiceClass_IN). * * rdlen: The length, in bytes, of the resource record rdata. * * rdata: The raw rdata of the resource record. * * ttl: The resource record's time to live, in seconds. * * context: The context pointer that was passed to the callout. * */ typedef void (DNSSD_API * DNSServiceQueryRecordReply) ( DNSServiceRef DNSServiceRef_, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, void *context ); /* DNSServiceQueryRecord() Parameters: * * sdRef: A pointer to an uninitialized DNSServiceRef. If the call succeeds * then it initializes the DNSServiceRef, returns kDNSServiceErr_NoError, * and the query operation will run indefinitely until the client * terminates it by passing this DNSServiceRef to DNSServiceRefDeallocate(). * * flags: Pass kDNSServiceFlagsLongLivedQuery to create a "long-lived" unicast * query in a non-local domain. Without setting this flag, unicast queries * will be one-shot - that is, only answers available at the time of the call * will be returned. By setting this flag, answers (including Add and Remove * events) that become available after the initial call is made will generate * callbacks. This flag has no effect on link-local multicast queries. * * interfaceIndex: If non-zero, specifies the interface on which to issue the query * (the index for a given interface is determined via the if_nametoindex() * family of calls.) Passing 0 causes the name to be queried for on all * interfaces. See "Constants for specifying an interface index" for more details. * * fullname: The full domain name of the resource record to be queried for. * * rrtype: The numerical type of the resource record to be queried for * (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) * * rrclass: The class of the resource record (usually kDNSServiceClass_IN). * * callBack: The function to be called when a result is found, or if the call * asynchronously fails. * * context: An application context pointer which is passed to the callback function * (may be NULL). * * return value: Returns kDNSServiceErr_NoError on succeses (any subsequent, asynchronous * errors are delivered to the callback), otherwise returns an error code indicating * the error that occurred (the callback is never invoked and the DNSServiceRef * is not initialized.) */ #if ORIGINAL_DNSSD_INCLUDE DNSServiceErrorType DNSSD_API DNSServiceQueryRecord ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, DNSServiceQueryRecordReply callBack, void *context /* may be NULL */ ); #else /* */ typedef DNSServiceErrorType DNSSD_API(*_DNSServiceQueryRecord) ( DNSServiceRef * sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, DNSServiceQueryRecordReply callBack, void *context /* may be NULL */ ); extern _DNSServiceQueryRecord DNSServiceQueryRecord; #endif /* */ /* DNSServiceReconfirmRecord * * Instruct the daemon to verify the validity of a resource record that appears to * be out of date (e.g. because tcp connection to a service's target failed.) * Causes the record to be flushed from the daemon's cache (as well as all other * daemons' caches on the network) if the record is determined to be invalid. * * Parameters: * * flags: Currently unused, reserved for future use. * * interfaceIndex: If non-zero, specifies the interface of the record in question. * Passing 0 causes all instances of this record to be reconfirmed. * * fullname: The resource record's full domain name. * * rrtype: The resource record's type (e.g. kDNSServiceType_PTR, kDNSServiceType_SRV, etc) * * rrclass: The class of the resource record (usually kDNSServiceClass_IN). * * rdlen: The length, in bytes, of the resource record rdata. * * rdata: The raw rdata of the resource record. * */ #if ORIGINAL_DNSSD_INCLUDE void DNSSD_API DNSServiceReconfirmRecord ( DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata ); #else /* */ typedef void DNSSD_API(*_DNSServiceReconfirmRecord) ( DNSServiceFlags flags, uint32_t interfaceIndex, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata ); extern _DNSServiceReconfirmRecord DNSServiceReconfirmRecord; #endif /* */ /********************************************************************************************* * * General Utility Functions * *********************************************************************************************/ /* DNSServiceConstructFullName() * * Concatenate a three-part domain name (as returned by the above callbacks) into a * properly-escaped full domain name. Note that callbacks in the above functions ALREADY ESCAPE * strings where necessary. * * Parameters: * * fullName: A pointer to a buffer that where the resulting full domain name is to be written. * The buffer must be kDNSServiceMaxDomainName (1005) bytes in length to * accommodate the longest legal domain name without buffer overrun. * * service: The service name - any dots or backslashes must NOT be escaped. * May be NULL (to construct a PTR record name, e.g. * "_ftp._tcp.apple.com."). * * regtype: The service type followed by the protocol, separated by a dot * (e.g. "_ftp._tcp"). * * domain: The domain name, e.g. "apple.com.". Literal dots or backslashes, * if any, must be escaped, e.g. "1st\. Floor.apple.com." * * return value: Returns 0 on success, -1 on error. * */ #if ORIGINAL_DNSSD_INCLUDE int DNSSD_API DNSServiceConstructFullName ( char *fullName, const char *service, /* may be NULL */ const char *regtype, const char *domain ); #else /* */ typedef int DNSSD_API(*_DNSServiceConstructFullName) ( char *fullName, const char *service, /* may be NULL */ const char *regtype, const char *domain ); extern _DNSServiceConstructFullName DNSServiceConstructFullName; #endif /* */ /********************************************************************************************* * * TXT Record Construction Functions * *********************************************************************************************/ /* * A typical calling sequence for TXT record construction is something like: * * Client allocates storage for TXTRecord data (e.g. declare buffer on the stack) * TXTRecordCreate(); * TXTRecordSetValue(); * TXTRecordSetValue(); * TXTRecordSetValue(); * ... * DNSServiceRegister( ... TXTRecordGetLength(), TXTRecordGetBytesPtr() ... ); * TXTRecordDeallocate(); * Explicitly deallocate storage for TXTRecord data (if not allocated on the stack) */ /* TXTRecordRef * * Opaque internal data type. * Note: Represents a DNS-SD TXT record. */ typedef union _TXTRecordRef_t { char PrivateData[16]; char *ForceNaturalAlignment; } TXTRecordRef; /* TXTRecordCreate() * * Creates a new empty TXTRecordRef referencing the specified storage. * * If the buffer parameter is NULL, or the specified storage size is not * large enough to hold a key subsequently added using TXTRecordSetValue(), * then additional memory will be added as needed using malloc(). * * On some platforms, when memory is low, malloc() may fail. In this * case, TXTRecordSetValue() will return kDNSServiceErr_NoMemory, and this * error condition will need to be handled as appropriate by the caller. * * You can avoid the need to handle this error condition if you ensure * that the storage you initially provide is large enough to hold all * the key/value pairs that are to be added to the record. * The caller can precompute the exact length required for all of the * key/value pairs to be added, or simply provide a fixed-sized buffer * known in advance to be large enough. * A no-value (key-only) key requires (1 + key length) bytes. * A key with empty value requires (1 + key length + 1) bytes. * A key with non-empty value requires (1 + key length + 1 + value length). * For most applications, DNS-SD TXT records are generally * less than 100 bytes, so in most cases a simple fixed-sized * 256-byte buffer will be more than sufficient. * Recommended size limits for DNS-SD TXT Records are discussed in * * * Note: When passing parameters to and from these TXT record APIs, * the key name does not include the '=' character. The '=' character * is the separator between the key and value in the on-the-wire * packet format; it is not part of either the key or the value. * * txtRecord: A pointer to an uninitialized TXTRecordRef. * * bufferLen: The size of the storage provided in the "buffer" parameter. * * buffer: Optional caller-supplied storage used to hold the TXTRecord data. * This storage must remain valid for as long as * the TXTRecordRef. */ void DNSSD_API TXTRecordCreate ( TXTRecordRef * txtRecord, uint16_t bufferLen, void *buffer ); /* TXTRecordDeallocate() * * Releases any resources allocated in the course of preparing a TXT Record * using TXTRecordCreate()/TXTRecordSetValue()/TXTRecordRemoveValue(). * Ownership of the buffer provided in TXTRecordCreate() returns to the client. * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * */ void DNSSD_API TXTRecordDeallocate ( TXTRecordRef * txtRecord ); /* TXTRecordSetValue() * * Adds a key (optionally with value) to a TXTRecordRef. If the "key" already * exists in the TXTRecordRef, then the current value will be replaced with * the new value. * Keys may exist in four states with respect to a given TXT record: * - Absent (key does not appear at all) * - Present with no value ("key" appears alone) * - Present with empty value ("key=" appears in TXT record) * - Present with non-empty value ("key=value" appears in TXT record) * For more details refer to "Data Syntax for DNS-SD TXT Records" in * * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * * key: A null-terminated string which only contains printable ASCII * values (0x20-0x7E), excluding '=' (0x3D). Keys should be * 8 characters or less (not counting the terminating null). * * valueSize: The size of the value. * * value: Any binary value. For values that represent * textual data, UTF-8 is STRONGLY recommended. * For values that represent textual data, valueSize * should NOT include the terminating null (if any) * at the end of the string. * If NULL, then "key" will be added with no value. * If non-NULL but valueSize is zero, then "key=" will be * added with empty value. * * return value: Returns kDNSServiceErr_NoError on success. * Returns kDNSServiceErr_Invalid if the "key" string contains * illegal characters. * Returns kDNSServiceErr_NoMemory if adding this key would * exceed the available storage. */ DNSServiceErrorType DNSSD_API TXTRecordSetValue ( TXTRecordRef * txtRecord, const char *key, uint8_t valueSize, /* may be zero */ const void *value /* may be NULL */ ); /* TXTRecordRemoveValue() * * Removes a key from a TXTRecordRef. The "key" must be an * ASCII string which exists in the TXTRecordRef. * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * * key: A key name which exists in the TXTRecordRef. * * return value: Returns kDNSServiceErr_NoError on success. * Returns kDNSServiceErr_NoSuchKey if the "key" does not * exist in the TXTRecordRef. * */ DNSServiceErrorType DNSSD_API TXTRecordRemoveValue ( TXTRecordRef * txtRecord, const char *key ); /* TXTRecordGetLength() * * Allows you to determine the length of the raw bytes within a TXTRecordRef. * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * * return value: Returns the size of the raw bytes inside a TXTRecordRef * which you can pass directly to DNSServiceRegister() or * to DNSServiceUpdateRecord(). * Returns 0 if the TXTRecordRef is empty. * */ uint16_t DNSSD_API TXTRecordGetLength ( const TXTRecordRef * txtRecord ); /* TXTRecordGetBytesPtr() * * Allows you to retrieve a pointer to the raw bytes within a TXTRecordRef. * * txtRecord: A TXTRecordRef initialized by calling TXTRecordCreate(). * * return value: Returns a pointer to the raw bytes inside the TXTRecordRef * which you can pass directly to DNSServiceRegister() or * to DNSServiceUpdateRecord(). * */ const void *DNSSD_API TXTRecordGetBytesPtr ( const TXTRecordRef * txtRecord ); /********************************************************************************************* * * TXT Record Parsing Functions * *********************************************************************************************/ /* * A typical calling sequence for TXT record parsing is something like: * * Receive TXT record data in DNSServiceResolve() callback * if (TXTRecordContainsKey(txtLen, txtRecord, "key")) then do something * val1ptr = TXTRecordGetValuePtr(txtLen, txtRecord, "key1", &len1); * val2ptr = TXTRecordGetValuePtr(txtLen, txtRecord, "key2", &len2); * ... * bcopy(val1ptr, myval1, len1); * bcopy(val2ptr, myval2, len2); * ... * return; * * If you wish to retain the values after return from the DNSServiceResolve() * callback, then you need to copy the data to your own storage using bcopy() * or similar, as shown in the example above. * * If for some reason you need to parse a TXT record you built yourself * using the TXT record construction functions above, then you can do * that using TXTRecordGetLength and TXTRecordGetBytesPtr calls: * TXTRecordGetValue(TXTRecordGetLength(x), TXTRecordGetBytesPtr(x), key, &len); * * Most applications only fetch keys they know about from a TXT record and * ignore the rest. * However, some debugging tools wish to fetch and display all keys. * To do that, use the TXTRecordGetCount() and TXTRecordGetItemAtIndex() calls. */ /* TXTRecordContainsKey() * * Allows you to determine if a given TXT Record contains a specified key. * * txtLen: The size of the received TXT Record. * * txtRecord: Pointer to the received TXT Record bytes. * * key: A null-terminated ASCII string containing the key name. * * return value: Returns 1 if the TXT Record contains the specified key. * Otherwise, it returns 0. * */ int DNSSD_API TXTRecordContainsKey ( uint16_t txtLen, const void *txtRecord, const char *key ); /* TXTRecordGetValuePtr() * * Allows you to retrieve the value for a given key from a TXT Record. * * txtLen: The size of the received TXT Record * * txtRecord: Pointer to the received TXT Record bytes. * * key: A null-terminated ASCII string containing the key name. * * valueLen: On output, will be set to the size of the "value" data. * * return value: Returns NULL if the key does not exist in this TXT record, * or exists with no value (to differentiate between * these two cases use TXTRecordContainsKey()). * Returns pointer to location within TXT Record bytes * if the key exists with empty or non-empty value. * For empty value, valueLen will be zero. * For non-empty value, valueLen will be length of value data. */ const void *DNSSD_API TXTRecordGetValuePtr ( uint16_t txtLen, const void *txtRecord, const char *key, uint8_t * valueLen ); /* TXTRecordGetCount() * * Returns the number of keys stored in the TXT Record. The count * can be used with TXTRecordGetItemAtIndex() to iterate through the keys. * * txtLen: The size of the received TXT Record. * * txtRecord: Pointer to the received TXT Record bytes. * * return value: Returns the total number of keys in the TXT Record. * */ uint16_t DNSSD_API TXTRecordGetCount ( uint16_t txtLen, const void *txtRecord ); /* TXTRecordGetItemAtIndex() * * Allows you to retrieve a key name and value pointer, given an index into * a TXT Record. Legal index values range from zero to TXTRecordGetCount()-1. * It's also possible to iterate through keys in a TXT record by simply * calling TXTRecordGetItemAtIndex() repeatedly, beginning with index zero * and increasing until TXTRecordGetItemAtIndex() returns kDNSServiceErr_Invalid. * * On return: * For keys with no value, *value is set to NULL and *valueLen is zero. * For keys with empty value, *value is non-NULL and *valueLen is zero. * For keys with non-empty value, *value is non-NULL and *valueLen is non-zero. * * txtLen: The size of the received TXT Record. * * txtRecord: Pointer to the received TXT Record bytes. * * index: An index into the TXT Record. * * keyBufLen: The size of the string buffer being supplied. * * key: A string buffer used to store the key name. * On return, the buffer contains a null-terminated C string * giving the key name. DNS-SD TXT keys are usually * 8 characters or less. To hold the maximum possible * key name, the buffer should be 256 bytes long. * * valueLen: On output, will be set to the size of the "value" data. * * value: On output, *value is set to point to location within TXT * Record bytes that holds the value data. * * return value: Returns kDNSServiceErr_NoError on success. * Returns kDNSServiceErr_NoMemory if keyBufLen is too short. * Returns kDNSServiceErr_Invalid if index is greater than * TXTRecordGetCount()-1. */ DNSServiceErrorType DNSSD_API TXTRecordGetItemAtIndex ( uint16_t txtLen, const void *txtRecord, uint16_t index_, uint16_t keyBufLen, char *key, uint8_t * valueLen, const void **value ); #ifdef __APPLE_API_PRIVATE /* * Mac OS X specific functionality * 3rd party clients of this API should not depend on future support or availability of this routine */ /* DNSServiceSetDefaultDomainForUser() * * Set the default domain for the caller's UID. Future browse and registration * calls by this user that do not specify an explicit domain will browse and * register in this wide-area domain in addition to .local. In addition, this * domain will be returned as a Browse domain via domain enumeration calls. * * * Parameters: * * flags: Pass kDNSServiceFlagsAdd to add a domain for a user. Call without * this flag set to clear a previously added domain. * * domain: The domain to be used for the caller's UID. * * return value: Returns kDNSServiceErr_NoError on succeses, otherwise returns * an error code indicating the error that occurred */ DNSServiceErrorType DNSSD_API DNSServiceSetDefaultDomainForUser ( DNSServiceFlags flags, const char *domain ); #endif //__APPLE_API_PRIVATE // Some C compiler cleverness. We can make the compiler check certain things for us, // and report errors at compile-time if anything is wrong. The usual way to do this would // be to use a run-time "if" statement or the conventional run-time "assert" mechanism, but // then you don't find out what's wrong until you run the software. This way, if the assertion // condition is false, the array size is negative, and the complier complains immediately. struct DNS_SD_CompileTimeAssertionChecks { char assert0[(sizeof(union _TXTRecordRef_t) == 16) ? 1 : -1]; }; #ifdef __cplusplus } #endif /* */ #endif /* _DNS_SD_H */ owfs-3.1p5/module/owlib/src/include/ow_eds.h0000644000175000001440000000077412654730021015771 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_EDS_H #define OW_EDS_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(EDS); #endif /* OW_EDS_H */ owfs-3.1p5/module/owlib/src/include/ow_eeef.h0000644000175000001440000000171712654730021016120 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor LICENSE (As of version 2.5p4 2-Oct-2006) owlib: LGPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): LGPL v2 owperl: GPL v2 owtcl: GPL v2 or later at your discretion owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" */ #ifndef OW_EEEF_H #define OW_EEEF_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* -------- Structures ---------- */ DeviceHeader(HobbyBoards_EE); DeviceHeader(HobbyBoards_EF); #endif owfs-3.1p5/module/owlib/src/include/ow_example_slave.h0000644000175000001440000000104512654730021020033 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_EXAMPLE_SLAVE_H #define OW_EXAMPLE_SLAVE_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(Example_slave); #endif /* OW_EXAMPLE_SLAVE_H */ owfs-3.1p5/module/owlib/src/include/ow_exec.h0000644000175000001440000000111512654730021016130 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_EXEC_H #define OW_EXEC_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif struct re_exec { void * data ; void (* func) ( void * ) ; } ; void ArgCopy( int argc, char * argv[] ) ; void ArgFree( void ) ; void ReExecute( void * v ) ; #endif /* OW_EXEC_H */ owfs-3.1p5/module/owlib/src/include/ow_external.h0000644000175000001440000000440312654730021017031 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille GPL license 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. */ #ifndef OW_EXTERNAL_H /* tedious wrapper */ #define OW_EXTERNAL_H #include "ow_device.h" #include "ow_filetype.h" enum external_type { et_none, et_internal, et_script, et_tcp, et_udp, } ; struct sensor_node { char * name ; char * family ; char * description ; char * data ; char payload[0] ; } ; struct property_node { char * property ; char * family ; char * read ; char * write ; char * data ; char * other ; enum external_type et ; struct filetype ft ; struct aggregate ag ; char payload[0] ; } ; struct family_node { struct device dev ; // Must be first since this is actual entry in device tree. char * family ; char payload[0] ; } ; extern void * property_tree ; extern void * family_tree ; extern void * sensor_tree ; void AddSensor( char * input_string ) ; void AddProperty( char * input_string, enum external_type et ) ; struct sensor_node * Find_External_Sensor( char * sensor ) ; struct family_node * Find_External_Family( char * family ) ; struct property_node * Find_External_Property( char * family, char * property ) ; int sensor_compare( const void * a , const void * b ) ; int family_compare( const void * a , const void * b ) ; int property_compare( const void * a , const void * b ) ; #endif /* OW_EXTERNAL_H */ owfs-3.1p5/module/owlib/src/include/ow_fd.h0000644000175000001440000000323612654730021015603 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille GPL license 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. */ #ifndef OW_FD_H /* tedious wrapper */ #define OW_FD_H /* Simple type for file descriptors */ typedef int FILE_DESCRIPTOR_OR_ERROR ; #define FILE_DESCRIPTOR_BAD -1 #define FILE_DESCRIPTOR_VALID(fd) ((fd)>FILE_DESCRIPTOR_BAD) #define FILE_DESCRIPTOR_NOT_VALID(fd) (! FILE_DESCRIPTOR_VALID(fd)) /* Add a little complexity for Persistence * There is another state where a channel is alreaddy opened * and we with to test that one first */ typedef int FILE_DESCRIPTOR_OR_PERSISTENT ; #define FILE_DESCRIPTOR_PERSISTENT_IN_USE -2 /* Pipe channels */ enum fd_pipe_channels { fd_pipe_read = 0 , fd_pipe_write = 1 , } ; #endif /* OW_LOCALRETURNS_H */ owfs-3.1p5/module/owlib/src/include/ow_filetype.h0000644000175000001440000001413112654730021017027 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille */ #ifndef OW_FILETYPE_H /* tedious wrapper */ #define OW_FILETYPE_H /* Define our understanding of integers, floats, ... */ #include "ow_localtypes.h" /* Several different structures: device -- one for each type of 1-wire device filetype -- one for each type of file parsedname -- translates a path into usable form */ /* --------------------------------------------------------- */ /* Filetypes -- directory entries for each 1-wire chip found */ /* Filetype is the most elaborate of the internal structures, though simple in concept. Actually a little misnamed. Each filetype corresponds to a device property, and to a file in the file system (though there are Filetype entries for some directory elements too) Filetypes belong to a particular device. (i.e. each device has it's list of filetypes) and have a name and pointers to processing functions. Filetypes also have a data format (integer, ascii,...) and a data length, and an indication of whether the property is static, changes only on command, or is volatile. Some properties occur are arrays (pages of memory, logs of temperature values). The "aggregate" structure holds to allowable size, and the method of access. -- Aggregate properties are either accessed all at once, then split, or accessed individually. The choice depends on the device hardware. There is even a further wrinkle: mixed. In cases where the handling can be either, mixed causes separate handling of individual items are querried, and combined if ALL are requested. This is useful for the DS2450 quad A/D where volt and PIO functions step on each other, but the conversion time for individual is rather costly. */ enum ag_index { ag_numbers, ag_letters, }; enum ag_combined { ag_separate, ag_aggregate, ag_mixed, ag_sparse, }; /* aggregate defines array properties */ struct aggregate { int elements; /* Maximum number of elements */ enum ag_index letters; /* name them with letters or numbers */ enum ag_combined combined; /* Combined bitmaps properties, or separately addressed */ }; /* property format, controls web display */ /* Some explanation of ft_format: Each file type is either a device (physical 1-wire chip or virtual statistics container). or a file (property). The devices act as directories of properties. The files are either properties of the device, or sometimes special directories themselves. If properties, they can be integer, text, etc or special directory types. There is also the directory type, ft_directory reflects a branch type, * which restarts the parsing process. */ enum ft_format { ft_unknown, ft_directory, ft_subdir, ft_integer, ft_unsigned, ft_float, ft_alias, // A human readable name in lue of numeric ID ft_ascii, ft_vascii, // variable length ascii -- must be read and measured. ft_binary, ft_yesno, ft_date, ft_bitfield, ft_temperature, ft_tempgap, ft_pressure, }; /* property changability. Static unchanged, Stable we change, Volatile changes */ enum fc_change { fc_static, // doesn't change (e.g. chip property) fc_stable, // only changes if we write to the chip fc_read_stable, // stable after a read, not a write fc_volatile, // changes on it's own (e.g. external pin voltage) fc_simultaneous_temperature, // volatile with a twist fc_simultaneous_voltage, // volatile with a twist fc_uncached, // Don't cache (because the read and write interpretation are different) fc_second, // timer (changes every second) fc_statistic, // internally held statistic fc_persistent, // internal cumulative counter fc_directory, // directory listing fc_presence, // chip <-> bus pairing fc_link, // a link to another property -- cache that one instead fc_page, // cache a page of memory fc_subdir, // really a NOP, but makes code clearer }; /* Predeclare one_wire_query */ struct one_wire_query; /* Predeclare parsedname */ struct parsedname; #define PROPERTY_LENGTH_INTEGER 12 #define PROPERTY_LENGTH_UNSIGNED 12 #define PROPERTY_LENGTH_BITFIELD 12 #define PROPERTY_LENGTH_FLOAT 12 #define PROPERTY_LENGTH_PRESSURE 12 #define PROPERTY_LENGTH_TEMP 12 #define PROPERTY_LENGTH_TEMPGAP 12 #define PROPERTY_LENGTH_DATE 24 #define PROPERTY_LENGTH_YESNO 1 #define PROPERTY_LENGTH_STRUCTURE 32 #define PROPERTY_LENGTH_DIRECTORY 8 #define PROPERTY_LENGTH_SUBDIR 0 #define PROPERTY_LENGTH_ALIAS 256 #define PROPERTY_LENGTH_ADDRESS 16 #define PROPERTY_LENGTH_TYPE 32 #define NON_AGGREGATE NULL #define NO_FILETYPE_DATA {.v=NULL} #define NO_READ_FUNCTION NULL #define NO_WRITE_FUNCTION NULL #include "ow_visibility.h" /* filetype gives -file types- for chip properties */ struct filetype { char *name; int suglen; // length of field struct aggregate *ag; // struct pointer for aggregate enum ft_format format; // type of data enum fc_change change; // volatility ZERO_OR_ERROR (*read) (struct one_wire_query *); // read callback function ZERO_OR_ERROR (*write) (struct one_wire_query *); // write callback function enum e_visibility (*visible) (const struct parsedname *); // Show in a directory listing? union { void * v; int i; UINT u; _FLOAT f; size_t s; BYTE c; ASCII *a; } data; // extra data pointer (used for separating similar but differently named functions) }; #define NO_FILETYPE_DATA {.v=NULL} #include "ow_bitfield.h" // read/write bit fields /* --------- end Filetype -------------------- */ #endif /* OW_FILETYPE_H */ owfs-3.1p5/module/owlib/src/include/ow_ftdi.h0000644000175000001440000000140312756340653016145 00000000000000/** * ow_ftdi lowlevel communication routines */ #if OW_FTDI #ifndef OW_FTDI_H #define OW_FTDI_H // for some local types #include "ow_localreturns.h" struct connection_in ; GOOD_OR_BAD owftdi_open( struct connection_in * in ) ; void owftdi_close( struct connection_in * in ) ; GOOD_OR_BAD owftdi_change(struct connection_in *in) ; void owftdi_free( struct connection_in *in ) ; void owftdi_flush( const struct connection_in *in ) ; void owftdi_break( struct connection_in *in ) ; void owftdi_slurp(struct connection_in *in, uint64_t usec) ; SIZE_OR_ERROR owftdi_read(BYTE * data, size_t length, struct connection_in *in) ; GOOD_OR_BAD owftdi_write_once( const BYTE * data, size_t length, struct connection_in *in) ; #endif /* OW_FTDI_H */ #endif /* OW_FTDI */ owfs-3.1p5/module/owlib/src/include/ow_functions.h0000644000175000001440000002360112654730021017220 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Cannot stand alone -- part of ow.h but separated for clarity */ #ifndef OW_FUNCTION_H /* tedious wrapper */ #define OW_FUNCTION_H #include "ow_parse_sn.h" // sub-includes /* Prototypes */ #define READ_FUNCTION( fname ) static int fname( struct one_wire_query * owq ) #define WRITE_FUNCTION( fname ) static int fname( struct one_wire_query * owq ) /* Prototypes for owlib.c -- libow overall control */ void LibSetup(enum enum_program_type op); GOOD_OR_BAD LibStart(void * v); void HandleSignals(void); void LibStop(void); void LibClose(void); GOOD_OR_BAD EnterBackground(void); /* Initial sorting or the device and filetype lists */ void DeviceSort(void); void DeviceDestroy(void); /* Pasename processing -- URL/path comprehension */ int filetype_cmp(const void *name, const void *ex); ZERO_OR_ERROR FS_ParsedNamePlus(const char *path, const char *file, struct parsedname *pn); ZERO_OR_ERROR FS_ParsedNamePlusExt(const char *path, const char *file, int extension, enum ag_index alphanumeric, struct parsedname *pn); ZERO_OR_ERROR FS_ParsedNamePlusText(const char *path, const char *file, const char *extension, struct parsedname *pn); ZERO_OR_ERROR FS_ParsedName(const char *fn, struct parsedname *pn); ZERO_OR_ERROR FS_ParsedName_BackFromRemote(const char *fn, struct parsedname *pn); void FS_ParsedName_destroy(struct parsedname *pn); void FS_ParsedName_Placeholder( struct parsedname * pn ) ; size_t FileLength(const struct parsedname *pn); size_t FullFileLength(const struct parsedname *pn); INDEX_OR_ERROR CheckPresence(struct parsedname *pn); INDEX_OR_ERROR ReCheckPresence(struct parsedname *pn); INDEX_OR_ERROR RemoteAlias(struct parsedname *pn); void FS_devicename(char *buffer, const size_t length, const BYTE * sn, const struct parsedname *pn); void FS_devicefind(const char *code, struct parsedname *pn); struct device * FS_devicefindhex(BYTE f, struct parsedname *pn); const char *FS_DirName(const struct parsedname *pn); /* Utility functions */ BYTE CRC8(const BYTE * bytes, const size_t length); BYTE CRC8seeded(const BYTE * bytes, const size_t length, const UINT seed); BYTE CRC8compute(const BYTE * bytes, const size_t length, const UINT seed); int CRC16(const BYTE * bytes, const size_t length); int CRC16seeded(const BYTE * bytes, const size_t length, const UINT seed); BYTE char2num(const char *s); BYTE string2num(const char *s); char num2char(const BYTE n); void num2string(char *s, const BYTE n); void string2bytes(const char *str, BYTE * b, const int bytes); void bytes2string(char *str, const BYTE * b, const int bytes); int UT_getbit(const BYTE * buf, int loc); void UT_setbit(BYTE * buf, int loc, int bit); int UT_getbit_U(UINT U, int loc); void UT_setbit_U(UINT * U, int loc, int bit); int UT_get2bit(const BYTE * buf, int loc); void UT_set2bit(BYTE * buf, int loc, int bits); void UT_fromDate(const _DATE D, BYTE * data); _DATE UT_toDate(const BYTE * date); void Test_and_Close( FILE_DESCRIPTOR_OR_ERROR * file_descriptor ) ; void Test_and_Close_Pipe( FILE_DESCRIPTOR_OR_ERROR * pipe_fd ) ; void Init_Pipe( FILE_DESCRIPTOR_OR_ERROR * pipe_fd ) ; /* Cache and Storage functions */ #include "ow_cache.h" void FS_LoadDirectoryOnly(struct parsedname *pn_directory, const struct parsedname *pn_original); GOOD_OR_BAD FS_Test_Simultaneous( const struct internal_prop *ip, UINT delay, const struct parsedname * pn) ; // ow_locks.c void LockSetup(void); ZERO_OR_ERROR DeviceLockGet(struct parsedname *pn); void DeviceLockRelease(struct parsedname *pn); /* 1-wire lowlevel */ void UT_delay(const UINT len); void UT_delay_us(const unsigned long len); ZERO_OR_ERROR tcp_read(FILE_DESCRIPTOR_OR_ERROR file_descriptor, BYTE * buffer, size_t n, const struct timeval *ptv, size_t * actual_read); void tcp_read_flush(FILE_DESCRIPTOR_OR_ERROR file_descriptor); GOOD_OR_BAD tcp_wait(FILE_DESCRIPTOR_OR_ERROR file_descriptor, const struct timeval *ptv); ssize_t udp_read(FILE_DESCRIPTOR_OR_ERROR file_descriptor, void *vptr, size_t n, const struct timeval * ptv, struct sockaddr_in *from, socklen_t *fromlen) ; GOOD_OR_BAD ClientAddr(char *sname, char * default_port, struct connection_in *in); FILE_DESCRIPTOR_OR_ERROR ClientConnect(struct connection_in *in); void FreeClientAddr(struct connection_in *in); void ServerProcess(void (*HandlerRoutine) (FILE_DESCRIPTOR_OR_ERROR file_descriptor)); GOOD_OR_BAD ServerOutSetup(struct connection_out *out); void InterruptListening( void ) ; void Setup_Systemd( void ) ; void Announce_Systemd( void ) ; GOOD_OR_BAD ReadAliasFile(const ASCII * file) ; GOOD_OR_BAD Test_and_Add_Alias( char * name, BYTE * sn ) ; speed_t COM_MakeBaud( int raw_baud ) ; int COM_BaudRate( speed_t B_baud ) ; void COM_BaudRestrict( speed_t * B_baud, ... ) ; void FS_help(const char *arg); INDEX_OR_ERROR ServerPresence( struct parsedname *pn); SIZE_OR_ERROR ServerRead(struct one_wire_query *owq); ZERO_OR_ERROR ServerWrite(struct one_wire_query *owq); ZERO_OR_ERROR ServerDir(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn, uint32_t * flags); /* High-level callback functions */ ZERO_OR_ERROR FS_dir(void (*dirfunc) (void *, const struct parsedname *), void *v, struct parsedname *pn); ZERO_OR_ERROR FS_dir_remote(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn, uint32_t * flags); void FS_dir_entry_aliased(void (*dirfunc) (void *, const struct parsedname *), void *v, const struct parsedname *pn) ; SIZE_OR_ERROR FS_write(const char *path, const char *buf, const size_t size, const off_t offset); SIZE_OR_ERROR FS_write_postparse(struct one_wire_query *owq); ZERO_OR_ERROR FS_write_local(struct one_wire_query *owq); SIZE_OR_ERROR FS_get(const char *path, char **return_buffer, size_t * buffer_length) ; SIZE_OR_ERROR FS_read(const char *path, char *buf, const size_t size, const off_t offset); SIZE_OR_ERROR FS_read_postparse(struct one_wire_query *owq); ZERO_OR_ERROR FS_read_fake(struct one_wire_query *owq); ZERO_OR_ERROR FS_read_tester(struct one_wire_query *owq); ZERO_OR_ERROR FS_r_aggregate_all(struct one_wire_query *owq); SIZE_OR_ERROR FS_read_local( struct one_wire_query *owq); size_t FileLength_vascii(struct one_wire_query *owq); ZERO_OR_ERROR FS_r_external( struct one_wire_query * owq ) ; ZERO_OR_ERROR FS_w_external( struct one_wire_query * owq ) ; #include "ow_sibling.h" ZERO_OR_ERROR FS_fstat(const char *path, struct stat *stbuf); ZERO_OR_ERROR FS_fstat_postparse(struct stat *stbuf, const struct parsedname *pn); /* iteration functions for splitting writes to buffers */ GOOD_OR_BAD COMMON_readwrite_paged(struct one_wire_query *owq, size_t page, size_t pagelen, GOOD_OR_BAD (*readwritefunc) (BYTE *, size_t, off_t, struct parsedname *)); GOOD_OR_BAD COMMON_OWQ_readwrite_paged(struct one_wire_query *owq, size_t page, size_t pagelen, GOOD_OR_BAD (*readwritefunc) (struct one_wire_query *, size_t, size_t)); ZERO_OR_ERROR COMMON_r_date( struct one_wire_query * owq ) ; ZERO_OR_ERROR COMMON_w_date( struct one_wire_query * owq ) ; GOOD_OR_BAD COMMON_read_memory_F0(struct one_wire_query *owq, size_t page, size_t pagesize); GOOD_OR_BAD COMMON_read_memory_crc16_A5(struct one_wire_query *owq, size_t page, size_t pagesize); GOOD_OR_BAD COMMON_read_memory_crc16_AA(struct one_wire_query *owq, size_t page, size_t pagesize); GOOD_OR_BAD COMMON_read_memory_toss_counter(struct one_wire_query *owq, size_t page, size_t pagesize); GOOD_OR_BAD COMMON_read_memory_plus_counter(BYTE * extra, size_t page, size_t pagesize, struct parsedname *pn); ZERO_OR_ERROR COMMON_write_eprom_mem_owq(struct one_wire_query * owq) ; ZERO_OR_ERROR COMMON_offset_process( ZERO_OR_ERROR (*func) (struct one_wire_query *), struct one_wire_query * owq, off_t shift_offset) ; void BUS_lock(const struct parsedname *pn); void BUS_unlock(const struct parsedname *pn); void BUS_lock_in(struct connection_in *in); void BUS_unlock_in(struct connection_in *in); void CHANNEL_lock_in(struct connection_in *in); void CHANNEL_unlock_in(struct connection_in *in); void PORT_lock_in(struct connection_in *in); void PORT_unlock_in(struct connection_in *in); /* API wrappers for swig and owcapi */ enum restart_init { restart_if_repeat, continue_if_repeat, } ; // behavior if init called a second time void API_setup(enum enum_program_type opt); GOOD_OR_BAD API_init(const char *command_line, enum restart_init repeat); GOOD_OR_BAD API_init_args(int argc, char **argv, enum restart_init repeat) ; void API_set_error_level(const char *params); void API_set_error_print(const char *params); void API_finish(void); int API_access_start(void); void API_access_end(void); #endif /* OW_FUNCTION_H */ owfs-3.1p5/module/owlib/src/include/ow_generic_read.h0000644000175000001440000000301712654730021017616 00000000000000/* $Id$ OW -- One-Wire filesystem LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille GPL license 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. */ #ifndef OW_GENERIC_READ_H /* tedious wrapper */ #define OW_GENERIC_READ_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" #define UNPAGED_MEMORY 0 struct generic_read { int pagesize ; enum read_crc_type { rct_no_crc, rct_crc8, rct_crc16, } crc_type ; enum read_address_type { rat_not_supported, rat_2byte, rat_1byte, rat_page, rat_complement, } addressing_type ; BYTE command ; } ; #define NO_GENERIC_READ NULL #endif /* OW_GENERIC_READ_H */ owfs-3.1p5/module/owlib/src/include/ow_generic_write.h0000644000175000001440000000263612654730021020043 00000000000000/* $Id$ OW -- One-Wire filesystem LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille GPL license 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. */ #ifndef OW_GENERIC_WRITE_H /* tedious wrapper */ #define OW_GENERIC_WRITE_H struct generic_write { int pagesize ; enum write_crc_type { wct_no_crc, wct_crc8, wct_crc16, } crc_type ; enum write_address_type { wat_not_supported, wat_2byte, wat_1byte, wat_page, wat_complement, } addressing_type ; BYTE write_cmd ; BYTE read_cmd ; BYTE copy_cmd ; } ; #define NO_GENERIC_WRITE NULL #endif /* OW_GENERIC_WRITE_H */ owfs-3.1p5/module/owlib/src/include/ow_global.h0000644000175000001440000001342612654730021016454 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Can stand alone -- separated out of ow.h for clarity */ #ifndef OW_GLOBAL_H /* tedious wrapper */ #define OW_GLOBAL_H #include "ow_temperature.h" #include "ow_pressure.h" // some improbably sub-absolute-zero number #define GLOBAL_UNTOUCHED_TEMP_LIMIT (-999.) #define DEFAULT_USB_SCAN_INTERVAL 10 /* seconds */ #define DEFAULT_ENET_SCAN_INTERVAL 60 /* seconds */ #define DEFAULT_MASTERHUB_SCAN_INTERVAL 60 /* seconds */ enum zero_support { zero_unknown, zero_none, zero_bonjour, zero_avahi, } ; enum enum_program_type { program_type_filesystem, program_type_server, program_type_httpd, program_type_ftpd, program_type_external, program_type_tcl, program_type_swig, program_type_clibrary, program_option_sensor, program_option_property, }; /* Daemon status * can be running as foreground or background * this is for a state machine implementation * sd is systemd which is foreground * sd cannot be changed * want_bg is default state * goes to bg if proper program type and can daemonize * */ enum enum_daemon_status { e_daemon_want_bg, e_daemon_bg, e_daemon_sd, e_daemon_sd_done, e_daemon_fg, e_daemon_unknown, } ; /* Globals information (for local control) */ struct global { int announce_off; // use zeroconf? ASCII *announce_name; enum temp_type temp_scale; enum pressure_type pressure_scale ; enum deviceformat format ; enum enum_program_type program_type; enum enum_daemon_status daemon_status ; int allow_external ; // allow this program to call external programs for read/write -- dangerous int allow_other ; struct antiloop Token; int uncached ; // all requests are from /uncached directory int unaliased ; // all requests are from /unaliased (no alias substitution on results) int error_level; int error_level_restore; int error_print; int fatal_debug; ASCII *fatal_debug_file; int readonly; int max_clients; // for ftp size_t cache_size; // max cache size (or 0 for no max) ; int one_device; // Single device, use faster ROM comands /* Special parameter to trigger William Robison timings */ int altUSB; int usb_flextime; int serial_flextime; int serial_reverse; // reverse polarity ? int serial_hardflow ; // hardware flow control /* timeouts -- order must match ow_opt.c values for correct indexing */ int timeout_volatile; int timeout_stable; int timeout_directory; int timeout_presence; int timeout_serial; // serial read and write use the same timeout currently int timeout_usb; int timeout_network; int timeout_server; int timeout_ftp; int timeout_ha7; int timeout_w1; int timeout_persistent_low; int timeout_persistent_high; int clients_persistent_low; int clients_persistent_high; int pingcrazy; int no_dirall; int no_get; int no_persistence; int eightbit_serial; int trim; enum zero_support zero ; int i2c_APU ; int i2c_PPM ; int baud ; int traffic ; // show bus traffic int locks ; // show mutexes _FLOAT templow ; _FLOAT temphigh ; #if OW_USB libusb_context * luc ; #endif /* OW_USB */ int argc; char ** argv ; enum e_inet_type inet_type ; enum { exit_early, exit_normal, exit_exec, } exitmode ; // is this an execpe on config file change? int restart_seconds ; // time after close before execve }; extern struct global Globals; // generic value for ignorable function returns extern int ignore_result ; void SetLocalControlFlags( void ) ; #endif /* OW_GLOBAL_H */ owfs-3.1p5/module/owlib/src/include/ow_inotify.h0000644000175000001440000000125512654730021016672 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_INOTIFY_H #define OW_INOTIFY_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #ifdef WE_HAVE_INOTIFY // kevent based monitor for configuration file changes // usually linux systems #include void Config_Monitor_Add( const char * file ) ; void Config_Monitor_Watch( void * v ) ; #endif /* WE_HAVE_INOTIFY */ #endif /* OW_INOTIFY_H */ owfs-3.1p5/module/owlib/src/include/ow_integer.h0000644000175000001440000000356612654730021016655 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_INTEGER_H #define OW_INTEGER_H /* Routines to play with byte <-> integer */ static inline uint8_t UT_uint8(const BYTE * p) { return (uint8_t) p[0]; } static inline uint16_t UT_uint16(const BYTE * p) { return (((uint16_t) p[1]) << 8) | ((uint16_t) p[0]); } static inline uint32_t UT_uint24(const BYTE * p) { return (((uint32_t) p[2]) << 16) | (((uint32_t) p[1]) << 8) | ((uint32_t) p[0]); } static inline uint32_t UT_uint32(const BYTE * p) { return (((uint32_t) p[3]) << 24) | (((uint32_t) p[2]) << 16) | (((uint32_t) p[1]) << 8) | ((uint32_t) p[0]); } static inline int8_t UT_int8(const BYTE * p) { return (int8_t) p[0]; } static inline int16_t UT_int16(const BYTE * p) { return (((int16_t) p[1]) << 8) | ((uint16_t) p[0]); } static inline int32_t UT_int24(const BYTE * p) { return (((int32_t) p[2]) << 16) | (((uint32_t) p[1]) << 8) | ((uint32_t) p[0]); } static inline int32_t UT_int32(const BYTE * p) { // least sig to most sig return (((int32_t) p[3]) << 24) | (((uint32_t) p[2]) << 16) | (((uint32_t) p[1]) << 8) | ((uint32_t) p[0]); } static inline void UT_uint8_to_bytes( const uint8_t num, unsigned char * p ) { p[0] = num&0xFF ; } static inline void UT_uint16_to_bytes( const uint16_t num, unsigned char * p ) { p[0] = num&0xFF ; p[1] = (num>>8)&0xFF ; } static inline void UT_uint24_to_bytes( const uint16_t num, unsigned char * p ) { p[0] = num&0xFF ; p[1] = (num>>8)&0xFF ; p[2] = (num>>16)&0xFF ; } static inline void UT_uint32_to_bytes( const uint32_t num, unsigned char * p ) { p[0] = num&0xFF ; p[1] = (num>>8)&0xFF ; p[2] = (num>>16)&0xFF ; p[3] = (num>>24)&0xFF ; } #endif /* OW_INTEGER_H */ owfs-3.1p5/module/owlib/src/include/ow_interface.h0000644000175000001440000000112212654730021017142 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_INTERFACE_H #define OW_INTERFACE_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* -------- Structures ---------- */ DeviceHeader(interface_settings); DeviceHeader(interface_statistics); #endif /* OW_INTERFACE_H */ owfs-3.1p5/module/owlib/src/include/ow_kevent.h0000644000175000001440000000125412654730021016504 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_KEVENT_H #define OW_KEVENT_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #ifdef WE_HAVE_KEVENT // kevent based monitor for configuration file changes // usually OSX and BSD systems #include void Config_Monitor_Watch( void * v ) ; void Config_Monitor_Add( const char * file ) ; #endif /* WE_HAVE_KEVENT */ #endif /* OW_KEVENT_H */ owfs-3.1p5/module/owlib/src/include/ow_launchd.h0000644000175000001440000000117312654730021016626 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_LAUNCHD_H #define OW_LAUNCHD_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #ifdef HAVE_LAUNCH_ACTIVATE_SOCKET // Header file from OSX #include #endif /* HAVE_LAUNCH_ACTIVATE_SOCKET */ // Our function -- safe outside of OSX too void Setup_Launchd( void ) ; #endif /* OW_LAUNCHD_H */ owfs-3.1p5/module/owlib/src/include/ow_localtypes.h0000644000175000001440000000701512654730021017370 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_LOCALTYPES_H /* tedious wrapper */ #define OW_LOCALTYPES_H #include /* Floating point */ /* I hate to do this, making everything a double */ /* The compiler complains mercilessly, however */ /* 1-wire really is low precision -- float is more than enough */ /* FLOAT and DATE collides with cygwin windows include-files. */ typedef double _FLOAT; typedef time_t _DATE; typedef unsigned char BYTE; typedef char ASCII; typedef unsigned int UINT; typedef int INT; #endif /* OW_LOCALTYPES_H */ owfs-3.1p5/module/owlib/src/include/ow_localreturns.h0000644000175000001440000000246612654730021017733 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" */ #ifndef OW_LOCALRETURNS_H /* tedious wrapper */ #define OW_LOCALRETURNS_H typedef int SIZE_OR_ERROR ; typedef int ZERO_OR_ERROR ; typedef enum { gbGOOD, gbBAD, gbOTHER, } GOOD_OR_BAD ; // OTHER breaks the encapsulation a bit. #define GOOD(x) ((x)==gbGOOD) #define BAD(x) ((x)!=gbGOOD) #define GB_to_Z_OR_E(x) GOOD(x)?0:-EINVAL #define RETURN_BAD_IF_BAD(x) if ( BAD(x) ) { return gbBAD; } #define RETURN_GOOD_IF_GOOD(x) if (GOOD(x) ) { return gbGOOD; } #define RETURN_ERROR_IF_BAD(x) if ( BAD(x) ) { return -EINVAL; } /* Use this every place we call a void * function (unless the return value is really used). */ #define VOID_RETURN NULL #endif /* OW_LOCALRETURNS_H */ owfs-3.1p5/module/owlib/src/include/ow_lcd.h0000644000175000001440000000075512654730021015757 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_LCD_H #define OW_LCD_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Structures ----------- */ DeviceHeader(LCD); #endif owfs-3.1p5/module/owlib/src/include/ow_master.h0000644000175000001440000001341012672234566016515 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ #ifndef OW_MASTER_H /* tedious wrapper */ #define OW_MASTER_H /* included in ow_connection.h as the bus-master specific portion of the connection_in structure */ struct master_server { char *type; // for zeroconf char *domain; // for zeroconf char *name; // zeroconf name int no_dirall; // flag that server doesn't support DIRALL } ; struct master_serial { enum ds2480b_mode { ds2480b_data_mode, ds2480b_command_mode, } mode ; int reverse_polarity ; }; struct master_fake { int index; _FLOAT templow; _FLOAT temphigh; // For adapters that maintain dir-at-once (or dirgulp): struct dirblob main; /* main directory */ struct dirblob alarm; /* alarm directory */ }; // DS2490R (usb) hub struct master_usb { #if OW_USB libusb_device * lusb_dev ; libusb_device_handle * lusb_handle ; int bus_number; int address; int datasampleoffset; int writeonelowtime; int pulldownslewrate; int timeout; #endif /* OW_USB */ int specific_usb_address ; // only a specific address requested? /* "Name" of the device, like "8146572300000051" * This is set to the first DS1420 id found on the 1-wire adapter which * exists on the DS9490 adapters. If user only have a DS2490 chip, there * are no such DS1420 device available. It's used to find the 1-wire adapter * if it's disconnected and later reconnected again. */ BYTE ds1420_address[SERIAL_NUMBER_SIZE]; }; // DS2482 (i2c) hub -- 800 has 8 channels struct master_i2c { int channels; int index; int i2c_address; enum ds248x_type { ds2482_unknown, ds2482_100, ds2482_800, ds2483, } type ; int i2c_index ; BYTE configreg; BYTE configchip; /* only one per chip, the bus entries for the other 7 channels point to the first one */ int current; struct connection_in *head; }; // HobbyBoards Master Hub // Single char channel (1,2,3,4,W -- ignore A) struct master_masterhub { // Need to lock directory for "next" command" int channels; char channel_char; }; // Embedded Data Systems HA7 hub struct master_ha7 { ASCII lock[10]; int locked; int found; }; struct master_enet { int version; }; struct master_ds1wm { off_t base ; off_t page_start ; off_t page_offset ; void * mm ; // mmap int longline ; int byte_mode ; long int frequency ; int presence_mask ; size_t mm_size ; uint8_t channels_count; // for k1wm uint8_t active_channel; // for k1wm }; enum e_link_t_mode { e_link_t_unknown, e_link_t_extra, e_link_t_none } ; struct master_link { enum e_link_t_mode tmode ; // extra ',' before tF0 command enum e_link_t_mode qmode ; //extra '?' after b command #if OW_FTDI struct ftdi_context *ftdic; #endif }; // Embedded Data Systems HA5 hub struct master_ha5 { int checksum ; /* flag to use checksum byte in communication */ char channel ; struct connection_in *head; }; struct master_pbm { char channel; unsigned int version; unsigned int serial_number; struct connection_in *head; }; // W1 (kernel) "device" struct master_w1 { #if OW_W1 // bus master name kept in name SEQ_OR_ERROR seq ; int id ; // equivalent to the number part of w1_bus_master23 FILE_DESCRIPTOR_OR_ERROR netlink_pipe[2] ; enum enum_w1_slave_order { w1_slave_order_unknown, w1_slave_order_forward, w1_slave_order_reversed } w1_slave_order ; #endif /* OW_W1 */ }; // Search for W1 (kernel) devices struct master_w1_monitor { #if OW_W1 // netlink fd kept in file_descriptor SEQ_OR_ERROR seq ; // seq number to netlink pid_t pid ; struct timeval last_read ; pthread_mutex_t seq_mutex; // mutex for w1 sequence number */ pthread_mutex_t read_mutex; // mutex for w1 netlink read time #endif /* OW_W1 */ }; // Search for USB (DS9490R) devices struct master_usb_monitor { FILE_DESCRIPTOR_OR_ERROR shutdown_pipe[2] ; int usb_scan_interval ; }; struct master_enet_monitor { FILE_DESCRIPTOR_OR_ERROR shutdown_pipe[2] ; int enet_scan_interval ; }; // Search for HobbyBoards MasterHub (network) devices struct master_masterhub_monitor { FILE_DESCRIPTOR_OR_ERROR shutdown_pipe[2] ; int mh_scan_interval ; }; struct master_browse { #if OW_ZERO DNSServiceRef bonjour_browse; #endif /* OW_ZERO */ #if OW_AVAHI AvahiClient *client ; AvahiServiceBrowser * browser ; AvahiThreadedPoll *poll ; #if __HAS_IPV6__ char host[INET6_ADDRSTRLEN+1] ; #else char host[INET_ADDRSTRLEN+1] ; #endif char service[10] ; #endif /* OW_AVAHI */ }; union master_union { struct master_serial serial; struct master_link link; struct master_server server ; struct master_usb usb; struct master_usb_monitor usb_monitor ; struct master_i2c i2c; struct master_fake fake; struct master_fake tester; struct master_fake mock; struct master_enet enet; struct master_enet_monitor enet_monitor ; struct master_ha5 ha5; struct master_ha7 ha7; struct master_pbm pbm; struct master_w1 w1; struct master_masterhub masterhub; struct master_masterhub_monitor masterhub_monitor ; struct master_w1_monitor w1_monitor ; struct master_browse browse; struct master_ds1wm ds1wm ; }; #endif /* OW_MASTER_H */ owfs-3.1p5/module/owlib/src/include/ow_memblob.h0000644000175000001440000000631012654730021016623 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 2006 dirblob */ #ifndef OW_MEMBLOB_H /* tedious wrapper */ #define OW_MEMBLOB_H struct memblob { int troubled; size_t allocated; size_t increment; size_t used; BYTE *memory_storage; }; int MemblobPure(struct memblob *mb) ; void MemblobClear(struct memblob *mb); void MemblobInit(struct memblob *mb, size_t increment); int MemblobAdd(const BYTE * data, size_t length, struct memblob *mb); int MemblobAddChar(BYTE character, size_t length, struct memblob *mb); BYTE * MemblobData(struct memblob * mb); size_t MemblobLength(struct memblob * mb); void MemblobTrim(size_t nchars, struct memblob * mb); #endif /* OW_MEMBLOB_H */ owfs-3.1p5/module/owlib/src/include/ow_message.h0000644000175000001440000000465612654730021016645 00000000000000/* $Id$ Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ /* definitions and stuctures for the owserver messages */ /* This file doesn't stand alone, it must be included in ow.h */ #ifndef OW_MESSAGE_H /* tedious wrapper */ #define OW_MESSAGE_H /* Unique token for owserver loop checks */ struct antiloop { BYTE uuid[16]; }; /* Server (Socket-based) interface */ enum msg_classification { msg_error, msg_nop, msg_read, msg_write, msg_dir, msg_size, // No longer used, leave here for compatibility msg_presence, msg_dirall, msg_get, msg_dirallslash, msg_getslash, }; /* message to owserver */ struct server_msg { int32_t version; int32_t payload; int32_t type; int32_t control_flags; int32_t size; int32_t offset; }; /* message to client */ struct client_msg { int32_t version; int32_t payload; int32_t ret; int32_t control_flags; int32_t size; int32_t offset; }; union address { struct sockaddr sock; char text[120]; }; struct serverpackage { const ASCII *path; BYTE *data; size_t datasize; BYTE *tokenstring; size_t tokens; }; // Current version of the protocol #define OWSERVER_PROTOCOL_VERSION 0 // lower 16 bits is token size (only FROM owserver of course) #define Servertokens(tokens) ((tokens)&0xFFFF) #define MakeServertokens(tokens) (tokens) // bit 17 is FROM server flag #define ServermessageMASK (((int32_t)1)<<16) #define MakeServermessage ServermessageMASK #define isServermessage(version) (((version) & ServermessageMASK) == ServermessageMASK) //owserver protocol #define ServerprotocolMASK ((0xFF)<<17) #define Serverprotocol(version) (((version) & ServerprotocolMASK) >> 17 ) #define MakeServerprotocol(protocol) ((protocol) << 17) #endif /* OW_MESSAGE_H */ owfs-3.1p5/module/owlib/src/include/ow_mutex.h0000644000175000001440000002402412654730021016352 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Cannot stand alone -- part of ow.h and only separated out for clarity */ #ifndef OW_MUTEX_H /* tedious wrapper */ #define OW_MUTEX_H extern const char mutex_init_failed[]; extern const char mutex_destroy_failed[]; extern const char mutex_lock_failed[]; extern const char mutex_unlock_failed[]; extern const char mutexattr_init_failed[]; extern const char mutexattr_destroy_failed[]; extern const char mutexattr_settype_failed[]; extern const char rwlock_init_failed[]; extern const char rwlock_read_lock_failed[]; extern const char rwlock_read_unlock_failed[]; extern const char cond_timedwait_failed[]; extern const char cond_signal_failed[]; extern const char cond_broadcast_failed[]; extern const char cond_wait_failed[]; extern const char cond_init_failed[]; extern const char cond_destroy_failed[]; extern const char sem_init_failed[]; extern const char sem_post_failed[]; extern const char sem_wait_failed[]; extern const char sem_trywait_failed[]; extern const char sem_timedwait_failed[]; extern const char sem_destroy_failed[]; #define LOCK_DEBUG(...) if ( Globals.locks != 0 ) { LEVEL_DEFAULT(__VA_ARGS__) ; } /* FreeBSD might fail on sem_init() since they are limited per machine */ #define my_sem_init(sem, shared, value) \ do { \ int mrc = sem_init(sem, shared, value); \ if(mrc != 0) { \ FATAL_ERROR(sem_init_failed, mrc, strerror(mrc)); \ } \ LOCK_DEBUG("sem_init %lX, %d, %d\n", (unsigned long)sem, shared, value); \ } while(0) #define my_sem_post(sem) \ do { \ int mrc = sem_post(sem); \ if(mrc != 0) { \ FATAL_ERROR(sem_post_failed, mrc, strerror(mrc)); \ } \ LOCK_DEBUG("sem_post %lX done", (unsigned long)sem); \ } while(0) #define my_sem_wait(sem) \ do { \ int mrc = sem_wait(sem); \ if(mrc != 0) { \ FATAL_ERROR(sem_wait_failed, mrc, strerror(mrc)); \ } \ LOCK_DEBUG("sem_wait %lX done", (unsigned long)sem); \ } while(0) #define my_sem_trywait(sem, res) \ do { \ int mrc = sem_trywait(sem); \ if((mrc < 0) && (errno != EAGAIN)) { \ FATAL_ERROR(sem_trywait_failed, mrc, strerror(mrc)); \ } \ *(res) = mrc; \ LOCK_DEBUG("sem_trywait %lX done", (unsigned long)sem); \ } while(0) #define my_sem_timedwait(sem, ts, res) \ do { \ int mrc; \ while(((mrc = sem_timedwait(sem, ts)) == -1) && (errno == EINTR)) { \ continue; /* Restart if interrupted by handler */ \ } \ if((mrc < 0) && (errno != ETIMEDOUT)) { \ FATAL_ERROR(sem_timedwait_failed, mrc, strerror(mrc)); \ } \ *(res) = mrc; /* res=-1 timeout, res=0 succeed */ \ LOCK_DEBUG("sem_timedwait %lX done", (unsigned long)sem); \ } while(0) #define my_sem_destroy(sem) \ do { \ int mrc = sem_destroy(sem); \ if(mrc != 0) { \ FATAL_ERROR(sem_destroy_failed, mrc, strerror(mrc)); \ } \ LOCK_DEBUG("sem_destroy %lX", (unsigned long)sem); \ } while(0) #define my_pthread_mutex_init(mutex, attr) \ do { \ int mrc; \ LOCK_DEBUG("pthread_mutex_init %lX begin", (unsigned long)mutex); \ mrc = pthread_mutex_init(mutex, attr); \ if(mrc != 0) { \ FATAL_ERROR(mutex_init_failed, mrc, strerror(mrc)); \ } \ LOCK_DEBUG("pthread_mutex_init %lX done", (unsigned long)mutex); \ } while(0) #define my_pthread_mutex_destroy(mutex) \ do { \ int mrc = pthread_mutex_destroy(mutex); \ LOCK_DEBUG("pthread_mutex_destroy %lX begin", (unsigned long)mutex); \ if(mrc != 0) { \ LEVEL_DEFAULT(mutex_destroy_failed, mrc, strerror(mrc)); \ } \ LOCK_DEBUG("pthread_mutex_destroy %lX done", (unsigned long)mutex); \ } while(0) #define my_pthread_mutex_lock(mutex) \ do { \ int mrc; \ LOCK_DEBUG("pthread_mutex_lock %lX begin", (unsigned long)mutex); \ mrc = pthread_mutex_lock(mutex); \ if(mrc != 0) { \ FATAL_ERROR(mutex_lock_failed, mrc, strerror(mrc)); \ } \ LOCK_DEBUG("pthread_mutex_lock %lX done", (unsigned long)mutex); \ } while(0) #define my_pthread_mutex_unlock(mutex) \ do { \ int mrc; \ LOCK_DEBUG("pthread_mutex_unlock %lX begin", (unsigned long)mutex); \ mrc = pthread_mutex_unlock(mutex); \ if(mrc != 0) { \ FATAL_ERROR(mutex_unlock_failed, mrc, strerror(mrc)); \ } \ LOCK_DEBUG("pthread_mutex_unlock %lX done", (unsigned long)mutex); \ } while(0) #define my_pthread_mutexattr_init(attr) \ do { \ int mrc = pthread_mutexattr_init(attr); \ if(mrc != 0) { \ FATAL_ERROR(mutexattr_init_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_mutexattr_destroy(attr) \ do { \ int mrc = pthread_mutexattr_destroy(attr); \ if(mrc != 0) { \ FATAL_ERROR(mutexattr_destroy_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_mutexattr_settype(attr, typ) \ do { \ int mrc = pthread_mutexattr_settype(attr, typ); \ if(mrc != 0) { \ FATAL_ERROR(mutexattr_settype_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_timedwait(cond, mutex, abstime) \ do { \ int mrc = pthread_cond_timedwait(cond, mutex, abstime); \ if(mrc != 0) { \ FATAL_ERROR(cond_timedwait_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_wait(cond, mutex) \ do { \ int mrc = pthread_cond_wait(cond, mutex); \ if(mrc != 0) { \ FATAL_ERROR(cond_wait_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_signal(cond) \ do { \ int mrc = pthread_cond_signal(cond); \ if(mrc != 0) { \ FATAL_ERROR(cond_signal_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_broadcast(cond) \ do { \ int mrc = pthread_cond_broadcast(cond); \ if(mrc != 0) { \ FATAL_ERROR(cond_broadcast_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_init(cond, attr) \ do { \ int mrc = pthread_cond_init(cond, attr); \ if(mrc != 0) { \ FATAL_ERROR(cond_init_failed, mrc, strerror(mrc)); \ } \ } while(0) #define my_pthread_cond_destroy(cond) \ do { \ int mrc = pthread_cond_destroy(cond); \ if(mrc != 0) { \ FATAL_ERROR(cond_destroy_failed, mrc, strerror(mrc)); \ } \ } while(0) #endif owfs-3.1p5/module/owlib/src/include/ow_mutexes.h0000644000175000001440000001736112654730021016710 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Cannot stand alone -- part of ow.h and only separated out for clarity */ #ifndef OW_MUTEXES_H /* tedious wrapper */ #define OW_MUTEXES_H #include #include "ow_mutex.h" #define DEFAULT_THREAD_ATTR NULL extern struct mutexes { pthread_mutex_t stat_mutex; pthread_mutex_t controlflags_mutex; pthread_mutex_t fstat_mutex; pthread_mutex_t dir_mutex; #if OW_USB pthread_mutex_t libusb_mutex; #endif /* OW_USB */ pthread_mutex_t typedir_mutex; pthread_mutex_t externaldir_mutex; pthread_mutex_t namefind_mutex; pthread_mutex_t aliaslist_mutex; pthread_mutex_t externalcount_mutex; pthread_mutex_t timegm_mutex; pthread_mutex_t detail_mutex; pthread_mutexattr_t mattr; // mutex attribute -- used for all mutexes my_rwlock_t lib; my_rwlock_t cache; my_rwlock_t persistent_cache; my_rwlock_t monitor; // allow monitor processes my_rwlock_t connin; // allow connection_in changes #ifdef __UCLIBC__ pthread_mutex_t uclibc_mutex; #endif /* __UCLIBC__ */ } Mutex; #define _MUTEX_ATTR_INIT(at) my_pthread_mutexattr_init( &(at) ) #define _MUTEX_ATTR_SET(at,typ) my_pthread_mutexattr_settype( &(at) , typ ) #define _MUTEX_ATTR_DESTROY(at) my_pthread_mutexattr_destroy( &(at) ) #define _MUTEX_INIT(mut) my_pthread_mutex_init( &(mut) , &(Mutex.mattr) ) #define _MUTEX_DESTROY(mut) my_pthread_mutex_destroy( &(mut) ) #define _MUTEX_LOCK(mut) my_pthread_mutex_lock( &(mut) ) #define _MUTEX_UNLOCK(mut) my_pthread_mutex_unlock( &(mut) ) #define RWLOCK_INIT(rw) my_rwlock_init( &(rw) ) #define RWLOCK_DESTROY(rw) my_rwlock_destroy( &(rw) ) #define _SEM_INIT(sem, shared, value) my_sem_init( &(sem) , (shared), (value) ) #define RWLOCK_WLOCK(mut) my_rwlock_write_lock( &(mut) ) #define RWLOCK_WUNLOCK(mut) my_rwlock_write_unlock( &(mut) ) #define RWLOCK_RLOCK(mut) my_rwlock_read_lock( &(mut) ) #define RWLOCK_RUNLOCK(mut) my_rwlock_read_unlock( &(mut) ) #define LIB_WLOCK RWLOCK_WLOCK( Mutex.lib ) #define LIB_WUNLOCK RWLOCK_WUNLOCK( Mutex.lib ) #define LIB_RLOCK RWLOCK_RLOCK( Mutex.lib ) #define LIB_RUNLOCK RWLOCK_RUNLOCK( Mutex.lib ) #define CACHE_WLOCK RWLOCK_WLOCK( Mutex.cache ) #define CACHE_WUNLOCK RWLOCK_WUNLOCK( Mutex.cache ) #define CACHE_RLOCK RWLOCK_RLOCK( Mutex.cache ) #define CACHE_RUNLOCK RWLOCK_RUNLOCK( Mutex.cache ) #define PERSISTENT_WLOCK RWLOCK_WLOCK( Mutex.persistent_cache ) #define PERSISTENT_WUNLOCK RWLOCK_WUNLOCK( Mutex.persistent_cache ) #define PERSISTENT_RLOCK RWLOCK_RLOCK( Mutex.persistent_cache ) #define PERSISTENT_RUNLOCK RWLOCK_RUNLOCK( Mutex.persistent_cache ) #define CONNIN_WLOCK RWLOCK_WLOCK( Mutex.connin ) #define CONNIN_WUNLOCK RWLOCK_WUNLOCK( Mutex.connin ) #define CONNIN_RLOCK RWLOCK_RLOCK( Mutex.connin ) #define CONNIN_RUNLOCK RWLOCK_RUNLOCK( Mutex.connin ) #define MONITOR_WLOCK RWLOCK_WLOCK( Mutex.monitor ) #define MONITOR_WUNLOCK RWLOCK_WUNLOCK( Mutex.monitor ) #define MONITOR_RLOCK RWLOCK_RLOCK( Mutex.monitor ) #define MONITOR_RUNLOCK RWLOCK_RUNLOCK( Mutex.monitor ) #define STATLOCK _MUTEX_LOCK( Mutex.stat_mutex ) #define STATUNLOCK _MUTEX_UNLOCK(Mutex.stat_mutex ) #define CONTROLFLAGSLOCK _MUTEX_LOCK( Mutex.controlflags_mutex ) #define CONTROLFLAGSUNLOCK _MUTEX_UNLOCK(Mutex.controlflags_mutex ) #define FSTATLOCK _MUTEX_LOCK( Mutex.fstat_mutex ) #define FSTATUNLOCK _MUTEX_UNLOCK(Mutex.fstat_mutex ) #define DIRLOCK _MUTEX_LOCK( Mutex.dir_mutex ) #define DIRUNLOCK _MUTEX_UNLOCK(Mutex.dir_mutex ) #define LIBUSBLOCK _MUTEX_LOCK( Mutex.libusb_mutex ) #define LIBUSBUNLOCK _MUTEX_UNLOCK(Mutex.libusb_mutex ) #define TYPEDIRLOCK _MUTEX_LOCK( Mutex.typedir_mutex) #define TYPEDIRUNLOCK _MUTEX_UNLOCK(Mutex.typedir_mutex) #define EXTERNALDIRLOCK _MUTEX_LOCK( Mutex.externaldir_mutex) #define EXTERNALDIRUNLOCK _MUTEX_UNLOCK(Mutex.externaldir_mutex) #define NAMEFINDLOCK _MUTEX_LOCK( Mutex.namefind_mutex) #define NAMEFINDUNLOCK _MUTEX_UNLOCK(Mutex.namefind_mutex) #define ALIASLISTLOCK _MUTEX_LOCK( Mutex.aliaslist_mutex) #define ALIASLISTUNLOCK _MUTEX_UNLOCK(Mutex.aliaslist_mutex) #define EXTERNALCOUNTLOCK _MUTEX_LOCK( Mutex.externalcount_mutex) #define EXTERNALCOUNTUNLOCK _MUTEX_UNLOCK(Mutex.externalcount_mutex) #define TIMEGMLOCK _MUTEX_LOCK( Mutex.timegm_mutex) #define TIMEGMUNLOCK _MUTEX_UNLOCK(Mutex.timegm_mutex) #define DETAILLOCK _MUTEX_LOCK( Mutex.detail_mutex) #define DETAILUNLOCK _MUTEX_UNLOCK(Mutex.detail_mutex) #define BUSLOCK(pn) BUS_lock(pn) #define BUSUNLOCK(pn) BUS_unlock(pn) #define BUSLOCKIN(in) BUS_lock_in(in) #define BUSUNLOCKIN(in) BUS_unlock_in(in) #define CHANNELLOCKIN(in) CHANNEL_lock_in(in) #define CHANNELUNLOCKIN(in) CHANNEL_unlock_in(in) #define PORTLOCKIN(in) PORT_lock_in(in) #define PORTUNLOCKIN(in) PORT_unlock_in(in) #ifdef __UCLIBC__ #define UCLIBCLOCK _MUTEX_LOCK( Mutex.uclibc_mutex) #define UCLIBCUNLOCK _MUTEX_UNLOCK(Mutex.uclibc_mutex) #else /* __UCLIBC__ */ #define UCLIBCLOCK return_ok() #define UCLIBCUNLOCK return_ok() #endif /* __UCLIBC__ */ #define DETACH_THREAD pthread_detach(pthread_self()) #endif /* OW_MUTEXES_H */ owfs-3.1p5/module/owlib/src/include/ow_none.h0000644000175000001440000000104212654730021016142 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_NONE_H #define OW_NONE_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* ------- Prototypes ----------- */ /* ------- Structures ----------- */ extern struct filetype NoDev[]; #endif owfs-3.1p5/module/owlib/src/include/ow_onewirequery.h0000644000175000001440000001065712654730021017755 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 */ // encapsulation or parameters for read, write and directory #ifndef OW_ONEWIREQUERY_H /* tedious wrapper */ #define OW_ONEWIREQUERY_H enum owq_cleanup { owq_cleanup_none = 0, owq_cleanup_owq = 0x01, owq_cleanup_pn = 0x02, owq_cleanup_buffer = 0x04, owq_cleanup_rbuffer = 0x08, owq_cleanup_array = 0x10, // unrelated flag owq_simultaneous = 0x1000, } ; union value_object { int I; unsigned int U; _FLOAT F; _DATE D; int Y; //boolean size_t length; union value_object *array; }; struct one_wire_query { char *buffer; //char *read_buffer; //const char *write_buffer; size_t size; off_t offset; struct parsedname pn; enum owq_cleanup cleanup; union value_object val; }; #define NO_ONE_WIRE_QUERY NULL #define OWQ_pn(owq) ((owq)->pn) #define OWQ_buffer(owq) ((owq)->buffer) #define OWQ_read_buffer(owq) ((owq)->read_buffer) #define OWQ_write_buffer(owq) ((owq)->write_buffer) #define OWQ_size(owq) ((owq)->size) #define OWQ_offset(owq) ((owq)->offset) #define OWQ_cleanup(owq) ((owq)->cleanup) #define OWQ_val(owq) ((owq)->val) #define OWQ_array(owq) (((owq)->val).array) #define PN(owq) (&OWQ_pn(owq)) #define OWQ_I(owq) ((OWQ_val(owq)).I) #define OWQ_U(owq) ((OWQ_val(owq)).U) #define OWQ_F(owq) ((OWQ_val(owq)).F) #define OWQ_D(owq) ((OWQ_val(owq)).D) #define OWQ_Y(owq) ((OWQ_val(owq)).Y) #define OWQ_length(owq) ((OWQ_val(owq)).length) #define OWQ_array_I(owq,i) ((OWQ_array(owq)[i]).I) #define OWQ_array_U(owq,i) ((OWQ_array(owq)[i]).U) #define OWQ_array_F(owq,i) ((OWQ_array(owq)[i]).F) #define OWQ_array_D(owq,i) ((OWQ_array(owq)[i]).D) #define OWQ_array_Y(owq,i) ((OWQ_array(owq)[i]).Y) #define OWQ_array_length(owq,i) ((OWQ_array(owq)[i]).length) #define OWQ_explode(owq) (BYTE *)OWQ_buffer(owq),OWQ_size(owq),OWQ_offset(owq),PN(owq) #define OWQ_SIMUL_SET(owq) (((owq)->cleanup) |= owq_simultaneous ) #define OWQ_SIMUL_CLR(owq) (((owq)->cleanup) &= (~owq_simultaneous) ) #define OWQ_SIMUL_TEST(owq) ((((owq)->cleanup) & owq_simultaneous) != 0 ) //#define OWQ_allocate_struct_and_pointer( owq_name ) struct one_wire_query struct_##owq_name ; struct one_wire_query * owq_name = & struct_##owq_name // perhaps it would be nice to clear the memory try trace errors. OWQ_allocate_struct_and_pointer() needs to be defined as the last local variable now... // "owq_name->cleanup = owq_cleanup_none" is needed at least... but why not clear the whole struct just to make sure it never happens again. #define OWQ_allocate_struct_and_pointer( owq_name ) struct one_wire_query struct_##owq_name ; struct one_wire_query * owq_name = & struct_##owq_name; memset(&struct_##owq_name, 0, sizeof(struct one_wire_query)); GOOD_OR_BAD OWQ_create(const char *path, struct one_wire_query *owq); GOOD_OR_BAD OWQ_create_plus(const char *path, const char *file, struct one_wire_query *owq); void OWQ_destroy(struct one_wire_query *owq); struct one_wire_query * OWQ_create_from_path(const char *path) ; struct one_wire_query * OWQ_create_sibling(const char *sibling, struct one_wire_query *owq_original) ; GOOD_OR_BAD OWQ_allocate_read_buffer(struct one_wire_query * owq ) ; GOOD_OR_BAD OWQ_allocate_write_buffer( const char * write_buffer, size_t buffer_length, off_t offset, struct one_wire_query * owq ) ; void OWQ_assign_read_buffer(char *buffer, size_t size, off_t offset, struct one_wire_query *owq) ; void OWQ_assign_write_buffer(const char *buffer, size_t size, off_t offset, struct one_wire_query *owq) ; struct one_wire_query * OWQ_create_separate( int extension, struct one_wire_query * owq_aggregate ) ; struct one_wire_query * OWQ_create_aggregate( struct one_wire_query * owq_single ); void OWQ_create_temporary(struct one_wire_query *owq_temporary, char *buffer, size_t size, off_t offset, struct parsedname *pn); ZERO_OR_ERROR OWQ_format_output_offset_and_size(const char *string, size_t length, struct one_wire_query *owq); ZERO_OR_ERROR OWQ_format_output_offset_and_size_z(const char *string, struct one_wire_query *owq); struct one_wire_query * ALLtoBYTE( struct one_wire_query *owq_all ); struct one_wire_query * BYTEtoALL( struct one_wire_query *owq_byte ); int OWQ_parse_input(struct one_wire_query *owq); SIZE_OR_ERROR OWQ_parse_output(struct one_wire_query *owq); void _print_owq(struct one_wire_query *owq); #endif /* OW_ONEWIREQUERY_H */ owfs-3.1p5/module/owlib/src/include/ow_opt.h0000644000175000001440000000561612654730021016020 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- */ /* Cannot stand alone -- part of ow.h but separated for clarity */ #ifndef OW_OPT_H /* tedious wrapper */ #define OW_OPT_H /* command line options */ /* These are the owlib-specific options */ #define OWLIB_OPT "a:m:c:f:p:s:h::u::d:t:CFRKVP:rw:" extern const struct option owopts_long[]; GOOD_OR_BAD owopt(const int c, const char *arg); GOOD_OR_BAD owopt_packed(const char *params); // All these command line arguments are after the printable ascii characters enum e_long_option { e_error_print = 257, e_error_level, e_debug, e_cache_size, e_fuse_opt, e_fuse_open_opt, e_max_clients, e_safemode, e_ha7, e_fake, e_link, e_ha3, e_ha4b, e_ha5, e_ha7e, e_tester, e_mock, e_etherweather, e_passive, e_i2c, e_xport, e_enet, e_pbm, e_masterhub, e_ds1wm, e_k1wm, e_want_background, e_want_foreground, e_w1_monitor, e_browse, e_pressure_mbar, e_pressure_atm, e_pressure_mmhg, e_pressure_inhg, e_pressure_psi, e_pressure_Pa, e_pressure_6, e_pressure_7, e_announce, e_timeout_volatile, e_timeout_stable, e_timeout_directory, e_timeout_presence, e_timeout_serial, e_timeout_usb, e_timeout_network, e_timeout_server, e_timeout_ftp, e_timeout_ha7, e_timeout_w1, e_timeout_persistent_low, e_timeout_persistent_high, e_clients_persistent_low, e_clients_persistent_high, e_fatal_debug_file, e_baud, e_templow, e_temphigh, e_detail, }; #endif /* OW_OPT_H */ owfs-3.1p5/module/owlib/src/include/ow_parse_address.h0000644000175000001440000000570512654730021020034 00000000000000/* Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_PARSE_ADDRESS_H /* tedious wrapper */ #define OW_PARSE_ADDRESS_H struct address_entry { enum { address_none, address_alpha, address_all, address_scan, address_asterix, address_numeric, address_dottedquad, } type ; char * alpha ; int number ; } ; typedef int ADDRESS_OR_FLAG ; struct address_pair { int entries ; struct address_entry first ; struct address_entry second ; struct address_entry third ; } ; void Parse_Address( char * address, struct address_pair * ap ) ; void Free_Address( struct address_pair * ap ) ; #endif /* OW_PARSE_ADDRESS_H */ owfs-3.1p5/module/owlib/src/include/ow_parsedname.h0000644000175000001440000001740412654730021017333 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille */ #ifndef OW_PARSEDNAME_H /* tedious wrapper */ #define OW_PARSEDNAME_H /* Define our understanding of integers, floats, ... */ #include "ow_localtypes.h" /* predeclare some structures */ struct connection_in; struct device; struct filetype; struct devloc ; /* Maximum length of a file or directory name, and extension */ #define OW_NAME_MAX (32) #define OW_EXT_MAX (6) #define OW_FULLNAME_MAX (OW_NAME_MAX+OW_EXT_MAX) #define OW_DEFAULT_LENGTH (128) /* Parsedname -- path converted into components */ /* Parsed name is the primary structure interpreting a owfs systrem call. It is the interpretation of the owfs file name, or the owhttpd URL. It contains everything but the operation requested. The operation (read, write or directory is in the extended URL or the actual callback function requested). */ /* Parsed name has several components: sn is the serial number of the device dev and ft are pointers to device and filetype members corresponding to the element ds2409_hubs and ds2409_depth interpret the route through DS2409 branch controllers filetype and extension correspond to property (filetype) details subdir points to in-device groupings */ #define NO_PARSEDNAME NULL #define NO_PATH NULL /* LocalControlFlags information (for remote control) */ /* bit0: cacheenabled bit1: return bus-list */ /* presencecheck */ /* tempscale */ /* device format */ extern int32_t LocalControlFlags; // flag to pn->selected_connection->branch.branch to force select from root dir enum eBranch { eBranch_bad = 0xFF, eBranch_cleared = 0xFE, eBranch_main = 0x00, eBranch_aux = 0x01, }; struct ds2409_hubs { BYTE sn[SERIAL_NUMBER_SIZE]; BYTE branch; }; #define EXTENSION_BYTE -2 #define EXTENSION_ALL -1 #define EXTENSION_UNKNOWN -3 /* Sparse and not given yet */ #define NO_FILETYPE NULL #define NO_SUBDIR NULL #define NO_DEVICE NULL enum ePN_type { ePN_root, ePN_real, ePN_statistics, ePN_system, ePN_settings, ePN_structure, ePN_interface, ePN_max_type, }; extern char *ePN_name[]; // must match ePN_type enum ePS_state { ePS_normal = 0x0000, ePS_uncached = 0x0001, ePS_alarm = 0x0002, ePS_text = 0x0004, ePS_bus = 0x0008, ePS_buslocal = 0x0010, ePS_busanylocal = 0x0020, ePS_busremote = 0x0040, ePS_busveryremote = 0x0080, ePS_reconnection = 0x0100, ePS_unaliased = 0x0200, ePS_json = 0x0400, }; struct parsedname { char path[2*PATH_MAX+2]; // full device name char path_to_server[PATH_MAX+2]; // path without first bus char * device_name ; // for external name struct connection_in *known_bus; // where this device is located enum ePN_type type; // real? settings? ... enum ePS_state state; // alarm? BYTE sn[SERIAL_NUMBER_SIZE]; // 64-bit serial number struct device *selected_device; // 1-wire device struct filetype *selected_filetype; // device property int extension; // numerical extension (for array values) or -1 char * sparse_name; // text extension for a sparse array value struct filetype *subdir; // in-device grouping int dirlength ; // Length of just directory part of path UINT ds2409_depth; // DS2409 branching depth struct ds2409_hubs *bp; // DS2409 branching route struct connection_in *selected_connection; // which bus is assigned to this item uint32_t control_flags; // more state info, packed for network transmission struct devlock *lock; // pointer to a device-specific lock int return_code ; // return (error) code int detail_flag ; // matches a detail request int tokens; // for anti-loop work BYTE *tokenstring; // List of tokens from owservers passed }; /* ---- end Parsedname ----------------- */ #define SHOULD_RETURN_BUS_LIST ( (UINT) 0x00000002 ) #define PERSISTENT_MASK ( (UINT) 0x00000004 ) #define PERSISTENT_BIT 2 #define ALIAS_REQUEST ( (UINT) 0x00000008 ) #define SAFEMODE ( (UINT) 0x00000010 ) #define UNCACHED ( (UINT) 0x00000020 ) #define TRIM ( (UINT) 0x00000040 ) #define OWNET ( (UINT) 0x00000100 ) #define TEMPSCALE_MASK ( (UINT) 0x00030000 ) #define TEMPSCALE_BIT 16 #define PRESSURESCALE_MASK ( (UINT) 0x001C0000 ) #define PRESSURESCALE_BIT 18 #define DEVFORMAT_MASK ( (UINT) 0xFF000000 ) #define DEVFORMAT_BIT 24 #define IsPersistent(ppn) ( ((ppn)->control_flags & PERSISTENT_MASK) ) #define SetPersistent(ppn,b) UT_Setbit(((ppn)->control_flags),PERSISTENT_BIT,(b)) #define TemperatureScale(ppn) ( (enum temp_type) (((ppn)->control_flags & TEMPSCALE_MASK) >> TEMPSCALE_BIT) ) #define PressureScale(ppn) ( (enum pressure_type) (((ppn)->control_flags & PRESSURESCALE_MASK) >> PRESSURESCALE_BIT) ) #define SGTemperatureScale(sg) ( (enum temp_type)(((sg) & TEMPSCALE_MASK) >> TEMPSCALE_BIT) ) #define SGPressureScale(sg) ( (enum pressure_type)(((sg) & PRESSURESCALE_MASK) >> PRESSURESCALE_BIT) ) #define DeviceFormat(ppn) ( (enum deviceformat) (((ppn)->control_flags & DEVFORMAT_MASK) >> DEVFORMAT_BIT) ) #define IsDir( pn ) ( ((pn)->selected_device)==NO_DEVICE \ || ((pn)->selected_filetype)==NO_FILETYPE \ || ((pn)->selected_filetype)->format==ft_subdir \ || ((pn)->selected_filetype)->format==ft_directory ) #define NotUncachedDir(pn) ( (((pn)->state)&ePS_uncached) == 0 ) #define IsUncachedDir(pn) ( ! NotUncachedDir(pn) ) #define IsStructureDir(pn) ( ((pn)->type) == ePN_structure ) #define IsInterfaceDir(pn) ( ((pn)->type) == ePN_interface ) #define NotAlarmDir(pn) ( (((pn)->state)&ePS_alarm) == 0 ) #define IsAlarmDir(pn) ( ! NotAlarmDir(pn) ) #define NotRealDir(pn) ( ((pn)->type) != ePN_real ) #define IsRealDir(pn) ( ((pn)->type) == ePN_real ) #define NotReconnect(pn) ( (((pn)->state)&ePS_reconnection) == 0 ) #define ClearReconnect(pn) do { ((pn)->state)&=~ePS_reconnection; } while(0) #define SetReconnect(pn) do { ((pn)->state)|=ePS_reconnection; } while(0) #define InSafeMode(pn) ( (((pn)->control_flags) & SAFEMODE ) != 0 ) #define ShouldTrim(pn) ( (((pn)->control_flags) & TRIM ) != 0 ) #define KnownBus(pn) ((((pn)->state) & ePS_bus) != 0 ) #define UnsetKnownBus(pn) do { (pn)->state &= ~ePS_bus; \ (pn)->known_bus=NULL; \ (pn)->selected_connection=NO_CONNECTION; \ } while(0) #define ShouldReturnBusList(ppn) ( ((ppn)->control_flags & SHOULD_RETURN_BUS_LIST) ) #define SpecifiedVeryRemoteBus(pn) ((((pn)->state) & ePS_busveryremote) != 0 ) #define SpecifiedRemoteBus(pn) ((((pn)->state) & ePS_busremote) != 0 ) #define SpecifiedLocalBus(pn) ((((pn)->state) & ePS_buslocal) != 0 ) #define SpecifiedBus(pn) ( SpecifiedLocalBus(pn) || SpecifiedRemoteBus(pn) ) #define RootNotBranch(pn) (((pn)->ds2409_depth)==0) enum parse_enum { parse_first, parse_done, parse_error, parse_real, parse_branch, parse_nonreal, parse_prop, parse_subprop }; #endif /* OW_PARSEDNAME_H */ owfs-3.1p5/module/owlib/src/include/ow_parse_sn.h0000644000175000001440000000345612654730021017030 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, // --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Cannot stand alone -- part of ow.h but separated for clarity */ #ifndef OW_PARSE_SN_H /* tedious wrapper */ #define OW_PARSE_SN_H enum parse_serialnumber { sn_valid, sn_invalid, sn_not_sn, sn_null, } ; enum parse_serialnumber Parse_SerialNumber(char *sn_char, BYTE * sn) ; int SerialNumber_length(char *sn_char, BYTE * sn) ; #endif /* OW_PARSE_SN_H */ owfs-3.1p5/module/owlib/src/include/ow_pid.h0000644000175000001440000000047112654730021015764 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 PID saving code -- isolated for convenience */ #ifndef OWPID_H /* tedious wrapper */ #define OWPID_H /* PID file nsme */ extern int pid_created; extern char *pid_file; void PIDstart(void); void PIDstop(void); #endif /* OWPID_H */ owfs-3.1p5/module/owlib/src/include/ow_port_in.h0000644000175000001440000000647512672234566016711 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ #ifndef OW_PORT_IN_H /* tedious wrapper */ #define OW_PORT_IN_H /* struct connection_in (for each bus master) as part of ow_connection.h */ //enum server_type { srv_unknown, srv_direct, srv_client, src_ /* Network connection structure */ enum bus_mode { bus_unknown = 0, bus_serial, bus_xport, bus_passive, bus_usb, bus_usb_monitor, bus_enet_monitor, bus_masterhub_monitor, bus_parallel, bus_server, bus_zero, bus_browse, bus_i2c, bus_ha7net, bus_ha5, bus_ha7e, bus_enet, bus_fake, bus_tester, bus_mock, bus_link, bus_masterhub, bus_pbm, bus_etherweather, bus_bad, bus_w1, bus_w1_monitor, bus_xport_control, bus_external, bus_ds1wm, bus_k1wm, }; enum com_state { cs_virgin, cs_deflowered, } ; enum com_type { ct_unknown, ct_serial, ct_telnet, ct_tcp, ct_i2c, ct_usb, ct_netlink, ct_ftdi, ct_none, } ; struct com_serial { struct termios oldSerialTio; /*old serial port settings */ } ; struct com_tcp { char *host; char *service; struct addrinfo *ai; struct addrinfo *ai_ok; enum { needs_negotiation, completed_negotiation, } telnet_negotiated ; // have we attempted telnet negotiation -- reset at each OPEN int telnet_supported ; // server does telnet settings } ; // For forward references struct connection_in; struct port_in ; struct port_in { struct port_in * next ; struct connection_in *first; int connections ; enum bus_mode busmode; char * init_data ; union { struct com_serial serial ; struct com_tcp tcp ; struct com_tcp telnet ; } dev ; FILE_DESCRIPTOR_OR_PERSISTENT file_descriptor; enum com_state state ; enum com_type type ; enum { flow_none, flow_soft, flow_hard, } flow ; speed_t baud; // baud rate in the form of B9600 int bits; enum { parity_none, parity_odd, parity_even, parity_mark, } parity ; enum { stop_1, stop_2, stop_15, } stop; cc_t vmin ; cc_t vtime ; struct timeval timeout ; // for serial or tcp read pthread_mutex_t port_mutex; }; /* This bug-fix/workaround function seem to be fixed now... At least on * the platforms I have tested it on... printf() in owserver/src/c/owserver.c * returned very strange result on c->busmode before... but not anymore */ enum bus_mode get_busmode(const struct connection_in *c); void RemovePort( struct port_in * pin ) ; struct port_in * AllocPort( const struct port_in * old_pin ) ; struct port_in *LinkPort(struct port_in *pin) ; struct port_in *NewPort(const struct port_in *pin) ; struct connection_in * AddtoPort( struct port_in * pin ) ; #endif /* OW_PORT_IN_H */ owfs-3.1p5/module/owlib/src/include/ow_pressure.h0000644000175000001440000000252112654730021017056 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ /* Cannot stand alone -- separated out of ow.h for clarity */ #ifndef OW_PRESSURE_H /* tedious wrapper */ #define OW_PRESSURE_H /* Global pressure scale up tp 8 */ enum pressure_type { pressure_mbar, pressure_atm, pressure_mmhg, pressure_inhg, pressure_psi, pressure_Pa, pressure_end_mark }; _FLOAT Pressure(_FLOAT P, const struct parsedname *pn); _FLOAT fromPressure(_FLOAT P, const struct parsedname *pn); const char *PressureScaleName(enum pressure_type p); #endif /* OW_PRESSURE_H */ owfs-3.1p5/module/owlib/src/include/ow_programs.h0000644000175000001440000000316412654730021017044 00000000000000/* Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ /* control over users of owlib -- the programs */ /* This file doesn't stand alone, it must be included in ow.h */ #ifndef OW_PROGRAMS_H /* tedious wrapper */ #define OW_PROGRAMS_H extern void set_signal_handlers(void (*exit_handler) (int signo, siginfo_t * info, void *context)); void set_exit_signal_handlers(void (*exit_handler) (int signo, siginfo_t * info, void *context)); #ifndef SI_FROMUSER #define SI_FROMUSER(siptr) ((siptr)->si_code <= 0) #endif #ifndef SI_FROMKERNEL #define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0) #endif extern int main_threadid_init ; extern pthread_t main_threadid; #define IS_MAINTHREAD ( (main_threadid_init==1) && (main_threadid == pthread_self()) ) /* Exit handler */ void exit_handler(int signo, siginfo_t * info, void *context) ; void ow_exit(int exit_code) ; #endif /* OW_PROGRAMS_H */ owfs-3.1p5/module/owlib/src/include/ow_regex.h0000644000175000001440000000312612654730021016322 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, */ // Not intended to be stand-alone -- called from ow.h #ifndef OW_REGEX_H /* tedious wrapper */ #define OW_REGEX_H #include void ow_regcomp( regex_t * preg, const char * regex, int cflags ) ; void ow_regdestroy( void ) ; void ow_regfree( regex_t * reg ) ; struct ow_regmatch { int number ; char ** pre ; char ** match ; char ** post ; } ; int ow_regexec( const regex_t * rex, const char * string, struct ow_regmatch * orm ) ; void ow_regexec_free( struct ow_regmatch * orm ) ; #endif /* OW_REGEX_H */ owfs-3.1p5/module/owlib/src/include/ow_reset.h0000644000175000001440000000642612654730021016340 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_RESET_H /* tedious wrapper */ #define OW_RESET_H typedef int RESET_TYPE ; #define BUS_RESET_OK 0 #define BUS_RESET_SHORT 1 #define BUS_RESET_ERROR -EINVAL #define gbRESET( r ) ( ( (r) < BUS_RESET_OK ) ? gbBAD : gbGOOD ) #endif /* OW_RESET_H */ owfs-3.1p5/module/owlib/src/include/ow_return_code.h0000644000175000001440000000514012654730021017517 00000000000000/* $Id$ OW -- One-Wire filesystem LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille GPL license 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. */ #ifndef OW_RETURN_CODE_H /* tedious wrapper */ #define OW_RETURN_CODE_H #include "ow_debug.h" // Not stand-alone but part of ow_h extern char * return_code_strings[] ; // Fragile: return_code_out_of_bounds is set to the last entry in the error (return_code) list // it's defined in ow_return_code.c #define return_code_out_of_bounds 210 extern int return_code_calls[] ; #define N_RETURN_CODES (return_code_out_of_bounds+1) #define RETURN_CODE_INIT(pn) do { (pn)->return_code = 0 ; ++return_code_calls[0]; } while (0) ; #define RETURN_IF_ERROR(pn) if ( (pn)->return_code != 0 ) { return ; } #ifndef __FILE__ #define __FILE__ "" #endif #ifndef __LINE__ #define __LINE__ "" #endif #ifndef __func__ #define __func__ "" #endif /* Set return code into the proper place in parsedname strcture */ #define RETURN_CODE_SET(rc,pn) return_code_set_scalar( rc, pn, __FILE__, __LINE__, __func__ ) /* Set return code into an integer */ #define RETURN_CODE_SET_SCALAR(i,rc) return_code_set_scalar( rc, &(i), __FILE__, __LINE__, __func__ ) /* Unconditional return with return code */ #define RETURN_CODE_RETURN(rc) do { int i ; RETURN_CODE_SET_SCALAR(i,rc) ; return -i; } while(0) ; /* Conditional return with return code */ #define RETURN_CODE_ERROR_RETURN(rc) do { int i ; RETURN_CODE_SET_SCALAR(i,rc) ; if ( i != 0 ) { return -i; } } while(0) ; void return_code_set( int rc, struct parsedname * pn, const char * d_file, int d_line, const char * d_func ) ; void return_code_set_scalar( int rc, int * pi, const char * d_file, int d_line, const char * d_func ) ; void Return_code_setup(void) ; #endif /* OW_RETURN_CODE_H */ owfs-3.1p5/module/owlib/src/include/ow_settings.h0000644000175000001440000000115112654730021017044 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_SETTINGS_H #define OW_SETTINGS_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* -------- Structures ---------- */ DeviceHeader(set_timeout); DeviceHeader(set_units); DeviceHeader(set_alias); DeviceHeader(set_return_code); #endif /* OW_SETTINGS_H */ owfs-3.1p5/module/owlib/src/include/ow_search.h0000644000175000001440000000675612654730021016471 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_SEARCH_H /* tedious wrapper */ #define OW_SEARCH_H enum search_status { search_good, search_done, search_error } ; struct device_search { int LastDiscrepancy; // for search int LastDevice; // for search int index; BYTE sn[SERIAL_NUMBER_SIZE]; BYTE search; // For adapters that maintain dir-at-once (or dirgulp): struct dirblob gulp; }; enum search_status BUS_first(struct device_search *ds, const struct parsedname *pn); enum search_status BUS_next(struct device_search *ds, const struct parsedname *pn); enum search_status BUS_first_alarm(struct device_search *ds, const struct parsedname *pn); enum search_status BUS_next_both(struct device_search *ds, const struct parsedname *pn); enum search_status BUS_next_both_bitbang(struct device_search *ds, const struct parsedname *pn) ; void BUS_next_cleanup( struct device_search *ds ) ; #endif /* OW_SEARCH_H */ owfs-3.1p5/module/owlib/src/include/ow_sibling.h0000644000175000001440000000507012654730021016637 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 \ LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, // --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* Cannot stand alone -- part of ow.h but separated for clarity */ #ifndef OW_SIBLING_H /* tedious wrapper */ #define OW_SIBLING_H ZERO_OR_ERROR FS_r_sibling_F(_FLOAT *F, const char * sibling, struct one_wire_query *owq) ; ZERO_OR_ERROR FS_r_sibling_U( UINT *U, const char * sibling, struct one_wire_query *owq) ; ZERO_OR_ERROR FS_r_sibling_Y( INT *Y, const char * sibling, struct one_wire_query *owq) ; ZERO_OR_ERROR FS_r_sibling_binary(BYTE * data, size_t * size, const char * sibling, struct one_wire_query *owq) ; ZERO_OR_ERROR FS_w_sibling_binary(BYTE * data, size_t size, off_t offset, const char * sibling, struct one_wire_query *owq) ; ZERO_OR_ERROR FS_w_sibling_bitwork(UINT set, UINT mask, const char * sibling, struct one_wire_query *owq) ; ZERO_OR_ERROR FS_w_sibling_F(_FLOAT F, const char * sibling, struct one_wire_query *owq) ; ZERO_OR_ERROR FS_w_sibling_U( UINT U, const char * sibling, struct one_wire_query *owq) ; ZERO_OR_ERROR FS_w_sibling_Y( INT Y, const char * sibling, struct one_wire_query *owq) ; void FS_del_sibling(const char * sibling, struct one_wire_query *owq) ; #endif /* OW_SIBLING_H */ owfs-3.1p5/module/owlib/src/include/ow_simultaneous.h0000644000175000001440000000104312654730021017734 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_SIMULTANEOUS_H #define OW_SIMULTANEOUS_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* -------- Structures ---------- */ DeviceHeader(simultaneous); #endif /* OW_SIMULTANEOUS */ owfs-3.1p5/module/owlib/src/include/ow_standard.h0000644000175000001440000000604212654730021017010 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_STANDARD_H #define OW_STANDARD_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow.h" #include "ow_connection.h" #include "ow_codes.h" /* ------- Prototypes ----------- */ ZERO_OR_ERROR FS_type(struct one_wire_query *owq); ZERO_OR_ERROR FS_r_alias(struct one_wire_query *owq); ZERO_OR_ERROR FS_w_alias(struct one_wire_query *owq); ZERO_OR_ERROR FS_code(struct one_wire_query *owq); ZERO_OR_ERROR FS_crc8(struct one_wire_query *owq); ZERO_OR_ERROR FS_ID(struct one_wire_query *owq); ZERO_OR_ERROR FS_r_ID(struct one_wire_query *owq); ZERO_OR_ERROR FS_address(struct one_wire_query *owq); ZERO_OR_ERROR FS_r_address(struct one_wire_query *owq); ZERO_OR_ERROR FS_locator(struct one_wire_query *owq); ZERO_OR_ERROR FS_r_locator(struct one_wire_query *owq); ZERO_OR_ERROR FS_present(struct one_wire_query *owq); /* ------- Structures ----------- */ #define F_address \ {"address" , PROPERTY_LENGTH_ADDRESS, NON_AGGREGATE, ft_ascii , fc_static , FS_address , NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, } #define F_r_address \ {"r_address" , PROPERTY_LENGTH_ADDRESS, NON_AGGREGATE, ft_ascii , fc_static , FS_r_address, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, } #define F_crc8 \ {"crc8" , 2, NON_AGGREGATE, ft_ascii , fc_static , FS_crc8 , NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, } #define F_id \ {"id" , 12, NON_AGGREGATE, ft_ascii , fc_static , FS_ID , NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, } #define F_r_id \ {"r_id" , 12, NON_AGGREGATE, ft_ascii , fc_static , FS_r_ID , NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, } #define F_code \ {"family" , 2, NON_AGGREGATE, ft_ascii , fc_static , FS_code , NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, } #define F_present \ {"present" , PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno , fc_volatile, FS_present , NO_WRITE_FUNCTION, VISIBILE_PRESENT, NO_FILETYPE_DATA, } #define F_type \ {"type" , PROPERTY_LENGTH_TYPE, NON_AGGREGATE, ft_vascii, fc_static , FS_type , NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, } #define F_alias \ {"alias" ,PROPERTY_LENGTH_ALIAS, NON_AGGREGATE, ft_alias, fc_static , FS_r_alias , FS_w_alias, VISIBLE, NO_FILETYPE_DATA, } #define F_locator \ {"locator" , PROPERTY_LENGTH_ADDRESS, NON_AGGREGATE, ft_ascii , fc_directory,FS_locator , NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, } #define F_r_locator \ {"r_locator" , PROPERTY_LENGTH_ADDRESS, NON_AGGREGATE, ft_ascii , fc_directory,FS_r_locator, NO_WRITE_FUNCTION, VISIBLE, NO_FILETYPE_DATA, } #define F_STANDARD_NO_TYPE F_address,F_code,F_crc8,F_id,F_locator,F_present,F_r_address,F_r_id,F_r_locator,F_alias #define F_STANDARD F_STANDARD_NO_TYPE,F_type #endif /* OW_STANDARD_H */ owfs-3.1p5/module/owlib/src/include/ow_stateinfo.h0000644000175000001440000000565012654730021017210 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ /* CAnn stand alone -- separated out of ow.h for clarity */ #ifndef OW_STATEINFO_H /* tedious wrapper */ #define OW_STATEINFO_H enum lib_state { lib_state_pre, lib_state_setup, lib_state_started, lib_state_active, lib_state_finished, }; /* Globals information (for local control) */ struct stateinfo { enum lib_state owlib_state; int lock_setup_done; time_t start_time; time_t dir_time; int shutting_down; }; extern struct stateinfo StateInfo; #endif /* OW_STATEINFO_H */ owfs-3.1p5/module/owlib/src/include/ow_stats.h0000644000175000001440000000127212654730021016346 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_STATS_H #define OW_STATS_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* -------- Structures ---------- */ DeviceHeader(stats_cache); DeviceHeader(stats_read); DeviceHeader(stats_write); DeviceHeader(stats_directory); DeviceHeader(stats_errors); DeviceHeader(stats_thread); DeviceHeader(stats_return_code); #endif /* OW_STATS */ owfs-3.1p5/module/owlib/src/include/ow_stub.h0000644000175000001440000000102412654730021016160 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_STUB_H #define OW_STUB_H // VT: NOTE: This file serves the only purpose: so it can be checked by the // packages that depend on this package. Other header files can't be used // because they demand presence of config.h, or, rather, defined CONFIG_H. #endif owfs-3.1p5/module/owlib/src/include/ow_system.h0000644000175000001440000000111112654730021016524 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_SYSTEM_H #define OW_SYSTEM_H #ifndef OWFS_CONFIG_H #error Please make sure owfs_config.h is included *before* this header file #endif #include "ow_standard.h" /* -------- Structures ---------- */ DeviceHeader(sys_process); DeviceHeader(sys_connections); DeviceHeader(sys_configure); #endif /* OW_SYSTEM_H */ owfs-3.1p5/module/owlib/src/include/ow_temperature.h0000644000175000001440000000263412654730021017550 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. */ /* Cannot stand alone -- separated out of ow.h for clarity */ #ifndef OW_TEMPERATURE_H /* tedious wrapper */ #define OW_TEMPERATURE_H /* Global temperature scale */ enum temp_type { temp_celsius, temp_fahrenheit, temp_kelvin, temp_rankine, }; _FLOAT Temperature(_FLOAT C, const struct parsedname *pn); _FLOAT TemperatureGap(_FLOAT C, const struct parsedname *pn); _FLOAT fromTemperature(_FLOAT T, const struct parsedname *pn); _FLOAT fromTempGap(_FLOAT T, const struct parsedname *pn); const char *TemperatureScaleName(enum temp_type t); #endif /* OW_TEMPERATURE_H */ owfs-3.1p5/module/owlib/src/include/ow_thermocouple.h0000644000175000001440000000140412654730021017713 00000000000000/* $Id$ OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ #ifndef OW_THERMOCOUPLE_H #define OW_THERMOCOUPLE_H #include "ow_localtypes.h" // for _FLOAT enum e_thermocouple_type { e_type_b, e_type_e, e_type_j, e_type_k, e_type_n, e_type_r, e_type_s, e_type_t, e_type_last, }; _FLOAT ThermocoupleTemperature(_FLOAT mV_reading, _FLOAT temperature_coldjunction, enum e_thermocouple_type etype); _FLOAT Thermocouple_range_low(enum e_thermocouple_type etype); _FLOAT Thermocouple_range_high(enum e_thermocouple_type etype); #endif /* OW_THERMOCOUPLE_H */ owfs-3.1p5/module/owlib/src/include/ow_timer.h0000644000175000001440000001305512654730021016332 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_TIMER_H /* tedious wrapper */ #define OW_TIMER_H #ifdef HAVE_SYS_TIME_H #include /* for gettimeofday */ #endif /* HAVE_SYS_TIME_H */ /* These macros doesn't exist for Solaris */ /* Convenience macros for operations on timevals. NOTE: `timercmp' does not work for >= or <=. */ #ifndef timerisset # define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) #endif #ifndef timerclear # define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) #endif #ifndef timercmp # define timercmp(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) ? \ ((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_sec CMP (b)->tv_sec)) #endif #ifndef timeradd # define timeradd(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ if ((result)->tv_usec >= 1000000) \ { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0) #endif #ifndef timersub # define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif #define timernow( ptv ) gettimeofday( ptv, NULL ) #define timercpy( pdest, psrc ) do { (pdest)->tv_sec = (psrc)->tv_sec ; (pdest)->tv_usec = (psrc)->tv_usec ; } while (0) #define TVformat "%d.%06d seconds" #define TVvar(ptv) (ptv)->tv_sec,(ptv)->tv_usec #define TVfloat( ptv ) ( ( (double) (ptv)->tv_sec ) + ( (double) (ptv)->tv_usec ) * .000001 ) #endif /* OW_TIMER_H */ owfs-3.1p5/module/owlib/src/include/ow_traffic.h0000644000175000001440000000173312654730021016630 00000000000000/* Debug and error messages Meant to be included in ow.h Separated just for readability */ /* OWFS source code 1-wire filesystem for linux {c} 2006 Paul H Alfille License GPL2.0 */ #ifndef OW_TRAFFIC_H #define OW_TRAFFIC_H /* Debugging interface to showing all bus traffic * You need to configure compile with * ./configure --enable-owtraffic * if you don't want empty functions * */ /* Show bus traffic in detail (must be configured into the build to be active) */ void TrafficOut( const char * data_type, const BYTE * data, size_t length, const struct connection_in * in ); void TrafficIn( const char * data_type, const BYTE * data, size_t length, const struct connection_in * in ); void TrafficOutFD( const char * data_type, const BYTE * data, size_t length, FILE_DESCRIPTOR_OR_ERROR file_descriptor ); void TrafficInFD( const char * data_type, const BYTE * data, size_t length, FILE_DESCRIPTOR_OR_ERROR file_descriptor ); #endif /* OW_TRAFFIC_H */ owfs-3.1p5/module/owlib/src/include/ow_transaction.h0000644000175000001440000001342612654730021017541 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_TRANSACTION_H /* tedious wrapper */ #define OW_TRANSACTION_H enum transaction_type { trxn_select, trxn_match, trxn_bitmatch, trxn_modify, trxn_bitmodify, trxn_compare, trxn_bitcompare, trxn_read, trxn_bitread, trxn_blind, trxn_power, trxn_bitpower, trxn_program, trxn_reset, trxn_crc8, trxn_crc8seeded, trxn_crc16, trxn_crc16seeded, trxn_end, trxn_verify, trxn_nop, trxn_delay, trxn_udelay, }; struct transaction_log { const BYTE *out; BYTE *in; size_t size; enum transaction_type type; }; #define TRXN_NVERIFY { NULL, NULL, _1W_SEARCH_ROM, trxn_verify, } #define TRXN_AVERIFY { NULL, NULL, _1W_CONDITIONAL_SEARCH_ROM, trxn_verify, } #define TRXN_START { NULL, NULL, 0, trxn_select, } #define TRXN_END { NULL, NULL, 0, trxn_end, } #define TRXN_RESET { NULL, NULL, 0, trxn_reset, } #define TRXN_WRITE(writedata,length) { writedata, NULL, length, trxn_match, } #define TRXN_WRITE_BITS(writedata,length) { writedata, NULL, length, trxn_bitmatch, } #define TRXN_READ(readdata,length) { NULL, readdata, length, trxn_read, } #define TRXN_READ_BITS(readdata,length) { NULL, readdata, length, trxn_bitread, } #define TRXN_MODIFY(writedata,readdata,length) { writedata, readdata, length, trxn_modify, } #define TRXN_MODIFY_BITS(writedata,readdata,length) { writedata, readdata, length, trxn_bitmodify, } #define TRXN_COMPARE(data1, data2, length) { data1, data2, length, trxn_compare } #define TRXN_COMPARE_BITS(data1, data2, length) { data1, data2, length, trxn_bitcompare } #define TRXN_CRC8(data,length) { data, NULL, length, trxn_crc8, } #define TRXN_CRC16(data,length) { data, NULL, length, trxn_crc16, } #define TRXN_CRC16_seeded(data,length,seed) { data, seed, length, trxn_crc16, } #define TRXN_BLIND(writedata,length) { writedata, NULL, length, trxn_blind, } #define TRXN_POWER(byte_pointer, msec) { byte_pointer, byte_pointer, msec, trxn_power, } #define TRXN_POWER_BIT(byte_pointer, msec) { byte_pointer, byte_pointer, msec, trxn_bitpower, } #define TRXN_DELAY(msec) { NULL, NULL, msec, trxn_delay } #define TRXN_WRITE1(writedata) TRXN_WRITE(writedata,1) #define TRXN_READ1(readdata) TRXN_READ(readdata,1) #define TRXN_WRITE2(writedata) TRXN_WRITE(writedata,2) #define TRXN_READ2(readdata) TRXN_READ(readdata,2) #define TRXN_WRITE3(writedata) TRXN_WRITE(writedata,3) #define TRXN_READ3(readdata) TRXN_READ(readdata,3) #define TRXN_WR_CRC16(pointer,writelength,readlength) \ TRXN_WRITE((BYTE *)pointer,writelength), \ TRXN_READ(((BYTE *)pointer)+(writelength),readlength+2), \ TRXN_CRC16((BYTE *)pointer,writelength+readlength+2) #define TRXN_WR_CRC16_SEEDED(pointer,seed, writelength,readlength) \ TRXN_WRITE((BYTE *)pointer,writelength), \ TRXN_READ(((BYTE *)pointer)+(writelength),readlength+2), \ TRXN_CRC16_seeded((BYTE *)pointer, writelength+readlength+2, (BYTE *) (seed) ) #define TRXN_PROGRAM { NULL, NULL, 0, trxn_program, } GOOD_OR_BAD BUS_transaction(const struct transaction_log *tl, const struct parsedname *pn); GOOD_OR_BAD BUS_transaction_nolock(const struct transaction_log *tl, const struct parsedname *pn); #endif /* OW_TRANSACTION_H */ owfs-3.1p5/module/owlib/src/include/ow_usb_cycle.h0000644000175000001440000000611412654730021017160 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- Implementation: 25-05-2003 iButtonLink device */ #ifndef OW_USB_CYCLE_H /* tedious wrapper */ #define OW_USB_CYCLE_H #if OW_USB /* All the rest of the code sees is the DS9490_detect routine and the iroutine structure */ GOOD_OR_BAD USB_match(libusb_device * dev); GOOD_OR_BAD DS9490_root_dir( struct dirblob * db, struct connection_in * in ) ; GOOD_OR_BAD DS9490_ID_this_master(struct connection_in *in); #define DS2490_USB_VENDOR 0x04FA #define DS2490_USB_PRODUCT 0x2490 #endif /* OW_USB */ #endif /* OW_USB_CYCLE_H */ owfs-3.1p5/module/owlib/src/include/ow_usb_msg.h0000644000175000001440000000503112654730021016644 00000000000000/* OWFS -- One-Wire filesystem OWHTTPD -- One-Wire Web Server Written 2003 Paul H Alfille email: paul.alfille@gmail.com Released under the GPL See the header file: ow.h for full attribution 1wire/iButton system from Dallas Semiconductor */ /* DS9490R-W USB 1-Wire master USB parameters: Vendor ID: 04FA ProductID: 2490 Dallas controller DS2490 */ #ifndef OW_USB_MSG_H /* tedious wrapper */ #define OW_USB_MSG_H #if OW_USB /* conditional inclusion of USB */ /* All the rest of the code sees is the DS9490_detect routine and the iroutine structure */ GOOD_OR_BAD USB_Control_Msg(BYTE bRequest, UINT wValue, UINT wIndex, const struct parsedname *pn); GOOD_OR_BAD DS9490_open(struct connection_in *in); #define DS9490_getstatus_BUFFER ( 16 ) #define DS9490_getstatus_BUFFER_LENGTH ( DS9490_getstatus_BUFFER * 2 ) RESET_TYPE DS9490_getstatus(BYTE * buffer, int * readlen, const struct parsedname *pn); SIZE_OR_ERROR DS9490_read(BYTE * buf, size_t size, const struct parsedname *pn); SIZE_OR_ERROR DS9490_write(BYTE * buf, size_t size, const struct parsedname *pn); void DS9490_close(struct connection_in *in); void DS9490_port_setup( libusb_device * dev, struct port_in * pin ) ; // Mode Command Code Constants #define ONEWIREDEVICEDETECT 0xA5 #define COMMCMDERRORRESULT_NRS 0x01 #define COMMCMDERRORRESULT_SH 0x02 extern char badUSBname[] ; #define CONTROL_CMD 0x00 #define COMM_CMD 0x01 #define MODE_CMD 0x02 #define TEST_CMD 0x03 #define CTL_RESET_DEVICE 0x0000 #define CTL_START_EXE 0x0001 #define CTL_RESUME_EXE 0x0002 #define CTL_HALT_EXE_IDLE 0x0003 #define CTL_HALT_EXE_DONE 0x0004 #define CTL_FLUSH_COMM_CMDS 0x0007 #define CTL_FLUSH_CV_BUFFER 0x0008 #define CTL_FLUSH_CMT_BUFFER 0x0009 #define CTL_GET_COMM_CMDS 0x000A // Device Status Flags #define STATUSFLAGS_SPUA 0x01 // if set Strong Pull-up is active #define STATUSFLAGS_PRGA 0x02 // if set a 12V programming pulse is being generated #define STATUSFLAGS_12VP 0x04 // if set the external 12V programming voltage is present #define STATUSFLAGS_PMOD 0x08 // if set the DS2490 powered from USB and external sources #define STATUSFLAGS_HALT 0x10 // if set the DS2490 is currently halted #define STATUSFLAGS_IDLE 0x20 // if set the DS2490 is currently idle #endif /* OW_USB */ #endif /* OW_USB_MSG_H */ owfs-3.1p5/module/owlib/src/include/ow_visibility.h0000644000175000001440000000261212654730021017376 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" Written 2003 Paul H Alfille */ #ifndef OW_VISIBILITY_H /* tedious wrapper */ #define OW_VISIBILITY_H #define NO_READ_FUNCTION NULL #define NO_WRITE_FUNCTION NULL enum e_visibility { visible_never, visible_not_now, visible_now, visible_always, } ; enum e_visibility AlwaysVisible( const struct parsedname * pn ) ; #define VISIBLE AlwaysVisible enum e_visibility NeverVisible( const struct parsedname * pn ) ; #define INVISIBLE NeverVisible #define VISIBILE_PRESENT INVISIBLE GOOD_OR_BAD GetVisibilityCache( int * visibility_parameter, const struct parsedname * pn ) ; void SetVisibilityCache( int visibility_parameter, const struct parsedname * pn ) ; enum e_visibility FS_visible( const struct parsedname * pn ) ; #endif /* OW_VISIBILITY_H */ owfs-3.1p5/module/owlib/src/include/ow_w1.h0000644000175000001440000000422112654730021015534 00000000000000/* $Id$ W! Announce -- daemon for showing w1 busmasters using Avahi Written 2008 Paul H Alfille email: paul.alfille@gmail.com Released under the GPLv2 Much thanks to Evgeniy Polyakov */ #if OW_W1 #ifndef OW_W1_H #define OW_W1_H #ifdef HAVE_STDINT_H #include #endif #include "netlink.h" #include "connector.h" #include "w1_netlink.h" // for some local types #include "ow_fd.h" #include "ow_localreturns.h" #include "ow_w1_seq.h" #define W1_NLM_LENGTH 16 #define W1_CN_LENGTH 20 #define W1_W1M_LENGTH 12 #define W1_W1C_LENGTH 4 enum Netlink_Read_Status { nrs_complete = 0 , nrs_bad_send, nrs_nodev, nrs_timeout, nrs_error, } ; struct connection_in ; struct parsedname ; GOOD_OR_BAD w1_bind( struct connection_in * in ) ; void RemoveW1Bus( int bus_master ) ; void AddW1Bus( int bus_master ) ; SEQ_OR_ERROR W1_send_msg( struct connection_in * in, struct w1_netlink_msg *msg, struct w1_netlink_cmd *cmd, const unsigned char * data) ; GOOD_OR_BAD W1PipeSelect_timeout( FILE_DESCRIPTOR_OR_ERROR file_descriptor ) ; void * W1_Dispatch( void * v ) ; SEQ_OR_ERROR w1_list_masters( void ) ; #define MAKE_NL_SEQ( bus, seq ) ((uint32_t)(( ((bus) & 0xFFFF) << 16 ) | ((seq) & 0xFFFF))) #define NL_SEQ( seq ) ((uint32_t)((seq) & 0xFFFF)) #define NL_BUS( seq ) ((uint32_t)(((seq) >> 16 ) & 0xFFFF)) struct netlink_parse { struct nlmsghdr * nlm ; struct cn_msg * cn ; struct w1_netlink_msg * w1m ; struct w1_netlink_cmd * w1c ; unsigned char * data ; int data_size ; __u8 follow[0] ; } ; //void * w1_master_command(struct netlink_parse * nlp) ; void * w1_master_command(void * v) ; void w1_parse_master_list(struct netlink_parse * nlp); GOOD_OR_BAD Netlink_Parse_Get( struct netlink_parse * nlp ) ; GOOD_OR_BAD Netlink_Parse_Buffer( struct netlink_parse * nlp ) ; void Netlink_Print( struct nlmsghdr * nlm, struct cn_msg * cn, struct w1_netlink_msg * w1m, struct w1_netlink_cmd * w1c, unsigned char * data, int length ) ; enum Netlink_Read_Status W1_Process_Response( void (* nrs_callback)( struct netlink_parse * nlp, void *v, const struct parsedname * pn), SEQ_OR_ERROR seq, void * v, const struct parsedname * pn ) ; #endif /* OW_W1_H */ #endif /* OW_W1 */ owfs-3.1p5/module/owlib/src/include/ow_w1_seq.h0000644000175000001440000000117712654730021016413 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 LICENSE (As of version 2.5p4 2-Oct-2006) owlib: GPL v2 owfs, owhttpd, owftpd, owserver: GPL v2 owshell(owdir owread owwrite owpresent): GPL v2 owcapi (libowcapi): GPL v2 owperl: GPL v2 owtcl: LGPL v2 owphp: GPL v2 owpython: GPL v2 owsim.tcl: GPL v2 where GPL v2 is the "Gnu General License version 2" and "LGPL v2" is the "Lesser Gnu General License version 2" */ #ifndef OW_W1_SEQ_H /* tedious wrapper */ #define OW_W1_SEQ_H typedef int SEQ_OR_ERROR ; #define SEQ_BAD -1 #define SEQ_INIT 0 #endif /* OW_W1_SEQ_H */ owfs-3.1p5/module/owlib/src/include/rwlock.h0000644000175000001440000001640612654730021016011 00000000000000/* From Paul Alfille */ /* Implementation of Reader/Writer locks using semaphores and mutexes */ /* Note, these are relatively light-weight rwlocks, only solve writer starvation and no timeout or queued wakeup */ #ifndef RWLOCK_H #define RWLOCK_H #include "ow_stateinfo.h" #include "ow_debug.h" // debug_crash() #include #if PTHREAD_RWLOCK typedef pthread_rwlock_t my_rwlock_t; #else #include "sem.h" typedef struct { pthread_mutex_t protect_reader_count; int reader_count; sem_t allow_readers; sem_t no_processes; } my_rwlock_t; #endif #ifndef EXTENDED_RWLOCK_DEBUG void my_rwlock_init(my_rwlock_t * rwlock); void my_rwlock_destroy(my_rwlock_t * rwlock); int my_rwlock_write_lock(my_rwlock_t * rwlock); int my_rwlock_write_unlock(my_rwlock_t * rwlock); int my_rwlock_read_lock(my_rwlock_t * rwlock); int my_rwlock_read_unlock(my_rwlock_t * rwlock); #endif /* EXTENDED_RWLOCK_DEBUG */ #if PTHREAD_RWLOCK #ifdef EXTENDED_RWLOCK_DEBUG #define my_rwlock_init(rwlock) \ { \ int semrc; \ semrc = pthread_rwlock_init(rwlock, NULL); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ } #define my_rwlock_destroy(rwlock) \ { \ int semrc; \ semrc = pthread_rwlock_destroy(rwlock); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ } #define my_rwlock_write_lock(rwlock) \ { \ int semrc; \ semrc = pthread_rwlock_wrlock(rwlock); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ } #define my_rwlock_write_unlock(rwlock) \ { \ int semrc; \ semrc = pthread_rwlock_unlock(rwlock); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ } #define my_rwlock_read_lock(rwlock) \ { \ int semrc; \ semrc = pthread_rwlock_rdlock(rwlock); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ } #define my_rwlock_read_unlock(rwlock) \ { \ int semrc; \ semrc = pthread_rwlock_unlock(rwlock); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ } #endif /* EXTENDED_RWLOCK_DEBUG */ #else /* PTHREAD_RWLOCK */ /* rwlock-implementation with semaphores */ #ifdef EXTENDED_RWLOCK_DEBUG /* Don't use the builtin rwlock-support in pthread */ #define my_rwlock_init(rwlock) \ { \ int semrc = 0; \ memset((rwlock), 0, sizeof(my_rwlock_t)); \ _MUTEX_INIT((rwlock)->protect_reader_count); \ semrc |= sem_init(&((rwlock)->allow_readers), 0, 1); \ if(semrc != 0) { \ LEVEL_DEFAULT("rc=%d [%s]", semrc, strerror(errno)); \ debug_crash(); \ } \ semrc |= sem_init(&((rwlock)->no_processes), 0, 1); \ if(semrc != 0) { \ LEVEL_DEFAULT("rc=%d [%s]", semrc, strerror(errno)); \ debug_crash(); \ } \ (rwlock)->reader_count = 0; \ } #define my_rwlock_destroy(rwlock) \ { \ int semrc = 0; \ _MUTEX_DESTROY((rwlock)->protect_reader_count); \ semrc |= sem_destroy(&((rwlock)->allow_readers)); \ if(semrc != 0) { \ LEVEL_DEFAULT("rc=%d [%s]", semrc, strerror(errno)); \ debug_crash(); \ } \ semrc |= sem_destroy(&((rwlock)->no_processes)); \ if(semrc != 0) { \ LEVEL_DEFAULT("rc=%d [%s]", semrc, strerror(errno)); \ debug_crash(); \ } \ memset((rwlock), 0, sizeof(my_rwlock_t)); \ } #define my_rwlock_write_lock(rwlock) \ { \ int sval, semrc; \ semrc = sem_wait(&((rwlock)->allow_readers)); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ if((sem_getvalue(&((rwlock)->allow_readers), &sval) < 0) || (sval != 0)) { \ LEVEL_DEFAULT("sval=%d\n", sval); \ debug_crash(); \ } \ semrc = sem_wait(&((rwlock)->no_processes)); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ if((sem_getvalue(&((rwlock)->no_processes), &sval) < 0) || (sval != 0)) { \ LEVEL_DEFAULT("sval=%d\n", sval); \ debug_crash(); \ } \ } #define my_rwlock_write_unlock(rwlock) \ { \ int sval, semrc; \ if((sem_getvalue(&((rwlock)->allow_readers), &sval) < 0) || (sval != 0)) { \ LEVEL_DEFAULT("sval=%d != 0\n", sval); \ debug_crash(); \ } \ semrc = sem_post(&((rwlock)->allow_readers)); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ if((sem_getvalue(&((rwlock)->no_processes), &sval) < 0) || (sval != 0)) { \ LEVEL_DEFAULT("sval=%d != 0\n", sval); \ debug_crash(); \ } \ semrc = sem_post(&((rwlock)->no_processes)); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ } #define my_rwlock_read_lock(rwlock) \ { \ int semrc; \ semrc = sem_wait(&((rwlock)->allow_readers)); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ my_pthread_mutex_lock(&((rwlock)->protect_reader_count)); \ if (++((rwlock)->reader_count) == 1) { \ sem_wait(&((rwlock)->no_processes)); \ } \ my_pthread_mutex_unlock(&((rwlock)->protect_reader_count)); \ semrc = sem_post(&((rwlock)->allow_readers)); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ } #define my_rwlock_read_unlock(rwlock) \ { \ int semrc; \ my_pthread_mutex_lock(&((rwlock)->protect_reader_count)); \ if ((rwlock)->reader_count <= 0) { \ LEVEL_DEFAULT("count<=0 %d\n", (rwlock)->reader_count); \ debug_crash(); \ } \ if (--((rwlock)->reader_count) == 0) { \ semrc = sem_post(&((rwlock)->no_processes)); \ if(semrc != 0) { \ LEVEL_DEFAULT("semrc=%d [%s]\n", semrc, strerror(errno)); \ debug_crash(); \ } \ } \ my_pthread_mutex_unlock(&((rwlock)->protect_reader_count)); \ } #endif /* EXTENDED_RWLOCK_DEBUG */ #endif /* PTHREAD_RWLOCK */ #endif /* RWLOCK */ owfs-3.1p5/module/owlib/src/include/netlink.h0000644000175000001440000001715612654730021016157 00000000000000#ifndef __LINUX_NETLINK_H #define __LINUX_NETLINK_H #include /* for sa_family_t */ #include #define NETLINK_ROUTE 0 /* Routing/device hook */ #define NETLINK_UNUSED 1 /* Unused number */ #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ #define NETLINK_FIREWALL 3 /* Firewalling hook */ #define NETLINK_INET_DIAG 4 /* INET socket monitoring */ #define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ #define NETLINK_XFRM 6 /* ipsec */ #define NETLINK_SELINUX 7 /* SELinux event notifications */ #define NETLINK_ISCSI 8 /* Open-iSCSI */ #define NETLINK_AUDIT 9 /* auditing */ #define NETLINK_FIB_LOOKUP 10 #define NETLINK_CONNECTOR 11 #define NETLINK_NETFILTER 12 /* netfilter subsystem */ #define NETLINK_IP6_FW 13 #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ #define NETLINK_GENERIC 16 #define MAX_LINKS 32 struct sockaddr_nl { sa_family_t nl_family; /* AF_NETLINK */ unsigned short nl_pad; /* zero */ uint32_t nl_pid; /* process pid */ uint32_t nl_groups; /* multicast groups mask */ }; #pragma pack(push) /* push current alignment to stack */ #pragma pack(1) /* set alignment to 1 byte boundary */ struct nlmsghdr { uint32_t nlmsg_len; /* Length of message including header */ uint16_t nlmsg_type; /* Message content */ uint16_t nlmsg_flags; /* Additional flags */ uint32_t nlmsg_seq; /* Sequence number */ uint32_t nlmsg_pid; /* Sending process PID */ }; #pragma pack(pop) /* restore original alignment from stack */ /* Flags values */ #define NLM_F_REQUEST 1 /* It is request message. */ #define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */ #define NLM_F_ACK 4 /* Reply with ack, with zero or error code */ #define NLM_F_ECHO 8 /* Echo this request */ /* Modifiers to GET request */ #define NLM_F_ROOT 0x100 /* specify tree root */ #define NLM_F_MATCH 0x200 /* return all matching */ #define NLM_F_ATOMIC 0x400 /* atomic GET */ #define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH) /* Modifiers to NEW request */ #define NLM_F_REPLACE 0x100 /* Override existing */ #define NLM_F_EXCL 0x200 /* Do not touch, if it exists */ #define NLM_F_CREATE 0x400 /* Create, if it does not exist */ #define NLM_F_APPEND 0x800 /* Add to end of list */ /* 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL 4.4BSD CHANGE NLM_F_REPLACE True CHANGE NLM_F_CREATE|NLM_F_REPLACE Append NLM_F_CREATE Check NLM_F_EXCL */ #define NLMSG_ALIGNTO 4 #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN)) #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \ (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ (nlh)->nlmsg_len <= (len)) #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) #define NLMSG_NOOP 0x1 /* Nothing. */ #define NLMSG_ERROR 0x2 /* Error */ #define NLMSG_DONE 0x3 /* End of a dump */ #define NLMSG_OVERRUN 0x4 /* Data lost */ #define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */ struct nlmsgerr { int error; struct nlmsghdr msg; }; #define NETLINK_ADD_MEMBERSHIP 1 #define NETLINK_DROP_MEMBERSHIP 2 #define NETLINK_PKTINFO 3 struct nl_pktinfo { uint32_t group; }; #define NET_MAJOR 36 /* Major 36 is reserved for networking */ enum { NETLINK_UNCONNECTED = 0, NETLINK_CONNECTED, }; /* * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)--> * +---------------------+- - -+- - - - - - - - - -+- - -+ * | Header | Pad | Payload | Pad | * | (struct nlattr) | ing | | ing | * +---------------------+- - -+- - - - - - - - - -+- - -+ * <-------------- nlattr->nla_len --------------> */ struct nlattr { uint16_t nla_len; uint16_t nla_type; }; #define NLA_ALIGNTO 4 #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr))) #ifdef __KERNEL__ #include #include struct netlink_skb_parms { struct ucred creds; /* Skb credentials */ uint32_t pid; uint32_t dst_pid; uint32_t dst_group; kernel_cap_t eff_cap; uint32_t loginuid; /* Login (audit) uid */ uint32_t sid; /* SELinux security id */ }; #define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); extern int netlink_has_listeners(struct sock *sk, unsigned int group); extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, uint32_t pid, int nonblock); extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, uint32_t pid, uint32_t group, gfp_t allocation); extern void netlink_set_err(struct sock *ssk, uint32_t pid, uint32_t group, int code); extern int netlink_register_notifier(struct notifier_block *nb); extern int netlink_unregister_notifier(struct notifier_block *nb); /* finegrained unicast helpers: */ struct sock *netlink_getsockbyfilp(struct file *filp); int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo, struct sock *ssk); void netlink_detachskb(struct sock *sk, struct sk_buff *skb); int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); /* * skb should fit one page. This choice is good for headerless malloc. */ #define NLMSG_GOODORDER 0 #define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER)) struct netlink_callback { struct sk_buff *skb; struct nlmsghdr *nlh; int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); int (*done)(struct netlink_callback *cb); int family; long args[5]; }; struct netlink_notify { int pid; int protocol; }; static __inline__ struct nlmsghdr * __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) { struct nlmsghdr *nlh; int size = NLMSG_LENGTH(len); nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); nlh->nlmsg_type = type; nlh->nlmsg_len = size; nlh->nlmsg_flags = flags; nlh->nlmsg_pid = pid; nlh->nlmsg_seq = seq; memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size); return nlh; } #define NLMSG_NEW(skb, pid, seq, type, len, flags) \ ({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) \ goto nlmsg_failure; \ __nlmsg_put(skb, pid, seq, type, len, flags); }) #define NLMSG_PUT(skb, pid, seq, type, len) \ NLMSG_NEW(skb, pid, seq, type, len, 0) #define NLMSG_NEW_ANSWER(skb, cb, type, len, flags) \ NLMSG_NEW(skb, NETLINK_CB((cb)->skb).pid, \ (cb)->nlh->nlmsg_seq, type, len, flags) #define NLMSG_END(skb, nlh) \ ({ (nlh)->nlmsg_len = (skb)->tail - (unsigned char *) (nlh); \ (skb)->len; }) #define NLMSG_CANCEL(skb, nlh) \ ({ skb_trim(skb, (unsigned char *) (nlh) - (skb)->data); \ -1; }) extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, struct nlmsghdr *nlh, int (*dump)(struct sk_buff *skb, struct netlink_callback*), int (*done)(struct netlink_callback*)); #define NL_NONROOT_RECV 0x1 #define NL_NONROOT_SEND 0x2 extern void netlink_set_nonroot(int protocol, unsigned flag); #endif /* __KERNEL__ */ #endif /* __LINUX_NETLINK_H */ owfs-3.1p5/module/owlib/src/include/w1_netlink.h0000644000175000001440000000347412654730021016564 00000000000000/* $Id$ Much thanks to Evgeniy Polyakov This file itself is a snapshop version of netlink.h by Evgeniy Polyakov */ /* * w1_netlink.h * * Copyright (c) 2003 Evgeniy Polyakov * * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __W1_NETLINK_H #define __W1_NETLINK_H //#include #ifndef CN_W1_IDX #define CN_W1_IDX 4 #define CN_W1_VAL 1 #endif #pragma pack(push) /* push current alignment to stack */ #pragma pack(1) /* set alignment to 1 byte boundary */ enum w1_netlink_message_types { W1_SLAVE_ADD = 0, W1_SLAVE_REMOVE, W1_MASTER_ADD, W1_MASTER_REMOVE, W1_MASTER_CMD, W1_SLAVE_CMD, W1_LIST_MASTERS, }; struct w1_netlink_msg { __u8 type; __u8 status; __u16 len; union { __u8 id[8]; struct w1_mst { __u32 id; __u32 res; } mst; } id; __u8 data[0]; }; enum w1_commands { W1_CMD_READ = 0 , W1_CMD_WRITE , W1_CMD_SEARCH, W1_CMD_ALARM_SEARCH, W1_CMD_TOUCH, W1_CMD_RESET, W1_CMD_MAX, } ; struct w1_netlink_cmd { __u8 cmd; __u8 res; __u16 len; __u8 data[0]; }; #pragma pack(pop) /* restore original alignment from stack */ #endif /* __W1_NETLINK_H */ owfs-3.1p5/module/owlib/src/include/sem.h0000644000175000001440000000330112654730021015262 00000000000000/* From Geo Carncross geocar@internetconnection.net -- GPL */ /* File for incomplete semaphore implementations */ /* Note: gcc wants inline before int */ #ifndef __semaphore_h #define __semaphore_h #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1050 /* Newer OSX deprecates semaphore */ #undef HAVE_SEMAPHORE_H #endif #ifdef HAVE_SEMAPHORE_H #include #else /* HAVE_SEMAPHORE_H */ #include #include typedef struct { pthread_mutex_t m; pthread_cond_t c; volatile unsigned int v, w; } sem_t; static inline int sem_destroy(sem_t * s) { pthread_mutex_lock(&s->m); if (s->w) { pthread_mutex_unlock(&s->m); errno = EBUSY; return -1; } pthread_cond_destroy(&s->c); pthread_mutex_unlock(&s->m); pthread_mutex_destroy(&s->m); return 0; } static inline int sem_init(sem_t * s, int ign, int val) { if (ign != 0) { errno = ENOSYS; return -1; } if (pthread_mutex_init(&s->m, NULL) != 0) { return -1; } if (pthread_cond_init(&s->c, NULL) != 0) { return -1; } s->v = val; s->w = 0; return 0; } static inline int sem_post(sem_t * s) { int ok = -1 ; if (pthread_mutex_lock(&s->m) == -1) { return -1; } s->v++; if (s->w == 1) { ok = pthread_cond_signal(&s->c); } else if (s->w > 1) ok = pthread_cond_broadcast(&s->c); } pthread_mutex_unlock(&s->m); return ok; } static inline int sem_wait(sem_t * s) { int ok = 0; if (pthread_mutex_lock(&s->m) == -1) { return -1; } while (s->v == 0) { s->w++; if (pthread_cond_wait(&s->c, &s->m) == -1) { ok = -1; break; } s->w--; } s->v--; pthread_mutex_unlock(&s->m); return ok; } #endif /* HAVE_SEMAPHORE_H */ #endif /* __semaphore_h */ owfs-3.1p5/module/owlib/src/include/sd-daemon.h0000644000175000001440000002562412654730021016361 00000000000000/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ #ifndef foosddaemonhfoo #define foosddaemonhfoo /*** Copyright 2010 Lennart Poettering 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ***/ #include #include #ifdef __cplusplus extern "C" { #endif /* Reference implementation of a few systemd related interfaces for writing daemons. These interfaces are trivial to implement. To simplify porting we provide this reference implementation. Applications are welcome to reimplement the algorithms described here if they do not want to include these two source files. The following functionality is provided: - Support for logging with log levels on stderr - File descriptor passing for socket-based activation - Daemon startup and status notification - Detection of systemd boots You may compile this with -DDISABLE_SYSTEMD to disable systemd support. This makes all those calls NOPs that are directly related to systemd (i.e. only sd_is_xxx() will stay useful). Since this is drop-in code we don't want any of our symbols to be exported in any case. Hence we declare hidden visibility for all of them. You may find an up-to-date version of these source files online: http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c This should compile on non-Linux systems, too, but with the exception of the sd_is_xxx() calls all functions will become NOPs. See sd-daemon(3) for more information. */ #ifndef _sd_printf_attr_ # if __GNUC__ >= 4 # define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) # else # define _sd_printf_attr_(a,b) # endif #endif /* Log levels for usage on stderr: fprintf(stderr, SD_NOTICE "Hello World!\n"); This is similar to printk() usage in the kernel. */ #define SD_EMERG "<0>" /* system is unusable */ #define SD_ALERT "<1>" /* action must be taken immediately */ #define SD_CRIT "<2>" /* critical conditions */ #define SD_ERR "<3>" /* error conditions */ #define SD_WARNING "<4>" /* warning conditions */ #define SD_NOTICE "<5>" /* normal but significant condition */ #define SD_INFO "<6>" /* informational */ #define SD_DEBUG "<7>" /* debug-level messages */ /* The first passed file descriptor is fd 3 */ #define SD_LISTEN_FDS_START 3 /* Returns how many file descriptors have been passed, or a negative errno code on failure. Optionally, removes the $LISTEN_FDS and $LISTEN_PID file descriptors from the environment (recommended, but problematic in threaded environments). If r is the return value of this function you'll find the file descriptors passed as fds SD_LISTEN_FDS_START to SD_LISTEN_FDS_START+r-1. Returns a negative errno style error code on failure. This function call ensures that the FD_CLOEXEC flag is set for the passed file descriptors, to make sure they are not passed on to child processes. If FD_CLOEXEC shall not be set, the caller needs to unset it after this call for all file descriptors that are used. See sd_listen_fds(3) for more information. */ int sd_listen_fds(int unset_environment); /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is a FIFO in the file system stored under the specified path, 0 otherwise. If path is NULL a path name check will not be done and the call only verifies if the file descriptor refers to a FIFO. Returns a negative errno style error code on failure. See sd_is_fifo(3) for more information. */ int sd_is_fifo(int fd, const char *path); /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is a special character device on the file system stored under the specified path, 0 otherwise. If path is NULL a path name check will not be done and the call only verifies if the file descriptor refers to a special character. Returns a negative errno style error code on failure. See sd_is_special(3) for more information. */ int sd_is_special(int fd, const char *path); /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is a socket of the specified family (AF_INET, ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If family is 0 a socket family check will not be done. If type is 0 a socket type check will not be done and the call only verifies if the file descriptor refers to a socket. If listening is > 0 it is verified that the socket is in listening mode. (i.e. listen() has been called) If listening is == 0 it is verified that the socket is not in listening mode. If listening is < 0 no listening mode check is done. Returns a negative errno style error code on failure. See sd_is_socket(3) for more information. */ int sd_is_socket(int fd, int family, int type, int listening); /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is an Internet socket, of the specified family (either AF_INET or AF_INET6) and the specified type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If version is 0 a protocol version check is not done. If type is 0 a socket type check will not be done. If port is 0 a socket port check will not be done. The listening flag is used the same way as in sd_is_socket(). Returns a negative errno style error code on failure. See sd_is_socket_inet(3) for more information. */ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is an AF_UNIX socket of the specified type (SOCK_DGRAM, SOCK_STREAM, ...) and path, 0 otherwise. If type is 0 a socket type check will not be done. If path is NULL a socket path check will not be done. For normal AF_UNIX sockets set length to 0. For abstract namespace sockets set length to the length of the socket name (including the initial 0 byte), and pass the full socket path in path (including the initial 0 byte). The listening flag is used the same way as in sd_is_socket(). Returns a negative errno style error code on failure. See sd_is_socket_unix(3) for more information. */ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is a POSIX Message Queue of the specified name, 0 otherwise. If path is NULL a message queue name check is not done. Returns a negative errno style error code on failure. */ int sd_is_mq(int fd, const char *path); /* Informs systemd about changed daemon state. This takes a number of newline separated environment-style variable assignments in a string. The following variables are known: READY=1 Tells systemd that daemon startup is finished (only relevant for services of Type=notify). The passed argument is a boolean "1" or "0". Since there is little value in signaling non-readiness the only value daemons should send is "READY=1". STATUS=... Passes a single-line status string back to systemd that describes the daemon state. This is free-from and can be used for various purposes: general state feedback, fsck-like programs could pass completion percentages and failing programs could pass a human readable error message. Example: "STATUS=Completed 66% of file system check..." ERRNO=... If a daemon fails, the errno-style error code, formatted as string. Example: "ERRNO=2" for ENOENT. BUSERROR=... If a daemon fails, the D-Bus error-style error code. Example: "BUSERROR=org.freedesktop.DBus.Error.TimedOut" MAINPID=... The main pid of a daemon, in case systemd did not fork off the process itself. Example: "MAINPID=4711" WATCHDOG=1 Tells systemd to update the watchdog timestamp. Services using this feature should do this in regular intervals. A watchdog framework can use the timestamps to detect failed services. Daemons can choose to send additional variables. However, it is recommended to prefix variable names not listed above with X_. Returns a negative errno-style error code on failure. Returns > 0 if systemd could be notified, 0 if it couldn't possibly because systemd is not running. Example: When a daemon finished starting up, it could issue this call to notify systemd about it: sd_notify(0, "READY=1"); See sd_notifyf() for more complete examples. See sd_notify(3) for more information. */ int sd_notify(int unset_environment, const char *state); /* Similar to sd_notify() but takes a format string. Example 1: A daemon could send the following after initialization: sd_notifyf(0, "READY=1\n" "STATUS=Processing requests...\n" "MAINPID=%lu", (unsigned long) getpid()); Example 2: A daemon could send the following shortly before exiting, on failure: sd_notifyf(0, "STATUS=Failed to start up: %s\n" "ERRNO=%i", strerror(errno), errno); See sd_notifyf(3) for more information. */ int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3); /* Returns > 0 if the system was booted with systemd. Returns < 0 on error. Returns 0 if the system was not booted with systemd. Note that all of the functions above handle non-systemd boots just fine. You should NOT protect them with a call to this function. Also note that this function checks whether the system, not the user session is controlled by systemd. However the functions above work for both user and system services. See sd_booted(3) for more information. */ int sd_booted(void); #ifdef __cplusplus } #endif #endif owfs-3.1p5/module/owlib/src/include/telnet.h0000644000175000001440000001334612654730021016003 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 */ #ifndef OW_TELNET_H /* tedious wrapper */ #define OW_TELNET_H // Defnitions for telnet protocol // Mostly lifted from arpa/telnet.h // Added RFC2217 COM PORT CONTROL /* * Definitions for the TELNET protocol. */ // added TELNET_ prefix #define TELNET_IAC 255 /* interpret as command: */ #define TELNET_DONT 254 /* you are not to use option */ #define TELNET_DO 253 /* please, you use option */ #define TELNET_WONT 252 /* I won't use option */ #define TELNET_WILL 251 /* I will use option */ #define TELNET_SB 250 /* interpret as subnegotiation */ #define TELNET_GA 249 /* you may reverse the line */ #define TELNET_EL 248 /* erase the current line */ #define TELNET_EC 247 /* erase the current character */ #define TELNET_AYT 246 /* are you there */ #define TELNET_AO 245 /* abort output--but let prog finish */ #define TELNET_IP 244 /* interrupt process--permanently */ #define TELNET_BREAK 243 /* break */ #define TELNET_DM 242 /* data mark--for connect. cleaning */ #define TELNET_NOP 241 /* nop */ #define TELNET_SE 240 /* end sub negotiation */ #define TELNET_EOR 239 /* end of record (transparent mode) */ #define TELNET_ABORT 238 /* Abort process */ #define TELNET_SUSP 237 /* Suspend process */ #define TELNET_EOF 236 /* End of file: EOF is already used... */ #define TELNET_SYNCH 242 /* for telfunc calls */ /* telnet options */ #define TELOPT_BINARY 0 /* 8-bit data path */ #define TELOPT_ECHO 1 /* echo */ #define TELOPT_RCP 2 /* prepare to reconnect */ #define TELOPT_SGA 3 /* suppress go ahead */ #define TELOPT_NAMS 4 /* approximate message size */ #define TELOPT_STATUS 5 /* give status */ #define TELOPT_TM 6 /* timing mark */ #define TELOPT_RCTE 7 /* remote controlled transmission and echo */ #define TELOPT_NAOL 8 /* negotiate about output line width */ #define TELOPT_NAOP 9 /* negotiate about output page size */ #define TELOPT_NAOCRD 10 /* negotiate about CR disposition */ #define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */ #define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */ #define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */ #define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */ #define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */ #define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */ #define TELOPT_XASCII 17 /* extended ascii character set */ #define TELOPT_LOGOUT 18 /* force logout */ #define TELOPT_BM 19 /* byte macro */ #define TELOPT_DET 20 /* data entry terminal */ #define TELOPT_SUPDUP 21 /* supdup protocol */ #define TELOPT_SUPDUPOUTPUT 22 /* supdup output */ #define TELOPT_SNDLOC 23 /* send location */ #define TELOPT_TTYPE 24 /* terminal type */ #define TELOPT_EOR 25 /* end or record */ #define TELOPT_TUID 26 /* TACACS user identification */ #define TELOPT_OUTMRK 27 /* output marking */ #define TELOPT_TTYLOC 28 /* terminal location number */ #define TELOPT_3270REGIME 29 /* 3270 regime */ #define TELOPT_X3PAD 30 /* X.3 PAD */ #define TELOPT_NAWS 31 /* window size */ #define TELOPT_TSPEED 32 /* terminal speed */ #define TELOPT_LFLOW 33 /* remote flow control */ #define TELOPT_LINEMODE 34 /* Linemode option */ #define TELOPT_XDISPLOC 35 /* X Display Location */ #define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */ #define TELOPT_AUTHENTICATION 37/* Authenticate */ #define TELOPT_ENCRYPT 38 /* Encryption option */ #define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */ // Add RFC2217 serial port setup #define TELOPT_COM_PORT 44 /* RFC 2217 Com port control */ #define TELOPT_EXOPL 255 /* extended-options-list */ // From RFC2217 Options #define COMOPT_BAUDRATE 1 #define COMOPT_DATASIZE 2 #define COMOPT_PARITY 3 #define COMOPT_STOPSIZE 4 #define COMOPT_CONTROL 5 #define COMOPT_LINESTATE 6 #define COMOPT_MODEMSTATE 7 #define COMOPT_SUSPEND 8 #define COMOPT_RESUME 9 #define COMOPT_LINEMASK 10 #define COMOPT_MODEMMASK 11 #define COMOPT_PURGE 12 /* sub-option qualifiers */ #define TELQUAL_IS 0 /* option is... */ #define TELQUAL_SEND 1 /* send option */ #define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */ #define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */ #define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */ #define LFLOW_OFF 0 /* Disable remote flow control */ #define LFLOW_ON 1 /* Enable remote flow control */ #define LFLOW_RESTART_ANY 2 /* Restart output on any char */ #define LFLOW_RESTART_XON 3 /* Restart output only on XON */ /* * LINEMODE suboptions */ #define LM_MODE 1 #define LM_FORWARDMASK 2 #define LM_SLC 3 #define MODE_EDIT 0x01 #define MODE_TRAPSIG 0x02 #define MODE_ACK 0x04 #define MODE_SOFT_TAB 0x08 #define MODE_LIT_ECHO 0x10 #define MODE_MASK 0x1f /* Not part of protocol, but needed to simplify things... */ #define MODE_FLOW 0x0100 #define MODE_ECHO 0x0200 #define MODE_INBIN 0x0400 #define MODE_OUTBIN 0x0800 #define MODE_FORCE 0x1000 #define SLC_SYNCH 1 #define SLC_BRK 2 #define SLC_IP 3 #define SLC_AO 4 #define SLC_AYT 5 #define SLC_EOR 6 #define SLC_ABORT 7 #define SLC_EOF 8 #define SLC_SUSP 9 #define SLC_EC 10 #define SLC_EL 11 #define SLC_EW 12 #define SLC_RP 13 #define SLC_LNEXT 14 #define SLC_XON 15 #define SLC_XOFF 16 #define SLC_FORW1 17 #define SLC_FORW2 18 #define NSLC 18 #define SLC_NOSUPPORT 0 #define SLC_CANTCHANGE 1 #define SLC_VARIABLE 2 #define SLC_DEFAULT 3 #define SLC_LEVELBITS 0x03 #define SLC_FUNC 0 #define SLC_FLAGS 1 #define SLC_VALUE 2 #define SLC_ACK 0x80 #define SLC_FLUSHIN 0x40 #define SLC_FLUSHOUT 0x20 #define OLD_ENV_VAR 1 #define OLD_ENV_VALUE 0 #define NEW_ENV_VAR 0 #define NEW_ENV_VALUE 1 #define ENV_ESC 2 #define ENV_USERVAR 3 #endif /* OW_TELNET_H */ owfs-3.1p5/module/owlib/src/include/Makefile.in0000644000175000001440000005367213022537052016411 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owlib/src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 HEADERS = $(noinst_HEADERS) 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)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = \ compat_getopt.h \ compat.h \ i2c-dev.h \ compat_netdb.h \ connector.h \ jsmn.h \ libusb.h \ ow.h \ ownet.h \ ow_1820.h \ ow_1821.h \ ow_1921.h \ ow_1923.h \ ow_1954.h \ ow_1963.h \ ow_1977.h \ ow_1991.h \ ow_1993.h \ ow_2401.h \ ow_2404.h \ ow_2405.h \ ow_2406.h \ ow_2408.h \ ow_2409.h \ ow_2413.h \ ow_2415.h \ ow_2423.h \ ow_2430.h \ ow_2433.h \ ow_2436.h \ ow_2438.h \ ow_2450.h \ ow_2502.h \ ow_2505.h \ ow_2760.h \ ow_2804.h \ ow_2810.h \ ow_2890.h \ ow_alloc.h \ ow_arg.h \ ow_avahi.h \ ow_bae.h \ ow_bitfield.h \ ow_bitwork.h \ ow_busnumber.h \ ow_bus_routines.h \ ow_cache.h \ ow_charblob.h \ ow_cmciel.h \ ow_codes.h \ ow_communication.h \ ow_connection.h \ ow_connection_in.h \ ow_connection_out.h\ ow_counters.h \ ow_debug.h \ ow_detail.h \ ow_detect.h \ ow_device.h \ ow_devices.h \ ow_dirblob.h \ ow_dl.h \ ow_dnssd.h \ ow_eds.h \ ow_eeef.h \ ow_example_slave.h \ ow_exec.h \ ow_external.h \ ow_fd.h \ ow_filetype.h \ ow_ftdi.h \ ow_functions.h \ ow_generic_read.h \ ow_generic_write.h \ ow_global.h \ ow_inotify.h \ ow_integer.h \ ow_interface.h \ ow_kevent.h \ ow_launchd.h \ ow_localtypes.h \ ow_localreturns.h \ ow_lcd.h \ ow_master.h \ ow_memblob.h \ ow_message.h \ ow_mutex.h \ ow_mutexes.h \ ow_none.h \ ow_onewirequery.h \ ow_opt.h \ ow_parse_address.h \ ow_parsedname.h \ ow_parse_sn.h \ ow_pid.h \ ow_port_in.h \ ow_pressure.h \ ow_programs.h \ ow_regex.h \ ow_reset.h \ ow_return_code.h \ ow_settings.h \ ow_search.h \ ow_sibling.h \ ow_simultaneous.h \ ow_standard.h \ ow_stateinfo.h \ ow_stats.h \ ow_stub.h \ ow_system.h \ ow_temperature.h \ ow_thermocouple.h \ ow_timer.h \ ow_traffic.h \ ow_transaction.h \ ow_usb_cycle.h \ ow_usb_msg.h \ ow_visibility.h \ ow_w1.h \ ow_w1_seq.h \ rwlock.h \ netlink.h \ w1_netlink.h \ sem.h \ sd-daemon.h \ telnet.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) --foreign module/owlib/src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owlib/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(HEADERS) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am 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-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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool 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-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags 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: owfs-3.1p5/module/owlib/tests/0000755000175000001440000000000013022537103013334 500000000000000owfs-3.1p5/module/owlib/tests/Makefile.am0000644000175000001440000000065512711737666015342 00000000000000#if HAVE_CHECK # Each check_xxx.c file must be added to OWLIB_CHECK_SOURCES # and must also be called from owlib_test.c OWLIB_CHECK_SOURCES = check_ow_parseinput.c # Main entrypoint is owlib_test. TESTS=owlib_test check_PROGRAMS = owlib_test owlib_test_SOURCES = owlib_test.c ow_testhelper.c ${OWLIB_CHECK_SOURCES} owlib_test_CFLAGS = -I../src/include @CHECK_CFLAGS@ owlib_test_LDADD = ../src/c/libow.la @CHECK_LIBS@ #endif owfs-3.1p5/module/owlib/tests/Makefile.in0000644000175000001440000012401213022537052015324 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ #if HAVE_CHECK 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ TESTS = owlib_test$(EXEEXT) check_PROGRAMS = owlib_test$(EXEEXT) subdir = module/owlib/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__objects_1 = owlib_test-check_ow_parseinput.$(OBJEXT) am_owlib_test_OBJECTS = owlib_test-owlib_test.$(OBJEXT) \ owlib_test-ow_testhelper.$(OBJEXT) $(am__objects_1) owlib_test_OBJECTS = $(am_owlib_test_OBJECTS) owlib_test_DEPENDENCIES = ../src/c/libow.la 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 = owlib_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(owlib_test_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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(owlib_test_SOURCES) DIST_SOURCES = $(owlib_test_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__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/src/scripts/install/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) \ $(top_srcdir)/src/scripts/install/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs \ $(top_srcdir)/src/scripts/install/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Each check_xxx.c file must be added to OWLIB_CHECK_SOURCES # and must also be called from owlib_test.c OWLIB_CHECK_SOURCES = check_ow_parseinput.c owlib_test_SOURCES = owlib_test.c ow_testhelper.c ${OWLIB_CHECK_SOURCES} owlib_test_CFLAGS = -I../src/include @CHECK_CFLAGS@ owlib_test_LDADD = ../src/c/libow.la @CHECK_LIBS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(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) --foreign module/owlib/tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owlib/tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list owlib_test$(EXEEXT): $(owlib_test_OBJECTS) $(owlib_test_DEPENDENCIES) $(EXTRA_owlib_test_DEPENDENCIES) @rm -f owlib_test$(EXEEXT) $(AM_V_CCLD)$(owlib_test_LINK) $(owlib_test_OBJECTS) $(owlib_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owlib_test-check_ow_parseinput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owlib_test-ow_testhelper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owlib_test-owlib_test.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< owlib_test-owlib_test.o: owlib_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(owlib_test_CFLAGS) $(CFLAGS) -MT owlib_test-owlib_test.o -MD -MP -MF $(DEPDIR)/owlib_test-owlib_test.Tpo -c -o owlib_test-owlib_test.o `test -f 'owlib_test.c' || echo '$(srcdir)/'`owlib_test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/owlib_test-owlib_test.Tpo $(DEPDIR)/owlib_test-owlib_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='owlib_test.c' object='owlib_test-owlib_test.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) $(owlib_test_CFLAGS) $(CFLAGS) -c -o owlib_test-owlib_test.o `test -f 'owlib_test.c' || echo '$(srcdir)/'`owlib_test.c owlib_test-owlib_test.obj: owlib_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(owlib_test_CFLAGS) $(CFLAGS) -MT owlib_test-owlib_test.obj -MD -MP -MF $(DEPDIR)/owlib_test-owlib_test.Tpo -c -o owlib_test-owlib_test.obj `if test -f 'owlib_test.c'; then $(CYGPATH_W) 'owlib_test.c'; else $(CYGPATH_W) '$(srcdir)/owlib_test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/owlib_test-owlib_test.Tpo $(DEPDIR)/owlib_test-owlib_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='owlib_test.c' object='owlib_test-owlib_test.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) $(owlib_test_CFLAGS) $(CFLAGS) -c -o owlib_test-owlib_test.obj `if test -f 'owlib_test.c'; then $(CYGPATH_W) 'owlib_test.c'; else $(CYGPATH_W) '$(srcdir)/owlib_test.c'; fi` owlib_test-ow_testhelper.o: ow_testhelper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(owlib_test_CFLAGS) $(CFLAGS) -MT owlib_test-ow_testhelper.o -MD -MP -MF $(DEPDIR)/owlib_test-ow_testhelper.Tpo -c -o owlib_test-ow_testhelper.o `test -f 'ow_testhelper.c' || echo '$(srcdir)/'`ow_testhelper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/owlib_test-ow_testhelper.Tpo $(DEPDIR)/owlib_test-ow_testhelper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ow_testhelper.c' object='owlib_test-ow_testhelper.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) $(owlib_test_CFLAGS) $(CFLAGS) -c -o owlib_test-ow_testhelper.o `test -f 'ow_testhelper.c' || echo '$(srcdir)/'`ow_testhelper.c owlib_test-ow_testhelper.obj: ow_testhelper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(owlib_test_CFLAGS) $(CFLAGS) -MT owlib_test-ow_testhelper.obj -MD -MP -MF $(DEPDIR)/owlib_test-ow_testhelper.Tpo -c -o owlib_test-ow_testhelper.obj `if test -f 'ow_testhelper.c'; then $(CYGPATH_W) 'ow_testhelper.c'; else $(CYGPATH_W) '$(srcdir)/ow_testhelper.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/owlib_test-ow_testhelper.Tpo $(DEPDIR)/owlib_test-ow_testhelper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ow_testhelper.c' object='owlib_test-ow_testhelper.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) $(owlib_test_CFLAGS) $(CFLAGS) -c -o owlib_test-ow_testhelper.obj `if test -f 'ow_testhelper.c'; then $(CYGPATH_W) 'ow_testhelper.c'; else $(CYGPATH_W) '$(srcdir)/ow_testhelper.c'; fi` owlib_test-check_ow_parseinput.o: check_ow_parseinput.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(owlib_test_CFLAGS) $(CFLAGS) -MT owlib_test-check_ow_parseinput.o -MD -MP -MF $(DEPDIR)/owlib_test-check_ow_parseinput.Tpo -c -o owlib_test-check_ow_parseinput.o `test -f 'check_ow_parseinput.c' || echo '$(srcdir)/'`check_ow_parseinput.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/owlib_test-check_ow_parseinput.Tpo $(DEPDIR)/owlib_test-check_ow_parseinput.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_ow_parseinput.c' object='owlib_test-check_ow_parseinput.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) $(owlib_test_CFLAGS) $(CFLAGS) -c -o owlib_test-check_ow_parseinput.o `test -f 'check_ow_parseinput.c' || echo '$(srcdir)/'`check_ow_parseinput.c owlib_test-check_ow_parseinput.obj: check_ow_parseinput.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(owlib_test_CFLAGS) $(CFLAGS) -MT owlib_test-check_ow_parseinput.obj -MD -MP -MF $(DEPDIR)/owlib_test-check_ow_parseinput.Tpo -c -o owlib_test-check_ow_parseinput.obj `if test -f 'check_ow_parseinput.c'; then $(CYGPATH_W) 'check_ow_parseinput.c'; else $(CYGPATH_W) '$(srcdir)/check_ow_parseinput.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/owlib_test-check_ow_parseinput.Tpo $(DEPDIR)/owlib_test-check_ow_parseinput.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_ow_parseinput.c' object='owlib_test-check_ow_parseinput.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) $(owlib_test_CFLAGS) $(CFLAGS) -c -o owlib_test-check_ow_parseinput.obj `if test -f 'check_ow_parseinput.c'; then $(CYGPATH_W) 'check_ow_parseinput.c'; else $(CYGPATH_W) '$(srcdir)/check_ow_parseinput.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? owlib_test.log: owlib_test$(EXEEXT) @p='owlib_test$(EXEEXT)'; \ b='owlib_test'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) 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-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool 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-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile #endif # 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: owfs-3.1p5/module/owlib/tests/owlib_test.c0000644000175000001440000000141712711737666015622 00000000000000#include "ow_testhelper.h" #define _DEFINE_SUITE(suite_name) Suite* suite_name(void); #define _INCLUDE_SUITE(suite_name) srunner_add_suite(runner, suite_name()); /** * Add all your test suites here, and in setup_test_suites below */ _DEFINE_SUITE(ow_parseinput_suite); static void setup_test_suites(SRunner *runner) { _INCLUDE_SUITE(ow_parseinput_suite); } int main(void) { Globals.error_level = e_err_debug ; Globals.error_level_restore = e_err_debug ; Globals.error_print = e_err_print_console; SRunner *sr; sr = srunner_create(NULL); setup_test_suites(sr); srunner_set_fork_status(sr, CK_NOFORK); srunner_run_all(sr, CK_NORMAL); int number_failed = srunner_ntests_failed(sr); srunner_free(sr); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } owfs-3.1p5/module/owlib/tests/ow_testhelper.c0000644000175000001440000000246712711737666016341 00000000000000#include "ow_testhelper.h" // Global "owq" which, if used, is destroyed in teardown struct one_wire_query* owq; static void LockTeardown(); /** * Setup a basic owlib stack. Should be setup via * * tcase_add_checked_fixture(tc, owlib_test_setup, owlib_test_teardown); * */ void owlib_test_setup(void) { LockSetup(); Cache_Open(); Detail_Init(); DeviceSort(); SetLocalControlFlags() ; // reset by every option and other change. owq = NULL; } void owlib_test_teardown(void) { if(owq) { OWQ_destroy(owq); owq = NULL; } LockTeardown(); Detail_Close(); } static void LockTeardown() { /* global mutex attribute */ _MUTEX_ATTR_DESTROY(Mutex.mattr); _MUTEX_DESTROY(Mutex.stat_mutex); _MUTEX_DESTROY(Mutex.controlflags_mutex); _MUTEX_DESTROY(Mutex.fstat_mutex); _MUTEX_DESTROY(Mutex.dir_mutex); #if OW_USB _MUTEX_DESTROY(Mutex.libusb_mutex); #endif /* OW_USB */ _MUTEX_DESTROY(Mutex.typedir_mutex); _MUTEX_DESTROY(Mutex.externaldir_mutex); _MUTEX_DESTROY(Mutex.namefind_mutex); _MUTEX_DESTROY(Mutex.aliaslist_mutex); _MUTEX_DESTROY(Mutex.externalcount_mutex); _MUTEX_DESTROY(Mutex.timegm_mutex); _MUTEX_DESTROY(Mutex.detail_mutex); RWLOCK_DESTROY(Mutex.lib); RWLOCK_DESTROY(Mutex.cache); RWLOCK_DESTROY(Mutex.persistent_cache); RWLOCK_DESTROY(Mutex.connin); RWLOCK_DESTROY(Mutex.monitor); } owfs-3.1p5/module/owlib/tests/check_ow_parseinput.c0000644000175000001440000000720612711737666017505 00000000000000#include "ow_testhelper.h" // Configure a fake LCD device #define LCD_ADDR "FF.AAAAAA000000" static void add_lcd_device() { // ow_lcd.c device const BYTE addr[] = {0xFF,0xAA,0xAA,0xAA,0x00,0x00,0x00,0xA9}; ck_assert_int_eq(gbGOOD, Cache_Add_Device(0, addr)); } // Fake line write function static ZERO_OR_ERROR FS_w_lineX_FAKE(struct one_wire_query *owq) { } // Setup a query for the above LCD device, property /line20.ALL static void setup_lcd_line20ALL_query() { add_lcd_device(); owq = owmalloc(sizeof(struct one_wire_query)); memset(owq, 0, sizeof(struct one_wire_query)); ck_assert_int_eq(gbGOOD, OWQ_create("/" LCD_ADDR "/line20.ALL", owq)); } // Test that we get EINVAL on empty string START_TEST(test_FS_input_ascii_array_empty) { setup_lcd_line20ALL_query(); char buf[20]; OWQ_assign_write_buffer( buf, 0, 0, owq) ; ck_assert_int_eq(-EINVAL, OWQ_parse_input(owq)); } END_TEST // Test writing single row to ALL START_TEST(test_FS_input_ascii_array_single_row) { setup_lcd_line20ALL_query(); struct parsedname *pn = PN(owq); char buf[20]; memcpy(buf, "aaa", 3); OWQ_assign_write_buffer( buf, 3, 0, owq) ; ck_assert_int_eq(0, OWQ_parse_input(owq)); ck_assert_int_eq(EXTENSION_ALL, pn->extension); ck_assert_int_eq(3, OWQ_array_length(owq, 0)); ck_assert_int_eq(0, OWQ_array_length(owq, 1)); ck_assert_int_eq(0, OWQ_array_length(owq, 2)); ck_assert_int_eq(0, OWQ_array_length(owq, 3)); ck_assert(!memcmp("aaa", OWQ_buffer(owq) + 0, 3)); } END_TEST // Test writing 4 non-full rows to ALL START_TEST(test_FS_input_ascii_array_all_rows) { setup_lcd_line20ALL_query(); struct parsedname *pn = PN(owq); char buf[20]; memcpy(buf, "aaa,bbb,ccc,ddd", 15); OWQ_assign_write_buffer( buf, 15, 0, owq) ; ck_assert_int_eq(0, OWQ_parse_input(owq)); ck_assert_int_eq(EXTENSION_ALL, pn->extension); ck_assert_int_eq(3, OWQ_array_length(owq, 0)); ck_assert_int_eq(3, OWQ_array_length(owq, 1)); ck_assert_int_eq(3, OWQ_array_length(owq, 2)); ck_assert_int_eq(3, OWQ_array_length(owq, 3)); ck_assert(!memcmp("aaa", OWQ_buffer(owq) + 0, 3)); ck_assert(!memcmp("bbb", OWQ_buffer(owq) + 3, 3)); ck_assert(!memcmp("ccc", OWQ_buffer(owq) + 6, 3)); ck_assert(!memcmp("ddd", OWQ_buffer(owq) + 9, 3)); } END_TEST // Test writing 4 overflowed rows (more data than filetype allows) to ALL START_TEST(test_FS_input_ascii_array_overflow) { setup_lcd_line20ALL_query(); struct parsedname *pn = PN(owq); char buf[200]; // Max 20 characters per line; we have 30 each here memcpy(buf, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa," "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb," "cccccccccccccccccccccccccccccc," "dddddddddddddddddddddddddddddd", 123); OWQ_assign_write_buffer( buf, 123, 0, owq) ; ck_assert_int_eq(0, OWQ_parse_input(owq)); ck_assert_int_eq(EXTENSION_ALL, pn->extension); ck_assert_int_eq(20, OWQ_array_length(owq, 0)); ck_assert_int_eq(20, OWQ_array_length(owq, 1)); ck_assert_int_eq(20, OWQ_array_length(owq, 2)); ck_assert_int_eq(20, OWQ_array_length(owq, 3)); ck_assert(!memcmp("aaaaaaaaaaaaaaaaaaaa", OWQ_buffer(owq) + 0, 20)); ck_assert(!memcmp("bbbbbbbbbbbbbbbbbbbb", OWQ_buffer(owq) + 20, 20)); ck_assert(!memcmp("cccccccccccccccccccc", OWQ_buffer(owq) + 40, 20)); ck_assert(!memcmp("dddddddddddddddddddd", OWQ_buffer(owq) + 60, 20)); } END_TEST // Create test-suite Suite* ow_parseinput_suite(void) { Suite *s; TCase *tc; s = suite_create("Owfs"); tc = tcase_create("parseinput"); tcase_add_checked_fixture(tc, owlib_test_setup, owlib_test_teardown); suite_add_tcase (s, tc); tcase_add_test(tc, test_FS_input_ascii_array_empty); tcase_add_test(tc, test_FS_input_ascii_array_all_rows); tcase_add_test(tc, test_FS_input_ascii_array_overflow); return s; } owfs-3.1p5/module/owhttpd/0000755000175000001440000000000013022537103012547 500000000000000owfs-3.1p5/module/owhttpd/Makefile.am0000644000175000001440000000001712654730021014525 00000000000000SUBDIRS = src owfs-3.1p5/module/owhttpd/Makefile.in0000644000175000001440000005500713022537051014545 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owhttpd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src 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) --foreign module/owhttpd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owhttpd/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owhttpd/src/0000755000175000001440000000000013022537104013337 500000000000000owfs-3.1p5/module/owhttpd/src/Makefile.am0000644000175000001440000000002512654730021015313 00000000000000SUBDIRS = include c owfs-3.1p5/module/owhttpd/src/Makefile.in0000644000175000001440000005503113022537051015331 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owhttpd/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include c 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) --foreign module/owhttpd/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owhttpd/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owhttpd/src/include/0000755000175000001440000000000013022537104014762 500000000000000owfs-3.1p5/module/owhttpd/src/include/Makefile.am0000644000175000001440000000003412654730021016736 00000000000000noinst_HEADERS = owhttpd.h owfs-3.1p5/module/owhttpd/src/include/owhttpd.h0000644000175000001440000000371012654730021016550 00000000000000/* OWFS and OWHTTPD one-wire file system and one-wire web server By Paul H Alfille {c} 2003 GPL paul.alfille@gmail.com */ /* OWHTTPD - specific header */ #ifndef OWHTTPD_H #define OWHTTPD_H #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #include // getpwuid #include // initgroups #include #define SVERSION "owhttpd" #define BODYCOLOR "BGCOLOR='#BBBBBB'" #define TOPTABLE "WIDTH='100%%' BGCOLOR='#DDDDDD' BORDER='1'" #define DEVTABLE "BGCOLOR='#DDDDDD' BORDER='1'" #define VALTABLE "BGCOLOR='#DDDDDD' BORDER='1'" /* * Main routine for actually handling a request * deals with a conncection */ /* in owhttpd_handler.c */ int handle_socket(FILE * out); struct OutputControl { FILE * out ; int not_first ; char * base_url ; char * host ; } ; /* in owhttpd_present */ enum content_type { ct_text, ct_html, ct_icon, ct_json, }; void HTTPstart( struct OutputControl * oc, const char *status, const enum content_type ct); void HTTPtitle( struct OutputControl * oc, const char *title); void HTTPheader( struct OutputControl * oc, const char *head); void HTTPfoot( struct OutputControl * oc); /* in owhttpd_write.c */ void PostData(struct one_wire_query *owq); void ChangeData(struct one_wire_query *owq); /* in owhttpd_read.c */ void ShowDevice( struct OutputControl * oc, struct parsedname *const pn); /* in owhttpd_dir.c */ struct JsonCBstruct { FILE * out ; int not_first ; } ; void ShowDir( struct OutputControl * oc, struct parsedname * pn); int Backup(const char *path); void JSON_dir_init( struct OutputControl * oc ) ; void JSON_dir_entry( struct OutputControl * oc, const char * format, const char * data ) ; void JSON_dir_finish( struct OutputControl * oc ) ; /* in ow_favicon.c */ void Favicon( struct OutputControl * oc); /* in owhttpd_escape */ void httpunescape(BYTE * httpstr) ; char * httpescape( const char * original_string ) ; #endif /* OWHTTPD_H */ owfs-3.1p5/module/owhttpd/src/include/Makefile.in0000644000175000001440000004461513022537052016763 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owhttpd/src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 HEADERS = $(noinst_HEADERS) 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)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = owhttpd.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) --foreign module/owhttpd/src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owhttpd/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(HEADERS) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am 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-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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool 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-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags 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: owfs-3.1p5/module/owhttpd/src/c/0000755000175000001440000000000013022537104013561 500000000000000owfs-3.1p5/module/owhttpd/src/c/Makefile.am0000644000175000001440000000123112665167763015560 00000000000000bin_PROGRAMS = owhttpd owhttpd_SOURCES = owhttpd.c \ owhttpd_handler.c \ owhttpd_present.c \ owhttpd_write.c \ owhttpd_read.c \ owhttpd_dir.c \ owhttpd_escape.c \ owhttpd_favicon.c owhttpd_DEPENDENCIES = ../../../owlib/src/c/libow.la AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${EXTRACFLAGS} LDADD = -low ${LD_EXTRALIBS} ${OSLIBS} owfs-3.1p5/module/owhttpd/src/c/Makefile.in0000644000175000001440000006142713022537052015562 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = owhttpd$(EXEEXT) subdir = module/owhttpd/src/c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_owhttpd_OBJECTS = owhttpd.$(OBJEXT) owhttpd_handler.$(OBJEXT) \ owhttpd_present.$(OBJEXT) owhttpd_write.$(OBJEXT) \ owhttpd_read.$(OBJEXT) owhttpd_dir.$(OBJEXT) \ owhttpd_escape.$(OBJEXT) owhttpd_favicon.$(OBJEXT) owhttpd_OBJECTS = $(am_owhttpd_OBJECTS) owhttpd_LDADD = $(LDADD) am__DEPENDENCIES_1 = 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 = 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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(owhttpd_SOURCES) DIST_SOURCES = $(owhttpd_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)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ owhttpd_SOURCES = owhttpd.c \ owhttpd_handler.c \ owhttpd_present.c \ owhttpd_write.c \ owhttpd_read.c \ owhttpd_dir.c \ owhttpd_escape.c \ owhttpd_favicon.c owhttpd_DEPENDENCIES = ../../../owlib/src/c/libow.la AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${EXTRACFLAGS} LDADD = -low ${LD_EXTRALIBS} ${OSLIBS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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) --foreign module/owhttpd/src/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owhttpd/src/c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list owhttpd$(EXEEXT): $(owhttpd_OBJECTS) $(owhttpd_DEPENDENCIES) $(EXTRA_owhttpd_DEPENDENCIES) @rm -f owhttpd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owhttpd_OBJECTS) $(owhttpd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owhttpd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owhttpd_dir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owhttpd_escape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owhttpd_favicon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owhttpd_handler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owhttpd_present.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owhttpd_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owhttpd_write.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .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: owfs-3.1p5/module/owhttpd/src/c/owhttpd.c0000644000175000001440000000542412654730021015346 00000000000000/* OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2003 Paul H Alfille * based on chttpd/1.0 * main program. Somewhat adapted from dhttpd * Copyright (c) 0x7d0 * Some parts * Copyright (c) 0x7cd David A. Bartold * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "owhttpd.h" // httpd-specific /* * Default port to listen too. If you aren't root, you'll need it to * be > 1024 unless you plan on using a config file */ #define DEFAULTPORT 80 static void Acceptor(int listenfd); int main(int argc, char *argv[]) { int c; /* Set up owlib */ LibSetup(program_type_httpd); Setup_Systemd() ; // systemd? Setup_Launchd() ; // launchd? /* grab our executable name */ ArgCopy( argc, argv ) ; while ((c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL)) != -1) { switch (c) { case 'V': fprintf(stderr, "%s version:\n\t" VERSION "\n", argv[0]); break; default: break; } if ( BAD( owopt(c, optarg) ) ) { ow_exit(0); /* rest of message */ } } /* non-option arguments */ while (optind < argc) { ARG_Generic(argv[optind]); ++optind; } switch (Globals.daemon_status) { case e_daemon_sd: case e_daemon_sd_done: // systemd done later break ; default: if (Outbound_Control.active == 0) { if (Globals.zero == zero_none) { LEVEL_DEFAULT("%s would be \"locked in\" so will quit.\nBonjour and Avahi not available.", argv[0]); ow_exit(1); } else { LEVEL_CONNECT("%s will use an ephemeral port", argv[0]) ; } ARG_Server(NULL); // make an ephemeral assignment } break ; } /* become a daemon if not told otherwise */ if ( BAD(EnterBackground()) ) { ow_exit(1); } /* Set up adapters and systemd */ if ( BAD(LibStart(NULL)) ) { ow_exit(1); } set_exit_signal_handlers(exit_handler); set_signal_handlers(NULL); ServerProcess(Acceptor); LEVEL_DEBUG("ServerProcess done"); ow_exit(0); LEVEL_DEBUG("owhttpd done"); return 0; } static void Acceptor(int listenfd) { FILE *fp = fdopen(listenfd, "w+"); if (fp) { handle_socket(fp); fflush(fp); fclose(fp); } } owfs-3.1p5/module/owhttpd/src/c/owhttpd_handler.c0000644000175000001440000003620212654730021017041 00000000000000/* * http.c for owhttpd (1-wire web server) * By Paul Alfille 2003, using libow * offshoot of the owfs ( 1wire file system ) * * GPL license ( Gnu Public Lincense ) * * Based on chttpd. copyright(c) 0x7d0 greg olszewski * */ #include "owhttpd.h" // #include /* for dirname() */ /* ------------ Protoypes ---------------- */ struct urlparse { char *line; size_t line_length ; char *cmd; char *file; char *version; char *request; char *value; }; enum http_return { http_ok, http_dir, http_icon, http_400, http_404 } ; /* Error page functions */ enum content_type PoorMansParser( char * bad_url ) ; static void Bad400( struct OutputControl * oc, const enum content_type ct); static void Bad404( struct OutputControl * oc, const enum content_type ct); /* URL parsing function */ static void URLparse(struct urlparse *up); static enum http_return handle_GET( struct OutputControl * oc, struct urlparse * up) ; static enum http_return handle_POST( struct OutputControl * oc, struct urlparse * up) ; static void ReadToCRLF( struct OutputControl * oc ) ; static void TrimBoundary( char ** boundary ) ; static int GetPostData( char * boundary, struct memblob * mb, struct OutputControl * oct ) ; static char * GetPostPath( struct OutputControl * oc ) ; static GOOD_OR_BAD GetHostURL( struct OutputControl * oc ) ; /* --------------- Functions ---------------- */ /* Main handler for a web page */ int handle_socket(FILE * out) { enum http_return http_code ; enum content_type pmp = ct_html; struct urlparse up; struct OutputControl s_oc = { out, 0, NULL, NULL, } ; struct OutputControl * oc = &s_oc ; struct parsedname s_pn; struct parsedname * pn = &s_pn ; up.line = NULL ; // prep for getline with null. Will be allocated by getline. if ( getline(&(up.line), &(up.line_length), out) >= 0 ) { LEVEL_CALL("PreParse line=%s", up.line); URLparse(&up); /* Break up URL */ httpunescape((BYTE *) up.file ); httpunescape((BYTE *) up.request ); httpunescape((BYTE *) up.value ); LEVEL_CALL( "WLcmd: %s\tfile: %s\trequest: %s\tvalue: %s\tversion: %s", SAFESTRING(up.cmd), SAFESTRING(up.file), SAFESTRING(up.request), SAFESTRING(up.value), SAFESTRING(up.version) ); oc->base_url = owstrdup( up.file==NULL ? "" : up.file ) ; if ( BAD( GetHostURL(oc) ) ) { // No command line in request pn = NO_PARSEDNAME ; http_code = http_400 ; } else if (up.cmd == NULL) { // No command line in request pn = NO_PARSEDNAME ; http_code = http_400 ; } else if (up.file == NULL) { // could not parse a path from the request pn = NO_PARSEDNAME ; http_code = http_404 ; } else if (strcasecmp(up.file, "/favicon.ico") == 0) { // special case for the icon LEVEL_DEBUG("http icon request."); ReadToCRLF(oc) ; pn = NO_PARSEDNAME ; http_code = http_icon ; } else if (FS_ParsedName(up.file, pn) != 0) { // Can't understand the file name = URL LEVEL_DEBUG("http %s not understood.",up.file); ReadToCRLF(oc) ; pn = NO_PARSEDNAME ; http_code = http_404 ; } else if (pn->selected_device == NO_DEVICE) { // directory! LEVEL_DEBUG("http directory request."); ReadToCRLF(oc) ; http_code = http_dir ; } else if (strcmp(up.cmd, "POST") == 0) { LEVEL_DEBUG("http POST request."); http_code = handle_POST( oc, &up ) ; } else if (strcmp(up.cmd, "GET") == 0) { LEVEL_DEBUG("http GET request."); http_code = handle_GET( oc, &up ) ; // special case for possible alias changes // Parsedname structure may point to a device that no longer exists if ( http_code == http_ok ) { // was able to write FS_ParsedName_destroy(pn); if (FS_ParsedName(up.file, pn)) { // Can't understand the device name any more LEVEL_DEBUG("Alias change for %s",up.file); if (FS_ParsedName("/", pn)) { // Try to set to root LEVEL_DEBUG("Set to root"); pn = NO_PARSEDNAME ; http_code = http_404 ; } } } } else { ReadToCRLF(oc) ; http_code = http_400 ; } switch ( http_code ) { case http_400: case http_404: // need to call this before freeing up.file pmp = PoorMansParser(up.file) ; break ; default: // not an error break ; } // allocated by getline free(up.line) ; } else { LEVEL_DEBUG("No http data."); pn = NO_PARSEDNAME ; http_code = http_400 ; } // This is necessary for SunOS fflush(out); switch ( http_code ) { case http_icon: Favicon(oc); break ; case http_400: Bad400(oc,pmp); break ; case http_404: Bad404(oc,pmp); break ; case http_dir: ShowDir(oc, pn); break ; case http_ok: ShowDevice(oc, pn); break ; } if ( pn != NO_PARSEDNAME ) { FS_ParsedName_destroy(pn); } if ( oc->base_url != NULL ) { owfree( oc->base_url ) ; } if ( oc->host != NULL ) { owfree( oc->host ) ; } return 0 ; } /* The HTTP request is a GET message */ static enum http_return handle_GET( struct OutputControl * oc, struct urlparse * up) { /* read lines until blank */ if (up->version) { ReadToCRLF( oc ) ; } if (up->request == NULL) { // NO request -- just a read or dir, not a write LEVEL_DEBUG("Simple GET request -- read a value or directory"); return http_ok ; } else if (up->value==NULL) { // write without a value LEVEL_DEBUG("Null value for write command -- Bad URL."); return http_400 ; } else { /* First write new values, then show */ OWQ_allocate_struct_and_pointer(owq_write); size_t req_leng = strlen(up->request) ; size_t fil_leng = strlen(up->file) ; char * remove_filetype = NULL ; // remove the filetype from the file name // see if the URL includes the property twice -- happens if only a property is shown if ( req_leng <= fil_leng && strcasecmp(up->request,&up->file[fil_leng-req_leng])==0 ) { struct parsedname s_pn ; if ( FS_ParsedName(up->file,&s_pn)==0 ) { if ( s_pn.selected_filetype != NO_FILETYPE ) { LEVEL_DEBUG("Property name %s duplicated on command line. Not a problem.",up->request) ; remove_filetype = &up->file[fil_leng-req_leng-1] ; remove_filetype[0] = '\0'; } FS_ParsedName_destroy(&s_pn); } } // Create the owq to write to. if ( BAD( OWQ_create_plus(up->file, up->request, owq_write) ) ) { // for write return http_404 ; } OWQ_assign_write_buffer( up->value, strlen(up->value), 0, owq_write ) ; /* Execute the write */ ChangeData(owq_write); OWQ_destroy(owq_write); if ( remove_filetype != NULL ) { // restore full URL path remove_filetype[0] = '/' ; } return http_ok ; } } /* The HTTP request is a POST message */ static enum http_return handle_POST( struct OutputControl * oc, struct urlparse * up) { FILE* out = oc->out ; enum http_return http_code = http_404 ; // default error mode char * boundary = NULL ; size_t boundary_length ; /* read lines until blank */ if (up->version) { ReadToCRLF( oc ) ; } // use getline because it handles null chars if ( getline(&boundary,&boundary_length,out) > 2 ) { char * post_path = GetPostPath( oc ) ; TrimBoundary( &boundary) ; LEVEL_CALL("POST boundary=%s",boundary); if ( post_path ) { struct memblob mb ; if ( GetPostData( boundary, &mb, oc ) == 0 ) { struct one_wire_query * owq = OWQ_create_from_path( post_path ) ; // for write if ( owq ) { LEVEL_DEBUG("File upload %s for %ld bytes",post_path,MemblobLength(&mb)); if ( GOOD( OWQ_allocate_write_buffer( (char *) MemblobData(&mb), MemblobLength(&mb), 0, owq)) ) { PostData(owq); http_code = http_ok ; } OWQ_destroy(owq) ; } else { LEVEL_DEBUG("Can't create %s",post_path); } } else { LEVEL_DEBUG("Can't read full binary data from file upload"); } MemblobClear( &mb ) ; owfree(post_path ) ; } else { LEVEL_DEBUG("Can't read property name from file upload"); } } if ( boundary ) { free(boundary) ; // allocated in getline with malloc, not owmalloc } return http_code ; } /* URL handler for a web page */ static void URLparse(struct urlparse *up) { char *str; int first = 1; char * extension ; up->cmd = up->version = up->file = up->request = up->value = NULL; /* Special case for sparse array * Substitute "/" for "?EXTENSION=" * */ extension = strchr( up->line, '?' ) ; if ( extension != NULL ) { if ( strncmp( "?EXTENSION=" , extension, 11 ) == 0 ) { int l = strlen( extension ) ; extension[0] = '/' ; memmove( &extension[1], &extension[11], l-10 ) ; } } /* Separate out the three parameters, all in same line */ for (str = up->line; *str; str++) { switch (*str) { case ' ': case '\n': case '\r': *str = '\0'; first = 1; break; default: if (!first || up->version) { break; } else if (up->file) { up->version = str; } else if (up->cmd) { up->file = str; } else { up->cmd = str; } first = 0; } } /* Separate out the filename and FORM data */ if (up->file) { for (str = up->file; *str; str++) { if (*str == '?') { *str = '\0'; up->request = str + 1; break; } } /* trim off trailing '/' */ --str; if (*str == '/' && str > up->file) *str = '\0'; } /* Separate out the FORM field and value */ if (up->request) { for (str = up->request; *str; str++) { if (*str == '=') { *str = '\0'; up->value = str + 1; break; } } } /* Remove garbage from oned of value */ if (up->value) { for (str = up->value; *str; str++) { if (*str == '&') { *str = '\0'; break; } } /* Special case -- checkbox off, CHANGE is value read */ if (strcmp("CHANGE", up->value) == 0) { up->value[0] = '0'; up->value[1] = '\0'; } } LEVEL_DEBUG("URL parse file=%s, request=%s, value=%s", SAFESTRING(up->file), SAFESTRING(up->request), SAFESTRING(up->value)); } static void Bad400(struct OutputControl * oc, const enum content_type ct) { FILE * out = oc->out ; LEVEL_CALL("Return a 400 HTTP error code"); switch( ct ) { case ct_text: HTTPstart(oc, "400 Bad Request", ct_text); fprintf(out, "400 Bad request"); break ; case ct_json: HTTPstart(oc, "400 Bad Request", ct_json); fprintf(out, "{}"); break ; default: HTTPstart(oc, "400 Bad Request", ct_html); HTTPtitle(oc, "Error 400 -- Bad request"); HTTPheader(oc, "Unrecognized Request"); fprintf(out, "

The 1-wire web server is carefully constrained for security and stability. Your requested web page is not recognized.

"); fprintf(out, "

Navigate from the Main page for best results.

"); HTTPfoot(oc); } } static void Bad404(struct OutputControl * oc, const enum content_type ct) { FILE * out = oc->out ; LEVEL_CALL("Return a 404 HTTP error code"); switch( ct ) { case ct_text: HTTPstart(oc, "404 Not Found", ct_text); fprintf(out, "404 Not Found"); break ; case ct_json: HTTPstart(oc, "404 Not Found", ct_json); fprintf(out, "{}"); break ; default: HTTPstart(oc, "404 Not Found", ct_html); HTTPtitle(oc, "Error 404 -- Item doesn't exist"); HTTPheader(oc, "Nonexistent Device"); fprintf(out, "

The 1-wire web server is carefully constrained for security and stability. Your requested device is not recognized.

"); fprintf(out, "

Navigate from the Main page for best results.

"); HTTPfoot(oc); } } static void ReadToCRLF( struct OutputControl * oc ) { FILE * out = oc->out ; char * text_in = NULL ; size_t length_in = 0 ; ssize_t getline_length ; /* read lines until blank */ while ( (getline_length = getline(&text_in, &length_in, out)) > 0 ) { LEVEL_DEBUG("More (%d) data:%s",(int)getline_length,text_in); if ( strcmp(text_in, "\r\n")==0 || strcmp(text_in, "\n")==0 ) { break ; } } if ( text_in != NULL ) { free( text_in) ; } } static void TrimBoundary( char ** boundary ) { char * remove_char ; remove_char = strrchr( *boundary, '\n' ) ; if ( remove_char ) { *remove_char = '\0' ; } remove_char = strrchr( *boundary, '\r' ) ; if ( remove_char ) { *remove_char = '\0' ; } } static char * GetPostPath(struct OutputControl * oc ) { FILE * out = oc->out ; char * text_in = NULL ; size_t length_in = 0 ; char * path_found = NO_PATH ; /* read lines until blank */ while (getline(&text_in, &length_in, out)>-1) { char * namestart ; LEVEL_DEBUG("Post data:%s",SAFESTRING(text_in)); if ( strcmp(text_in, "\r\n")==0 || strcmp(text_in, "\n")==0 ) { free( text_in) ; return path_found ; } namestart = strstr(text_in," name=\"") ; if (namestart != NULL ) { char * nameend ; namestart += 7 ; nameend = strchr(namestart,'\"') ; if ( nameend != NULL ) { nameend[0] = '\0' ; if( path_found ) { owfree(path_found); } path_found = owstrdup( namestart ) ; } } } if ( text_in ) { free( text_in) ; } return path_found ; } // read data from file upload static int GetPostData( char * boundary, struct memblob * mb, struct OutputControl * oc ) { FILE * out = oc->out ; char * data = NULL ; size_t data_length ; ssize_t read_this_pass ; MemblobInit( mb, 1000 ) ; // increqment in 1K amounts (arbitrary) while ( (read_this_pass = getline(&data, &data_length, out)) > -1 ) { Debug_Bytes(boundary,(BYTE *)data,(size_t)read_this_pass); if ( strstr( data, boundary ) != NULL ) { free(data) ; // allocated by getline with malloc, not owmalloc MemblobTrim(2,mb) ; // trim off final 0x0A 0x0D LEVEL_DEBUG("Read in POST file upload of %ld bytes",MemblobLength(mb)); return 0 ; } if ( MemblobAdd( (BYTE *)data, (size_t)read_this_pass, mb ) ) { LEVEL_DEBUG("Data size too large"); free(data) ; // allocated by getline with malloc, not owmalloc return 1 ; } } if ( data ) { free(data) ; // allocated by getline with malloc, not owmalloc } LEVEL_DEBUG("HTTP error -- no ending MIME boundary"); return 1 ; } // Parse the line for just the text or json key since there was an error and Parsedname is null enum content_type PoorMansParser( char * bad_url ) { if ( bad_url == NULL ) { LEVEL_DEBUG("Error on http request assume html"); return ct_html ; } else if ( strstr( bad_url, "json" ) != NULL ) { LEVEL_DEBUG("Error on http request <%s> assume json",bad_url); return ct_json ; } else if ( strstr( bad_url, "JSON" ) != NULL ) { LEVEL_DEBUG("Error on http request <%s> assume json",bad_url); return ct_json ; } else if ( strstr( bad_url, "text" ) != NULL ) { LEVEL_DEBUG("Error on http request <%s> assume text",bad_url); return ct_text ; } else if ( strstr( bad_url, "TEXT" ) != NULL ) { LEVEL_DEBUG("Error on http request <%s> assume text",bad_url); return ct_text ; } LEVEL_DEBUG("Error on http request <%s> assume html",bad_url); return ct_html ; } static GOOD_OR_BAD GetHostURL( struct OutputControl * oc ) { FILE * out = oc->out ; char * line = NULL ; static regex_t rx_host ; struct ow_regmatch orm ; orm.number = 1 ; ow_regcomp( &rx_host, "host *: *([^ ]+) *\r", REG_ICASE ) ; do { size_t s ; if ( getline( &line, &s, out ) < 0 ) { free( line ) ; LEVEL_DEBUG("Couldn't find Host: line in HTTP header") ; return gbBAD ; } LEVEL_DEBUG("Test line <%s>",line ) ; if ( ow_regexec( &rx_host, line, &orm ) != 0 ) { LEVEL_DEBUG("No match <%s>",line) ; continue ; } oc->host = owstrdup( orm.match[1] ) ; ow_regexec_free( &orm ) ; free(line) ; return gbGOOD ; } while (1) ; } owfs-3.1p5/module/owhttpd/src/c/owhttpd_present.c0000644000175000001440000000372612654730021017111 00000000000000/* * http.c for owhttpd (1-wire web server) * By Paul Alfille 2003, using libow * offshoot of the owfs ( 1wire file system ) * * GPL license ( Gnu Public Lincense ) * * Based on chttpd. copyright(c) 0x7d0 greg olszewski * */ #define SVERSION "owhttpd" #include "owhttpd.h" /* ------------ Protoypes ---------------- */ /* Utility HTML page display functions */ void HTTPstart(struct OutputControl * oc, const char *status, const enum content_type ct) { FILE * out = oc->out ; char d[44]; time_t t = NOW_TIME; size_t l = strftime(d, sizeof(d), "%a, %d %b %Y %T GMT", gmtime(&t)); fprintf(out, "HTTP/1.0 %s\r\n", status); fprintf(out, "Date: %*s\n", (int) l, d); fprintf(out, "Server: %s\r\n", SVERSION); fprintf(out, "Last-Modified: %*s\r\n", (int) l, d); /* * fprintf( out, "MIME-version: 1.0\r\n" ); */ switch (ct) { case ct_html: fprintf(out, "Content-Type: text/html\r\n"); break; case ct_icon: fprintf(out, "Content-Length: 894\r\n"); fprintf(out, "Connection: close\r\n"); break ; case ct_text: fprintf(out, "Content-Type: text/plain\r\n"); break ; case ct_json: fprintf(out, "Access-Control-Allow-Origin: *\r\n"); fprintf(out, "Content-Type: application/json\r\n"); break ; } fprintf(out, "\r\n"); } void HTTPtitle(struct OutputControl * oc, const char *title) { FILE * out = oc->out ; fprintf(out, "1-Wire Web: %s\n", title); } void HTTPheader(struct OutputControl * oc, const char *head) { FILE * out = oc->out ; fprintf(out, "
OWFSBus listingOWFS homepageDallas/Maximby Paul H Alfille
\n"); fprintf(out, "

%s


\n", head); } void HTTPfoot(struct OutputControl * oc) { FILE * out = oc->out; fprintf(out, ""); } owfs-3.1p5/module/owhttpd/src/c/owhttpd_write.c0000644000175000001440000000335312654730021016557 00000000000000/* * http.c for owhttpd (1-wire web server) * By Paul Alfille 2003, using libow * offshoot of the owfs ( 1wire file system ) * * GPL license ( Gnu Public Lincense ) * * Based on chttpd. copyright(c) 0x7d0 greg olszewski * */ #include "owhttpd.h" // #include /* for dirname() */ /* string format functions */ static int hex_convert(char *str); static void hex_only(char *str); /* --------------- Functions ---------------- */ // POST data -- a file upload void PostData(struct one_wire_query *owq) { /* Do command processing and make changes to 1-wire devices */ LEVEL_DETAIL("Uploaded Data path=%s size=%ld", PN(owq)->path, OWQ_size(owq)); FS_write_postparse(owq); } // Standard Data via GET void ChangeData(struct one_wire_query *owq) { struct parsedname *pn = PN(owq); ASCII *value_string = OWQ_buffer(owq); /* Do command processing and make changes to 1-wire devices */ LEVEL_DETAIL("New data path=%s value=%s", pn->path, value_string); switch (pn->selected_filetype->format) { case ft_binary: hex_only(value_string); OWQ_size(owq) = hex_convert(value_string); break; default: OWQ_size(owq) = strlen(value_string); break; } FS_write_postparse(owq); } /* reads an as ascii hex string, strips out non-hex, converts in place */ static void hex_only(char *str) { char *leader = str; char *trailer = str; while (*leader) { if (isxdigit(*leader)) { *trailer++ = *leader; } leader++; } *trailer = '\0'; } /* reads an as ascii hex string, converts in place */ /* returns length */ static int hex_convert(char *str) { char *leader = str; BYTE *trailer = (BYTE *) str; while (*leader) { *trailer++ = string2num(leader); leader += 2 ; } return trailer - ((BYTE *) str); } owfs-3.1p5/module/owhttpd/src/c/owhttpd_read.c0000644000175000001440000004734112756346023016355 00000000000000/* * http.c for owhttpd (1-wire web server) * By Paul Alfille 2003, using libow * offshoot of the owfs ( 1wire file system ) * * GPL license ( Gnu Public Lincense ) * * Based on chttpd. copyright(c) 0x7d0 greg olszewski * */ #include "owhttpd.h" // #include /* for dirname() */ /* --------------- Prototypes---------------- */ static void Show(struct OutputControl * oc, const struct parsedname *pn_entry); static void ShowDirectory(struct OutputControl * oc, const struct parsedname *pn_entry); static void ShowReadWrite(struct OutputControl * oc, struct one_wire_query *owq); static void ShowReadonly(struct OutputControl * oc, struct one_wire_query *owq); static void ShowWriteonly(struct OutputControl * oc, struct one_wire_query *owq); static void ShowStructure(struct OutputControl * oc, struct one_wire_query *owq); static void StructureDetail(struct OutputControl * oc, const char * structure_details ); static void Upload( struct OutputControl * oc, const struct parsedname * pn ) ; static void Extension( struct OutputControl * oc, const struct parsedname * pn ) ; static void ShowText(struct OutputControl * oc, const struct parsedname *pn_entry); static void ShowTextDirectory(struct OutputControl * oc, const struct parsedname *pn_entry); static void ShowTextReadWrite(struct OutputControl * oc, struct one_wire_query *owq); static void ShowTextReadonly(struct OutputControl * oc, struct one_wire_query *owq); static void ShowTextWriteonly(struct OutputControl * oc, struct one_wire_query *owq); static void ShowTextStructure(struct OutputControl * oc, struct one_wire_query *owq); static void ShowJson(struct OutputControl * oc, const struct parsedname *pn_entry); static void ShowJsonDirectory(struct OutputControl * oc, const struct parsedname *pn_entry); static void ShowJsonReadWrite(struct OutputControl * oc, struct one_wire_query *owq); static void ShowJsonReadonly(struct OutputControl * oc, struct one_wire_query *owq); static void ShowJsonWriteonly(struct OutputControl * oc, struct one_wire_query *owq); static void ShowJsonStructure(struct OutputControl * oc, struct one_wire_query *owq); static void StructureDetailJson(struct OutputControl * oc, const char * structure_details ); /* --------------- Functions ---------------- */ /* Device entry -- table line for a filetype */ static void Show(struct OutputControl * oc, const struct parsedname *pn_entry) { FILE * out = oc->out ; struct one_wire_query *owq = OWQ_create_from_path(pn_entry->path); // for read or dir struct filetype * ft = pn_entry->selected_filetype ; /* Left column */ fprintf(out, "%s", FS_DirName(pn_entry)); if (owq == NO_ONE_WIRE_QUERY) { fprintf(out, "Memory exhausted"); } else if ( BAD( OWQ_allocate_read_buffer(owq)) ) { fprintf(out, "Memory exhausted"); } else if (ft == NO_FILETYPE) { ShowDirectory(oc, pn_entry); } else if (IsStructureDir(pn_entry)) { ShowStructure(oc, owq); } else if (ft->format == ft_directory || ft->format == ft_subdir) { // Directory ShowDirectory(oc, pn_entry); } else if ( pn_entry->extension == EXTENSION_UNKNOWN && ft->ag != NON_AGGREGATE && ft->ag->combined == ag_sparse ) { Extension(oc, pn_entry ) ; // flag as generic needing an extension chosen } else if (ft->write == NO_WRITE_FUNCTION || Globals.readonly) { // Unwritable if (ft->read != NO_READ_FUNCTION) { ShowReadonly(oc, owq); } else { // Property has no read or write ability } } else { // Writeable if (ft->read == NO_READ_FUNCTION) { ShowWriteonly(oc, owq); } else { ShowReadWrite(oc, owq); } } fprintf(out, "\r\n"); OWQ_destroy(owq); } /* Device entry -- table line for a filetype */ static void ShowReadWrite(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; struct parsedname * pn = PN(owq) ; const char *file = FS_DirName(pn); SIZE_OR_ERROR read_return = FS_read_postparse(owq); if (read_return < 0) { fprintf(out, "Error: %s", strerror(-read_return)); return; } switch (pn->selected_filetype->format) { case ft_binary: { int i = 0; fprintf(out, "
"); Upload( oc, pn ) ; break; } case ft_yesno: case ft_bitfield: if (pn->extension >= 0) { fprintf(out, "
",oc->host, oc->base_url, file, (OWQ_buffer(owq)[0] == '0') ? "" : "CHECKED", file); break; } // fall through default: fprintf(out, "
",oc->host, oc->base_url, file, read_return, OWQ_buffer(owq)); break; } } static void Upload( struct OutputControl * oc, const struct parsedname * pn ) { FILE * out = oc->out ; fprintf(out,"
Load from file:
",oc->host, oc->base_url, pn->path); } static void Extension( struct OutputControl * oc, const struct parsedname * pn ) { static regex_t rx_extension ; FILE * out = oc->out ; const char * file = FS_DirName(pn); struct ow_regmatch orm ; orm.number = 0 ; ow_regcomp( &rx_extension, "\\.", 0 ) ; if ( ow_regexec( &rx_extension, file, &orm ) == 0 ) { fprintf(out, "
", oc->host, oc->base_url, orm.pre[0] ); ow_regexec_free( &orm ) ; } } /* Device entry -- table line for a filetype */ static void ShowReadonly(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; SIZE_OR_ERROR read_return = FS_read_postparse(owq); struct parsedname * pn = PN(owq) ; if (read_return < 0) { fprintf(out, "Error: %s", strerror(-read_return)); return; } switch (pn->selected_filetype->format) { case ft_binary: { int i = 0; fprintf(out, "
");
			while (i < read_return) {
				fprintf(out, "%.2hhX", OWQ_buffer(owq)[i]);
				if (((++i) < read_return) && (i & 0x1F) == 0) {
					fprintf(out, "\r\n");
				}
			}
			fprintf(out, "
"); break; } case ft_yesno: case ft_bitfield: if (pn->extension >= 0) { switch (OWQ_buffer(owq)[0]) { case '0': fprintf(out, "NO (0)"); break; case '1': fprintf(out, "YES (1)"); break; } break; } // fall through default: fprintf(out, "%.*s", read_return, OWQ_buffer(owq)); break; } } /* Structure entry */ static void ShowStructure(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; SIZE_OR_ERROR read_return = FS_read_postparse(owq); if (read_return < 0) { fprintf(out, "Error: %s", strerror(-read_return)); return; } fprintf(out, "%.*s", read_return, OWQ_buffer(owq)); // Optional structure details StructureDetail(oc,OWQ_buffer(owq)) ; } /* Detailed (parsed) structure entry */ static void StructureDetail(struct OutputControl * oc, const char * structure_details ) { FILE * out = oc->out ; char format_type ; int extension ; int elements ; char rw[4] ; int size ; if ( sscanf( structure_details, "%c,%d,%d,%2s,%d,", &format_type, &extension, &elements, rw, &size ) < 5 ) { return ; } fprintf(out, "
"); switch( format_type ) { case 'b': fprintf(out, "Binary string"); break ; case 'a': fprintf(out, "Ascii string"); break ; case 'D': fprintf(out, "Directory"); break ; case 'i': fprintf(out, "Integer value"); break ; case 'u': fprintf(out, "Unsigned integer value"); break ; case 'f': fprintf(out, "Floating point value"); break ; case 'l': fprintf(out, "Alias"); break ; case 'y': fprintf(out, "Yes/No value"); break ; case 'd': fprintf(out, "Date value"); break ; case 't': fprintf(out, "Temperature value"); break ; case 'g': fprintf(out, "Delta temperature value"); break ; case 'p': fprintf(out, "Pressure value"); break ; default: fprintf(out, "Unknown value type"); } fprintf(out, ", "); if ( elements == 1 ) { fprintf(out, "Singleton"); } else if ( extension == EXTENSION_BYTE ) { fprintf(out, "Array of %d bits as a BYTE",elements); } else if ( extension == EXTENSION_ALL ) { fprintf(out, "Array of %d elements combined",elements); } else { fprintf(out, "Element %d (of %d)",extension,elements); } fprintf(out, ", "); if ( strncasecmp( rw, "rw", 2 ) == 0 ) { fprintf(out, "Read/Write"); } else if ( strncasecmp( rw, "ro", 2 ) == 0 ) { fprintf(out, "Read only"); } else if ( strncasecmp( rw, "wo", 2 ) == 0 ) { fprintf(out, "Write only"); } else{ fprintf(out, "No access"); } fprintf(out, ", "); if ( format_type == 'b' ) { fprintf(out, "%d bytes",size); } else { fprintf(out, "%d characters",size); } } /* Device entry -- table line for a filetype */ static void ShowWriteonly(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; struct parsedname * pn = PN(owq) ; const char *file = FS_DirName(pn); switch (pn->selected_filetype->format) { case ft_binary: fprintf(out, "
",oc->host, oc->base_url, file, (int) (OWQ_size(owq) >> 5)); Upload(oc,pn) ; break; case ft_yesno: case ft_bitfield: if (pn->extension >= 0) { fprintf(out, "
", oc->host, oc->base_url, file, file); break; } // fall through default: fprintf(out, "
", oc->host, oc->base_url, file); break; } } static void ShowDirectory(struct OutputControl * oc, const struct parsedname *pn_entry) { FILE * out = oc->out ; fprintf(out, "%s", pn_entry->path, FS_DirName(pn_entry)); } /* Device entry -- table line for a filetype */ static void ShowText(struct OutputControl * oc, const struct parsedname *pn_entry) { FILE * out = oc->out ; struct one_wire_query *owq = OWQ_create_from_path(pn_entry->path); // for read or dir struct filetype * ft = pn_entry->selected_filetype ; /* Left column */ fprintf(out, "%s ", FS_DirName(pn_entry)); if (owq == NO_ONE_WIRE_QUERY) { } else if ( BAD( OWQ_allocate_read_buffer(owq)) ) { //fprintf(out, "(memory exhausted)"); } else if (ft == NO_FILETYPE) { ShowTextDirectory(oc, pn_entry); } else if (ft->format == ft_directory || ft->format == ft_subdir) { ShowTextDirectory(oc, pn_entry); } else if (IsStructureDir(pn_entry)) { ShowTextStructure(oc, owq); } else if (ft->write == NO_WRITE_FUNCTION || Globals.readonly) { // Unwritable if (ft->read != NO_READ_FUNCTION) { ShowTextReadonly(oc, owq); } } else { // Writeable if (ft->read == NO_READ_FUNCTION) { ShowTextWriteonly(oc, owq); } else { ShowTextReadWrite(oc, owq); } } fprintf(out, "\r\n"); OWQ_destroy(owq); } /* Device entry -- table line for a filetype */ static void ShowTextStructure(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; SIZE_OR_ERROR read_return = FS_read_postparse(owq); if (read_return < 0) { //fprintf(out, "error: %s", strerror(-read_return)); return; } fprintf(out, "%.*s", read_return, OWQ_buffer(owq)); } /* Device entry -- table line for a filetype */ static void ShowTextReadWrite(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; SIZE_OR_ERROR read_return = FS_read_postparse(owq); if (read_return < 0) { //fprintf(out, "error: %s", strerror(-read_return)); return; } switch (PN(owq)->selected_filetype->format) { case ft_binary: { int i; for (i = 0; i < read_return; ++i) { fprintf(out, "%.2hhX", OWQ_buffer(owq)[i]); } break; } case ft_yesno: case ft_bitfield: if (PN(owq)->extension >= 0) { fprintf(out, "%c", OWQ_buffer(owq)[0]); break; } // fall through default: fprintf(out, "%.*s", read_return, OWQ_buffer(owq)); break; } } /* Device entry -- table line for a filetype */ static void ShowTextReadonly(struct OutputControl * oc, struct one_wire_query *owq) { ShowTextReadWrite(oc, owq); } /* Device entry -- table line for a filetype */ static void ShowTextWriteonly(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; (void) owq; fprintf(out, "(writeonly)"); } static void ShowTextDirectory(struct OutputControl * oc, const struct parsedname *pn_entry) { (void) oc; (void) pn_entry; } /* Now show the device */ static void ShowDeviceTextCallback(void *v, const struct parsedname * pn_entry) { struct OutputControl * oc = v; ShowText(oc, pn_entry); } static void ShowDeviceCallback(void *v, const struct parsedname * pn_entry) { struct OutputControl * oc = v; Show(oc, pn_entry); } static void ShowDeviceText(struct OutputControl * oc, struct parsedname *pn) { HTTPstart(oc, "200 OK", ct_text); if (pn->selected_filetype == NO_DEVICE) { /* whole device */ //printf("whole directory path=%s \n", pn->path); FS_dir(ShowDeviceTextCallback, oc, pn); } else { /* Single item */ //printf("single item path=%s\n", pn->path); ShowText(oc, pn); } } /* Device entry -- table line for a filetype */ static void ShowJson(struct OutputControl * oc, const struct parsedname *pn_entry) { FILE * out = oc->out ; struct one_wire_query *owq = OWQ_create_from_path(pn_entry->path); // for read or dir struct filetype * ft = pn_entry->selected_filetype ; if (owq == NO_ONE_WIRE_QUERY) { fprintf(out, "null"); } else if ( BAD( OWQ_allocate_read_buffer(owq)) ) { fprintf(out, "null"); } else if (ft == NO_FILETYPE) { ShowJsonDirectory(oc, pn_entry); } else if (IsStructureDir(pn_entry)) { ShowJsonStructure(oc, owq); } else if (ft->format == ft_directory || ft->format == ft_subdir) { ShowJsonDirectory(oc, pn_entry); } else if (ft->write == NO_WRITE_FUNCTION || Globals.readonly) { // Unwritable if (ft->read != NO_READ_FUNCTION) { ShowJsonReadonly(oc, owq); } } else { // Writeable if (ft->read == NO_READ_FUNCTION) { ShowJsonWriteonly(oc, owq); } else { ShowJsonReadWrite(oc, owq); } } OWQ_destroy(owq); } /* Device entry -- table line for a filetype */ static void ShowJsonStructure(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; SIZE_OR_ERROR read_return = FS_read_postparse(owq); if (read_return < 0) { fprintf(out, "null"); return; } fprintf(out, "\"%.*s\":", read_return, OWQ_buffer(owq)); StructureDetailJson( oc, OWQ_buffer(owq) ) ; } /* Detailed (parsed) structure entry */ static void StructureDetailJson(struct OutputControl * oc, const char * structure_details ) { FILE * out = oc->out ; char format_type ; int extension ; int elements ; char rw[4] ; int size ; if ( sscanf( structure_details, "[\"%c\",\"%d\",\"%d\",\"%2s\",\"%d\",", &format_type, &extension, &elements, rw, &size ) < 5 ) { return ; } fprintf(out, "\""); switch( format_type ) { case 'b': fprintf(out, "Binary string"); break ; case 'a': fprintf(out, "Ascii string"); break ; case 'D': fprintf(out, "Directory"); break ; case 'i': fprintf(out, "Integer value"); break ; case 'u': fprintf(out, "Unsigned integer value"); break ; case 'f': fprintf(out, "Floating point value"); break ; case 'l': fprintf(out, "Alias"); break ; case 'y': fprintf(out, "Yes/No value"); break ; case 'd': fprintf(out, "Date value"); break ; case 't': fprintf(out, "Temperature value"); break ; case 'g': fprintf(out, "Delta temperature value"); break ; case 'p': fprintf(out, "Pressure value"); break ; default: fprintf(out, "Unknown value type"); } fprintf(out, "\", \""); if ( elements == 1 ) { fprintf(out, "Singleton"); } else if ( extension == EXTENSION_BYTE ) { fprintf(out, "Array of %d bits as a BYTE",elements); } else if ( extension == EXTENSION_ALL ) { fprintf(out, "Array of %d elements combined",elements); } else { fprintf(out, "Element %d (of %d)",extension,elements); } fprintf(out, "\", \""); if ( strncasecmp( rw, "rw", 2 ) == 0 ) { fprintf(out, "Read/Write"); } else if ( strncasecmp( rw, "ro", 2 ) == 0 ) { fprintf(out, "Read only"); } else if ( strncasecmp( rw, "wo", 2 ) == 0 ) { fprintf(out, "Write only"); } else{ fprintf(out, "No access"); } fprintf(out, "\", \""); if ( format_type == 'b' ) { fprintf(out, "%d bytes",size); } else { fprintf(out, "%d characters",size); } fprintf( out, "\"]" ); } /* Device entry -- table line for a filetype */ static void ShowJsonReadWrite(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; struct parsedname * pn = PN(owq) ; SIZE_OR_ERROR read_return = FS_read_postparse(owq); if (read_return < 0) { fprintf(out, "null"); return; } switch (pn->selected_filetype->format) { case ft_binary: { int i; fprintf(out,"\""); for (i = 0; i < read_return; ++i) { fprintf(out, "%.2hhX", OWQ_buffer(owq)[i]); } fprintf(out,"\""); break; } case ft_yesno: case ft_bitfield: if (pn->extension >= 0) { fprintf(out, "\"%s\"", OWQ_buffer(owq)[0]=='0'?"false":"true"); break; } // fall through default: fprintf(out, "\"%.*s\"", read_return, OWQ_buffer(owq)); break; } } /* Device entry -- table line for a filetype */ static void ShowJsonReadonly(struct OutputControl * oc, struct one_wire_query *owq) { ShowJsonReadWrite(oc, owq); } /* Device entry -- table line for a filetype */ static void ShowJsonWriteonly(struct OutputControl * oc, struct one_wire_query *owq) { FILE * out = oc->out ; (void) owq ; fprintf(out,"null") ; } static void ShowJsonDirectory(struct OutputControl * oc, const struct parsedname *pn_entry) { FILE * out = oc->out ; (void) pn_entry; fprintf(out,"[]") ; } /* Now show the device */ static void ShowDeviceJsonCallback(void *v, const struct parsedname * pn_entry) { struct OutputControl * oc = v ; JSON_dir_entry(oc, "\"%s\":",FS_DirName(pn_entry) ) ; ShowJson(oc, pn_entry); } static void ShowDeviceJson(struct OutputControl * oc, struct parsedname *pn) { FILE * out = oc->out ; HTTPstart(oc, "200 OK", ct_json); if (pn->selected_filetype == NO_DEVICE) { /* whole device */ JSON_dir_init( oc ) ; fprintf(out, "{\n" ) ; FS_dir(ShowDeviceJsonCallback, oc, pn); JSON_dir_finish(oc) ; fprintf(out, "}" ); } else { /* Single item */ //printf("single item path=%s\n", pn->path); fprintf(out, "[ " ) ; ShowJson(oc, pn); fprintf(out, " ]" ) ; } } void ShowDevice(struct OutputControl * oc, struct parsedname *pn) { FILE * out = oc->out ; if (pn->state & ePS_text) { ShowDeviceText(oc, pn); return; } else if (pn->state & ePS_json) { ShowDeviceJson(oc, pn); return; } HTTPstart(oc, "200 OK", ct_html); HTTPtitle(oc, &pn->path[1]); HTTPheader(oc, &pn->path[1]); if (NotUncachedDir(pn) && IsRealDir(pn)) { fprintf(out, "
uncached version", pn->path); } fprintf(out, ""); fprintf(out, "", Backup(pn->path), pn->path); if (pn->selected_filetype == NO_FILETYPE) { /* whole device */ FS_dir(ShowDeviceCallback, oc, pn); } else { /* single item */ Show(oc, pn); } fprintf(out, "
updirectory
"); HTTPfoot(oc); } owfs-3.1p5/module/owhttpd/src/c/owhttpd_dir.c0000644000175000001440000001151712654730021016204 00000000000000/* * http.c for owhttpd (1-wire web server) * By Paul Alfille 2003, using libow * offshoot of the owfs ( 1wire file system ) * * GPL license ( Gnu Public Lincense ) * * Based on chttpd. copyright(c) 0x7d0 greg olszewski * */ #include "owhttpd.h" // #include /* for dirname() */ /* --------------- Functions ---------------- */ static void ShowDirText(struct OutputControl * oc, struct parsedname * pn); static void ShowDirJson(struct OutputControl * oc, struct parsedname * pn); /* Find he next higher level by search for last slash that doesn't end the string */ /* return length of "higher level" */ /* Assumes good path: null delimitted starts with / non-null */ int Backup(const char *path) { int i = strlen(path) - 1; if (i == 0) return 1; if (path[i] == '/') --i; while (path[i] != '/') --i; return i + 1; } #define name_directory "directory" #define name_onewire_chip "1-wire chip" /* Callback function to FS_dir */ static void ShowDirCallback(void *v, const struct parsedname *pn_entry) { /* uncached tag */ /* device name */ /* Have to allocate all buffers to make it work for Coldfire */ struct OutputControl * oc = v; FILE * out = oc->out ; const char *nam; const char *typ; char * escaped_path = httpescape( pn_entry->path ) ; if (IsDir(pn_entry)) { nam = FS_DirName(pn_entry); typ = name_directory; } else { nam = pn_entry->selected_device->readable_name; typ = name_onewire_chip; } fprintf(out, "%s%s%s", escaped_path==NULL ? pn_entry->path : escaped_path, FS_DirName(pn_entry), nam, typ); if ( escaped_path ) { owfree( escaped_path ) ; } } /* Misnamed. Actually all directory */ void ShowDir(struct OutputControl * oc, struct parsedname * pn) { FILE * out = oc->out ; int b = Backup(pn->path); // length of string to get to higher level if (pn->state & ePS_text) { ShowDirText(oc, pn); return; } else if (pn->state & ePS_json) { ShowDirJson(oc, pn); return; } HTTPstart(oc, "200 OK", ct_html); HTTPtitle(oc, "Directory"); if (NotRealDir(pn)) { /* return whole path since tree structure could be much deeper now */ /* first / is stripped off */ HTTPheader(oc, &pn->path[1]); } else if (pn->state) { /* return whole path since tree structure could be much deeper now */ /* first / is stripped off */ HTTPheader(oc, &pn->path[1]); } else { HTTPheader(oc, "directory"); } fprintf(out, ""); if (b != 1) { char * escaped_path = httpescape( pn->path ) ; fprintf(out, "", b, escaped_path==NULL ? pn->path : escaped_path ); if ( escaped_path ) { owfree( escaped_path ) ; } } else { fprintf(out, ""); } FS_dir(ShowDirCallback, oc, pn); fprintf(out, "
uphigher leveldirectory
tophighest leveldirectory
"); HTTPfoot(oc); } static void ShowDirTextCallback(void *v, const struct parsedname *const pn_entry) { /* uncached tag */ /* device name */ /* Have to allocate all buffers to make it work for Coldfire */ struct OutputControl * oc = v; FILE * out = oc->out ; const char *nam; const char *typ; if (IsDir(pn_entry)) { nam = FS_DirName(pn_entry); typ = name_directory; } else { nam = pn_entry->selected_device->readable_name; typ = name_onewire_chip; } fprintf(out, "%s %s \"%s\"\r\n", FS_DirName(pn_entry), nam, typ); } static void ShowDirText(struct OutputControl * oc, struct parsedname * pn) { HTTPstart(oc, "200 OK", ct_text); FS_dir(ShowDirTextCallback, oc, pn); return; } void JSON_dir_init( struct OutputControl * oc ) { oc->not_first = 0 ; } void JSON_dir_entry( struct OutputControl * oc, const char * format, const char * data ) { FILE * out = oc->out ; // handle comma (so not after last entry) if ( oc->not_first ) { fprintf(out, ",\n" ) ; } else { oc->not_first = 1 ; } fprintf(out, format, data ) ; } void JSON_dir_finish( struct OutputControl * oc ) { FILE * out = oc->out ; if ( oc->not_first ) { fprintf(out, "\n" ) ; } } static void ShowDirJsonCallback(void *v, const struct parsedname *const pn_entry) { /* uncached tag */ /* device name */ /* Have to allocate all buffers to make it work for Coldfire */ struct OutputControl * oc = v ; const char *nam; if (IsDir(pn_entry)) { nam = FS_DirName(pn_entry); } else { nam = pn_entry->selected_device->readable_name; } JSON_dir_entry( oc, "\"%s\":[]", nam ) ; } static void ShowDirJson(struct OutputControl * oc, struct parsedname * pn) { FILE * out = oc->out ; JSON_dir_init( oc ) ; HTTPstart(oc, "200 OK", ct_json); fprintf(out, "{" ); FS_dir(ShowDirJsonCallback, oc, pn); JSON_dir_finish( oc ) ; fprintf(out, "}" ); return; } owfs-3.1p5/module/owhttpd/src/c/owhttpd_escape.c0000644000175000001440000000325212654730021016663 00000000000000/* * http.c for owhttpd (1-wire web server) * By Paul Alfille 2003, using libow * offshoot of the owfs ( 1wire file system ) * * GPL license ( Gnu Public Lincense ) * * Based on chttpd. copyright(c) 0x7d0 greg olszewski * */ #include "owhttpd.h" /* Change web-escaped string back to straight ascii */ /* Works in-place since the final string is never longer */ void httpunescape(BYTE * httpstr) { BYTE *in = httpstr; /* input string pointer */ BYTE *out = httpstr; /* output string pointer */ while (in) { switch (*in) { case '+': *out++ = ' '; break; case '\0': *out++ = '\0'; return; case '%': if ( isxdigit(in[1]) && isxdigit(in[2]) ) { ++in; *out++ = string2num((char *) in); ++in; break ; } // fall through default: *out++ = *in; break; } in++; } } /* HTTP encode */ char * httpescape( const char * original_string ) { const char * original_p = original_string ; char * escaped_string ; char * escaped_p ; if ( original_string == NULL ) { return NULL ; } escaped_p = escaped_string = owmalloc( strlen(original_string)*3 + 1 ) ; if ( escaped_string == NULL ) { return NULL ; } while (1) { switch ( *original_p ) { case '\0': *escaped_p = '\0' ; return escaped_string ; case ' ': case '!': case '"': case '#': case '$': case '%': case '@': case '\'': case '(': case ')': case '<': case '>': case ';': case ':': case '+': case ',': case '=': UCLIBCLOCK; escaped_p += sprintf( escaped_p, "%%%.2X", *original_p++ ) ; UCLIBCUNLOCK; break ; default: *escaped_p++ = *original_p++ ; break ; } } } owfs-3.1p5/module/owhttpd/src/c/owhttpd_favicon.c0000644000175000001440000001367612654730021017063 00000000000000/* $Id$ * http.c for owhttpd (1-wire web server) * By Paul Alfille 2003, using libow * offshoot of the owfs ( 1wire file system ) * * GPL license ( Gnu Public Lincense ) * * Based on chttpd. copyright(c) 0x7d0 greg olszewski * */ #include "owhttpd.h" // #include /* for dirname() */ /* ------------ Protoypes ---------------- */ static const char favicon[] = { 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x10, 0x10, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x28, 0x03, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 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, 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, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; void Favicon(struct OutputControl * oc) { FILE * out = oc->out ; int i; HTTPstart(oc, "200 OK", ct_icon); for (i = 0; i < 894; ++i) { fprintf(out, "%c", favicon[i]); } HTTPfoot(oc); } owfs-3.1p5/module/owserver/0000755000175000001440000000000013022537104012733 500000000000000owfs-3.1p5/module/owserver/Makefile.am0000644000175000001440000000001712654730021014710 00000000000000SUBDIRS = src owfs-3.1p5/module/owserver/Makefile.in0000644000175000001440000005501213022537052014725 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owserver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src 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) --foreign module/owserver/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owserver/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owserver/src/0000755000175000001440000000000013022537104013522 500000000000000owfs-3.1p5/module/owserver/src/Makefile.am0000644000175000001440000000002512654730021015476 00000000000000SUBDIRS = include c owfs-3.1p5/module/owserver/src/Makefile.in0000644000175000001440000005503413022537052015520 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owserver/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include c 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) --foreign module/owserver/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owserver/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owserver/src/include/0000755000175000001440000000000013022537104015145 500000000000000owfs-3.1p5/module/owserver/src/include/Makefile.am0000644000175000001440000000003512654730021017122 00000000000000noinst_HEADERS = owserver.h owfs-3.1p5/module/owserver/src/include/owserver.h0000644000175000001440000000514512654730021017122 00000000000000/* $Id$ OWFS and OWHTTPD one-wire file system and one-wire web server By Paul H Alfille {c} 2003 GPL paul.alfille@gmail.com */ /* OWSERVER - specific header */ #ifndef OWSERVER_H #define OWSERVER_H #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" pthread_mutex_t persistence_mutex ; #define PERSISTENCELOCK _MUTEX_LOCK( persistence_mutex ) ; #define PERSISTENCEUNLOCK _MUTEX_UNLOCK( persistence_mutex ) ; #define TOCLIENTLOCK(hd) _MUTEX_LOCK( (hd)->to_client ) #define TOCLIENTUNLOCK(hd) _MUTEX_UNLOCK( (hd)->to_client ) enum toclient_state { toclient_postping , // also initial state toclient_postmessage, // only for interme4diate messages like DIR entries toclient_complete, // final payload has been sent } ; // this structure holds the data needed for the handler function called in a separate thread by the ping wrapper struct handlerdata { int file_descriptor; int persistent; pthread_mutex_t to_client; int ping_pipe[2] ; enum toclient_state toclient ; struct timeval tv; struct server_msg sm; struct serverpackage sp; }; /* read from client, free return pointer if not Null */ int FromClient(struct handlerdata *hd); /* Send fully configured message back to client */ int ToClient(int file_descriptor, struct client_msg *cm, const char *data); /* Read from 1-wire bus and return file contents */ void *ReadHandler(struct handlerdata *hd, struct client_msg *cm, struct one_wire_query *owq); /* write a new value ot a 1-wire device */ void WriteHandler(struct handlerdata *hd, struct client_msg *cm, struct one_wire_query *owq); /* Clasic directory -- one value at a time */ void DirHandler(struct handlerdata *hd, struct client_msg *cm, const struct parsedname *pn); /* Newer directory-at-once */ void *DirallHandler(struct handlerdata *hd, struct client_msg *cm, const struct parsedname *pn); /* Newer directory-at-once with directory '/' */ void *DirallslashHandler(struct handlerdata *hd, struct client_msg *cm, const struct parsedname *pn); /* Handle the actual request -- pings handled higher up */ void *DataHandler(void *v); /* Handle a client request, including timeout pings */ void Handler(FILE_DESCRIPTOR_OR_ERROR file_descriptor); /* Send a response to client of an error */ void ErrorToClient(struct handlerdata *hd, struct client_msg * cm ) ; /* Send a timeout ping */ void PingClient(struct handlerdata *hd); /* Loop waiting for finish sending pings */ void PingLoop(struct handlerdata *hd) ; /* Create a md5 hash (for the token) */ void md5(const uint8_t *initial_msg, size_t initial_len, uint8_t *digest) ; #endif /* OWSERVER_H */ owfs-3.1p5/module/owserver/src/include/Makefile.in0000644000175000001440000004462113022537053017144 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owserver/src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 HEADERS = $(noinst_HEADERS) 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)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = owserver.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) --foreign module/owserver/src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owserver/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(HEADERS) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am 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-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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool 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-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags 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: owfs-3.1p5/module/owserver/src/c/0000755000175000001440000000000013022537104013744 500000000000000owfs-3.1p5/module/owserver/src/c/Makefile.am0000644000175000001440000000261212665167763015747 00000000000000if ENABLE_OWSERVER MODULE_OWSERVER = owserver endif if ENABLE_OWEXTERNAL MODULE_OWEXTERNAL = owexternal endif bin_PROGRAMS = $(MODULE_OWSERVER) $(MODULE_OWEXTERNAL) owserver_SOURCES = owserver.c \ from_client.c \ to_client.c \ read.c \ write.c \ dir.c \ dirall.c \ dirallslash.c \ data.c \ error.c \ handler.c \ loop.c \ md5.c \ ping.c owserver_DEPENDENCIES = ../../../owlib/src/c/libow.la owexternal_SOURCES = $(owserver_SOURCES) owexternal_DEPENDENCIES = $(owserver_DEPENDENCIES) AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${PTHREAD_CFLAGS} \ ${EXTRACFLAGS} LDADD = -low ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} #if HAVE_CYGWIN #NOWINE=1 #else #DOS_OWFSROOT:=$(OWFSROOT) #LINT_DIR:=$(DOS_OWFSROOT)/src/tools/lint #LINT_CC:=wine $(LINT_DIR)/lint-nt.exe #endif # #SRC:=$(owserver_SOURCES) #include $(abs_top_srcdir)/src/tools/lint/lint.mk # #clean-generic: # @RM@ -f *~ .*~ *.lint *.lint.txt .#* *.bak owfs-3.1p5/module/owserver/src/c/Makefile.in0000644000175000001440000006520113022537053015740 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) subdir = module/owserver/src/c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @ENABLE_OWSERVER_TRUE@am__EXEEXT_1 = owserver$(EXEEXT) @ENABLE_OWEXTERNAL_TRUE@am__EXEEXT_2 = owexternal$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__objects_1 = owserver.$(OBJEXT) from_client.$(OBJEXT) \ to_client.$(OBJEXT) read.$(OBJEXT) write.$(OBJEXT) \ dir.$(OBJEXT) dirall.$(OBJEXT) dirallslash.$(OBJEXT) \ data.$(OBJEXT) error.$(OBJEXT) handler.$(OBJEXT) \ loop.$(OBJEXT) md5.$(OBJEXT) ping.$(OBJEXT) am_owexternal_OBJECTS = $(am__objects_1) owexternal_OBJECTS = $(am_owexternal_OBJECTS) owexternal_LDADD = $(LDADD) am__DEPENDENCIES_1 = 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 = am_owserver_OBJECTS = owserver.$(OBJEXT) from_client.$(OBJEXT) \ to_client.$(OBJEXT) read.$(OBJEXT) write.$(OBJEXT) \ dir.$(OBJEXT) dirall.$(OBJEXT) dirallslash.$(OBJEXT) \ data.$(OBJEXT) error.$(OBJEXT) handler.$(OBJEXT) \ loop.$(OBJEXT) md5.$(OBJEXT) ping.$(OBJEXT) owserver_OBJECTS = $(am_owserver_OBJECTS) owserver_LDADD = $(LDADD) 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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(owexternal_SOURCES) $(owserver_SOURCES) DIST_SOURCES = $(owexternal_SOURCES) $(owserver_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)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @ENABLE_OWSERVER_TRUE@MODULE_OWSERVER = owserver @ENABLE_OWEXTERNAL_TRUE@MODULE_OWEXTERNAL = owexternal owserver_SOURCES = owserver.c \ from_client.c \ to_client.c \ read.c \ write.c \ dir.c \ dirall.c \ dirallslash.c \ data.c \ error.c \ handler.c \ loop.c \ md5.c \ ping.c owserver_DEPENDENCIES = ../../../owlib/src/c/libow.la owexternal_SOURCES = $(owserver_SOURCES) owexternal_DEPENDENCIES = $(owserver_DEPENDENCIES) AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${PTHREAD_CFLAGS} \ ${EXTRACFLAGS} LDADD = -low ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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) --foreign module/owserver/src/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owserver/src/c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list owexternal$(EXEEXT): $(owexternal_OBJECTS) $(owexternal_DEPENDENCIES) $(EXTRA_owexternal_DEPENDENCIES) @rm -f owexternal$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owexternal_OBJECTS) $(owexternal_LDADD) $(LIBS) owserver$(EXEEXT): $(owserver_OBJECTS) $(owserver_DEPENDENCIES) $(EXTRA_owserver_DEPENDENCIES) @rm -f owserver$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owserver_OBJECTS) $(owserver_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirallslash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/from_client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owserver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/to_client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile #if HAVE_CYGWIN #NOWINE=1 #else #DOS_OWFSROOT:=$(OWFSROOT) #LINT_DIR:=$(DOS_OWFSROOT)/src/tools/lint #LINT_CC:=wine $(LINT_DIR)/lint-nt.exe #endif # #SRC:=$(owserver_SOURCES) #include $(abs_top_srcdir)/src/tools/lint/lint.mk # #clean-generic: # @RM@ -f *~ .*~ *.lint *.lint.txt .#* *.bak # 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: owfs-3.1p5/module/owserver/src/c/owserver.c0000644000175000001440000000743012654730021015713 00000000000000/* OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* --- Prototypes ------------ */ static void SetupAntiloop(int argc, char **argv); int main(int argc, char **argv) { int c; /* Set up owlib */ LibSetup(program_type_server); Setup_Systemd() ; // systemd? Setup_Launchd() ; // launchd? /* grab our executable name */ ArgCopy( argc, argv ) ; if ( strcasecmp( Globals.argv[0], "owexternal" ) == 0 ) { Globals.allow_external = 1 ; // only if program named "owexternal" } while ((c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL)) != -1) { switch (c) { case 'V': fprintf(stderr, "%s version:\n\t" VERSION "\n", argv[0]); break; default: break; } if ( BAD( owopt(c, optarg) ) ) { ow_exit(0); /* rest of message */ } } /* non-option arguments */ while (optind < argc) { ARG_Generic(argv[optind]); ++optind; } if (Outbound_Control.active == 0) { ARG_Server(NULL); // make the default assignment or systemd } /* become a daemon if not told otherwise */ if ( BAD(EnterBackground()) ) { ow_exit(1); } /* Set up adapters and systemd*/ if ( BAD(LibStart(NULL)) ) { ow_exit(1); } set_exit_signal_handlers(exit_handler); set_signal_handlers(NULL); _MUTEX_INIT(persistence_mutex); /* Set up "Antiloop" -- a unique token */ SetupAntiloop( argc, argv ); /* Call up main processing routine -- waits for network queries */ ServerProcess( Handler ); LEVEL_DEBUG("ServerProcess done"); _MUTEX_DESTROY(persistence_mutex); ow_exit(0); return 0; } #define ARG_STRING_LENGTH 500 static void SetupAntiloop(int argc, char **argv) { // a structure of relatively unique items to hash together struct { struct tms t; pid_t pid ; long int rand ; char args[ARG_STRING_LENGTH+1] ; } data_struct ; int argnum ; int left = ARG_STRING_LENGTH ; // current time times( & (data_struct.t) ); // process ID data_struct.pid = getpid() ; // random number (seeded from current time) srandom(time(0)) ; data_struct.rand = random() ; // command line arguments (don't clear out buffer) for ( argnum=0 ; argnum < argc ; ++argnum ) { int argsize = strlen( argv[argnum] ) ; if ( argsize > left ) { argsize = left ; } strncat( data_struct.args, argv[argnum], argsize ) ; left -= argsize ; } // backup definition memcpy( Globals.Token.uuid, (void *) &data_struct, 16 ) ; // use MD5 has (gives the required 16 bytes) md5( (void *) &data_struct, sizeof(data_struct) , Globals.Token.uuid ) ; } owfs-3.1p5/module/owserver/src/c/from_client.c0000644000175000001440000001213712654730021016340 00000000000000/* $Id$ OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* read from client, free return pointer if not Null */ int FromClient(struct handlerdata *hd) { BYTE *msg; ssize_t trueload; size_t actual_read ; struct timeval tv = { Globals.timeout_server, 0, }; /* Clear return structure */ memset(&hd->sp, 0, sizeof(struct serverpackage)); /* read header */ tcp_read(hd->file_descriptor, (BYTE *) &hd->sm, sizeof(struct server_msg), &tv, &actual_read) ; if (actual_read != sizeof(struct server_msg)) { hd->sm.type = msg_error; return -EIO; } /* translate endian state */ hd->sm.version = ntohl(hd->sm.version); hd->sm.payload = ntohl(hd->sm.payload); hd->sm.type = ntohl(hd->sm.type); hd->sm.control_flags = ntohl(hd->sm.control_flags); hd->sm.size = ntohl(hd->sm.size); hd->sm.offset = ntohl(hd->sm.offset); LEVEL_DEBUG("FromClient payload=%d size=%d type=%d sg=0x%X offset=%d", hd->sm.payload, hd->sm.size, hd->sm.type, hd->sm.control_flags, hd->sm.offset); /* figure out length of rest of message: payload plus tokens */ trueload = hd->sm.payload; if (isServermessage(hd->sm.version)) { trueload += sizeof(struct antiloop) * Servertokens(hd->sm.version); LEVEL_DEBUG("FromClient (servermessage) payload=%d nrtokens=%d trueload=%d size=%d type=%d controlflags=0x%X offset=%d", hd->sm.payload, Servertokens(hd->sm.version), trueload, hd->sm.size, hd->sm.type, hd->sm.control_flags, hd->sm.offset); } else { LEVEL_DEBUG("FromClient (no servermessage) payload=%d size=%d type=%d controlflags=0x%X offset=%d", hd->sm.payload, hd->sm.size, hd->sm.type, hd->sm.control_flags, hd->sm.offset); } if (trueload == 0) { return 0; } /* valid size? */ if ((hd->sm.payload < 0) || (trueload > MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE)) { hd->sm.type = msg_error; return -EMSGSIZE; } /* Can allocate space? */ if ((msg = owmalloc(trueload+2)) == NULL) { /* create a buffer */ // Adds an extra byte for the path null hd->sm.type = msg_error; return -ENOMEM; } /* read in data */ tcp_read(hd->file_descriptor, msg, trueload, &tv, &actual_read) ; if ((ssize_t)actual_read != trueload) { /* read in the expected data */ hd->sm.type = msg_error; goto BADDATA ; } /* New algorithm as of 2.9p4 -- no longer use terminating null as path length * now use payload length and data size (for writes) * */ if (hd->sm.payload) { int pathlen = hd->sm.payload ; if ( hd->sm.type == msg_write ) { // only for write -- everything else has just path pathlen -= hd->sm.size ; if ( pathlen <= 0 ) { LEVEL_DEBUG("Data size mismatch") ; goto BADDATA ; } if ( msg[pathlen-1] == '\0' ) { // already null-terminated string // no reason to increase size, shift data, and add null hd->sp.data = & msg[pathlen]; } else { // make room for null at end of path (needed for some clients) // we allocated extra space and will use memmove that allows overlapping memmove( &msg[pathlen+1], &msg[pathlen], hd->sm.size ) ; msg[pathlen] = '\0' ; // terminating null hd->sp.data = & msg[pathlen+1]; } hd->sp.datasize = hd->sm.size; } else { // add null for the rest msg[hd->sm.payload] = '\0' ; // terminating null hd->sp.data = NULL; hd->sp.datasize = 0; } hd->sp.path = (char *) msg; } else { hd->sp.data = NULL; hd->sp.datasize = 0; } if (isServermessage(hd->sm.version)) { /* make sure no loop */ size_t i; BYTE *p = &msg[hd->sm.payload]; // end of normal buffer hd->sp.tokenstring = p; hd->sp.tokens = Servertokens(hd->sm.version); for (i = 0; i < hd->sp.tokens; ++i, p += sizeof(struct antiloop)) { if (memcmp(p, &(Globals.Token), sizeof(struct antiloop)) == 0) { hd->sm.type = msg_error; LEVEL_CALL("owserver loop suppression"); goto BADDATA ; } } } return 0; BADDATA: owfree(msg); return -EINVAL; } owfs-3.1p5/module/owserver/src/c/to_client.c0000644000175000001440000000672512654730021016025 00000000000000/* $Id$ OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* Send fully configured message back to client. data is optional and length depends on "payload" */ int ToClient(int file_descriptor, struct client_msg *machine_order_cm, const char *data) { struct client_msg s_cm; struct client_msg *network_order_cm = &s_cm; int nio = 1; // at least header #if ( __GNUC__ > 4 ) || (__GNUC__ == 4 && __GNUC_MINOR__ > 4 ) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" // note data should be (const char *) but iovec complains about const arguments struct iovec io[] = { {network_order_cm, sizeof(struct client_msg),}, { (char *) data, machine_order_cm->payload,}, }; #pragma GCC diagnostic pop #else // note data should be (const char *) but iovec complains about const arguments struct iovec io[] = { {network_order_cm, sizeof(struct client_msg),}, { (char *) data, machine_order_cm->payload,}, }; #endif // Prep header network_order_cm->version = htonl( machine_order_cm->version ); network_order_cm->payload = htonl( machine_order_cm->payload ); network_order_cm->ret = htonl( machine_order_cm->ret ); network_order_cm->control_flags = htonl( machine_order_cm->control_flags ); network_order_cm->size = htonl( machine_order_cm->size ); network_order_cm->offset = htonl( machine_order_cm->offset ); LEVEL_DEBUG("payload=%d size=%d, ret=%d, sg=0x%X offset=%d ", machine_order_cm->payload, machine_order_cm->size, machine_order_cm->ret, machine_order_cm->control_flags, machine_order_cm->offset); /* If payload==0, no extra data If payload <0, flag to show a delay message, again no data */ if(machine_order_cm->payload < 0) { LEVEL_DEBUG("Send delay message (ping)"); } else if ( machine_order_cm->payload == 0 ) { LEVEL_DEBUG("No data") ; } else if ( data == NULL ) { LEVEL_DEBUG("Bad data pointer -- NULL") ; } else { nio = 2; // add data segment TrafficOutFD("to server data",io[1].iov_base,io[1].iov_len,file_descriptor); } return writev(file_descriptor, io, nio) != (ssize_t) (io[0].iov_len + io[1].iov_len); } owfs-3.1p5/module/owserver/src/c/read.c0000644000175000001440000000755212654730021014757 00000000000000/* $Id$ OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* Read, called from Handler with the following caveates: */ /* path is path, already parsed, and null terminated */ /* sm has been read, cm has been zeroed */ /* pn is configured */ /* Read, will return: */ /* cm fully constructed */ /* a malloc'ed string, that must be free'd by Handler */ /* The length of string is cm.payload */ /* If cm.payload is 0, then a NULL string is returned */ /* cm.ret is also set to an error <0 or the read length */ void *ReadHandler(struct handlerdata *hd, struct client_msg *cm, struct one_wire_query *owq) { BYTE * retbuffer = NULL ; SIZE_OR_ERROR read_or_error; LEVEL_DEBUG("ReadHandler start"); if (hd == NULL || owq == NULL || cm == NULL) { LEVEL_DEBUG("ReadHandler: illegal null inputs hd==%p owq==%p cm==%p", hd, owq, cm); return NULL; // only sane response for bad inputs } LEVEL_DEBUG("ReadHandler: From Client sm->payload=%d sm->size=%d sm->offset=%d", hd->sm.payload, hd->sm.size, hd->sm.offset); if (hd->sm.payload >= PATH_MAX) { cm->ret = -EMSGSIZE; } else if ((hd->sm.size <= 0) || (hd->sm.size > MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE)) { cm->ret = -EMSGSIZE; LEVEL_DEBUG("ReadHandler: error hd->sm.size == %d", hd->sm.size); } else if ( BAD( OWQ_allocate_read_buffer(owq)) ) { // allocate read buffer LEVEL_DEBUG("ReadHandler: can't allocate memory"); cm->ret = -ENOBUFS; } else { struct parsedname *pn = PN(owq); if ( OWQ_size(owq) > (size_t) hd->sm.size ) { OWQ_size(owq) = hd->sm.size ; } OWQ_offset(owq) = hd->sm.offset ; LEVEL_DEBUG("ReadHandler: call FS_read_postparse on %s", pn->path); read_or_error = FS_read_postparse(owq); LEVEL_DEBUG("ReadHandler: FS_read_postparse read on %s return = %d", pn->path, read_or_error); Debug_OWQ(owq); if (read_or_error <= 0) { LEVEL_DEBUG("ReadHandler: FS_read_postparse error %d", read_or_error); cm->ret = read_or_error; } else { LEVEL_DEBUG("ReadHandler: FS_read_postparse ok size=%d", read_or_error); // make return size smaller (just large enough) cm->payload = read_or_error; cm->offset = hd->sm.offset; cm->size = read_or_error; cm->ret = read_or_error; /* Move this pointer, and let owfree remove it instead of OWQ_destroy() */ retbuffer = (BYTE *)OWQ_buffer(owq); OWQ_buffer(owq) = NULL; } } LEVEL_DEBUG("ReadHandler: To Client cm->payload=%d cm->size=%d cm->offset=%d", cm->payload, cm->size, cm->offset); if ((cm->size > 0)) { Debug_Bytes("Data returned to client",(BYTE *) OWQ_buffer(owq),cm->size) ; } return retbuffer; } owfs-3.1p5/module/owserver/src/c/write.c0000644000175000001440000000441612654730021015172 00000000000000/* $Id$ OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* Write, called from Handler with the following caveates: */ /* path is path, already parsed, and null terminated */ /* sm has been read, cm has been zeroed */ /* pn is configured */ /* data is what will be written, of sm->size length */ /* cm fully constructed */ /* cm.ret is also set to an error <0 or the written length */ void WriteHandler(struct handlerdata *hd, struct client_msg *cm, struct one_wire_query *owq) { int ret; LEVEL_DEBUG("WriteHandler: hd->sm.payload=%d hd->sm.size=%d hd->sm.offset=%d OWQ_size=%d OWQ_offset=%d", hd->sm.payload, hd->sm.size, hd->sm.offset, OWQ_size(owq), OWQ_offset(owq)); ret = FS_write_postparse(owq); //printf("Handler: WRITE done\n"); if (ret < 0) { cm->size = 0; cm->ret = ret; } else { cm->size = ret; cm->ret = 0; cm->control_flags = OWQ_pn(owq).control_flags; if (hd->persistent) cm->control_flags |= PERSISTENT_MASK; } } owfs-3.1p5/module/owserver/src/c/dir.c0000644000175000001440000000630712654730021014617 00000000000000/* $Id$ OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* Dir, called from Handler with the following caveats: */ /* path is path, already parsed, and null terminated */ /* sm has been read, cm has been zeroed */ /* pn is configured */ /* Dir, will return: */ /* cm fully constructed for error message or null marker (end of directory elements */ /* cm.ret is also set to an error or 0 */ struct dirhandlerstruct { struct handlerdata *hd; struct client_msg *cm; }; static void DirHandlerCallback(void *v, const struct parsedname *pn_entry) { struct dirhandlerstruct *dhs = (struct dirhandlerstruct *) v; const char *path = pn_entry->path; LEVEL_DEBUG("owserver Calling dir=%s", SAFESTRING(path)); dhs->cm->size = strlen(path); dhs->cm->payload = dhs->cm->size + 1; dhs->cm->ret = 0; TOCLIENTLOCK(dhs->hd); ToClient(dhs->hd->file_descriptor, dhs->cm, path); // send this directory element dhs->hd->toclient = toclient_postmessage ; TOCLIENTUNLOCK(dhs->hd); } void DirHandler(struct handlerdata *hd, struct client_msg *cm, const struct parsedname *pn) { uint32_t flags = 0; struct dirhandlerstruct dhs = { hd, cm, }; LEVEL_CALL("DirHandler: pn->path=%s", pn->path); // Settings for all directory elements cm->payload = strlen(pn->path) + 1 + OW_FULLNAME_MAX + 2; LEVEL_DEBUG("OWSERVER SpecifiedBus=%d path=%s", SpecifiedBus(pn), SAFESTRING(pn->path)); if (hd->sm.payload >= PATH_MAX) { cm->ret = -EMSGSIZE; } else { // Now generate the directory using the callback function above for each element cm->ret = FS_dir_remote(DirHandlerCallback, &dhs, pn, &flags); } // Finished -- send some flags and set up for a null element to tell client we're done cm->offset = flags; /* send the flags in the offset slot */ /* Now null entry to show end of directory listing */ cm->payload = cm->size = 0; //printf("DirHandler: DIR done ret=%d flags=%d\n", cm->ret, flags); } owfs-3.1p5/module/owserver/src/c/dirall.c0000644000175000001440000000570412654730021015310 00000000000000/* $Id$ OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* Dirall, called from Handler with the following caveats: */ /* path is path, already parsed, and null terminated */ /* sm has been read, cm has been zeroed */ /* pn is configured */ /* Dir, will return: */ /* cm fully constructed for error message or null marker (end of directory elements */ /* cm.ret is also set to an error or 0 */ void DirallHandlerCallback(void *v, const struct parsedname *pn_entry) { struct charblob *cb = v; CharblobAdd(pn_entry->path, strlen(pn_entry->path), cb); } void *DirallHandler(struct handlerdata *hd, struct client_msg *cm, const struct parsedname *pn) { uint32_t flags = 0; struct charblob cb; char *ret = NULL; (void) hd; CharblobInit(&cb); // Now generate the directory (using the embedded callback function above for each element LEVEL_DEBUG("OWSERVER Dir-All SpecifiedBus=%d path = %s", SpecifiedBus(pn), SAFESTRING(pn->path)); if (hd->sm.payload >= PATH_MAX) { cm->ret = -EMSGSIZE; } else { // Now generate the directory using the callback function above for each element cm->ret = FS_dir_remote(DirallHandlerCallback, &cb, pn, &flags); } if (cm->ret < 0) { // error cm->size = cm->payload = 0; } else if (CharblobData(&cb) == NO_CHARBLOB) { // empty cm->size = cm->payload = 0; } else if ((ret = owstrdup(CharblobData(&cb))) != NULL) { // try to copy cm->payload = CharblobLength(&cb) + 1; cm->size = CharblobLength(&cb); } else { // couldn't copy cm->ret = -ENOMEM; cm->size = cm->payload = 0; } cm->offset = flags; /* send the flags in the offset slot */ CharblobClear(&cb); return ret; } owfs-3.1p5/module/owserver/src/c/dirallslash.c0000644000175000001440000000602512654730021016340 00000000000000/* $Id$ OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* Dirallslash, called from Handler with the following caveats: */ /* path is path, already parsed, and null terminated */ /* sm has been read, cm has been zeroed */ /* pn is configured */ /* Dir, will return: */ /* cm fully constructed for error message or null marker (end of directory elements */ /* cm.ret is also set to an error or 0 */ static void DirallslashHandlerCallback(void *v, const struct parsedname *pn_entry) { struct charblob *cb = v; CharblobAdd(pn_entry->path, strlen(pn_entry->path), cb); if (IsDir(pn_entry)) { CharblobAddChar('/',cb); } } void *DirallslashHandler(struct handlerdata *hd, struct client_msg *cm, const struct parsedname *pn) { uint32_t flags = 0; struct charblob cb; char *ret = NULL; (void) hd; CharblobInit(&cb); // Now generate the directory (using the embedded callback function above for each element LEVEL_DEBUG("OWSERVER Dir-All SpecifiedBus=%d path = %s", SpecifiedBus(pn), SAFESTRING(pn->path)); if (hd->sm.payload >= PATH_MAX) { cm->ret = -EMSGSIZE; } else { // Now generate the directory using the callback function above for each element cm->ret = FS_dir_remote(DirallslashHandlerCallback, &cb, pn, &flags); } if (cm->ret < 0) { // error cm->size = cm->payload = 0; } else if (CharblobData(&cb) == NO_CHARBLOB) { // empty cm->size = cm->payload = 0; } else if ((ret = owstrdup(CharblobData(&cb))) != NULL) { // try to copy cm->payload = CharblobLength(&cb) + 1; cm->size = CharblobLength(&cb); } else { // couldn't copy cm->ret = -ENOMEM; cm->size = cm->payload = 0; } cm->offset = flags; /* send the flags in the offset slot */ CharblobClear(&cb); return ret; } owfs-3.1p5/module/owserver/src/c/data.c0000644000175000001440000001545612654730021014757 00000000000000/* OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* * lower level routine for actually handling a request * deals with data (ping is handled higher) */ void *DataHandler(void *v) { struct handlerdata *hd = v; char *retbuffer = NULL; struct client_msg cm; // the return message #if OW_CYGWIN /* Random generator seem to need initialization for each new thread * If not, seed will be reset and rand() will return 0 the first call. */ { struct timeval tv; gettimeofday(&tv, NULL); srand((unsigned int) tv.tv_usec); } #endif memset(&cm, 0, sizeof(struct client_msg)); cm.version = MakeServerprotocol(OWSERVER_PROTOCOL_VERSION); cm.control_flags = hd->sm.control_flags; // default flag return -- includes persistence state /* Pre-handling for special testing mode to exclude certain messages */ switch ((enum msg_classification) hd->sm.type) { case msg_dirall: case msg_dirallslash: if (Globals.no_dirall) { LEVEL_DEBUG("DIRALL message rejected.") ; hd->sm.type = msg_error; } break; case msg_get: case msg_getslash: if (Globals.no_get) { LEVEL_DEBUG("GET message rejected.") ; hd->sm.type = msg_error; } break; default: break; } /* Now Check message types and only parse valid messages */ switch ((enum msg_classification) hd->sm.type) { // outer switch case msg_read: // good message case msg_write: // good message case msg_dir: // good message case msg_presence: // good message case msg_dirall: // good message case msg_dirallslash: // good message case msg_get: // good message case msg_getslash: // good message if (hd->sm.payload == 0) { /* Bad query -- no data after header */ LEVEL_DEBUG("No payload -- ignore.") ; cm.ret = -EBADMSG; } else { struct parsedname *pn; OWQ_allocate_struct_and_pointer(owq); pn = PN(owq); /* Parse the path string and crete query object */ LEVEL_CALL("DataHandler: parse path=%s", hd->sp.path); cm.ret = BAD( OWQ_create(hd->sp.path, owq) ) ? -1 : 0 ; if ( cm.ret != 0 ) { LEVEL_DEBUG("DataHandler: OWQ_create failed cm.ret=%d", cm.ret); break; } /* Use client persistent settings (temp scale, display mode ...) */ pn->control_flags = hd->sm.control_flags; /* Override some settings from control flags */ if ( (pn->control_flags & UNCACHED) != 0 ) { // client wants uncached pn->state |= ePS_uncached; } if ( (pn->control_flags & ALIAS_REQUEST) == 0 ) { // client wants unaliased pn->state |= ePS_unaliased; } /* Antilooping tags */ pn->tokens = hd->sp.tokens; pn->tokenstring = hd->sp.tokenstring; //printf("Handler: sm.sg=%X pn.state=%X\n", sm.sg, pn.state); //printf("Scale=%s\n", TemperatureScaleName(SGTemperatureScale(sm.sg))); switch ((enum msg_classification) hd->sm.type) { case msg_presence: LEVEL_CALL("Presence message for %s", SAFESTRING(pn->path)); // Basically, if we were able to ParsedName it's here! cm.size = 0; retbuffer = owmalloc( SERIAL_NUMBER_SIZE ) ; if ( retbuffer ) { memcpy( retbuffer, pn->sn, SERIAL_NUMBER_SIZE ) ; cm.payload = SERIAL_NUMBER_SIZE ; } else { cm.payload = 0 ; } cm.ret = 0; // good answer break; case msg_read: LEVEL_CALL("Read message"); retbuffer = ReadHandler(hd, &cm, owq); LEVEL_DEBUG("Read message done value=%p", retbuffer); break; case msg_write: LEVEL_CALL("Write message"); if ( (int) hd->sp.datasize < hd->sm.size ) { cm.ret = -EMSGSIZE; } else { /* set buffer (size already set) */ OWQ_assign_write_buffer( (ASCII *) hd->sp.data, hd->sm.size, hd->sm.offset, owq) ; WriteHandler(hd, &cm, owq); } break; case msg_dir: LEVEL_CALL("Directory message (one at a time)"); DirHandler(hd, &cm, pn); break; case msg_dirall: LEVEL_CALL("Directory message (all at once)"); retbuffer = DirallHandler(hd, &cm, pn); break; case msg_dirallslash: LEVEL_CALL("Directory message (all at once, with directory /)"); retbuffer = DirallslashHandler(hd, &cm, pn); break; case msg_get: if (IsDir(pn)) { LEVEL_CALL("Get -> Directory message (all at once)"); retbuffer = DirallHandler(hd, &cm, pn); } else { LEVEL_CALL("Get -> Read message"); retbuffer = ReadHandler(hd, &cm, owq); } break; case msg_getslash: if (IsDir(pn)) { LEVEL_CALL("Get -> Directory message (all at once)"); retbuffer = DirallslashHandler(hd, &cm, pn); } else { LEVEL_CALL("Get -> Read message"); retbuffer = ReadHandler(hd, &cm, owq); } break; default: // never reached LEVEL_CALL("Error: unknown message %d", (int) hd->sm.type); break; } OWQ_destroy(owq); LEVEL_DEBUG("DataHandler: FS_ParsedName_destroy done"); } break; case msg_nop: // "bad" message LEVEL_CALL("NOP message"); cm.ret = 0; break; case msg_size: // no longer used case msg_error: default: // "bad" message cm.ret = -ENOMSG; LEVEL_CALL("No message"); break; } LEVEL_DEBUG("DataHandler: cm.ret=%d", cm.ret); TOCLIENTLOCK(hd); if (cm.ret != -EIO) { ToClient(hd->file_descriptor, &cm, retbuffer); } else { ErrorToClient(hd, &cm) ; } // Signal to PingLoop that we're done. hd->toclient = toclient_complete ; if ( hd->ping_pipe[fd_pipe_write] != FILE_DESCRIPTOR_BAD ) { ignore_result = write( hd->ping_pipe[fd_pipe_write],"X",1) ; //dummy payload } TOCLIENTUNLOCK(hd); if (retbuffer) { owfree(retbuffer); } LEVEL_DEBUG("Finished with client request"); return VOID_RETURN; } owfs-3.1p5/module/owserver/src/c/error.c0000644000175000001440000000311412654730021015163 00000000000000/* $Id$ OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" void ErrorToClient(struct handlerdata *hd, struct client_msg * cm ) { cm->payload = 0 ; cm->size = 0 ; cm->offset = 0 ; ToClient(hd->file_descriptor, cm, NULL); // send the ping } owfs-3.1p5/module/owserver/src/c/handler.c0000644000175000001440000001135312654730021015453 00000000000000/* $Id$ OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" /* Counters for persistent connections */ int persistent_connections = 0; int handler_count = 0 ; static void SingleHandler(struct handlerdata *hd); /* * Main routine for actually handling a request * deals with a connection */ void Handler(FILE_DESCRIPTOR_OR_ERROR file_descriptor) { struct handlerdata hd; struct timeval tv_low = { Globals.timeout_persistent_low, 0, }; struct timeval tv_high = { Globals.timeout_persistent_high, 0, }; int persistent = 0; hd.file_descriptor = file_descriptor; _MUTEX_INIT(hd.to_client); timersub(&tv_high, &tv_low, &tv_high); // just the delta while (FromClient(&hd) == 0) { // Was persistence requested? int loop_persistent = ((hd.sm.control_flags & PERSISTENT_MASK) != 0); /* Persistence suppression? */ if (Globals.no_persistence) { loop_persistent = 0; } /* Persistence logic */ if (loop_persistent) { /* Requested persistence */ LEVEL_DEBUG("Persistence requested"); if (persistent) { /* already had persistence granted */ hd.persistent = 1; /* so keep it */ } else { /* See if available */ PERSISTENCELOCK; if (persistent_connections < Globals.clients_persistent_high) { /* ok */ ++persistent_connections; /* global count */ persistent = 1; /* connection toggle */ hd.persistent = 1; /* for responses */ } else { loop_persistent = 0; /* denied! */ hd.persistent = 0; /* for responses */ } PERSISTENCEUNLOCK; } } else { /* No persistence requested this time */ hd.persistent = 0; /* for responses */ } /* now set the sg flag because it usually is copied back to the client */ if (loop_persistent) { hd.sm.control_flags |= PERSISTENT_MASK; } else { hd.sm.control_flags &= ~PERSISTENT_MASK; } /* Do the real work */ SingleHandler(&hd); /* Now see if we should reloop */ if (loop_persistent == 0) { break; /* easiest one */ } /* Shorter wait */ if ( BAD(tcp_wait(file_descriptor, &tv_low)) ) { // timed out /* test if below threshold for longer wait */ PERSISTENCELOCK; /* store the test because the mutex locks the variable */ loop_persistent = (persistent_connections < Globals.clients_persistent_low); PERSISTENCEUNLOCK; if (loop_persistent == 0) { break; /* too many connections and we're slow */ } /* longer wait */ if ( BAD(tcp_wait(file_descriptor, &tv_high)) ) { break; } } LEVEL_DEBUG("OWSERVER tcp connection persistence -- reusing connection now."); } LEVEL_DEBUG("OWSERVER handler done"); _MUTEX_DESTROY(hd.to_client); // restore the persistent count if (persistent) { PERSISTENCELOCK; --persistent_connections; PERSISTENCEUNLOCK; } } static void SingleHandler(struct handlerdata *hd) { timerclear(&hd->tv); LEVEL_DEBUG("START handler %s",hd->sp.path) ; gettimeofday(&(hd->tv), NULL); if (Globals.pingcrazy) { // extra pings PingClient(hd); // send the ping LEVEL_DEBUG("Extra ping (pingcrazy mode)"); } PingLoop( hd ) ; if (hd->sp.path) { #if ( __GNUC__ > 4 ) || (__GNUC__ == 4 && __GNUC_MINOR__ > 4 ) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" // allocated in From_Client with owmalloc, but cast to const owfree( (void *) hd->sp.path); #pragma GCC diagnostic pop #else // allocated in From_Client with owmalloc, but cast to const owfree( (void *) hd->sp.path); #endif hd->sp.path = NULL; } } owfs-3.1p5/module/owserver/src/c/loop.c0000644000175000001440000001133312654730021015005 00000000000000/* OW_HTML -- OWFS used for the web OW -- One-Wire filesystem Written 2004 Paul H Alfille * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* owserver -- responds to requests over a network socket, and processes them on the 1-wire bus/ Basic idea: control the 1-wire bus and answer queries over a network socket Clients can be owperl, owfs, owhttpd, etc... Clients can be local or remote Eventually will also allow bounce servers. syntax: owserver -u (usb) -d /dev/ttyS1 (serial) -p tcp port e.g. 3001 or 10.183.180.101:3001 or /tmp/1wire */ #include "owserver.h" static void LoopCleanup(struct handlerdata *hd); static enum toclient_state Ping_or_Send( enum toclient_state last_toclient, struct handlerdata * hd ); static GOOD_OR_BAD LoopSetup(struct handlerdata *hd) ; static GOOD_OR_BAD LoopSetup(struct handlerdata *hd) { if ( pipe(hd->ping_pipe) != 0 ) { ERROR_DEBUG("Cannot create pipe pair for keep-alive pulses") ; return gbBAD ; } // fcntl (hd->ping_pipe[fd_pipe_read], F_SETFD, FD_CLOEXEC); // for safe forking // fcntl (hd->ping_pipe[fd_pipe_write], F_SETFD, FD_CLOEXEC); // for safe forking hd->toclient = toclient_postping ; return gbGOOD ; } static void LoopCleanup(struct handlerdata *hd) { if (hd->ping_pipe[fd_pipe_read] > -1 ) { close(hd->ping_pipe[fd_pipe_read]) ; } if (hd->ping_pipe[fd_pipe_write] > -1 ) { close(hd->ping_pipe[fd_pipe_write]) ; } } struct timeval tv_long = { 1 , 000000 } ; // 1 second struct timeval tv_short = { 0 , 500000 } ; // 1/2 second static enum toclient_state Ping_or_Send( enum toclient_state last_toclient, struct handlerdata * hd ) { struct timeval tv ; fd_set read_set ; int select_value ; enum toclient_state next_toclient ; FD_ZERO( &read_set ) ; FD_SET( hd->ping_pipe[fd_pipe_read], &read_set ) ; switch ( last_toclient ) { case toclient_postmessage: tv = tv_short ; break ; case toclient_complete: return toclient_complete ; case toclient_postping: tv = tv_long ; break ; } select_value = select( hd->ping_pipe[fd_pipe_read]+1, &read_set, NULL, NULL, &tv ) ; TOCLIENTLOCK(hd); next_toclient = hd->toclient ; switch ( select_value ) { case 1: // message from other thread that we're done // some architectures (like MIPS) want this check inside the lock next_toclient = toclient_complete ; break ; case 0: // timeout -- time for ping? switch ( next_toclient ) { case toclient_complete: // crossed paths, we're really done break ; case toclient_postmessage: LEVEL_DEBUG("Ping forestalled by a directory element"); hd->toclient = toclient_postping ; break ; case toclient_postping: LEVEL_DEBUG("Taking too long, send a keep-alive pulse"); PingClient(hd); // send the ping next_toclient = toclient_postping ; break ; } break ; default: // select error LEVEL_DEBUG("Select problem in keep-alive pulsing"); switch ( next_toclient ) { case toclient_complete: // fortunately we're done break ; case toclient_postmessage: case toclient_postping: // not done. Send a ping and resync the process PingClient(hd); // send the ping next_toclient = toclient_postping ; hd->toclient = toclient_postping ; break ; } break ; } TOCLIENTUNLOCK(hd); return next_toclient ; } void PingLoop(struct handlerdata *hd) { enum toclient_state current_toclient = toclient_postping ; if ( GOOD( LoopSetup(hd) ) ) { pthread_t thread ; // Create DataHandler if (pthread_create(&thread, DEFAULT_THREAD_ATTR, DataHandler, hd) != 0) { LEVEL_DEBUG("OWSERVER:handler() can't create new thread"); DataHandler(hd); // do it without pings } else { // ping vs data loop do { current_toclient = Ping_or_Send( current_toclient, hd ) ; } while ( current_toclient != toclient_complete ) ; if (pthread_join(thread, NULL) != 0) { LEVEL_DEBUG("Error waiting for finish of data thread"); } } LoopCleanup(hd); } } owfs-3.1p5/module/owserver/src/c/md5.c0000644000175000001440000001114012654730021014515 00000000000000/* Simple MD5 implementation from http://en.wikipedia.org/wiki/MD5 */ /* * Simple MD5 implementation * * Compile with: gcc -o md5 md5.c */ #include #include #include #include // Constants are the integer part of the sines of integers (in radians) * 2^32. const uint32_t k[64] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee , 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501 , 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be , 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821 , 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa , 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8 , 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed , 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a , 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c , 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70 , 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05 , 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665 , 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039 , 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1 , 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1 , 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 }; // r specifies the per-round shift amounts const uint32_t r[] = {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21}; // leftrotate function definition #define LEFTROTATE(x, c) (((x) << (c)) | ((x) >> (32 - (c)))) static void to_bytes(uint32_t val, uint8_t *bytes) { bytes[0] = (uint8_t) val; bytes[1] = (uint8_t) (val >> 8); bytes[2] = (uint8_t) (val >> 16); bytes[3] = (uint8_t) (val >> 24); } static uint32_t to_int32(const uint8_t *bytes) { return (uint32_t) bytes[0] | ((uint32_t) bytes[1] << 8) | ((uint32_t) bytes[2] << 16) | ((uint32_t) bytes[3] << 24); } void md5(const uint8_t *initial_msg, size_t initial_len, uint8_t *digest) { // These vars will contain the hash uint32_t h0, h1, h2, h3; // Message (to prepare) uint8_t *msg = NULL; size_t new_len, offset; uint32_t w[16]; uint32_t a, b, c, d, i, f, g, temp; // Initialize variables - simple count in nibbles: h0 = 0x67452301; h1 = 0xefcdab89; h2 = 0x98badcfe; h3 = 0x10325476; //Pre-processing: //append "1" bit to message //append "0" bits until message length in bits ≡ 448 (mod 512) //append length mod (2^64) to message for (new_len = initial_len + 1; new_len % (512/8) != 448/8; new_len++) ; msg = malloc(new_len + 8); if ( msg == NULL ) { // Added by Paul Alfille to prevent memory problem (at risk of no hash) return ; } memcpy(msg, initial_msg, initial_len); msg[initial_len] = 0x80; // append the "1" bit; most significant bit is "first" for (offset = initial_len + 1; offset < new_len; offset++) msg[offset] = 0; // append "0" bits // append the len in bits at the end of the buffer. to_bytes(initial_len*8, msg + new_len); // initial_len>>29 == initial_len*8>>32, but avoids overflow. to_bytes(initial_len>>29, msg + new_len + 4); // Process the message in successive 512-bit chunks: //for each 512-bit chunk of message: for(offset=0; offsetfile_descriptor, &ping_cm, NULL); // send the ping } owfs-3.1p5/module/owfs/0000755000175000001440000000000013022537104012035 500000000000000owfs-3.1p5/module/owfs/Makefile.am0000644000175000001440000000001712654730021014012 00000000000000SUBDIRS = src owfs-3.1p5/module/owfs/Makefile.in0000644000175000001440000005477613022537051014046 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owfs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src 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) --foreign module/owfs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owfs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owfs/src/0000755000175000001440000000000013022537104012624 500000000000000owfs-3.1p5/module/owfs/src/Makefile.am0000644000175000001440000000002512654730021014600 00000000000000SUBDIRS = c include owfs-3.1p5/module/owfs/src/Makefile.in0000644000175000001440000005502013022537051014614 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owfs/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = c include 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) --foreign module/owfs/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owfs/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owfs/src/c/0000755000175000001440000000000013022537104013046 500000000000000owfs-3.1p5/module/owfs/src/c/Makefile.am0000644000175000001440000000076212665167763015055 00000000000000bin_PROGRAMS = owfs owfs_SOURCES = owfs.c owfs_callback.c fuse_line.c owfs_DEPENDENCIES = ../../../owlib/src/c/libow.la AM_CFLAGS = -I../include \ ${FUSE_FLAGS} \ ${FUSE_INCLUDES} \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${EXTRACFLAGS} \ ${PTHREAD_CFLAGS} LDADD = -low ${FUSE_LIBS} ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} owfs-3.1p5/module/owfs/src/c/Makefile.in0000644000175000001440000006005313022537051015040 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = owfs$(EXEEXT) subdir = module/owfs/src/c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_owfs_OBJECTS = owfs.$(OBJEXT) owfs_callback.$(OBJEXT) \ fuse_line.$(OBJEXT) owfs_OBJECTS = $(am_owfs_OBJECTS) owfs_LDADD = $(LDADD) am__DEPENDENCIES_1 = 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 = 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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(owfs_SOURCES) DIST_SOURCES = $(owfs_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)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ owfs_SOURCES = owfs.c owfs_callback.c fuse_line.c owfs_DEPENDENCIES = ../../../owlib/src/c/libow.la AM_CFLAGS = -I../include \ ${FUSE_FLAGS} \ ${FUSE_INCLUDES} \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${EXTRACFLAGS} \ ${PTHREAD_CFLAGS} LDADD = -low ${FUSE_LIBS} ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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) --foreign module/owfs/src/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owfs/src/c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list owfs$(EXEEXT): $(owfs_OBJECTS) $(owfs_DEPENDENCIES) $(EXTRA_owfs_DEPENDENCIES) @rm -f owfs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owfs_OBJECTS) $(owfs_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuse_line.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owfs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owfs_callback.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .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: owfs-3.1p5/module/owfs/src/c/owfs.c0000644000175000001440000000751212654730021014120 00000000000000/* $Id$ OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097 serial connector Written 2003 Paul H Alfille */ #include "owfs.h" #include "ow_connection.h" #include "sys/mount.h" /* OW -- One Wire Globals variables -- each invokation will have it's own data */ struct fuse *fuse; int fuse_fd = -1; char umount_cmd[1024] = ""; char *fuse_mnt_opt = NULL; char *fuse_open_opt = NULL; /* ---------------------------------------------- */ /* Command line parsing and mount handler to FUSE */ /* ---------------------------------------------- */ int main(int argc, char *argv[]) { int c; struct Fuse_option fuse_options; /* Set up owlib */ LibSetup(program_type_filesystem); /* grab our executable name */ ArgCopy( argc, argv ) ; //mtrace() ; /* process command line arguments */ while ((c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL)) != -1) { switch (c) { case 'V': fprintf(stderr, "%s version:\n\t" VERSION "\n", argv[0]); break; case e_fuse_opt: /* fuse_mnt_opt */ if (fuse_mnt_opt) { // delete prior owfree(fuse_mnt_opt); } fuse_mnt_opt = Fuse_arg(optarg, "FUSE mount options"); if (fuse_mnt_opt == NULL) { ow_exit(0); } break; case e_fuse_open_opt: /* fuse_open_opt */ if (fuse_open_opt) { // delete prior owfree(fuse_open_opt); } fuse_open_opt = Fuse_arg(optarg, "FUSE open options"); if (fuse_open_opt == NULL) { ow_exit(0); } break; } // rest of options -- use common opt arguments code if ( BAD( owopt(c, optarg) ) ) { ow_exit(0); } } /* non-option arguments */ while (optind < argc - 1) { ARG_Generic(argv[optind]); ++optind; } while (optind < argc) { if (Outbound_Control.active) { ARG_Generic(argv[optind]); } else { ARG_Server(argv[optind]); } ++optind; } if (Outbound_Control.active == 0) { LEVEL_DEFAULT("No mount point specified.\nTry '%s -h' for help.", argv[0]); ow_exit(1); } // FUSE directory mounting LEVEL_CONNECT("fuse mount point: %s", Outbound_Control.head->name); // Signal handler is set in fuse library //set_signal_handlers(exit_handler); /* Set up adapters */ if ( BAD(LibStart(NULL)) ) { ow_exit(1); } #if FUSE_VERSION >= 14 /* Set up "command line" for main fuse routines */ Fuse_setup(&fuse_options); // command line setup Fuse_add(Outbound_Control.head->name, &fuse_options); // mount point #if FUSE_VERSION >= 22 Fuse_add("-o", &fuse_options); // add "-o direct_io" to prevent buffering Fuse_add("direct_io", &fuse_options); #endif /* FUSE_VERSION >= 22 */ switch (Globals.daemon_status) { case e_daemon_fg: Fuse_add("-f", &fuse_options); // foreground for fuse too if (Globals.error_level > 2) { Fuse_add("-d", &fuse_options); // debug for fuse too } // Globals.daemon_status = e_daemon_bg; break ; default: break ; } // Unmount just in case // No checks -- can fail without consequences #ifdef __FreeBSD__ unmount( Outbound_Control.head->name, 0) ; #else umount( Outbound_Control.head->name ) ; #endif Fuse_parse(fuse_mnt_opt, &fuse_options); LEVEL_DEBUG("fuse_mnt_opt=[%s]", fuse_mnt_opt); Fuse_parse(fuse_open_opt, &fuse_options); LEVEL_DEBUG("fuse_open_opt=[%s]", fuse_open_opt); if (Globals.allow_other) { Fuse_add("-o", &fuse_options); // add "-o allow_other" to permit other users access Fuse_add("allow_other", &fuse_options); } #if FUSE_VERSION > 25 fuse_main(fuse_options.argc, fuse_options.argv, &owfs_oper, NULL); #else /* FUSE_VERSION <= 25 */ fuse_main(fuse_options.argc, fuse_options.argv, &owfs_oper); #endif /* FUSE_VERSION <= 25 */ Fuse_cleanup(&fuse_options); #endif ow_exit(0); return 0; } owfs-3.1p5/module/owfs/src/c/owfs_callback.c0000644000175000001440000001546112711737666015756 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interface LI -- LINK commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097U serial connector Written 2003 Paul H Alfille */ #include "owfs.h" #include "ow_pid.h" /* There was a major change in the function prototypes at FUSE 2.2, we'll make a flag */ #undef FUSE22PLUS #undef FUSE1X #ifdef FUSE_MAJOR_VERSION #if FUSE_MAJOR_VERSION > 2 #define FUSE22PLUS #elif FUSE_MAJOR_VERSION < 2 #define FUSE1X #elif FUSE_MINOR_VERSION > 1 #define FUSE22PLUS #endif /* FUSE > 2.1 */ #else /* no FUSE_MAJOR_VERSION */ #define FUSE1X #endif /* FUSE_MAJOR_VERSION */ #ifdef FUSE22PLUS #define FUSEFLAG struct fuse_file_info * #else /* FUSE < 2.2 */ #define FUSEFLAG int #endif /* FUSE_MAJOR_VERSION */ static int FS_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler); static int FS_utime(const char *path, struct utimbuf *buf); static int FS_truncate(const char *path, const off_t size); static int FS_chmod(const char *path, mode_t mode); static int FS_chown(const char *path, uid_t uid, gid_t gid); static int FS_open(const char *path, FUSEFLAG flags); static int FS_release(const char *path, FUSEFLAG flags); #ifdef FUSE22PLUS static int CB_read(const char *path, char *buffer, size_t size, off_t offset, struct fuse_file_info *flags); static int CB_write(const char *path, const char *buffer, size_t size, off_t offset, struct fuse_file_info *flags); #else /* fuse < 2.2 */ #define CB_read FS_read #define CB_write FS_write #endif #if FUSE_VERSION > 25 static void *FS_init(struct fuse_conn_info *); #elif FUSE_VERSION > 22 static void *FS_init(void); #endif /* FUSE_VERSION > 22 */ /* Change in statfs definition for newer FUSE versions */ #ifdef FUSE1X static int FS_statfs(struct fuse_statfs *fst); #else /* FUSE_MAJOR_VERSION */ #define FS_statfs NULL #endif /* FUSE_MAJOR_VERSION */ struct fuse_operations owfs_oper = { getattr:FS_fstat, readlink:NULL, getdir:FS_getdir, mknod:NULL, mkdir:NULL, symlink:NULL, unlink:NULL, rmdir:NULL, rename:NULL, link:NULL, chmod:FS_chmod, chown:FS_chown, truncate:FS_truncate, utime:FS_utime, open:FS_open, read:CB_read, write:CB_write, statfs:FS_statfs, release:FS_release, #if FUSE_VERSION > 22 init:FS_init, #endif /* FUSE_VERSION > 22 */ }; /* ---------------------------------------------- */ /* Filesystem callback functions */ /* ---------------------------------------------- */ /* Needed for "SETATTR" */ static int FS_utime(const char *path, struct utimbuf *buf) { LEVEL_CALL("UTIME path=%s", SAFESTRING(path)); (void) buf; return 0; } /* Needed for "SETATTR" */ static int FS_chmod(const char *path, mode_t mode) { LEVEL_CALL("CHMODE path=%s", SAFESTRING(path)); (void) mode; return 0; } /* Needed for "SETATTR" */ static int FS_chown(const char *path, uid_t uid, gid_t gid) { LEVEL_CALL("CHOWN path=%s", SAFESTRING(path)); (void) uid; (void) gid; return 0; } /* In theory, should handle file opening, but OWFS doesn't care. Device opened/closed with every read/write */ static int FS_open(const char *path, FUSEFLAG flags) { #if FUSE_VERSION < 23 if (!pid_created) PIDstart(); #endif /* FUSE_VERSION < 23 */ LEVEL_CALL("OPEN path=%s", SAFESTRING(path)); (void) flags; return 0; } /* In theory, should handle file closing, but OWFS doesn't care. Device opened/closed with every read/write */ static int FS_release(const char *path, FUSEFLAG flags) { LEVEL_CALL("RELEASE path=%s", SAFESTRING(path)); (void) flags; return 0; } /* dummy truncation (empty) function */ static int FS_truncate(const char *path, const off_t size) { LEVEL_CALL("TRUNCATE path=%s", SAFESTRING(path)); (void) size; return 0; } #ifdef FUSE22PLUS #define FILLER(handle,name) filler(handle,name,DT_DIR,(ino_t)0) #else /* FUSE22PLUS */ #define FILLER(handle,name) filler(handle,name,DT_DIR) #endif /* FUSE22PLUS */ struct getdirstruct { fuse_dirh_t h; fuse_dirfil_t filler; }; /* Callback function to FS_dir */ /* Prints this directory element (not the whole path) */ static void FS_getdir_callback(void *v, const struct parsedname *pn_entry) { struct getdirstruct *gds = v; #ifdef FUSE22PLUS (gds->filler) (gds->h, FS_DirName(pn_entry), DT_DIR, (ino_t) 0); #else /* FUSE22PLUS */ (gds->filler) (gds->h, FS_DirName(pn_entry), DT_DIR); #endif /* FUSE22PLUS */ } static int FS_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler) { struct parsedname pn; ZERO_OR_ERROR return_code ; RETURN_CODE_ERROR_RETURN( FS_ParsedName(path, &pn) ) ; LEVEL_CALL("GETDIR path=%s", SAFESTRING(path)); if (pn.selected_filetype == NO_FILETYPE) { struct getdirstruct gds = { h, filler, }; /* Call directory spanning function */ FS_dir(FS_getdir_callback, &gds, &pn); FILLER(h, "."); FILLER(h, ".."); RETURN_CODE_SET_SCALAR( return_code, 0 ) ; // success } else { /* property */ RETURN_CODE_SET_SCALAR( return_code, 69 ) ; // Directory - not a directory } /* Clean up */ FS_ParsedName_destroy(&pn); return return_code; } #ifdef FUSE22PLUS static int CB_read(const char *path, char *buffer, size_t size, off_t offset, struct fuse_file_info *flags) { (void) flags; int return_size ; OWQ_allocate_struct_and_pointer( owq ) ; if (path == NO_PATH) { path = "/"; } if ( BAD( OWQ_create(path, owq) ) ) { /* Can we parse the input string */ return -ENOENT; } if ( IsDir( PN(owq) ) ) { /* A directory of some kind */ return_size = -EISDIR ; } else if ( offset >= (off_t) FullFileLength( PN(owq) ) ) { // fuse requests a useless read at end of file -- just return ok. return_size = 0 ; } else { if ( size > MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE ) { LEVEL_DEBUG( "Requested read length %ld will be trimmed to owfs max %ld",(long int) size, (long int) MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE ) ; size = MAX_OWSERVER_PROTOCOL_PAYLOAD_SIZE ; } OWQ_assign_read_buffer( buffer, size, offset, owq) ; return_size = FS_read_postparse(owq) ; } OWQ_destroy(owq); return return_size ; } static int CB_write(const char *path, const char *buffer, size_t size, off_t offset, struct fuse_file_info *flags) { (void) flags; return FS_write(path, buffer, size, offset); } #endif /* FUSE22PLUS */ /* Change in statfs definition for newer FUSE versions */ #ifdef FUSE1X int FS_statfs(struct fuse_statfs *fst) { LEVEL_CALL("STATFS"); memset(fst, 0, sizeof(struct fuse_statfs)); return 0; } #endif /* FUSE1X */ #if FUSE_VERSION > 22 #if FUSE_VERSION > 25 static void *FS_init(struct fuse_conn_info *conn) { (void) conn; #else /* FUSE_VERSION > 25 */ static void *FS_init(void) { #endif /* FUSE_VERSION > 25 */ PIDstart(); Announce_Systemd(); return VOID_RETURN; } #endif /* FUSE_VERSION > 22 */ owfs-3.1p5/module/owfs/src/c/fuse_line.c0000644000175000001440000000477112665167763015142 00000000000000/* OW -- One-Wire filesystem version 0.4 7/2/2003 Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions COM - serial port functions DS2480 -- DS9097 serial connector Written 2003 Paul H Alfille */ #include "owfs.h" /* Fuse_main is called with a standard C-style argc / argv parameters */ /* These routines build the char **argv */ int Fuse_setup(struct Fuse_option *fo) { fo->allocated_slots = 0; fo->argc = 0; fo->argv = (char **) owmalloc( sizeof( char *) ) ; if ( fo->argv == NULL ) { return -ENOMEM ; } fo->argv[0] = NULL ; /* create "0th" item -- the program name */ /* Note this is required since the final NULL item doesn't exist yet */ return Fuse_add("OWFS", fo); } void Fuse_cleanup(struct Fuse_option *fo) { if (fo->argv) { char ** option_pointer; for (option_pointer=fo->argv; option_pointer[0] != NULL; ++option_pointer) { owfree(option_pointer[0]); } owfree(fo->argv); fo->argv = NULL ; fo->allocated_slots = 0 ; fo->argc = 0 ; } } int Fuse_parse(char *opts, struct Fuse_option *fo) { char *start; char *next = opts; while ((start = next)) { strsep(&next, " "); if (Fuse_add(start, fo)) return 1; } return 0; } /* Add an option for the fuse library. * Must be in char ** argv format like any parameters sent to main * use a resizeable array */ int Fuse_add(char *opt, struct Fuse_option *fo) { //LEVEL_DEBUG("Adding option %s",opt); if (fo->argc >= fo->allocated_slots-1) { char ** new_argv ; // need to allocate more space new_argv = (char **) owrealloc( fo->argv, (fo->allocated_slots + 10) * sizeof(char *)); if ( new_argv == NULL) { // not enough memory. Clean up and return an error Fuse_cleanup(fo) ; return -ENOMEM; } fo->allocated_slots += 10; fo->argv = new_argv ; } // Add new element fo->argv[fo->argc++] = owstrdup(opt); // and guard element at end fo->argv[fo->argc] = NULL; LEVEL_DEBUG("Added FUSE option %d %s",fo->argc-1,fo->argv[fo->argc-1]); return 0; } char *Fuse_arg(char *opt_arg, char *entryname) { char *ret = NULL; static regex_t rx_farg ; struct ow_regmatch orm ; orm.number = 1 ; ow_regcomp( &rx_farg, "^\"(.+)\"$", 0 ) ; if ( ow_regexec( &rx_farg, opt_arg, &orm ) != 0 ) { fprintf(stderr, "Put the %s value in quotes. \"%s\"", entryname, opt_arg); return NULL; } ret = owstrdup(orm.match[1]); // start after first quote ow_regexec_free( &orm ) ; return ret; } owfs-3.1p5/module/owfs/src/include/0000755000175000001440000000000013022537104014247 500000000000000owfs-3.1p5/module/owfs/src/include/Makefile.am0000644000175000001440000000003112654730021016220 00000000000000noinst_HEADERS = owfs.h owfs-3.1p5/module/owfs/src/include/owfs.h0000644000175000001440000000220512654730021015320 00000000000000/* OWFS and OWHTTPD one-wire file system and one-wire web server By Paul H Alfille {c} 2003 GPL paul.alfille@gmail.com */ /* OWFS - specific header */ #ifndef OWFS_H #define OWFS_H #include #include "owfs_config.h" #include "ow.h" /* Include FUSE -- http://fuse.sf.net */ /* Lot's of version-specific code */ //#define FUSE_USE_VERSION 26 // FUSE_USE_VERSION is set from configure script #include #ifndef FUSE_VERSION #ifndef FUSE_MAJOR_VERSION #define FUSE_VERSION 11 #else /* FUSE_MAJOR_VERSION */ #undef FUSE_MAKE_VERSION #define FUSE_MAKE_VERSION(maj,min) ((maj) * 10 + (min)) #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION,FUSE_MINOR_VERSION) #endif /* FUSE_MAJOR_VERSION */ #endif /* FUSE_VERSION */ extern struct fuse_operations owfs_oper; struct Fuse_option { int allocated_slots; char **argv; int argc; }; int Fuse_setup(struct Fuse_option *fo); void Fuse_cleanup(struct Fuse_option *fo); int Fuse_parse(char *opts, struct Fuse_option *fo); int Fuse_add(char *opt, struct Fuse_option *fo); char *Fuse_arg(char *opt_arg, char *entryname); #endif /* OWFS_H */ owfs-3.1p5/module/owfs/src/include/Makefile.in0000644000175000001440000004460113022537051016242 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owfs/src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 HEADERS = $(noinst_HEADERS) 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)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = owfs.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) --foreign module/owfs/src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owfs/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(HEADERS) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am 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-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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool 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-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags 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: owfs-3.1p5/module/owftpd/0000755000175000001440000000000013022537104012362 500000000000000owfs-3.1p5/module/owftpd/Makefile.am0000644000175000001440000000001712654730021014337 00000000000000SUBDIRS = src owfs-3.1p5/module/owftpd/Makefile.in0000644000175000001440000005507513022537051014364 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owftpd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs AUTHORS \ COPYING ChangeLog NEWS README TODO install-sh 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src 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) --foreign module/owftpd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owftpd/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owftpd/AUTHORS0000644000175000001440000000102612654730021013354 00000000000000Authors of oftpd: Shane Kerr Contributors: Beau Kuiper (Netscape timing bug fix) Mauro Tortonesi (IPv6 support, RPM spec file) Matthew Danish (Debian compile help, command-line options, address parse consolidation, configure modifications to deal with ss_family variations) Eric Jensen (Red Hat 7.0 init script) Anders Nordby (FreeBSD port) Adapted to OWFS by Paul Alfille owfs-3.1p5/module/owftpd/COPYING0000644000175000001440000000240512654730021013341 00000000000000Copyright 2000, 2001 Shane Kerr. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. owfs-3.1p5/module/owftpd/ChangeLog0000644000175000001440000002607212654730021014066 000000000000002004-08-07 Paul Alfille - Start of OWFS adaptation. 2004-03-25, Shane Kerr - Philippe Oechslin discovered a DoS vulnerability. As reported: "When the server receives a port command with a number that is higher than 255 the server crashes and has to be restarted manually. The port command can even be given before the user has given a username and a password." Yikes. In some ways this isn't *so* bad, as the chroot+setuid of oftpd means you are unlikely to have your server further compromised, but it does point to a flaw with using threaded C as the implementation language: if any connection has problems, your application is more-or-less hosed. Anyway, a one line fix. - Version 0.3.7 released. 2001-06-21, Shane Kerr - #ifdef wrap GLOB_ABORTED for really old gcc compilers (Slackware or older installations). - Add code to skip command line options that are intended for "ls". 2001-06-12, Shane Kerr - Disabled support for sendfile() on FreeBSD. It appears to me that there's a bug in the sendfile() user-level library. I would welcome advice from any FreeBSD developer wishing to set me straight. 2001-06-01, Shane Kerr - Changed SIZE command to return error for directories. 2001-05-28, Shane Kerr - Version 0.3.6 released. - Beat FreeBSD into submission. Now compiles (and runs!) on FreeBSD out of the box. 2001-05-11, Shane Kerr - Changed REST to only work for IMAGE (i.e. binary) mode. - Added the SIZE command. - Added the MDTM (modification time) command. 2001-04-20, Shane Kerr - Moved SIGPIPE ignore to run even in --nodetach mode. Needed to avoid unwanted signals on TCP disconnects. 2001-04-19, Shane Kerr - Added more logging: all client messages are logged with address and port, and all server responses are also logged. This occurs at DEBUG level, as it is probably not normally of interest. 2001-04-18, Shane Kerr - Version 0.3.5 released. - Changed resume code to reset offset to 0 after each file transfer. - Set accept() socket to NONBLOCK to insure the listener doesn't get stuck waiting for a connection. This is documented in the NOTES section for the accept() call in Linux. - Added sendfile() support on Linux systems. 2001-04-14, Shane Kerr - Fixed a bug caused by parsing EPRT commands. The server doesn't actually allow these commands, but it bravely attempts to parse them anyway. A special shout out to Anders Nordby for finding this. The error caused the server to terminate on an assert() fail, which is good because no server corruption happened, but it's bad because the server terminated without any indication. Therefore.... - Changed most assert() calls to daemon_assert() calls. These terminate the application as before, but log to syslog and STDERR. - Added ability to run as a non-daemon process. This will allow the server to be started from init, for instance. - Added support for SIGTERM and SIGINT. If one of these is received, then the server closes the port 21 socket - meaning that it will accept no further connections. When all existing connections have closed, then the server exits. A new server may be started before this occurs, to handle new connections. This allows very short downtimes: # killall oftpd; sleep 1; /etc/init.d/oftpd start This will result in a 1 second period of time where no new connections are accepted, with no existing connections closed. It's probably best to wait for this second, to allow the signal time to arrive. :) 2001-04-08, Shane Kerr - Changed check for '/' in path - was improperly allowing escaped '/' characters through the check! - Set TCP_NODELAY flag on socket - much reduced latency on control channel for high-speed connections. - New and improved init script from Eric Jensen. 2001-04-07, Anders Nordby - FreeBSD port. 2001-04-03, Shane Kerr - Version 0.3.4 released. - Changed FTP listener code to attempt to continue processing when formerly fatal errors occur. - Added man page. - Added Red Hat init script donated by Eric Jensen to release. 2001-03-28, Shane Kerr - Version 0.3.3 released. - Use IP address and port of the control connection port for default Data Transfer Port, as defined by RFC 959. Note that the default server process DTP is never used in oftpd, but that's not a problem as I read the RFC. - Use config.h 2001-03-27, Matthew Danish - configure.in and af_portability.h fixes to allow compilation on systems with both RFC 2553 and XNET formats 2001-03-27, Shane Kerr - Fixed bug where wrong server address was used on initalization of ftp_server class. Passive probably didn't work in the 0.3.x series for IPv4! 2001-03-26, Shane Kerr - Version 0.3.2 released. - Minor additions for better error reporting on error creating threads in listener, as well as checking success on setgid() and setuid(). I can't believe I wasn't!!! - Set syslog() to use FTP_DAEMON 2001-03-23, Shane Kerr - Fixed configure bug on Debian systems. Special thanks to Matthew Danish for helping me on this one. 2001-03-20, Matthew Danish - Clean up parsing of FTP address in ftp_listener.c - Added options to specify interface and maximum number of client connections at startup. - Added --long-style command-line options. 2001-03-21, Shane Kerr - The "Spring Fever" edition, version 0.3.1 released. Added workaround for the evil glob() denial-of-service attack. I chose the simple method of preventing file listing with both path separator and wildcards. Either is okay, but not both. I don't expect this to cause problems with legitimate use, but I could be wrong. It was much simpler than my other thought. :) Changed code so that ECONNABORTED and ECONNRESET errors don't increase the error count. This is to prevent a malicious client from taking a server down by sending a large number of connection requests that it then aborts. Integrated code from Matthew Danish that allows the user to specify the port to use from the command line. Thanks! Warnings from 0.3.0 still apply. Use with caution. Spring is in the air, after all. 2001-03-20, Shane Kerr - Version 0.3.0 released. This is almost guaranteed not to work, as I've not tested it with clients that support the new features. But I decided that after a year, I wasn't living up to the "release early, release often" motto of open source. In addition to working in the changes since the last release, I've done: o removed free list from ftp_listener; simple is better o use a random port rather than incrememting sequence; useful for preventing classes of data hijacking attacks There is a potential DOS attack against all versions, see the BUGS file. This will be fixed ASAP (hopefully tomorrow). 2001-02-22, Matthew Danish - Fix for missing check in configure.in 2000-12-13, Mauro Tortonesi - Added IPv6 support (EPRT & EPSV - RFC2428) - Added LPRT and LPSV support (RFC1639) 2000-08-25, Shane Kerr - Fixed telnet module to properly handle telnet escape sequences (since no clients actually use this, it wasn't really a problem) 2000-06-01, Shane Kerr - Beau Kuiper, author of muddleftpd, sent me a fix for the Netscape timing bug. Thanks!!! 2000-04-03, Shane Kerr - Version 0.2.0 released 2000-03-30, Shane Kerr - Changed README send to only send on directory change if you actually change to a different directory. That is, "CWD ." does not send a README file. The reason for this is that many clients perform a "CWD /" as soon as it connects, which cause the README to be sent twice - yuck! - Added missing check for closed file descriptor in write_fully(). - Converted use of FILE pointers to file descriptors. This wasn't done in the most efficient possible method (i.e. with buffers), but it does remove the maximum FILE limitation from the server. 2000-03-29, Shane Kerr - Added -D_REENTRANT flag to compile options. - Added an error data type to return details about errors that occur in module initialization. - Changed telnet module to never drop characters on outbound, even if we have a ton of DO and WILL commands from the other end. 2000-03-27, Shane Kerr - Fixed bug in telnet code when sending "" string. - Now sends README to client if file is in directory on connect or directory change. - Simplified watchdog a bit by adding pointer to watchdog in the watched structure. - Wrapped invariant() methods with #ifndef NDEBUG so they won't get compiled in non-debug code (in case there's ever a non-debug version) 2000-03-22, Shane Kerr - Changed NLST and LIST to silently drop a file specification that starts with a '-'. This will ignore attempts to pass an argument to "ls" that some clients try - it probably won't do what they expect, but at least they'll get a list of files. 2000-03-19, Shane Kerr - Set file descriptors 0, 1, and 2 to go to "/dev/null", so that any error messages sent by, say, the kernel don't accidentally go to a user. - Changed watchdog to have a single thread to watch all connections, rather than a thread per connection. This is considerably more complex, but effectively doubles the number of connections that can be supported (due to thread limits). 2000-03-16, Shane Kerr - Added support for REST command. (Note that this is *not* the REST exactly as described by RFC. The REST in the RFC only applies to block or compressed mode transfer, which oftpd does not currently support. However, it appears that Unix systems interpret the parameter to the REST command as the offset into the file to resume from. 2000-03-13, Shane Kerr - Version 0.1.3 released 2000-03-12, Shane Kerr - Fixed bug when connection limit reached - Fixed bug when attempt to bind() an already bound port 2000-03-12, Shane Kerr - Version 0.1.2 released 2000-03-11, Shane Kerr - Move configuration values into oftpd.h - Wrap source to 80 columns - Fix pthread_create() error check (code had incorrectly used errno rather than the return of pthread_create() to determine error) - Fix threads to run in detached mode (when appropriate) - Solaris port completed - Support for STOR added (reply with 553 error) - Added free list for per-thread information structures. owfs-3.1p5/module/owftpd/NEWS0000644000175000001440000000067612654730021013015 000000000000002004-08-08 owftpd is an adaptation of oftpd for the 1-wire filesystem 2004-03-25 oftpd is more-or-less abandoned at this point. Fortunately it pretty much just works. Please drop me a line if you want to maintain it. 2000-12-13 IPv6 code is maintained by Mauro Tortonesi . You can download the latest patches for oftpd from the Project6 website: http://project6.ferrara.linux.it Thanks Mauro! owfs-3.1p5/module/owftpd/README0000644000175000001440000000411412654730021013165 00000000000000$Id$ Installation See the INSTALL file for directions on compiling and installing the binary. Short version (as root): # ./configure # make # make install This will install the oftpd daemon itself. To run the server via the standard Unix startup mechanism, you'll need to add it to your startup files. In most Linux systems, this means putting a shell script in the /etc/rc.d/init.d directory and linking to it from the directories for your various run levels. If you have a Red Hat 7.0 (or similiar) system, you can use the oftpd.redhat7 script for this purpose: # cp init/oftpd.redhat7 /etc/rc.d/init.d/oftpd # chkconfig --add oftpd Be sure to read the FAQ if you have any questions! Introduction oftpd is designed to be as secure as an anonymous FTP server can possibly be. It runs as non-root for most of the time, and uses the Unix chroot() command to hide most of the systems directories from external users - they cannot change into them even if the server is totally compromised! It contains its own directory change code, so that it can run efficiently as a threaded server, and its own directory listing code (many FTP servers execute the system "ls" command to list files). It is currently being code-reviewed for buffer overflows, and being load-tested. History I wrote oftpd to fill a need we had at my company. Our public FTP site was a mess, and in addition to reorganizing organizing the hierarchy and file layout I wanted to get the latest version of our FTP server software. It turns out that the version we had had had a number of security issues. So I decided to find an anonymous-only, secure FTP server. None of the ones I found were fully baked. Time to write my own. :) Portability oftpd currently runs on modern Linux systems, including Red Hat-derived (Mandrake, Trustix, etc.) and Debian systems. oftpd has been ported to FreeBSD and is in the FreeBSD ports collection. While I have given up development of oftpd, it's small and reliable. Don't hesitate to e-mail if you have questions or suggestions. Good luck! Shane Kerr shane@time-travellers.org owfs-3.1p5/module/owftpd/TODO0000644000175000001440000000302712654730021012777 00000000000000$Id$ User requested: - STOR - User login - Bandwidth limits From RIPE: - Limit maximum download time Externally visible: - Add support for SIZE command (RFC 959?) - Add support for STAT command (RFC 959?) - Add support for the RECORD structure in transfer. Surely someone must use it. :) - Allow server messages to be configurable. I'm not sure of the best way to do this. The problem is that this entails putting the messages in a single location, which means that you *don't* see what the message is when you are looking through the code. Hm. I may just make it a comment in the code to allow readability. - Better LIST and NLST support. - Drop browser connections before the 15-minute timeout. You can detect this by looking for users who logged in as "mozilla@" or "IEUser@". In Perl, this would be /^.+\@$/ Internal use only: - Handle glob() returns more elegantly. Right now if a glob() returns 0 files, it's okay. This should return an error unless a wildcard was specified. - Possibly write our own glob() to reduce memory fragmentation. - Perhaps buffer NLST and LIST output. - Use getrlimit()/setrlimit() to cap the amount of memory allowable, and possibly other resources as well. Auditing requirements: - Run through its4, and find other lint-like tools to pound code with. - Sprinkle assert() more fully. Testing: - Find more ftp clients - Create automated test - Run on multi-CPU box Porting: - Compile on FreeBSD - Port to Windows? Other stuff: - Document design - pth support? owfs-3.1p5/module/owftpd/install-sh0000755000175000001440000001273612654730021014322 00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # 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. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # 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 $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 owfs-3.1p5/module/owftpd/src/0000755000175000001440000000000013022537105013152 500000000000000owfs-3.1p5/module/owftpd/src/Makefile.am0000644000175000001440000000002512654730021015125 00000000000000SUBDIRS = c include owfs-3.1p5/module/owftpd/src/Makefile.in0000644000175000001440000005502613022537051015147 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owftpd/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = c include 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) --foreign module/owftpd/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owftpd/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/module/owftpd/src/c/0000755000175000001440000000000013022537105013374 500000000000000owfs-3.1p5/module/owftpd/src/c/Makefile.am0000644000175000001440000000130712665167763015376 00000000000000bin_PROGRAMS = owftpd owftpd_SOURCES = file_list.c \ file_cd.c \ ftp_command.c \ ftp_listener.c \ ftp_session.c \ owftpd.c \ telnet_session.c \ watchdog.c \ daemon_assert.c owftpd_DEPENDENCIES = ../../../owlib/src/c/libow.la AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${PTHREAD_CFLAGS} \ ${EXTRACFLAGS} LDADD = -low ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} owfs-3.1p5/module/owftpd/src/c/Makefile.in0000644000175000001440000006155613022537051015376 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = owftpd$(EXEEXT) subdir = module/owftpd/src/c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_owftpd_OBJECTS = file_list.$(OBJEXT) file_cd.$(OBJEXT) \ ftp_command.$(OBJEXT) ftp_listener.$(OBJEXT) \ ftp_session.$(OBJEXT) owftpd.$(OBJEXT) \ telnet_session.$(OBJEXT) watchdog.$(OBJEXT) \ daemon_assert.$(OBJEXT) owftpd_OBJECTS = $(am_owftpd_OBJECTS) owftpd_LDADD = $(LDADD) am__DEPENDENCIES_1 = 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 = 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)/src/include depcomp = $(SHELL) $(top_srcdir)/src/scripts/install/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(owftpd_SOURCES) DIST_SOURCES = $(owftpd_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)/src/scripts/install/depcomp \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ owftpd_SOURCES = file_list.c \ file_cd.c \ ftp_command.c \ ftp_listener.c \ ftp_session.c \ owftpd.c \ telnet_session.c \ watchdog.c \ daemon_assert.c owftpd_DEPENDENCIES = ../../../owlib/src/c/libow.la AM_CFLAGS = -I../include \ -I../../../owlib/src/include \ -L../../../owlib/src/c \ -fexceptions \ -Wall \ -W \ -Wundef \ -Wshadow \ -Wpointer-arith \ -Wcast-qual \ -Wcast-align \ -Wstrict-prototypes \ -Wredundant-decls \ ${PTHREAD_CFLAGS} \ ${EXTRACFLAGS} LDADD = -low ${PTHREAD_LIBS} ${LD_EXTRALIBS} ${OSLIBS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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) --foreign module/owftpd/src/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owftpd/src/c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list owftpd$(EXEEXT): $(owftpd_OBJECTS) $(owftpd_DEPENDENCIES) $(EXTRA_owftpd_DEPENDENCIES) @rm -f owftpd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(owftpd_OBJECTS) $(owftpd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daemon_assert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_cd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftp_command.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftp_listener.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftp_session.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/owftpd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/telnet_session.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watchdog.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .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: owfs-3.1p5/module/owftpd/src/c/file_list.c0000644000175000001440000002246212654730021015442 00000000000000/* * part of owftpd By Paul H Alfille * The whole is GPLv2 licenced though the ftp code was more liberally licenced when first used. */ #include "owftpd.h" #include #include #include /* AIX requires this to be the first thing in the file. */ #ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca(); # endif # endif # endif #endif static void fdprintf(FILE_DESCRIPTOR_OR_ERROR file_descriptor, const char *fmt, ...); static void List_show(struct file_parse_s *fps, const struct parsedname *pn); static void WildLexParse(struct file_parse_s *fps, ASCII * match); static char *skip_ls_options(char *filespec); /* if no localtime_r() is available, provide one */ #ifndef HAVE_LOCALTIME_R #include struct tm *localtime_r(const time_t * timep, struct tm *timeptr) { static pthread_mutex_t time_lock = PTHREAD_MUTEX_INITIALIZER; _MUTEX_LOCK(time_lock); *timeptr = *(localtime(timep)); _MUTEX_UNLOCK(time_lock); return timeptr; } #endif /* HAVE_LOCALTIME_R */ static void List_show(struct file_parse_s *fps, const struct parsedname *pn) { struct stat stbuf; time_t now; struct tm tm_now; double age; char date_buf[13]; ASCII *perms[] = { "---------", "--x--x--x", "-w--w--w-", "-wx-wx-wx", "r--r--r--", "r-xr-xr-x", "rw-rw-rw-", "rwxrwxrwx", }; LEVEL_DEBUG("List_show %s", pn->path); switch (fps->fle) { case file_list_list: FS_fstat_postparse(&stbuf, pn); fdprintf(fps->out, "%s%s", stbuf.st_mode & S_IFDIR ? "d" : "-", perms[stbuf.st_mode & 0x07]); /* fps->output link & ownership information */ fdprintf(fps->out, " %3d %-8d %-8d %8lu ", stbuf.st_nlink, stbuf.st_uid, stbuf.st_gid, (unsigned long) stbuf.st_size); /* fps->output date */ time(&now); localtime_r(&stbuf.st_mtime, &tm_now); age = difftime(now, stbuf.st_mtime); if ((age > 60 * 60 * 24 * 30 * 6) || (age < -(60 * 60 * 24 * 30 * 6))) { strftime(date_buf, sizeof(date_buf), "%b %e %Y", &tm_now); } else { strftime(date_buf, sizeof(date_buf), "%b %e %H:%M", &tm_now); } fdprintf(fps->out, "%s ", date_buf); /* Fall Through */ case file_list_nlst: /* fps->output filename */ fdprintf(fps->out, "%s\r\n", &pn->path[fps->start]); } } void FileLexParse(struct file_parse_s *fps) { struct parsedname pn; while (1) { switch (fps->pse) { case parse_status_init: LEVEL_DEBUG("FTP parse_status_init Path<%s> File <%s>", fps->buffer, fps->rest); /* fps->buffer is absolute */ /* trailing / only at root */ fps->ret = 0; fps->start = strlen(fps->buffer); if (fps->start > 1) { ++fps->start; } fps->rest = skip_ls_options(fps->rest); if (fps->rest == NULL || fps->rest[0] == '\0') { fps->pse = parse_status_tame; } else { if (fps->rest[0] == '/') { // root specification fps->buffer[1] = '\0'; fps->start = 0; ++fps->rest; } fps->pse = parse_status_init2; } break; case parse_status_init2: LEVEL_DEBUG("FTP parse_status_init2 Path<%s> File <%s>", fps->buffer, fps->rest); /* fps->buffer is absolute */ /* trailing / only at root */ if ((fps->rest[0] == '.' && fps->rest[1] == '.') || strpbrk(fps->rest, "*[?")) { fps->pse = parse_status_back; } else { fps->pse = parse_status_tame; } break; case parse_status_back: LEVEL_DEBUG("FTP parse_status_back Path<%s> File <%s>", fps->buffer, fps->rest); /* fps->buffer is absolute */ /* trailing / only at root */ if (fps->rest[0] == '.' && fps->rest[1] == '.') { // Move back ASCII *back = strrchr(fps->buffer, '/'); back[1] = '\0'; fps->start = strlen(fps->buffer); // look for next file part if (fps->rest[2] == '\0') { fps->pse = parse_status_last; fps->rest = NULL; } else if (fps->rest[2] == '/') { fps->pse = parse_status_next; fps->rest = &fps->rest[3]; } else { fps->ret = -ENOENT; return; } } else { fps->pse = parse_status_next; // off the double dot trail } break; case parse_status_next: LEVEL_DEBUG("FTP parse_status_next Path<%s> File <%s>", fps->buffer, fps->rest); /* fps->buffer is absolute */ /* trailing / only at root */ if (fps->rest == NULL || fps->rest[0] == '\0') { fps->pse = parse_status_last; } else { ASCII *oldrest = strsep(&fps->rest, "/"); if (strpbrk(oldrest, "*[?")) { WildLexParse(fps, oldrest); return; } else { if (strlen(fps->buffer) + strlen(oldrest) + 4 > PATH_MAX) { fps->ret = -ENAMETOOLONG; return; } if (fps->buffer[1]) { strcat(fps->buffer, "/"); } strcat(fps->buffer, oldrest); fps->pse = parse_status_next; } } break; case parse_status_tame: LEVEL_DEBUG("FTP parse_status_tame Path<%s> File <%s>", fps->buffer, fps->rest); /* fps->buffer is absolute */ /* trailing / only at root */ if ( fps-> rest != NULL ) { if ( strlen(fps->buffer) + strlen(fps->rest) + 4 > PATH_MAX ) { fps->ret = -ENAMETOOLONG; return; } if ( fps->buffer[1] != 0 ) { strcat(fps->buffer, "/"); } strcat(fps->buffer, fps->rest); } if (FS_ParsedName(fps->buffer, &pn) == 0) { if (IsDir(&pn)) { fps->start = strlen(fps->buffer) + 1; if (fps->start == 2) { fps->start = 1; } else if (fps->buffer[fps->start - 2] == '/') { --fps->start; fps->buffer[fps->start - 1] = '\0'; } fps->rest = NULL; WildLexParse(fps, "*"); } else { List_show(fps, &pn); } FS_ParsedName_destroy(&pn); } else { fps->ret = -ENOENT; } return; case parse_status_last: LEVEL_DEBUG("FTP parse_status_last Path<%s> File <%s>", fps->buffer, fps->rest); /* fps->buffer is absolute */ /* trailing / only at root */ if (fps->rest && (strlen(fps->buffer) + strlen(fps->rest) + 4 > PATH_MAX)) { fps->ret = -ENAMETOOLONG; return; } if (FS_ParsedNamePlus(fps->buffer, fps->rest, &pn) == 0) { List_show(fps, &pn); FS_ParsedName_destroy(&pn); } return; } } } struct wildlexparse { ASCII *end; ASCII *match; struct file_parse_s *fps; }; /* Called for each directory element, and operates recursively */ /* uses C library fnmatch for file wildcard comparisons */ static void WildLexParseCallback(void *v, const struct parsedname *const pn_entry) { struct wildlexparse *wlp = v; struct file_parse_s fps; // duplicate for recursive call /* get real name from parsedname struct */ strcpy(&wlp->end[1], FS_DirName(pn_entry)); LEVEL_DEBUG("WildLexParseCallback: Try %s vs %s", &wlp->end[1], wlp->match); if (fnmatch(wlp->match, &wlp->end[1], FNM_PATHNAME)) { return; } /* Matched! So set up for recursive call on nect elements in path name */ memcpy(&fps, wlp->fps, sizeof(fps)); fps.pse = parse_status_next; FileLexParse(&fps); } /* Called for each directory, calls WildLEexParseCallback on each element to see if matches wildcards (even used for normal listings with * wildcard) */ static void WildLexParse(struct file_parse_s *fps, ASCII * match) { struct parsedname pn; /* Embedded callback function */ LEVEL_DEBUG("FTP Wildcard patern matching: Path=%s, Pattern=%s, File=%s", SAFESTRING(fps->buffer), SAFESTRING(match), SAFESTRING(fps->rest)); /* Check potential length */ if (strlen(fps->buffer) + OW_FULLNAME_MAX + 2 > PATH_MAX) { fps->ret = -ENAMETOOLONG; return; } /* Can we understand the current path? */ if (FS_ParsedName(fps->buffer, &pn) != 0 ) { fps->ret = -ENOENT; return; } if (pn.selected_filetype) { fps->ret = -ENOTDIR; } else { struct wildlexparse wlp = { NULL, match, fps, }; int root = (fps->buffer[1] == '\0'); wlp.end = &fps->buffer[strlen(fps->buffer)]; if (root) { --wlp.end; } wlp.end[0] = '/'; FS_dir(WildLexParseCallback, &wlp, &pn); if (root) { ++wlp.end; } wlp.end[0] = '\0'; // restore fps->buffer } FS_ParsedName_destroy(&pn); } /* write with care for max length and incomplete outout */ static void fdprintf(FILE_DESCRIPTOR_OR_ERROR file_descriptor, const char *fmt, ...) { char buf[PATH_MAX + 1]; ssize_t buflen; va_list ap; int amt_written; int write_ret; daemon_assert(FILE_DESCRIPTOR_VALID(file_descriptor)); daemon_assert(fmt != NULL); va_start(ap, fmt); buflen = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (buflen <= 0) { return; } if ((size_t) buflen >= sizeof(buf)) { buflen = sizeof(buf) - 1; } amt_written = 0; while (amt_written < buflen) { write_ret = write(file_descriptor, buf + amt_written, buflen - amt_written); if (write_ret <= 0) { return; } amt_written += write_ret; } } /* hack workaround clients like Midnight Commander that send: LIST -al /dirname */ static char *skip_ls_options(char *filespec) { daemon_assert(filespec != NULL); for (;;) { /* end when we've passed all options */ if (*filespec != '-') { break; } filespec++; /* if we find "--", eat it and any following whitespace then return */ if ((filespec[0] == '-') && (filespec[1] == ' ')) { filespec += 2; while (isspace(*filespec)) { filespec++; } break; } /* otherwise, skip this option */ while ((*filespec != '\0') && !isspace(*filespec)) { filespec++; } /* and skip any whitespace */ while (isspace(*filespec)) { filespec++; } } daemon_assert(filespec != NULL); return filespec; } owfs-3.1p5/module/owftpd/src/c/file_cd.c0000644000175000001440000001267412654730021015061 00000000000000/* * part of owftpd By Paul H Alfille * The whole is GPLv2 licenced though the ftp code was more liberally licenced when first used. */ #include "owftpd.h" #include #include #include /* AIX requires this to be the first thing in the file. */ #ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca(); # endif # endif # endif #endif static void WildLexCD(struct cd_parse_s *cps, ASCII * match); void FileLexCD(struct cd_parse_s *cps) { struct parsedname pn; while (1) { switch (cps->pse) { case parse_status_init: LEVEL_DEBUG("FTP parse_status_init Path<%s> File <%s>", cps->buffer, cps->rest); /* cps->buffer is absolute */ /* trailing / only at root */ cps->ret = 0; cps->solutions = 0; cps->dir = NULL; if (cps->rest == NULL || cps->rest[0] == '\0') { cps->pse = parse_status_tame; } else { if (cps->rest[0] == '/') { // root (absolute) specification cps->buffer[1] = '\0'; ++cps->rest; } cps->pse = parse_status_init2; } break; case parse_status_init2: LEVEL_DEBUG("FTP parse_status_init2 Path<%s> File <%s>", cps->buffer, cps->rest); /* cps->buffer is absolute */ /* trailing / only at root */ if ((cps->rest[0] == '.' && cps->rest[1] == '.') || strpbrk(cps->rest, "*[?")) { cps->pse = parse_status_back; } else { cps->pse = parse_status_tame; } break; case parse_status_back: LEVEL_DEBUG("FTP parse_status_back Path<%s> File <%s>", cps->buffer, cps->rest); /* cps->buffer is absolute */ /* trailing / only at root */ if (cps->rest[0] == '.' && cps->rest[1] == '.') { // Move back ASCII *back = strrchr(cps->buffer, '/'); back[1] = '\0'; // look for next file part if (cps->rest[2] == '\0') { cps->pse = parse_status_last; cps->rest = NULL; } else if (cps->rest[2] == '/') { cps->pse = parse_status_next; cps->rest = &cps->rest[3]; } else { cps->ret = -ENOENT; return; } } else { cps->pse = parse_status_next; // off the double dot trail } break; case parse_status_next: LEVEL_DEBUG("FTP parse_status_next Path<%s> File <%s>", cps->buffer, cps->rest); /* cps->buffer is absolute */ /* trailing / only at root */ if (cps->rest == NULL || cps->rest[0] == '\0') { cps->pse = parse_status_last; } else { ASCII *oldrest = strsep(&cps->rest, "/"); if (strpbrk(oldrest, "*[?")) { WildLexCD(cps, oldrest); return; } else { if (strlen(cps->buffer) + strlen(oldrest) + 4 > PATH_MAX) { cps->ret = -ENAMETOOLONG; return; } if (cps->buffer[1]) { strcat(cps->buffer, "/"); } strcat(cps->buffer, oldrest); cps->pse = parse_status_next; } } break; case parse_status_tame: LEVEL_DEBUG("FTP parse_status_tame Path<%s> File <%s>", cps->buffer, cps->rest); /* cps->buffer is absolute */ /* trailing / only at root */ if (cps->rest && (strlen(cps->buffer) + strlen(cps->rest) + 4 > PATH_MAX)) { cps->ret = -ENAMETOOLONG; return; } if (cps->buffer[1]) { strcat(cps->buffer, "/"); } strcat(cps->buffer, cps->rest); if (FS_ParsedName(cps->buffer, &pn) == 0) { if (IsDir(&pn)) { ++cps->solutions; if (cps->solutions == 1) { cps->dir = strdup(pn.path); } } else { cps->ret = -ENOTDIR; } FS_ParsedName_destroy(&pn); } else { cps->ret = -ENOENT; } return; case parse_status_last: LEVEL_DEBUG("FTP parse_status_last Path<%s> File <%s>", cps->buffer, cps->rest); /* cps->buffer is absolute */ /* trailing / only at root */ if (cps->rest && (strlen(cps->buffer) + strlen(cps->rest) + 4 > PATH_MAX)) { cps->ret = -ENAMETOOLONG; return; } if (FS_ParsedNamePlus(cps->buffer, cps->rest, &pn) == 0) { if (IsDir(&pn)) { ++cps->solutions; if (cps->solutions == 1) { cps->dir = strdup(pn.path); } } else { cps->ret = -ENOTDIR; } FS_ParsedName_destroy(&pn); } return; } } } struct wildlexcd { ASCII *end; ASCII *match; struct cd_parse_s *cps; }; static void WildLexCDCallback(void *v, const struct parsedname *const pn_entry) { struct wildlexcd *wlcd = v; struct cd_parse_s cps; strcpy(&wlcd->end[1], FS_DirName(pn_entry)); //printf("Try %s vs %s\n",end,match) ; //if ( fnmatch( match, end, FNM_PATHNAME|FNM_CASEFOLD ) ) return ; if (fnmatch(wlcd->match, &wlcd->end[1], FNM_PATHNAME)) { return; } //printf("Match! %s\n",end) ; memcpy(&cps, wlcd->cps, sizeof(cps)); cps.pse = parse_status_next; FileLexCD(&cps); } static void WildLexCD(struct cd_parse_s *cps, ASCII * match) { struct parsedname pn; LEVEL_DEBUG("FTP Wildcard patern matching: Path=%s, Pattern=%s, rest=%s", SAFESTRING(cps->buffer), SAFESTRING(match), SAFESTRING(cps->rest)); /* Check potential length */ if (strlen(cps->buffer) + OW_FULLNAME_MAX + 2 > PATH_MAX) { cps->ret = -ENAMETOOLONG; return; } if ( FS_ParsedName(cps->buffer, &pn) != 0 ) { cps->ret = -ENOENT; return; } if (!IsDir(&pn)) { cps->ret = -ENOTDIR; } else { struct wildlexcd wlcd = { NULL, match, cps, }; int root = (cps->buffer[1] == '\0'); wlcd.end = &cps->buffer[strlen(cps->buffer)]; if (root) { --wlcd.end; } wlcd.end[0] = '/'; FS_dir(WildLexCDCallback, &wlcd, &pn); if (root) { ++wlcd.end; } wlcd.end[0] = '\0'; // restore cps->buffer } FS_ParsedName_destroy(&pn); } owfs-3.1p5/module/owftpd/src/c/ftp_command.c0000644000175000001440000003045512654730021015760 00000000000000/* * Part of owftp by Paul Alfille * although this source was (legally) culled from open source * the whole is GPLv2 licenced */ #include "owftpd.h" #include /* argument types */ #define ARG_NONE 0 #define ARG_STRING 1 #define ARG_OPTIONAL_STRING 2 #define ARG_HOST_PORT 3 #define ARG_TYPE 4 #define ARG_STRUCTURE 5 #define ARG_MODE 6 #define ARG_OFFSET 7 #define ARG_HOST_PORT_LONG 8 #define ARG_HOST_PORT_EXT 9 #define ARG_OPTIONAL_NUMBER 10 /* our FTP commands */ struct { char *name; int arg_type; } command_def[] = { { "USER", ARG_STRING}, { "PASS", ARG_STRING}, { "CWD", ARG_STRING}, { "CDUP", ARG_NONE}, { "QUIT", ARG_NONE}, { "PORT", ARG_HOST_PORT}, { "LPRT", ARG_HOST_PORT_LONG}, { "EPRT", ARG_HOST_PORT_EXT}, { "PASV", ARG_NONE}, { "LPSV", ARG_NONE}, { "EPSV", ARG_OPTIONAL_NUMBER}, { "TYPE", ARG_TYPE}, { "STRU", ARG_STRUCTURE}, { "MODE", ARG_MODE}, { "RETR", ARG_STRING}, { "STOR", ARG_STRING}, { "PWD", ARG_NONE}, { "LIST", ARG_OPTIONAL_STRING}, { "NLST", ARG_OPTIONAL_STRING}, { "SYST", ARG_NONE}, { "HELP", ARG_OPTIONAL_STRING}, { "NOOP", ARG_NONE}, { "REST", ARG_OFFSET}, { "SIZE", ARG_STRING}, { "MDTM", ARG_STRING}, }; #define NUM_COMMAND (sizeof(command_def) / sizeof(command_def[0])) /* prototypes */ static const char *copy_string(char *dst, const char *src); static const char *parse_host_port(struct sockaddr_in *addr, const char *s); static const char *parse_number(int *num, const char *s, int max_num); static const char *parse_offset(off_t * ofs, const char *s); static const char *parse_host_port_long(sockaddr_storage_t * sa, const char *s); static const char *parse_host_port_ext(sockaddr_storage_t * sa, const char *s); int ftp_command_parse(const char *input, struct ftp_command_s *cmd) { size_t match; int c; const char *optional_number; if (input == NULL || cmd == NULL) { return 0; } /* see if our input starts with a valid command */ for (match = 0; match < NUM_COMMAND; ++match) { // loop though known commands if (strncasecmp(input, command_def[match].name, strlen(command_def[match].name)) == 0) { /* copy our command */ strcpy(cmd->command, command_def[match].name); /* advance input past the command */ input += strlen(command_def[match].name); break; } } /* if we didn't find a match, return error */ if (match == NUM_COMMAND) { return 0; } /* now act based on the command */ switch (command_def[match].arg_type) { case ARG_NONE: cmd->num_arg = 0; break; case ARG_STRING: if (*input != ' ') { // no space before arguments return 0; } ++input; input = copy_string(cmd->arg[0].string, input); cmd->num_arg = 1; break; case ARG_OPTIONAL_STRING: if (*input == ' ') { ++input; input = copy_string(cmd->arg[0].string, input); cmd->num_arg = 1; } else { cmd->num_arg = 0; } break; case ARG_HOST_PORT: if (*input != ' ') { return 0; } input++; /* parse the host & port information (if any) */ input = parse_host_port(&cmd->arg[0].host_port, input); if (input == NULL) { return 0; } cmd->num_arg = 1; break; case ARG_HOST_PORT_LONG: if (*input != ' ') { return 0; } input++; /* parse the host & port information (if any) */ input = parse_host_port_long(&cmd->arg[0].host_port, input); if (input == NULL) { return 0; } cmd->num_arg = 1; break; case ARG_HOST_PORT_EXT: if (*input != ' ') { return 0; } input++; /* parse the host & port information (if any) */ input = parse_host_port_ext(&cmd->arg[0].host_port, input); if (input == NULL) { return 0; } cmd->num_arg = 1; break; /* the optional number may also be "ALL" */ case ARG_OPTIONAL_NUMBER: if (*input == ' ') { ++input; optional_number = parse_number(&cmd->arg[0].num, input, 255); if (optional_number != NULL) { input = optional_number; } else { if ((tolower( (int) input[0] ) == 'a') && (tolower( (int) input[1] ) == 'l') && (tolower( (int) input[2] ) == 'l')) { cmd->arg[0].num = EPSV_ALL; input += 3; } else { return 0; } } cmd->num_arg = 1; } else { cmd->num_arg = 0; } break; case ARG_TYPE: if (*input != ' ') { return 0; } input++; c = toupper( (int) input[0] ); if ((c == 'A') || (c == 'E')) { cmd->arg[0].string[0] = c; cmd->arg[0].string[1] = '\0'; input++; if (*input == ' ') { input++; c = toupper( (int) input[0] ); if ((c != 'N') && (c != 'T') && (c != 'C')) return 0; cmd->arg[1].string[0] = c; cmd->arg[1].string[1] = '\0'; input++; cmd->num_arg = 2; } else { cmd->num_arg = 1; } } else if (c == 'I') { cmd->arg[0].string[0] = 'I'; cmd->arg[0].string[1] = '\0'; input++; cmd->num_arg = 1; } else if (c == 'L') { cmd->arg[0].string[0] = 'L'; cmd->arg[0].string[1] = '\0'; input++; input = parse_number(&cmd->arg[1].num, input, 255); if (input == NULL) { return 0; } cmd->num_arg = 2; } else { return 0; } break; case ARG_STRUCTURE: if (*input != ' ') return 0; input++; c = toupper( (int) input[0] ); if ((c != 'F') && (c != 'R') && (c != 'P')) { return 0; } input++; cmd->arg[0].string[0] = c; cmd->arg[0].string[1] = '\0'; cmd->num_arg = 1; break; case ARG_MODE: if (*input != ' ') { return 0; } input++; c = toupper( (int) input[0] ); if ((c != 'S') && (c != 'B') && (c != 'C')) { return 0; } input++; cmd->arg[0].string[0] = c; cmd->arg[0].string[1] = '\0'; cmd->num_arg = 1; break; case ARG_OFFSET: if (*input != ' ') { return 0; } input++; input = parse_offset(&cmd->arg[0].offset, input); if (input == NULL) { return 0; } cmd->num_arg = 1; break; default: daemon_assert(0); } /* check for our ending newline */ if (*input != '\n') { return 0; } /* return our result */ return 1; } /* copy a string terminated with a newline */ static const char *copy_string(char *dst, const char *src) { int i; daemon_assert(dst != NULL); daemon_assert(src != NULL); for (i = 0; (i <= MAX_STRING_LEN) && (src[i] != '\0') && (src[i] != '\n'); i++) { dst[i] = src[i]; } dst[i] = '\0'; return src + i; } static const char *parse_host_port(struct sockaddr_in *addr, const char *s) { int i; int octets[6]; char addr_str[16]; int port; struct in_addr in_addr; daemon_assert(addr != NULL); daemon_assert(s != NULL); /* scan in 5 pairs of "#," */ for (i = 0; i < 5; i++) { s = parse_number(&octets[i], s, 255); if (s == NULL) { return NULL; } if (*s != ',') { return NULL; } s++; } /* scan in ending "#" */ s = parse_number(&octets[5], s, 255); if (s == NULL) { return NULL; } daemon_assert(octets[0] >= 0); daemon_assert(octets[0] <= 255); daemon_assert(octets[1] >= 0); daemon_assert(octets[1] <= 255); daemon_assert(octets[2] >= 0); daemon_assert(octets[2] <= 255); daemon_assert(octets[3] >= 0); daemon_assert(octets[3] <= 255); /* convert our number to a IP/port */ sprintf(addr_str, "%d.%d.%d.%d", octets[0], octets[1], octets[2], octets[3]); port = (octets[4] << 8) | octets[5]; #ifdef HAVE_INET_ATON if (inet_aton(addr_str, &in_addr) == 0) { return NULL; } #else in_addr.s_addr = inet_addr(addr_str); if (in_addr.s_addr == (in_addr_t) - 1) { return NULL; } #endif addr->sin_family = AF_INET; addr->sin_addr = in_addr; addr->sin_port = htons(port); /* return success */ return s; } /* note: returns success even for unknown address families */ /* this is okay, as long as subsequent uses VERIFY THE FAMILY first */ static const char *parse_host_port_long(sockaddr_storage_t * sa, const char *s) { int i; int family; int tmp; int addr_len; unsigned char addr[255]; int port_len; unsigned char port[255]; /* we are family */ s = parse_number(&family, s, 255); if (s == NULL) { return NULL; } if (s[0] != ',') { return NULL; } s++; /* parse host length */ s = parse_number(&addr_len, s, 255); if (s == NULL) { return NULL; } if (s[0] != ',') { return NULL; } s++; /* parse address */ for (i = 0; i < addr_len; i++) { //daemon_assert(i < sizeof(addr)/sizeof(addr[0])); s = parse_number(&tmp, s, 255); addr[i] = tmp; if (s == NULL) { return NULL; } if (s[0] != ',') { return NULL; } s++; } /* parse port length */ s = parse_number(&port_len, s, 255); /* parse port */ for (i = 0; i < port_len; i++) { if (s == NULL) { return NULL; } if (s[0] != ',') { return NULL; } s++; //daemon_assert(i < sizeof(port)/sizeof(port[0])); s = parse_number(&tmp, s, 255); port[i] = tmp; } /* okay, everything parses, load the address if possible */ if (family == 4) { SAFAM(sa) = AF_INET; if (addr_len != sizeof(struct in_addr)) { return NULL; } if (port_len != 2) { return NULL; } memcpy(&SINADDR(sa), addr, addr_len); SINPORT(sa) = htons((port[0] << 8) + port[1]); #ifdef INET6 } else if (family == 6) { SAFAM(sa) = AF_INET6; if (addr_len != sizeof(struct in6_addr)) { return NULL; } if (port_len != 2) { return NULL; } memcpy(&SIN6ADDR(sa), addr, addr_len); SINPORT(sa) = htons((port[0] << 8) + port[1]); #endif } else { SAFAM(sa) = -1; } /* return new pointer */ return s; } static const char *parse_host_port_ext(sockaddr_storage_t * sa, const char *s) { int delimeter; int family; char *p; ssize_t len; char addr_str[256]; int port; /* get delimeter character */ if ((*s < 33) || (*s > 126)) { return NULL; } delimeter = *s; s++; /* get address family */ if (*s == '1') { family = AF_INET; #ifdef INET6 } else if (*s == '2') { family = AF_INET6; #endif } else { return NULL; } s++; if (*s != delimeter) { return NULL; } s++; /* get address string */ p = strchr(s, delimeter); if (p == NULL) { return NULL; } len = p - s; if (len >= (ssize_t) sizeof(addr_str)) { return NULL; } memcpy(addr_str, s, len); addr_str[len] = '\0'; s = p + 1; /* get port */ s = parse_number(&port, s, 65535); if (s == NULL) { return NULL; } if (*s != delimeter) { return NULL; } s++; /* now parse the value passed */ #ifndef INET6 { struct in_addr in_addr; #ifdef HAVE_INET_ATON if (inet_aton(addr_str, &in_addr) == 0) { return NULL; } #else in_addr.s_addr = inet_addr(addr_str); if (in_addr.s_addr == (in_addr_t) - 1) { return NULL; } #endif /* HAVE_INET_ATON */ SIN4ADDR(sa) = in_addr; } #else { struct addrinfo hints; struct *res; memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_NUMERICHOST; hints.ai_family = family; if (getaddrinfo(addr_str, NULL, &hints, &res) != 0) { return NULL; } memcpy(sa, res->ai_addr, res->ai_addrlen); freeaddrinfo(res); } #endif /* INET6 */ SAFAM(sa) = family; SINPORT(sa) = htons(port); /* return new pointer */ return s; } /* scan the string for a number from 0 to max_num */ /* returns the next non-numberic character */ /* returns NULL if not at least one digit */ static const char *parse_number(int *num, const char *s, int max_num) { int tmp; int cur_digit; daemon_assert(s != NULL); daemon_assert(num != NULL); /* handle first character */ if (!isdigit( (int) s[0] )) { return NULL; } tmp = (*s - '0'); s++; /* handle subsequent characters */ while (isdigit( (int) s[0] )) { cur_digit = (*s - '0'); /* check for overflow */ if ((max_num - cur_digit) < (tmp * 10)) { return NULL; } tmp *= 10; tmp += cur_digit; s++; } daemon_assert(tmp >= 0); daemon_assert(tmp <= max_num); /* return the result */ *num = tmp; return s; } static const char *parse_offset(off_t * ofs, const char *s) { off_t tmp_ofs; int cur_digit; off_t max_ofs; daemon_assert(ofs != NULL); daemon_assert(s != NULL); /* calculate maximum allowable offset based on size of off_t */ if (sizeof(off_t) == 8) { max_ofs = (off_t) 9223372036854775807LL; } else if (sizeof(off_t) == 4) { max_ofs = (off_t) 2147483647LL; } else if (sizeof(off_t) == 2) { max_ofs = (off_t) 32767LL; } else { max_ofs = 0; } daemon_assert(max_ofs != 0); /* handle first character */ if (!isdigit( (int) s[0] )) { return NULL; } tmp_ofs = (*s - '0'); s++; /* handle subsequent characters */ while (isdigit( (int) s[0] )) { cur_digit = (*s - '0'); /* check for overflow */ if ((max_ofs - cur_digit) < (tmp_ofs * 10)) { return NULL; } tmp_ofs *= 10; tmp_ofs += cur_digit; s++; } /* return */ *ofs = tmp_ofs; return s; } owfs-3.1p5/module/owftpd/src/c/ftp_listener.c0000644000175000001440000002621712654730021016170 00000000000000/* * part of owftpd By Paul H Alfille * The whole is GPLv2 licenced though the ftp code was more liberally licenced when first used. */ /* This is the code that waits for client connections and creates the threads that handle them. When ftp_listener_init() is called, it binds to the appropriate socket and sets up the other values for the structure. Then, when ftp_listener_start() is called, a thread is started dedicatd to accepting connections. This thread waits for input on two file descriptors. If input arrives on the socket, then it accepts the connection and creates a thread to handle it. If input arrives on the shutdown_request pipe, then the thread terminates. This is how ftp_listener_stop() signals the listener to end. */ #include "owftpd.h" #include #include /* maximum number of consecutive errors in accept() before we terminate listener */ #define MAX_ACCEPT_ERROR 10 /* buffer to hold address string */ #define ADDR_BUF_LEN 100 /* information for a specific connection */ struct connection_info_s { struct ftp_listener_s *ftp_listener; struct telnet_session_s telnet_session; struct ftp_session_s ftp_session; struct watched_s watched; struct connection_info *next; }; /* prototypes */ static int invariant(const struct ftp_listener_s *f); static void *connection_acceptor(void *v); static char *addr2string(const sockaddr_storage_t * s); static void *connection_handler(void *v); static void connection_handler_cleanup(void *v); /* initialize an FTP listener */ /* ftp uses 0 as an error return */ int ftp_listener_init(struct ftp_listener_s *f) { int flags; daemon_assert(f != NULL); if ( Outbound_Control.head->name == NULL ) { Outbound_Control.head->name = owstrdup( DEFAULT_FTP_PORT ) ; } LEVEL_DEBUG("ftp_listener_init: name=[%s]", Outbound_Control.head->name); // For sone reason, there must be an IP address included if (strchr(Outbound_Control.head->name, ':') == NULL) { char *newname; char *oldname = Outbound_Control.head->name; newname = owmalloc(8 + strlen(oldname) + 1); // "0.0.0.0:" + null-char. if (newname == NULL) { LEVEL_DEFAULT("Cannot allocate menory for port name"); return 0; } strcpy(newname, "0.0.0.0:"); strcat(newname, oldname); //LEVEL_DEBUG("OWSERVER composite name <%s> -> <%s>\n",oldname,newname); Outbound_Control.head->name = newname; owfree(oldname); } if ( BAD( ServerOutSetup(Outbound_Control.head) ) ) { return 0; } // Zeroconf/Bonjour start (since owftpd doesn't use ServerProcess yet) ZeroConf_Announce(Outbound_Control.head); /* prevent socket from blocking on accept() */ flags = fcntl(Outbound_Control.head->file_descriptor, F_GETFL); if (flags == -1) { ERROR_CONNECT("Error getting flags on socket"); return 0; } if (fcntl(Outbound_Control.head->file_descriptor, F_SETFL, flags | O_NONBLOCK) != 0) { ERROR_CONNECT("Error setting socket to non-blocking"); return 0; } /* create a pipe to wake up our listening thread */ if (pipe(f->shutdown_request_fd) != 0) { ERROR_CONNECT("Error creating pipe for internal use"); return 0; } // fcntl (f->shutdown_request_fd[fd_pipe_read], F_SETFD, FD_CLOEXEC); // for safe forking // fcntl (f->shutdown_request_fd[fd_pipe_write], F_SETFD, FD_CLOEXEC); // for safe forking /* now load the values into the structure, since we can't fail from here */ f->file_descriptor = Outbound_Control.head->file_descriptor; f->max_connections = Globals.max_clients; f->num_connections = 0; f->inactivity_timeout = Globals.timeout_ftp; _MUTEX_INIT(f->mutex); strcpy(f->dir, "/"); f->listener_running = 0; pthread_cond_init(&f->shutdown_cond, NULL); daemon_assert(invariant(f)); return 1; } /* receive connections */ int ftp_listener_start(struct ftp_listener_s *f) { pthread_t thread_id; int ret_val; int error_code; daemon_assert(invariant(f)); error_code = pthread_create(&thread_id, DEFAULT_THREAD_ATTR, connection_acceptor, f); if (error_code == 0) { f->listener_running = 1; f->listener_thread = thread_id; ret_val = 1; } else { errno = error_code; ERROR_CONNECT("Unable to create thread"); ret_val = 0; } daemon_assert(invariant(f)); return ret_val; } #ifndef NDEBUG static int invariant(const struct ftp_listener_s *f) { int dir_len; if (f == NULL) { return 0; } if (FILE_DESCRIPTOR_NOT_VALID(f->file_descriptor)) { return 0; } if (f->max_connections <= 0) { return 0; } if ((f->num_connections < 0) || (f->num_connections > f->max_connections)) { return 0; } dir_len = strlen(f->dir); if ((dir_len <= 0) || (dir_len > PATH_MAX)) { return 0; } if (FILE_DESCRIPTOR_NOT_VALID(f->shutdown_request_fd[fd_pipe_write])) { return 0; } if (FILE_DESCRIPTOR_NOT_VALID(f->shutdown_request_fd[fd_pipe_read])) { return 0; } return 1; } #endif /* NDEBUG */ /* handle incoming connections */ static void *connection_acceptor(void *v) { struct ftp_listener_s *f = (struct ftp_listener_s *) v; int num_error; FILE_DESCRIPTOR_OR_ERROR file_descriptor; int tcp_nodelay; sockaddr_storage_t client_addr; sockaddr_storage_t server_addr; unsigned addr_len; struct connection_info_s *info; pthread_t thread_id; int error_code; fd_set readfds; daemon_assert(invariant(f)); if (!watchdog_init(&f->watchdog, f->inactivity_timeout)) { LEVEL_CONNECT("Error initializing watchdog thread"); return VOID_RETURN; } num_error = 0; for (;;) { /* wait for something to happen */ FD_ZERO(&readfds); FD_SET(f->file_descriptor, &readfds); FD_SET(f->shutdown_request_fd[fd_pipe_read], &readfds); select(FD_SETSIZE, &readfds, NULL, NULL, NULL); /* if data arrived on our pipe, we've been asked to exit */ if (FD_ISSET(f->shutdown_request_fd[fd_pipe_read], &readfds)) { Test_and_Close( & f->file_descriptor); LEVEL_CONNECT("Listener no longer accepting connections"); pthread_exit(NULL); return VOID_RETURN; } /* otherwise accept our pending connection (if any) */ addr_len = sizeof(sockaddr_storage_t); file_descriptor = accept(f->file_descriptor, (struct sockaddr *) &client_addr, &addr_len); if (FILE_DESCRIPTOR_VALID(file_descriptor)) { tcp_nodelay = 1; if (setsockopt(file_descriptor, IPPROTO_TCP, TCP_NODELAY, (void *) &tcp_nodelay, sizeof(int)) != 0) { ERROR_CONNECT("Error in setsockopt(), FTP server dropping connection"); Test_and_Close( & file_descriptor); continue; } addr_len = sizeof(sockaddr_storage_t); if (getsockname(file_descriptor, (struct sockaddr *) &server_addr, &addr_len) == -1) { ERROR_CONNECT("Error in getsockname(), FTP server dropping connection"); Test_and_Close( & file_descriptor); continue; } info = (struct connection_info_s *) owmalloc(sizeof(struct connection_info_s)); if (info == NULL) { LEVEL_CONNECT("Out of memory, FTP server dropping connection"); Test_and_Close( & file_descriptor); continue; } info->ftp_listener = f; telnet_session_init(&info->telnet_session, file_descriptor, file_descriptor); if (!ftp_session_init(&info->ftp_session, &client_addr, &server_addr, &info->telnet_session, f->dir)) { LEVEL_CONNECT("Eerror initializing FTP session, FTP server exiting"); close(file_descriptor); telnet_session_destroy(&info->telnet_session); owfree(info); continue; } error_code = pthread_create(&thread_id, DEFAULT_THREAD_ATTR, connection_handler, info); if (error_code != 0) { errno = error_code; ERROR_CONNECT("Error creating new thread"); close(file_descriptor); telnet_session_destroy(&info->telnet_session); owfree(info); } num_error = 0; } else { if ((errno == ECONNABORTED) || (errno == ECONNRESET)) { ERROR_CONNECT("Interruption accepting FTP connection"); } else { ERROR_CONNECT("Error accepting FTP connection"); ++num_error; } if (num_error >= MAX_ACCEPT_ERROR) { LEVEL_CONNECT("Too many consecutive errors, FTP server exiting"); return VOID_RETURN; } } } return VOID_RETURN; } /* convert an address to a printable string */ /* NOT THREADSAFE - wrap with a mutex before calling! */ static char *addr2string(const sockaddr_storage_t * s) { char *ret_val; daemon_assert(s != NULL); #ifdef INET6 { static char addr[IP_ADDRSTRLEN + 1]; int error; error = getnameinfo((struct sockaddr *) s, sizeof(sockaddr_storage_t), addr, sizeof(addr), NULL, 0, NI_NUMERICHOST); if (error != 0) { LEVEL_CONNECT("getnameinfo error; %s", gai_strerror(error)); ret_val = "Unknown IP"; } else { ret_val = addr; } } #else ret_val = inet_ntoa(s->sin_addr); #endif return ret_val; } static void *connection_handler(void *v) { struct connection_info_s *info = (struct connection_info_s *) v; struct ftp_listener_s *f; int num_connections; char drop_reason[80]; /* for ease of use only */ f = info->ftp_listener; /* don't save state for pthread_join() */ DETACH_THREAD; /* set up our watchdog */ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); watchdog_add_watched(&f->watchdog, &info->watched); /* set up our cleanup handler */ pthread_cleanup_push(connection_handler_cleanup, info); /* process global data */ _MUTEX_LOCK(f->mutex); num_connections = ++f->num_connections; ERROR_DEBUG("%s port %d connection", addr2string(&info->ftp_session.client_addr), ntohs(SINPORT(&info->ftp_session.client_addr))); _MUTEX_UNLOCK(f->mutex); /* handle the session */ if (num_connections <= f->max_connections) { ftp_session_run(&info->ftp_session, &info->watched); } else { /* too many users */ sprintf(drop_reason, "Too many users logged in, dropping connection (%d logins maximum)", f->max_connections); ftp_session_drop(&info->ftp_session, drop_reason); /* log the rejection */ _MUTEX_LOCK(f->mutex); LEVEL_CONNECT ("%s port %d exceeds max users (%d), dropping connection", addr2string(&info->ftp_session.client_addr), ntohs(SINPORT(&info->ftp_session.client_addr)), num_connections); _MUTEX_UNLOCK(f->mutex); } /* exunt (pop calls cleanup function) */ pthread_cleanup_pop(1); /* return for form :) */ return VOID_RETURN; } /* clean up a connection */ static void connection_handler_cleanup(void *v) { struct connection_info_s *info = (struct connection_info_s *) v; struct ftp_listener_s *f; f = info->ftp_listener; watchdog_remove_watched(&info->watched); _MUTEX_LOCK(f->mutex); f->num_connections--; pthread_cond_signal(&f->shutdown_cond); LEVEL_CONNECT("%s port %d disconnected", addr2string(&info->ftp_session.client_addr), ntohs(SINPORT(&info->ftp_session.client_addr))); _MUTEX_UNLOCK(f->mutex); ftp_session_destroy(&info->ftp_session); telnet_session_destroy(&info->telnet_session); owfree(info); } void ftp_listener_stop(struct ftp_listener_s *f) { daemon_assert(invariant(f)); /* write a byte to the listening thread - this will wake it up */ #if ( __GNUC__ > 4 ) || (__GNUC__ == 4 && __GNUC_MINOR__ > 4 ) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" write(f->shutdown_request_fd[fd_pipe_write], "", 1); #pragma GCC diagnostic pop #else write(f->shutdown_request_fd[fd_pipe_write], "", 1); #endif /* wait for client connections to complete */ _MUTEX_LOCK(f->mutex); while (f->num_connections > 0) { pthread_cond_wait(&f->shutdown_cond, &f->mutex); } _MUTEX_UNLOCK(f->mutex); } owfs-3.1p5/module/owftpd/src/c/ftp_session.c0000644000175000001440000011737112711737666016050 00000000000000/* * part of owftpd By Paul H Alfille * The whole is GPLv2 licenced though the ftp code was more liberally licenced when first used. */ #include "owftpd.h" #include #include #include /* space requirements */ #define ADDRPORT_STRLEN 58 /* prototypes */ static int invariant(const struct ftp_session_s *f); static void reply(struct ftp_session_s *f, int code, const char *fmt, ...); static void change_dir(struct ftp_session_s *f, const char *new_dir); static FILE_DESCRIPTOR_OR_ERROR open_connection(struct ftp_session_s *f); static int write_fully(FILE_DESCRIPTOR_OR_ERROR file_descriptor, const char *buf, int buflen); static void init_passive_port(void); static int get_passive_port(void); static int convert_newlines(char *dst, const char *src, int srclen); static void get_addr_str(const sockaddr_storage_t * s, char *buf, int bufsiz); static void send_readme(const struct ftp_session_s *f, int code); static void netscape_hack(FILE_DESCRIPTOR_OR_ERROR file_descriptor); static void set_port(struct ftp_session_s *f, const sockaddr_storage_t * host_port); static FILE_DESCRIPTOR_OR_ERROR set_pasv(struct ftp_session_s *f, sockaddr_storage_t * host_port); //static int ip_equal(const sockaddr_storage_t *a, const sockaddr_storage_t *b); static int ip_equal(const sockaddr_storage_t * a, const sockaddr_storage_t * b); static void get_absolute_fname(char *fname, size_t fname_len, const char *dir, const char *file); static void both_list(struct ftp_session_s *f, const struct ftp_command_s *cmd, enum file_list_e fle); /* command handlers */ static void do_user(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_pass(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_cwd(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_cdup(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_quit(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_port(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_pasv(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_type(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_stru(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_mode(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_retr(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_stor(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_pwd(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_nlst(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_list(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_syst(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_noop(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_rest(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_lprt(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_lpsv(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_eprt(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_epsv(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_size(struct ftp_session_s *f, const struct ftp_command_s *cmd); static void do_mdtm(struct ftp_session_s *f, const struct ftp_command_s *cmd); static struct { char *name; void (*func) (struct ftp_session_s * f, const struct ftp_command_s * cmd); } command_func[] = { { "USER", do_user}, { "PASS", do_pass}, { "CWD", do_cwd}, { "CDUP", do_cdup}, { "QUIT", do_quit}, { "PORT", do_port}, { "PASV", do_pasv}, { "LPRT", do_lprt}, { "LPSV", do_lpsv}, { "EPRT", do_eprt}, { "EPSV", do_epsv}, { "TYPE", do_type}, { "STRU", do_stru}, { "MODE", do_mode}, { "RETR", do_retr}, { "STOR", do_stor}, { "PWD", do_pwd}, { "NLST", do_nlst}, { "LIST", do_list}, { "SYST", do_syst}, { "NOOP", do_noop}, { "REST", do_rest}, { "SIZE", do_size}, { "MDTM", do_mdtm} }; #define NUM_COMMAND_FUNC (sizeof(command_func) / sizeof(command_func[0])) int ftp_session_init(struct ftp_session_s *f, const sockaddr_storage_t * client_addr, const sockaddr_storage_t * server_addr, struct telnet_session_s *t, const char *dir) { daemon_assert(f != NULL); daemon_assert(client_addr != NULL); daemon_assert(server_addr != NULL); daemon_assert(t != NULL); daemon_assert(dir != NULL); daemon_assert(strlen(dir) <= PATH_MAX); #ifdef INET6 /* if the control connection is on IPv6, we need to get an IPv4 address */ /* to bind the socket to */ if (SSFAM(server_addr) == AF_INET6) { struct addrinfo hints; struct addrinfo *res; int errcode; /* getaddrinfo() does the job nicely */ memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_INET; hints.ai_flags = AI_PASSIVE; if (getaddrinfo(NULL, "ftp", &hints, &res) != 0) { ERROR_CONNECT("Unable to determing IPv4 address; %s", gai_strerror(errcode)); return 0; } /* let's sanity check */ daemon_assert(res != NULL); daemon_assert(sizeof(f->server_ipv4_addr) >= res->ai_addrlen); daemon_assert(SSFAM(host_port) == AF_INET); /* copy the result and free memory as necessary */ memcpy(&f->server_ipv4_addr, res->ai_addr, res->ai_addrlen); freeaddrinfo(res); } else { daemon_assert(SSFAM(host_port) == AF_INET); f->server_ipv4_addr = *server_addr; } #else f->server_ipv4_addr = *server_addr; #endif f->session_active = 1; f->command_number = 0; f->data_type = TYPE_ASCII; f->file_structure = STRU_FILE; f->file_offset = 0; f->file_offset_command_number = ULONG_MAX; f->epsv_all_set = 0; f->client_addr = *client_addr; get_addr_str(client_addr, f->client_addr_str, sizeof(f->client_addr_str)); f->server_addr = *server_addr; f->telnet_session = t; daemon_assert(strlen(dir) < sizeof(f->dir)); strncpy(f->dir, dir, sizeof(f->dir) - 1); f->data_channel = DATA_PORT; f->data_port = *client_addr; f->server_fd = FILE_DESCRIPTOR_BAD; daemon_assert(invariant(f)); return 1; } void ftp_session_drop(struct ftp_session_s *f, const char *reason) { daemon_assert(invariant(f)); daemon_assert(reason != NULL); /* say goodbye */ reply(f, 421, "%s.", reason); daemon_assert(invariant(f)); } void ftp_session_run(struct ftp_session_s *f, struct watched_s *watched) { char buf[2048]; int len; struct ftp_command_s cmd; size_t i; daemon_assert(invariant(f)); daemon_assert(watched != NULL); /* record our watchdog */ f->watched = watched; /* say hello */ send_readme(f, 220); reply(f, 220, "Service ready for new user."); /* process commands */ while (f->session_active && telnet_session_readln(f->telnet_session, buf, sizeof(buf))) { /* delay our timeout based on this input */ watchdog_defer_watched(f->watched); /* increase our command count */ if (f->command_number == ULONG_MAX) { f->command_number = 0; } else { f->command_number++; } /* make sure we read a whole line */ len = strlen(buf); if (buf[len - 1] != '\n') { reply(f, 500, "Command line too long."); while (telnet_session_readln(f->telnet_session, buf, sizeof(buf))) { len = strlen(buf); if (buf[len - 1] == '\n') { break; } } goto next_command; } syslog(LOG_DEBUG, "%s %s", f->client_addr_str, buf); /* parse the line */ if (!ftp_command_parse(buf, &cmd)) { reply(f, 500, "Syntax error, command unrecognized."); goto next_command; } /* dispatch the command */ for (i = 0; i < NUM_COMMAND_FUNC; i++) { if (strcmp(cmd.command, command_func[i].name) == 0) { (command_func[i].func) (f, &cmd); goto next_command; } } /* oops, we don't have this command (shouldn't happen - shrug) */ reply(f, 502, "Command not implemented."); next_command:{ } } daemon_assert(invariant(f)); } void ftp_session_destroy(struct ftp_session_s *f) { daemon_assert(invariant(f)); Test_and_Close( & f->server_fd ) ; } #ifndef NDEBUG static int invariant(const struct ftp_session_s *f) { int len; if (f == NULL) { return 0; } if ((f->session_active != 0) && (f->session_active != 1)) { return 0; } if ((f->data_type != TYPE_ASCII) && (f->data_type != TYPE_IMAGE)) { return 0; } if ((f->file_structure != STRU_FILE) && (f->file_structure != STRU_RECORD)) { return 0; } if (f->file_offset < 0) { return 0; } if ((f->epsv_all_set != 0) && (f->epsv_all_set != 1)) { return 0; } len = strlen(f->client_addr_str); if ((len <= 0) || (len >= ADDRPORT_STRLEN)) { return 0; } if (f->telnet_session == NULL) { return 0; } switch (f->data_channel) { case DATA_PORT: /* If the client specifies a port, verify that it is from the */ /* host the client connected from. This prevents a client from */ /* using the server to open connections to arbritrary hosts. */ if (!ip_equal(&f->client_addr, &f->data_port)) { return 0; } if ( FILE_DESCRIPTOR_NOT_VALID(f->server_fd)) { return 0; } break; case DATA_PASSIVE: if ( FILE_DESCRIPTOR_NOT_VALID(f->server_fd)) { return 0; } break; default: return 0; } return 1; } #endif /* NDEBUG */ static void reply(struct ftp_session_s *f, int code, const char *fmt, ...) { char buf[256]; va_list ap; daemon_assert(invariant(f)); daemon_assert(code >= 100); daemon_assert(code <= 559); daemon_assert(fmt != NULL); /* prepend our code to the buffer */ sprintf(buf, "%d", code); buf[3] = ' '; /* add the formatted output of the caller to the buffer */ va_start(ap, fmt); vsnprintf(buf + 4, sizeof(buf) - 4, fmt, ap); va_end(ap); /* log our reply */ LEVEL_DATA("%s %s", f->client_addr_str, buf); /* send the output to the other side */ telnet_session_println(f->telnet_session, buf); daemon_assert(invariant(f)); } static void do_user(struct ftp_session_s *f, const struct ftp_command_s *cmd) { const char *user; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); user = cmd->arg[0].string; if (strcasecmp(user, "ftp") && strcasecmp(user, "anonymous")) { LEVEL_CONNECT("%s attempted to log in as \"%s\"", f->client_addr_str, user); //reply(f, 530, "Only anonymous FTP supported."); reply(f, 331, "Force Anonymous. Send e-mail address as password."); } else { reply(f, 331, "Send e-mail address as password."); } daemon_assert(invariant(f)); } static void do_pass(struct ftp_session_s *f, const struct ftp_command_s *cmd) { const char *password; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); password = cmd->arg[0].string; LEVEL_CONNECT("%s reports e-mail address \"%s\"", f->client_addr_str, password); reply(f, 230, "User logged in, proceed."); daemon_assert(invariant(f)); } #ifdef INET6 static void get_addr_str(const sockaddr_storage_t * s, char *buf, int bufsiz) { int port; int error; int len; daemon_assert(s != NULL); daemon_assert(buf != NULL); /* buf must be able to contain (at least) a string representing an * ipv4 addr, followed by the string " port " (6 chars) and the port * number (which is 5 chars max), plus the '\0' character. */ daemon_assert(bufsiz >= (INET_ADDRSTRLEN + 12)); error = getnameinfo(client_addr, sizeof(sockaddr_storage_t), buf, bufsiz, NULL, 0, NI_NUMERICHOST); /* getnameinfo() should never fail when called with NI_NUMERICHOST */ daemon_assert(error == 0); len = strlen(buf); daemon_assert(bufsiz >= len + 12); snprintf(buf + len, bufsiz - len, " port %d", ntohs(SINPORT(&f->client_addr))); } #else static void get_addr_str(const sockaddr_storage_t * s, char *buf, int bufsiz) { unsigned int addr; int port; daemon_assert(s != NULL); daemon_assert(buf != NULL); /* buf must be able to contain (at least) a string representing an * ipv4 addr, followed by the string " port " (6 chars) and the port * number (which is 5 chars max), plus the '\0' character. */ daemon_assert(bufsiz >= (INET_ADDRSTRLEN + 12)); addr = ntohl(s->sin_addr.s_addr); port = ntohs(s->sin_port); snprintf(buf, bufsiz, "%d.%d.%d.%d port %d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff, port); } #endif static void do_cwd(struct ftp_session_s *f, const struct ftp_command_s *cmd) { const char *new_dir; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); new_dir = cmd->arg[0].string; change_dir(f, new_dir); daemon_assert(invariant(f)); } static void do_cdup(struct ftp_session_s *f, const struct ftp_command_s *cmd) { daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 0); change_dir(f, ".."); daemon_assert(invariant(f)); } static void change_dir(struct ftp_session_s *f, const char *new_dir) { struct cd_parse_s cps; strcpy(cps.buffer, (ASCII *) f->dir); cps.rest = new_dir; cps.pse = parse_status_init; LEVEL_DEBUG("CD dir=%s, file=%s", SAFESTRING(cps.buffer), SAFESTRING(new_dir)); FileLexCD(&cps); switch (cps.solutions) { case 0: cps.ret = -ENOENT; case 1: break; default: cps.ret = -EFAULT; } if (cps.dir == NULL) { cps.ret = -ENOMEM; } if (cps.ret) { reply(f, 550, "Error changing directory. %s", strerror(-cps.ret)); } else { f->dir[PATH_MAX] = '\0' ; // trailing null strncpy(f->dir, cps.dir, PATH_MAX); reply(f, 250, "Directory change successful."); } if (cps.dir) { owfree(cps.dir); } } static void do_quit(struct ftp_session_s *f, const struct ftp_command_s *cmd) { daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 0); reply(f, 221, "Service closing control connection."); f->session_active = 0; daemon_assert(invariant(f)); } /* support for the various port setting functions */ static void set_port(struct ftp_session_s *f, const sockaddr_storage_t * host_port) { daemon_assert(invariant(f)); daemon_assert(host_port != NULL); if (f->epsv_all_set) { reply(f, 500, "After EPSV ALL, only EPSV allowed."); } else if (!ip_equal(&f->client_addr, host_port)) { reply(f, 500, "Port must be on command channel IP."); } else if (ntohs(cSINPORT(host_port)) < IPPORT_RESERVED) { reply(f, 500, "Port may not be less than 1024, which is reserved."); } else { /* close any outstanding PASSIVE port */ if (f->data_channel == DATA_PASSIVE) { Test_and_Close( & f->server_fd ) ; } f->data_channel = DATA_PORT; f->data_port = *host_port; reply(f, 200, "Command okay."); } daemon_assert(invariant(f)); } /* set IP and port for client to receive data on */ static void do_port(struct ftp_session_s *f, const struct ftp_command_s *cmd) { const sockaddr_storage_t *host_port; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); host_port = &cmd->arg[0].host_port; daemon_assert(cSSFAM(host_port) == AF_INET); set_port(f, host_port); daemon_assert(invariant(f)); } /* set IP and port for client to receive data on, transport independent */ static void do_lprt(struct ftp_session_s *f, const struct ftp_command_s *cmd) { const sockaddr_storage_t *host_port; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); host_port = &cmd->arg[0].host_port; #ifdef INET6 if ((cSSFAM(host_port) != AF_INET) && (cSSFAM(host_port) != AF_INET6)) { reply(f, 521, "Only IPv4 and IPv6 supported, address families (4,6)"); } #else if (cSSFAM(host_port) != AF_INET) { reply(f, 521, "Only IPv4 supported, address family (4)"); } #endif set_port(f, host_port); daemon_assert(invariant(f)); } /* set IP and port for the client to receive data on, IPv6 extension */ /* */ /* RFC 2428 specifies that if the data connection is going to be on */ /* the same IP as the control connection, EPSV must be used. Since */ /* that is the only mode of transfer we support, we reject all EPRT */ /* requests. */ static void do_eprt(struct ftp_session_s *f, const struct ftp_command_s *cmd) { daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); reply(f, 500, "EPRT not supported, use EPSV."); daemon_assert(invariant(f)); } /* support for the various pasv setting functions */ /* returns the file descriptor of the bound port, or -1 on error */ /* note: the "host_port" parameter will be modified, having its port set */ static FILE_DESCRIPTOR_OR_ERROR set_pasv(struct ftp_session_s *f, sockaddr_storage_t * bind_addr) { FILE_DESCRIPTOR_OR_ERROR socket_fd; int port; daemon_assert(invariant(f)); daemon_assert(bind_addr != NULL); socket_fd = socket(SSFAM(bind_addr), SOCK_STREAM, 0); if (FILE_DESCRIPTOR_NOT_VALID(socket_fd)) { reply(f, 500, "Error creating server socket; %s.", strerror(errno)); return FILE_DESCRIPTOR_BAD; } // fcntl (socket_fd, F_SETFD, FD_CLOEXEC); // for safe forking for (;;) { port = get_passive_port(); SINPORT(bind_addr) = htons(port); if (bind(socket_fd, (struct sockaddr *) bind_addr, sizeof(struct sockaddr)) == 0) { break; } if (errno != EADDRINUSE) { reply(f, 500, "Error binding server port; %s.", strerror(errno)); Test_and_Close(&socket_fd); return FILE_DESCRIPTOR_BAD; } } if (listen(socket_fd, 1) != 0) { reply(f, 500, "Error listening on server port; %s.", strerror(errno)); Test_and_Close(&socket_fd); return FILE_DESCRIPTOR_BAD; } return socket_fd; } /* pick a server port to listen for connection on */ static void do_pasv(struct ftp_session_s *f, const struct ftp_command_s *cmd) { FILE_DESCRIPTOR_OR_ERROR socket_fd; unsigned int addr; int port; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 0); if (f->epsv_all_set) { reply(f, 500, "After EPSV ALL, only EPSV allowed."); goto exit_pasv; } socket_fd = set_pasv(f, &f->server_ipv4_addr); if (FILE_DESCRIPTOR_NOT_VALID(socket_fd)) { goto exit_pasv; } /* report port to client */ addr = ntohl(f->server_ipv4_addr.sin_addr.s_addr); port = ntohs(f->server_ipv4_addr.sin_port); reply(f, 227, "Entering Passive Mode (%d,%d,%d,%d,%d,%d).", addr >> 24, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff, port >> 8, port & 0xff); /* close any outstanding PASSIVE port */ if (f->data_channel == DATA_PASSIVE) { Test_and_Close( & f->server_fd); } f->data_channel = DATA_PASSIVE; f->server_fd = socket_fd; exit_pasv: daemon_assert(invariant(f)); } /* pick a server port to listen for connection on, including IPv6 */ static void do_lpsv(struct ftp_session_s *f, const struct ftp_command_s *cmd) { FILE_DESCRIPTOR_OR_ERROR socket_fd; char addr[80]; uint8_t *a; uint8_t *p; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 0); if (f->epsv_all_set) { reply(f, 500, "After EPSV ALL, only EPSV allowed."); goto exit_lpsv; } socket_fd = set_pasv(f, &f->server_addr); if (FILE_DESCRIPTOR_NOT_VALID(socket_fd)) { goto exit_lpsv; } /* report address and port to client */ #ifdef INET6 if (SSFAM(&f->server_addr) == AF_INET6) { a = (uint8_t *) & SIN6ADDR(&f->server_addr); p = (uint8_t *) & SIN6PORT(&f->server_addr); snprintf(addr, sizeof(addr), "(6,16,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,2,%d,%d)", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], p[0], p[1]); } else #endif { a = (uint8_t *) & SIN4ADDR(&f->server_addr); p = (uint8_t *) & SIN4PORT(&f->server_addr); snprintf(addr, sizeof(addr), "(4,4,%d,%d,%d,%d,2,%d,%d)", a[0], a[1], a[2], a[3], p[0], p[1]); } reply(f, 228, "Entering Long Passive Mode %s", addr); /* close any outstanding PASSIVE port */ if (f->data_channel == DATA_PASSIVE) { Test_and_Close( & f->server_fd); } f->data_channel = DATA_PASSIVE; f->server_fd = socket_fd; exit_lpsv: daemon_assert(invariant(f)); } /* pick a server port to listen for connection on, new IPv6 method */ static void do_epsv(struct ftp_session_s *f, const struct ftp_command_s *cmd) { FILE_DESCRIPTOR_OR_ERROR socket_fd; sockaddr_storage_t *addr; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert((cmd->num_arg == 0) || (cmd->num_arg == 1)); /* check our argument, if any, and use the appropriate address */ if (cmd->num_arg == 0) { addr = &f->server_addr; } else { switch (cmd->arg[0].num) { /* EPSV_ALL is a special number indicating the client sent */ /* the command "EPSV ALL" - this is not a request to assign */ /* a new passive port, but rather to deny all future port */ /* assignment requests other than EPSV */ case EPSV_ALL: f->epsv_all_set = 1; reply(f, 200, "EPSV ALL command successful."); goto exit_epsv; case 1: addr = (sockaddr_storage_t *) & f->server_ipv4_addr; break; #ifdef INET6 case 2: addr = &f->server_addr; break; default: reply(f, 522, "Only IPv4 and IPv6 supported, use (1,2)"); goto exit_epsv; #else default: reply(f, 522, "Only IPv4 supported, use (1)"); goto exit_epsv; #endif } } /* bind port and so on */ socket_fd = set_pasv(f, addr); if (FILE_DESCRIPTOR_NOT_VALID(socket_fd)) { goto exit_epsv; } /* report port to client */ reply(f, 229, "Entering Extended Passive Mode (|||%d|)", ntohs(SINPORT(&f->server_addr))); /* close any outstanding PASSIVE port */ if (f->data_channel == DATA_PASSIVE) { Test_and_Close( & f->server_fd ) ; } f->data_channel = DATA_PASSIVE; f->server_fd = socket_fd; exit_epsv: daemon_assert(invariant(f)); } /* seed the random number generator used to pick a port */ static void init_passive_port() { struct timeval tv; unsigned short int seed[3]; gettimeofday(&tv, NULL); seed[0] = (tv.tv_sec >> 16) & 0xFFFF; seed[1] = tv.tv_sec & 0xFFFF; seed[2] = tv.tv_usec & 0xFFFF; seed48(seed); } /* pick a port to try to bind() for passive FTP connections */ static int get_passive_port() { static pthread_once_t once_control = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; int port; /* initialize the random number generator the first time we're called */ pthread_once(&once_control, init_passive_port); /* pick a random port between 1024 and 65535, inclusive */ _MUTEX_LOCK(mutex); port = (lrand48() % 64512) + 1024; _MUTEX_UNLOCK(mutex); return port; } static void do_type(struct ftp_session_s *f, const struct ftp_command_s *cmd) { char type; char form; int cmd_okay; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg >= 1); daemon_assert(cmd->num_arg <= 2); type = cmd->arg[0].string[0]; if (cmd->num_arg == 2) { form = cmd->arg[1].string[0]; } else { form = 0; } cmd_okay = 0; if (type == 'A') { if ((cmd->num_arg == 1) || ((cmd->num_arg == 2) && (form == 'N'))) { f->data_type = TYPE_ASCII; cmd_okay = 1; } } else if (type == 'I') { f->data_type = TYPE_IMAGE; cmd_okay = 1; } if (cmd_okay) { reply(f, 200, "Command okay."); } else { reply(f, 504, "Command not implemented for that parameter."); } daemon_assert(invariant(f)); } static void do_stru(struct ftp_session_s *f, const struct ftp_command_s *cmd) { char structure; int cmd_okay; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); structure = cmd->arg[0].string[0]; cmd_okay = 0; if (structure == 'F') { f->file_structure = STRU_FILE; cmd_okay = 1; } else if (structure == 'R') { f->file_structure = STRU_RECORD; cmd_okay = 1; } if (cmd_okay) { reply(f, 200, "Command okay."); } else { reply(f, 504, "Command not implemented for that parameter."); } daemon_assert(invariant(f)); } static void do_mode(struct ftp_session_s *f, const struct ftp_command_s *cmd) { char mode; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); mode = cmd->arg[0].string[0]; if (mode == 'S') { reply(f, 200, "Command okay."); } else { reply(f, 504, "Command not implemented for that parameter."); } daemon_assert(invariant(f)); } /* convert the user-entered file name into a full path on our local drive */ static void get_absolute_fname(char *fname, size_t fname_len, const char *dir, const char *file) { daemon_assert(fname != NULL); daemon_assert(dir != NULL); daemon_assert(file != NULL); if (*file == '/') { /* absolute path, use as input */ daemon_assert(strlen(file) < fname_len); strcpy(fname, file); } else { /* construct a file name based on our current directory */ daemon_assert(strlen(dir) + 1 + strlen(file) < fname_len); strncpy(fname, dir, fname_len - 1); /* add a seperating '/' if we're not at the root */ if (fname[1] != '\0') { strcat(fname, "/"); } /* and of course the actual file name */ strcat(fname, file); } } static void do_retr(struct ftp_session_s *f, const struct ftp_command_s *cmd) { const char *file_name; FILE_DESCRIPTOR_OR_ERROR socket_fd; ASCII *buf2 = NULL; ASCII *bufwrite; struct timeval start_timestamp; struct timeval end_timestamp; struct timeval transfer_time; struct one_wire_query owq; size_t size_write; SIZE_OR_ERROR returned_length; off_t offset = 0; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); /* set up for exit */ socket_fd = FILE_DESCRIPTOR_BAD; /* create an absolute name for our file */ file_name = cmd->arg[0].string; /* if the last command was a REST command, restart at the */ /* requested position in the file */ if ( f->file_offset_command_number == (f->command_number - 1) ) { offset = f->file_offset; } /* Can we parse the name? */ if ( BAD( OWQ_create_plus(f->dir, file_name, &owq) ) ) { reply(f, 550, "File does not exist."); goto exit_retr; } if (IsDir(PN(&owq))) { reply(f, 550, "Error, file is a directory."); goto exit_retr; } if (OWQ_pn(&owq).selected_filetype->read == NO_READ_FUNCTION) { reply(f, 550, "Error, file is write-only."); goto exit_retr; } if ((OWQ_pn(&owq).selected_filetype->format == ft_binary) && (f->data_type == TYPE_ASCII)) { reply(f, 550, "Error, binary file (type ascii)."); goto exit_retr; } if ( BAD( OWQ_allocate_read_buffer(&owq)) ) { reply(f, 550, "Error, file too large."); goto exit_retr; } OWQ_offset(&owq) = offset ; returned_length = FS_read_postparse(&owq); if (returned_length < 0) { reply(f, 550, "Error reading from file; %s.", strerror(-returned_length)); goto exit_retr; } if (f->data_type == TYPE_IMAGE) { bufwrite = OWQ_buffer(&owq); size_write = returned_length; goto good_retr; } buf2 = owmalloc(2 * returned_length); if (buf2 == NULL) { reply(f, 550, "Error, file too large."); goto exit_retr; } // TYPE_ASCII size_write = convert_newlines(buf2, OWQ_buffer(&owq), returned_length); bufwrite = buf2; good_retr: /* ready to transfer */ reply(f, 150, "About to open data connection."); /* mark start time */ gettimeofday(&start_timestamp, NULL); /* open data path */ socket_fd = open_connection(f); if (FILE_DESCRIPTOR_NOT_VALID(socket_fd)) { goto exit_retr; } /* we're golden, send the file */ if (write_fully(socket_fd, bufwrite, size_write) == -1) { reply(f, 550, "Error writing to data connection; %s.", strerror(errno)); goto exit_retr; } watchdog_defer_watched(f->watched); /* disconnect */ Test_and_Close(&socket_fd); /* hey, it worked, let the other side know */ reply(f, 226, "File transfer complete."); /* mark end time */ gettimeofday(&end_timestamp, NULL); /* calculate transfer rate */ timersub( &end_timestamp, &start_timestamp, &transfer_time ) ; /* note the transfer */ LEVEL_DATA("%s retrieved \"%s\", %ld bytes in "TVformat, f->client_addr_str, OWQ_pn(&owq).path, size_write, TVvar(&transfer_time) ); exit_retr: OWQ_destroy(&owq); // safe at any speed if (buf2) { owfree(buf2); } f->file_offset = 0; Test_and_Close(&socket_fd) ; daemon_assert(invariant(f)); } /* Write to 1-wire device */ static void do_stor(struct ftp_session_s *f, const struct ftp_command_s *cmd) { FILE_DESCRIPTOR_OR_ERROR socket_fd; struct timeval start_timestamp; struct timeval end_timestamp; struct timeval transfer_time; struct timeval limit_time = { Globals.timeout_ftp, 0 }; size_t size_read; off_t offset = 0 ; char * data_in = NULL ; struct parsedname *pn; OWQ_allocate_struct_and_pointer(owq); pn = PN(owq); daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); /* set up for exit */ socket_fd = FILE_DESCRIPTOR_BAD; /* create an absolute name for our file */ if ( BAD( OWQ_create_plus(f->dir, cmd->arg[0].string, owq) ) ) { reply(f, 550, "File does not exist."); goto exit_stor; } /* if the last command was a REST command, restart at the */ /* requested position in the file */ if ( f->file_offset_command_number == (f->command_number - 1) ) { offset = f->file_offset; } if (IsDir(pn)) { reply(f, 550, "Error, file is a directory."); goto exit_stor; } if (pn->selected_filetype->write == NO_WRITE_FUNCTION) { reply(f, 550, "Error, file is read-only."); goto exit_stor; } if ((pn->selected_filetype->format == ft_binary) && (f->data_type == TYPE_ASCII)) { reply(f, 550, "Error, binary file (type ascii)."); goto exit_stor; } /* ready to transfer */ reply(f, 150, "About to open data connection."); /* mark start time */ gettimeofday(&start_timestamp, NULL); /* open data path */ socket_fd = open_connection(f); if ( FILE_DESCRIPTOR_NOT_VALID(socket_fd) ) { goto exit_stor; } size_read = FullFileLength(PN(owq)) - OWQ_offset(owq) + 100; data_in = owmalloc(size_read); if (data_in == NULL) { reply(f, 550, "Out of memory."); goto exit_stor; } else { /* we're golden, read the file */ size_t size_actual ; int read_return = tcp_read(socket_fd, (BYTE *) data_in, size_read, &limit_time, &size_actual) ; if (read_return != 0 && read_return != -EAGAIN) { reply(f, 550, "Error reading from data connection; %s.", strerror(errno)); goto exit_stor; } if ( BAD( OWQ_allocate_write_buffer( data_in, size_actual, offset, owq )) ) { reply(f, 550, "Out of memory."); goto exit_stor; } } watchdog_defer_watched(f->watched); /* disconnect */ Test_and_Close(&socket_fd) ; /* hey, it worked, let the other side know */ reply(f, 226, "File transfer complete."); /* mark end time */ gettimeofday(&end_timestamp, NULL); /* calculate transfer rate */ timersub( &end_timestamp, &start_timestamp, &transfer_time ) ; { /* write to one-wire */ int one_wire_error = FS_write_postparse(owq); if (one_wire_error < 0) { reply(f, 550, "Error writing to file; %s.", strerror(-one_wire_error)); goto exit_stor; } } /* note the transfer */ LEVEL_DATA("%s stored \"%s\", %ld bytes in "TVformat, f->client_addr_str, pn->path, OWQ_size(owq), TVvar(&transfer_time) ); /* Fall through */ exit_stor: OWQ_destroy(owq); f->file_offset = 0; /* Free memory */ if ( data_in != NULL ) { owfree(data_in) ; } /* disconnect */ Test_and_Close(&socket_fd) ; daemon_assert(invariant(f)); } static FILE_DESCRIPTOR_OR_ERROR open_connection(struct ftp_session_s *f) { FILE_DESCRIPTOR_OR_ERROR socket_fd; struct sockaddr_in addr; unsigned addr_len; daemon_assert((f->data_channel == DATA_PORT) || (f->data_channel == DATA_PASSIVE)); if (f->data_channel == DATA_PORT) { socket_fd = socket(SSFAM(&f->data_port), SOCK_STREAM, 0); if ( FILE_DESCRIPTOR_NOT_VALID(socket_fd) ) { reply(f, 425, "Error creating socket; %s.", strerror(errno)); return FILE_DESCRIPTOR_BAD ; } // fcntl (socket_fd, F_SETFD, FD_CLOEXEC); // for safe forking if (connect(socket_fd, (struct sockaddr *) &f->data_port, sizeof(sockaddr_storage_t)) != 0) { reply(f, 425, "Error connecting; %s.", strerror(errno)); Test_and_Close(&socket_fd); return FILE_DESCRIPTOR_BAD; } } else { daemon_assert(f->data_channel == DATA_PASSIVE); addr_len = sizeof(struct sockaddr_in); socket_fd = accept(f->server_fd, (struct sockaddr *) &addr, &addr_len); if ( FILE_DESCRIPTOR_NOT_VALID(socket_fd) ) { reply(f, 425, "Error accepting connection; %s.", strerror(errno)); return FILE_DESCRIPTOR_BAD; } #ifdef INET6 /* in IPv6, the client can connect to a channel using a different */ /* protocol - in that case, we'll just blindly let the connection */ /* through, otherwise verify addresses match */ if (SAFAM(addr) == SSFAM(&f->client_addr)) { if (memcmp(&SINADDR(&f->client_addr), &SINADDR(&addr), sizeof(SINADDR(&addr)))) { reply(f, 425, "Error accepting connection; connection from invalid IP."); Test_and_Close(&socket_fd); return FILE_DESCRIPTOR_BAD; } } #else if (memcmp(&f->client_addr.sin_addr, &addr.sin_addr, sizeof(struct in_addr))) { reply(f, 425, "Error accepting connection; connection from invalid IP."); Test_and_Close(&socket_fd); return FILE_DESCRIPTOR_BAD; } #endif } return socket_fd; } /* convert any '\n' to '\r\n' */ /* destination should be twice the size of the source for safety */ static int convert_newlines(char *dst, const char *src, int srclen) { int i; int dstlen; daemon_assert(dst != NULL); daemon_assert(src != NULL); dstlen = 0; for (i = 0; i < srclen; i++) { if (src[i] == '\n') { dst[dstlen++] = '\r'; } dst[dstlen++] = src[i]; } return dstlen; } static int write_fully(FILE_DESCRIPTOR_OR_ERROR file_descriptor, const char *buf, int buflen) { int amt_written; int write_ret; amt_written = 0; while (amt_written < buflen) { write_ret = write(file_descriptor, buf + amt_written, buflen - amt_written); if (write_ret <= 0) { return -1; } amt_written += write_ret; } return amt_written; } static void do_pwd(struct ftp_session_s *f, const struct ftp_command_s *cmd) { daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 0); reply(f, 257, "\"%s\" is current directory.", f->dir); daemon_assert(invariant(f)); } static void both_list(struct ftp_session_s *f, const struct ftp_command_s *cmd, enum file_list_e fle) { struct file_parse_s fps; strcpy(fps.buffer, f->dir); fps.rest = NULL; fps.pse = parse_status_init; fps.fle = fle; fps.out = FILE_DESCRIPTOR_BAD; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert((cmd->num_arg == 0) || (cmd->num_arg == 1)); /* figure out what parameters to use */ if (cmd->num_arg == 0) { fps.rest = strdup("*"); } else { daemon_assert(cmd->num_arg == 1); /* ignore attempts to send options to "ls" by silently dropping */ /* We don't use "ls" so can just pass on literal text */ fps.rest = strdup(cmd->arg[0].string); } /* ready to list */ reply(f, 150, "About to send name list."); /* open our data connection */ fps.out = open_connection(f); if (FILE_DESCRIPTOR_NOT_VALID(fps.out)) { goto exit_blst; } /* send any files */ FileLexParse(&fps); /* strange handshake for Netscape's benefit */ netscape_hack(fps.out); if (fps.ret == 0) { reply(f, 226, "Transfer complete."); } else { reply(f, 451, "Error sending name list. %s", strerror(-fps.ret)); } /* clean up and exit */ exit_blst: Test_and_Close( & fps.out ) ; daemon_assert(invariant(f)); } static void do_nlst(struct ftp_session_s *f, const struct ftp_command_s *cmd) { both_list(f, cmd, file_list_nlst); } static void do_list(struct ftp_session_s *f, const struct ftp_command_s *cmd) { both_list(f, cmd, file_list_list); } static void do_syst(struct ftp_session_s *f, const struct ftp_command_s *cmd) { daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 0); reply(f, 215, "UNIX"); daemon_assert(invariant(f)); } static void do_noop(struct ftp_session_s *f, const struct ftp_command_s *cmd) { daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 0); reply(f, 200, "Command okay."); daemon_assert(invariant(f)); } static void do_rest(struct ftp_session_s *f, const struct ftp_command_s *cmd) { daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); if (f->data_type != TYPE_IMAGE) { reply(f, 555, "Restart not possible in ASCII mode."); } else if (f->file_structure != STRU_FILE) { reply(f, 555, "Restart only possible with FILE structure."); } else { f->file_offset = cmd->arg[0].offset; f->file_offset_command_number = f->command_number; reply(f, 350, "Restart okay, awaiting file retrieval request."); } daemon_assert(invariant(f)); } static void do_size(struct ftp_session_s *f, const struct ftp_command_s *cmd) { off_t filesize; struct parsedname pn; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); if (f->data_type != TYPE_IMAGE) { reply(f, 550, "Size cannot be determined in ASCII mode."); } else if (f->file_structure != STRU_FILE) { reply(f, 550, "Size cannot be determined with FILE structure."); } else { /* get the file information */ if ( FS_ParsedNamePlus(f->dir, cmd->arg[0].string, &pn) != 0 ) { reply(f, 550, "Bad file specification"); } else { /* verify that the file is not a directory */ if (pn.selected_device == NO_DEVICE || pn.selected_filetype == NO_FILETYPE) { reply(f, 550, "File is a directory, SIZE command not valid."); } else { filesize = FullFileLength(&pn); /* output the size */ if (sizeof(off_t) == 8) { reply(f, 213, "%llu", filesize); } else { reply(f, 213, "%lu", filesize); } } FS_ParsedName_destroy(&pn); } } daemon_assert(invariant(f)); } /* if no gmtime_r() is available, provide one */ #ifndef HAVE_GMTIME_R struct tm *gmtime_r(const time_t * timep, struct tm *timeptr) { static pthread_mutex_t time_lock = PTHREAD_MUTEX_INITIALIZER; _MUTEX_LOCK(time_lock); *timeptr = *(gmtime(timep)); _MUTEX_UNLOCK(time_lock); return timeptr; } #endif /* HAVE_GMTIME_R */ static void do_mdtm(struct ftp_session_s *f, const struct ftp_command_s *cmd) { const char *file_name; char full_path[PATH_MAX + 1 + MAX_STRING_LEN]; struct stat stat_buf; struct tm mtime; char time_buf[16]; daemon_assert(invariant(f)); daemon_assert(cmd != NULL); daemon_assert(cmd->num_arg == 1); /* create an absolute name for our file */ file_name = cmd->arg[0].string; get_absolute_fname(full_path, sizeof(full_path), f->dir, file_name); /* get the file information */ if (FS_fstat(full_path, &stat_buf) < 0) { reply(f, 550, "Error getting file status; %s.", strerror(errno)); } else { gmtime_r(&stat_buf.st_mtime, &mtime); strftime(time_buf, sizeof(time_buf), "%Y%m%d%H%M%S", &mtime); reply(f, 213, time_buf); } daemon_assert(invariant(f)); } static void send_readme(const struct ftp_session_s *f, int code) { char code_str[8]; daemon_assert(invariant(f)); daemon_assert(code >= 100); daemon_assert(code <= 559); /* convert our code to a buffer */ daemon_assert(code >= 100); daemon_assert(code <= 999); sprintf(code_str, "%03d-", code); telnet_session_print(f->telnet_session, code_str); telnet_session_println(f->telnet_session, "owftpd 1-wire ftp server -- Paul H Alfille"); telnet_session_print(f->telnet_session, code_str); telnet_session_println(f->telnet_session, "Version: " VERSION " see http://www.owfs.org"); } /* hack which prevents Netscape error in file list */ static void netscape_hack(FILE_DESCRIPTOR_OR_ERROR file_descriptor) { fd_set readfds; struct timeval ns_timeout = {15, 0 } ; // 15 seconds int select_ret; char c; daemon_assert(FILE_DESCRIPTOR_VALID(file_descriptor)); shutdown(file_descriptor, 1); FD_ZERO(&readfds); FD_SET(file_descriptor, &readfds); select_ret = select(file_descriptor + 1, &readfds, NULL, NULL, &ns_timeout); if (select_ret > 0) { ignore_result = read(file_descriptor, &c, 1); // ignore warning } } /* compare two addresses to see if they contain the same IP address */ //static int ip_equal(const sockaddr_storage_t *a, const sockaddr_storage_t *b) { static int ip_equal(const sockaddr_storage_t * a, const sockaddr_storage_t * b) { daemon_assert(a != NULL); daemon_assert(b != NULL); #ifdef AF_INET6 daemon_assert((cSSFAM(a) == AF_INET) || (cSSFAM(a) == AF_INET6)); daemon_assert((cSSFAM(b) == AF_INET) || (cSSFAM(b) == AF_INET6)); #else daemon_assert((cSSFAM(a) == AF_INET)); daemon_assert((cSSFAM(b) == AF_INET)); #endif if (cSSFAM(a) != cSSFAM(b)) return 0; if (memcmp(&cSINADDR(a), &cSINADDR(b), sizeof(cSINADDR(a))) != 0) return 0; return 1; } owfs-3.1p5/module/owftpd/src/c/owftpd.c0000644000175000001440000000500512756347376015011 00000000000000/* * owftpd -- an ftp server for owfs 1-wire "virtual" files. * No actual file contents are exposed. * see owfs.org * Paul Alfille -- GPLv2 */ #include "owftpd.h" #include int main(int argc, char *argv[]) { int c; int err, signo; struct ftp_listener_s ftp_listener; sigset_t myset; struct re_exec sre = { & ftp_listener, (void (*)(void *)) ftp_listener_stop, }; /* Set up owlib */ LibSetup(program_type_ftpd); Setup_Systemd() ; // systemd? Setup_Launchd() ; // launchd? /* grab our executable name */ ArgCopy( argc, argv ) ; /* check our command-line arguments */ while ((c = getopt_long(argc, argv, OWLIB_OPT, owopts_long, NULL)) != -1) { switch (c) { case 'V': fprintf(stderr, "%s version:\n\t" VERSION "\n", argv[0]); break; } if ( BAD( owopt(c, optarg) ) ) { ow_exit(0); /* rest of message */ } } /* FTP on default port? */ if (Outbound_Control.active == 0) { ARG_Server(NULL); // default or ephemeral port // except systemd } /* non-option args are adapters */ while (optind < argc) { //printf("Adapter(%d): %s\n",optind,argv[optind]); ARG_Generic(argv[optind]); ++optind; } /* become a daemon if not told otherwise */ if ( BAD(EnterBackground()) ) { ow_exit(1); } sigemptyset(&myset); sigaddset(&myset, SIGHUP); sigaddset(&myset, SIGINT); // SIGTERM is used to kill all outprocesses which hang in accept() pthread_sigmask(SIG_BLOCK, &myset, NULL); /* Set up adapters and systemd */ if ( BAD(LibStart(&sre)) ) { ow_exit(1); } set_exit_signal_handlers(exit_handler); set_signal_handlers(NULL); /* create our main listener */ if (!ftp_listener_init(&ftp_listener)) { LEVEL_CONNECT("Problem initializing FTP listener"); ow_exit(1); } /* start our listener */ if (ftp_listener_start(&ftp_listener) == 0) { LEVEL_CONNECT("Problem starting FTP service"); ow_exit(1); } sigemptyset(&myset); sigaddset(&myset, SIGHUP); sigaddset(&myset, SIGINT); sigaddset(&myset, SIGTERM); while (!StateInfo.shutting_down) { Announce_Systemd() ; // If in systemd mode announce we're ready. if ((err = sigwait(&myset, &signo)) == 0) { if (signo == SIGHUP) { LEVEL_DEBUG("owftpd: ignore signo=%d", signo); continue; } LEVEL_DEBUG("owftpd: break signo=%d", signo); break; } else { LEVEL_DEBUG("owftpd: sigwait error %d", err); } } StateInfo.shutting_down = 1; LEVEL_DEBUG("owftpd shutdown initiated"); ftp_listener_stop(&ftp_listener); LEVEL_CONNECT("All connections finished, FTP server exiting"); ow_exit(0); return 0; } owfs-3.1p5/module/owftpd/src/c/telnet_session.c0000644000175000001440000002427712654730021016534 00000000000000/* * part of owftpd By Paul H Alfille * The whole is GPLv2 licenced though the ftp code was more liberally licenced when first used. */ #include "owftpd.h" /* characters to process */ #define SE 240 #define NOP 241 #define DATA_MARK 242 #define BRK 243 #define IP 244 #define AO 245 #define AYT 246 #define EC 247 #define EL 248 #define GA 249 #define SB 250 #define WILL 251 #define WONT 252 #define DO 253 #define DONT 254 #define IAC 255 /* input states */ #define NORMAL 0 #define GOT_IAC 1 #define GOT_WILL 2 #define GOT_WONT 3 #define GOT_DO 4 #define GOT_DONT 5 #define GOT_CR 6 /* prototypes */ static int invariant(const struct telnet_session_s *t); static void process_data(struct telnet_session_s *t, int wait_flag); static void read_incoming_data(struct telnet_session_s *t); static void process_incoming_char(struct telnet_session_s *t, int c); static void add_incoming_char(struct telnet_session_s *t, int c); static int use_incoming_char(struct telnet_session_s *t); static void write_outgoing_data(struct telnet_session_s *t); static void add_outgoing_char(struct telnet_session_s *t, int c); static int max_input_read(struct telnet_session_s *t); /* initialize a telnet session */ void telnet_session_init(struct telnet_session_s *t, FILE_DESCRIPTOR_OR_ERROR in, FILE_DESCRIPTOR_OR_ERROR out) { daemon_assert(t != NULL); daemon_assert(in >= 0); daemon_assert(out >= 0); t->in_fd = in; t->in_errno = 0; t->in_eof = 0; t->in_take = t->in_add = 0; t->in_buflen = 0; t->in_status = NORMAL; t->out_fd = out; t->out_errno = 0; t->out_eof = 0; t->out_take = t->out_add = 0; t->out_buflen = 0; process_data(t, 0); daemon_assert(invariant(t)); } /* print output */ int telnet_session_print(struct telnet_session_s *t, const char *s) { int len; int amt_printed; daemon_assert(invariant(t)); len = strlen(s); if (len == 0) { daemon_assert(invariant(t)); return 1; } amt_printed = 0; do { if ((t->out_errno != 0) || (t->out_eof != 0)) { daemon_assert(invariant(t)); return 0; } while ((amt_printed < len) && (t->out_buflen < BUF_LEN)) { daemon_assert(s[amt_printed] != '\0'); add_outgoing_char(t, s[amt_printed]); amt_printed++; } process_data(t, 1); } while (amt_printed < len); while (t->out_buflen > 0) { if ((t->out_errno != 0) || (t->out_eof != 0)) { daemon_assert(invariant(t)); return 0; } process_data(t, 1); } daemon_assert(invariant(t)); return 1; } /* print a line output */ int telnet_session_println(struct telnet_session_s *t, const char *s) { daemon_assert(invariant(t)); if (!telnet_session_print(t, s)) { daemon_assert(invariant(t)); return 0; } if (!telnet_session_print(t, "\015\012")) { daemon_assert(invariant(t)); return 0; } daemon_assert(invariant(t)); return 1; } /* read a line */ int telnet_session_readln(struct telnet_session_s *t, char *buf, int buflen) { int amt_read; daemon_assert(invariant(t)); amt_read = 0; for (;;) { if ((t->in_errno != 0) || (t->in_eof != 0)) { daemon_assert(invariant(t)); return 0; } while (t->in_buflen > 0) { if (amt_read == buflen - 1) { buf[amt_read] = '\0'; daemon_assert(invariant(t)); return 1; } daemon_assert(amt_read >= 0); daemon_assert(amt_read < buflen); buf[amt_read] = use_incoming_char(t); if (buf[amt_read] == '\012') { daemon_assert(amt_read + 1 >= 0); daemon_assert(amt_read + 1 < buflen); buf[amt_read + 1] = '\0'; daemon_assert(invariant(t)); return 1; } amt_read++; } process_data(t, 1); } } void telnet_session_destroy(struct telnet_session_s *t) { daemon_assert(invariant(t)); Test_and_Close( & t->in_fd); Test_and_Close( & t->out_fd); } /* receive any incoming data, send any pending data */ static void process_data(struct telnet_session_s *t, int wait_flag) { fd_set readfds; fd_set writefds; fd_set exceptfds; struct timeval tv_zero; struct timeval *tv; /* set up our select() variables */ FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); if (wait_flag) { tv = NULL; } else { tv_zero.tv_sec = 0; tv_zero.tv_usec = 0; tv = &tv_zero; } /* only check for input if we can accept input */ if ((t->in_errno == 0) && (t->in_eof == 0) && (max_input_read(t) > 0)) { FD_SET(t->in_fd, &readfds); FD_SET(t->in_fd, &exceptfds); } /* only check for output if we have pending output */ if ((t->out_errno == 0) && (t->out_eof == 0) && (t->out_buflen > 0)) { FD_SET(t->out_fd, &writefds); FD_SET(t->out_fd, &exceptfds); } /* see if there's anything to do */ if (select(FD_SETSIZE, &readfds, &writefds, &exceptfds, tv) > 0) { if (FD_ISSET(t->in_fd, &exceptfds)) { t->in_eof = 1; } else if (FD_ISSET(t->in_fd, &readfds)) { read_incoming_data(t); } if (FD_ISSET(t->out_fd, &exceptfds)) { t->out_eof = 1; } else if (FD_ISSET(t->out_fd, &writefds)) { write_outgoing_data(t); } } } static void read_incoming_data(struct telnet_session_s *t) { ssize_t read_ret; char buf[BUF_LEN]; ssize_t i; /* read as much data as we have buffer space for */ daemon_assert(max_input_read(t) <= BUF_LEN); read_ret = read(t->in_fd, buf, max_input_read(t)); /* handle three possible read results */ if (read_ret == -1) { t->in_errno = errno; } else if (read_ret == 0) { t->in_eof = 1; } else { for (i = 0; i < read_ret; i++) { process_incoming_char(t, (unsigned char) buf[i]); } } } /* process a single character */ static void process_incoming_char(struct telnet_session_s *t, int c) { switch (t->in_status) { case GOT_IAC: switch (c) { case WILL: t->in_status = GOT_WILL; break; case WONT: t->in_status = GOT_WONT; break; case DO: t->in_status = GOT_DO; break; case DONT: t->in_status = GOT_DONT; break; case IAC: add_incoming_char(t, IAC); t->in_status = NORMAL; break; default: t->in_status = NORMAL; } break; case GOT_WILL: add_outgoing_char(t, IAC); add_outgoing_char(t, DONT); add_outgoing_char(t, c); t->in_status = NORMAL; break; case GOT_WONT: t->in_status = NORMAL; break; case GOT_DO: add_outgoing_char(t, IAC); add_outgoing_char(t, WONT); add_outgoing_char(t, c); t->in_status = NORMAL; break; case GOT_DONT: t->in_status = NORMAL; break; case GOT_CR: add_incoming_char(t, '\012'); if (c != '\012') { add_incoming_char(t, c); } t->in_status = NORMAL; break; case NORMAL: if (c == IAC) { t->in_status = GOT_IAC; } else if (c == '\015') { t->in_status = GOT_CR; } else { add_incoming_char(t, c); } } } /* add a single character, wrapping buffer if necessary (should never occur) */ static void add_incoming_char(struct telnet_session_s *t, int c) { daemon_assert(t->in_add >= 0); daemon_assert(t->in_add < BUF_LEN); t->in_buf[t->in_add] = c; t->in_add++; if (t->in_add == BUF_LEN) { t->in_add = 0; } if (t->in_buflen == BUF_LEN) { t->in_take++; if (t->in_take == BUF_LEN) { t->in_take = 0; } } else { t->in_buflen++; } } /* remove a single character */ static int use_incoming_char(struct telnet_session_s *t) { int c; daemon_assert(t->in_take >= 0); daemon_assert(t->in_take < BUF_LEN); c = t->in_buf[t->in_take]; t->in_take++; if (t->in_take == BUF_LEN) { t->in_take = 0; } t->in_buflen--; return c; } /* add a single character, hopefully will never happen :) */ static void add_outgoing_char(struct telnet_session_s *t, int c) { daemon_assert(t->out_add >= 0); daemon_assert(t->out_add < BUF_LEN); t->out_buf[t->out_add] = c; t->out_add++; if (t->out_add == BUF_LEN) { t->out_add = 0; } if (t->out_buflen == BUF_LEN) { t->out_take++; if (t->out_take == BUF_LEN) { t->out_take = 0; } } else { t->out_buflen++; } } static void write_outgoing_data(struct telnet_session_s *t) { ssize_t write_ret; if (t->out_take < t->out_add) { /* handle a buffer that looks like this: */ /* |-- empty --|-- data --|-- empty --| */ daemon_assert(t->out_take >= 0); daemon_assert(t->out_take < BUF_LEN); daemon_assert(t->out_buflen > 0); daemon_assert(t->out_buflen + t->out_take <= BUF_LEN); write_ret = write(t->out_fd, t->out_buf + t->out_take, t->out_buflen); } else { /* handle a buffer that looks like this: */ /* |-- data --|-- empty --|-- data --| */ daemon_assert(t->out_take >= 0); daemon_assert(t->out_take < BUF_LEN); daemon_assert((BUF_LEN - t->out_take) > 0); write_ret = write(t->out_fd, t->out_buf + t->out_take, BUF_LEN - t->out_take); } /* handle three possible write results */ if (write_ret == -1) { t->out_errno = errno; } else if (write_ret == 0) { t->out_eof = 1; } else { t->out_buflen -= write_ret; t->out_take += write_ret; if (t->out_take >= BUF_LEN) { t->out_take -= BUF_LEN; } } } /* return the amount of a read */ static int max_input_read(struct telnet_session_s *t) { int max_in; int max_out; daemon_assert(invariant(t)); /* figure out how much space is available in the input buffer */ if (t->in_buflen < BUF_LEN) { max_in = BUF_LEN - t->in_buflen; } else { max_in = 0; } /* worry about space in the output buffer (for DONT/WONT replies) */ if (t->out_buflen < BUF_LEN) { max_out = BUF_LEN - t->out_buflen; } else { max_out = 0; } daemon_assert(invariant(t)); /* return the minimum of the two values */ return (max_in < max_out) ? max_in : max_out; } #ifndef NDEBUG static int invariant(const struct telnet_session_s *t) { if (t == NULL) { return 0; } if (FILE_DESCRIPTOR_NOT_VALID(t->in_fd)) { return 0; } if ((t->in_take < 0) || (t->in_take >= BUF_LEN)) { return 0; } if ((t->in_add < 0) || (t->in_add >= BUF_LEN)) { return 0; } if ((t->in_buflen < 0) || (t->in_buflen > BUF_LEN)) { return 0; } switch (t->in_status) { case NORMAL: break; case GOT_IAC: break; case GOT_WILL: break; case GOT_WONT: break; case GOT_DO: break; case GOT_DONT: break; case GOT_CR: break; default: return 0; } if (FILE_DESCRIPTOR_NOT_VALID(t->out_fd)) { return 0; } if ((t->out_take < 0) || (t->out_take >= BUF_LEN)) { return 0; } if ((t->out_add < 0) || (t->out_add >= BUF_LEN)) { return 0; } if ((t->out_buflen < 0) || (t->out_buflen > BUF_LEN)) { return 0; } return 1; } #endif /* NDEBUG */ owfs-3.1p5/module/owftpd/src/c/watchdog.c0000644000175000001440000001376012654730021015271 00000000000000/* * $Id$ */ #include "owftpd.h" static int invariant(struct watchdog_s *w); static void insert(struct watchdog_s *w, struct watched_s *watched); static void delete(struct watchdog_s *w, struct watched_s *watched); static void *watcher(void *void_w); int watchdog_init(struct watchdog_s *w, int inactivity_timeout) { pthread_t thread_id; int error_code; daemon_assert(w != NULL); daemon_assert(inactivity_timeout > 0); _MUTEX_INIT(w->mutex); w->inactivity_timeout = inactivity_timeout; w->oldest = NULL; w->newest = NULL; error_code = pthread_create(&thread_id, DEFAULT_THREAD_ATTR, watcher, w); if (error_code != 0) { errno = error_code; ERROR_CONNECT("Watchdog thread create problem\n"); return 0; } pthread_detach(thread_id); daemon_assert(invariant(w)); return 1; } void watchdog_add_watched(struct watchdog_s *w, struct watched_s *watched) { daemon_assert(invariant(w)); _MUTEX_LOCK(w->mutex); watched->watched_thread = pthread_self(); watched->watchdog = w; insert(w, watched); _MUTEX_UNLOCK(w->mutex); daemon_assert(invariant(w)); } void watchdog_defer_watched(struct watched_s *watched) { struct watchdog_s *w; daemon_assert(invariant(watched->watchdog)); w = watched->watchdog; _MUTEX_LOCK(w->mutex); delete(w, watched); insert(w, watched); _MUTEX_UNLOCK(w->mutex); daemon_assert(invariant(w)); } void watchdog_remove_watched(struct watched_s *watched) { struct watchdog_s *w; daemon_assert(invariant(watched->watchdog)); w = watched->watchdog; _MUTEX_LOCK(w->mutex); delete(w, watched); _MUTEX_UNLOCK(w->mutex); daemon_assert(invariant(w)); } static void insert(struct watchdog_s *w, struct watched_s *watched) { /********************************************************************* Set alarm to current time + timeout duration. Note that this is not strictly legal, since time_t is an abstract data type. *********************************************************************/ watched->alarm_time = NOW_TIME + w->inactivity_timeout; /********************************************************************* If the system clock got set backwards, we really should search for the correct location, instead of just inserting at the end. However, this happens very rarely (ntp and other synchronization protocols speed up or slow down the clock to adjust the time), so we'll just set our alarm to the time of the newest alarm - giving any watched processes added some extra time. *********************************************************************/ if (w->newest != NULL) { if (w->newest->alarm_time > watched->alarm_time) { watched->alarm_time = w->newest->alarm_time; } } /* set our pointers */ watched->older = w->newest; watched->newer = NULL; /* add to list */ if (w->oldest == NULL) { w->oldest = watched; } else { w->newest->newer = watched; } w->newest = watched; watched->in_list = 1; } static void delete(struct watchdog_s *w, struct watched_s *watched) { if (!watched->in_list) { return; } if (watched->newer == NULL) { daemon_assert(w->newest == watched); w->newest = w->newest->older; if (w->newest != NULL) { w->newest->newer = NULL; } } else { daemon_assert(w->newest != watched); watched->newer->older = watched->older; } if (watched->older == NULL) { daemon_assert(w->oldest == watched); w->oldest = w->oldest->newer; if (w->oldest != NULL) { w->oldest->older = NULL; } } else { daemon_assert(w->oldest != watched); watched->older->newer = watched->newer; } watched->older = NULL; watched->newer = NULL; watched->in_list = 0; } static void *watcher(void *void_w) { struct watchdog_s *w; struct timeval tvwatch = { 1, 0 } ; // 1 second time_t now; struct watched_s *watched; w = (struct watchdog_s *) void_w; for (;;) { struct timeval tv ; timercpy( &tv, &tvwatch ) ; select(0, NULL, NULL, NULL, &tv); time(&now); _MUTEX_LOCK(w->mutex); while ((w->oldest != NULL) && (difftime(now, w->oldest->alarm_time) > 0)) { watched = w->oldest; /******************************************************* This might seem like a memory leak, but in oftpd the struct watched_s structure is held in the thread itself, so canceling the thread effectively frees the memory. I'm not sure whether this is elegant or a hack. :) *******************************************************/ delete(w, watched); pthread_cancel(watched->watched_thread); } _MUTEX_UNLOCK(w->mutex); } return VOID_RETURN ; } #ifndef NDEBUG static int invariant(struct watchdog_s *w) { int ret_val; struct watched_s *ptr; int old_to_new_count; int new_to_old_count; if (w == NULL) { return 0; } ret_val = 0; _MUTEX_LOCK(w->mutex); if (w->inactivity_timeout <= 0) { goto exit_invariant; } /* either oldest and newest are both NULL, or neither is */ if (w->oldest != NULL) { if (w->newest == NULL) { goto exit_invariant; } /* check list from oldest to newest */ old_to_new_count = 0; ptr = w->oldest; while (ptr != NULL) { old_to_new_count++; if (ptr->older != NULL) { if (ptr->alarm_time < ptr->older->alarm_time) { goto exit_invariant; } } if (ptr->newer != NULL) { if (ptr->alarm_time > ptr->newer->alarm_time) { goto exit_invariant; } } ptr = ptr->newer; } /* check list from newest to oldest */ new_to_old_count = 0; ptr = w->newest; while (ptr != NULL) { new_to_old_count++; if (ptr->older != NULL) { if (ptr->alarm_time < ptr->older->alarm_time) { goto exit_invariant; } } if (ptr->newer != NULL) { if (ptr->alarm_time > ptr->newer->alarm_time) { goto exit_invariant; } } ptr = ptr->older; } /* verify forward and backward lists at least have the same count */ if (old_to_new_count != new_to_old_count) { goto exit_invariant; } } else { if (w->newest != NULL) { goto exit_invariant; } } /* at this point, we're probably okay */ ret_val = 1; exit_invariant: _MUTEX_UNLOCK(w->mutex); return ret_val; } #endif /* NDEBUG */ owfs-3.1p5/module/owftpd/src/c/daemon_assert.c0000644000175000001440000000044512654730021016311 00000000000000#include "owftpd.h" #ifndef NDEBUG void daemon_assert_fail(const char *assertion, const char *file, int line, const char *function) { syslog(LOG_CRIT, "%s:%d: %s: %s", file, line, function, assertion); fprintf(stderr, "%s:%d: %s: %s\n", file, line, function, assertion); exit(1); } #endif owfs-3.1p5/module/owftpd/src/include/0000755000175000001440000000000013022537105014575 500000000000000owfs-3.1p5/module/owftpd/src/include/Makefile.am0000644000175000001440000000003312654730021016547 00000000000000noinst_HEADERS = owftpd.h owfs-3.1p5/module/owftpd/src/include/owftpd.h0000644000175000001440000002321312711737666016214 00000000000000/* * part of owftpd By Paul H Alfille * The whole is GPLv2 licenced though the ftp code was more liberally licenced when first used. */ #ifndef OWFTPD_H #define OWFTPD_H #include #include "owfs_config.h" #include "ow.h" #include "ow_connection.h" #ifdef HAVE_LIMITS_H #include #endif #include #include #include /* _x_ must be a pointer to a sockaddr structure */ #define SAFAM(_x_) (((struct sockaddr *)(_x_))->sa_family) #define cSAFAM(_x_) (((const struct sockaddr *)(_x_))->sa_family) #define SIN4ADDR(_x_) (((struct sockaddr_in *)(_x_))->sin_addr) #define SIN4PORT(_x_) (((struct sockaddr_in *)(_x_))->sin_port) #define SIN6ADDR(_x_) (((struct sockaddr_in6 *)(_x_))->sin6_addr) #define SIN6PORT(_x_) (((struct sockaddr_in6 *)(_x_))->sin6_port) #define cSIN4ADDR(_x_) (((const struct sockaddr_in *)(_x_))->sin_addr) #define cSIN4PORT(_x_) (((const struct sockaddr_in *)(_x_))->sin_port) #define cSIN6ADDR(_x_) (((const struct sockaddr_in6 *)(_x_))->sin6_addr) #define cSIN6PORT(_x_) (((const struct sockaddr_in6 *)(_x_))->sin6_port) #ifdef INET6 #define SINADDR(_x_) ((SAFAM(_x_)==AF_INET6) ? SIN6ADDR(_x_) : SIN4ADDR(_x_)) #define SINPORT(_x_) ((SAFAM(_x_)==AF_INET6) ? SIN6PORT(_x_) : SIN4PORT(_x_)) #define cSINADDR(_x_) ((cSAFAM(_x_)==AF_INET6) ? cSIN6ADDR(_x_) : cSIN4ADDR(_x_)) #define cSINPORT(_x_) ((cSAFAM(_x_)==AF_INET6) ? cSIN6PORT(_x_) : cSIN4PORT(_x_)) #else #define SINADDR(_x_) SIN4ADDR(_x_) #define SINPORT(_x_) SIN4PORT(_x_) #define cSINADDR(_x_) cSIN4ADDR(_x_) #define cSINPORT(_x_) cSIN4PORT(_x_) #endif #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif #ifndef INET6_ADDRSTRLEN #define INET6_ADDRSTRLEN 46 #endif #ifdef INET6 #define IP6_ADDRSTRLEN INET6_ADDRSTRLEN #define IP4_ADDRSTRLEN INET_ADDRSTRLEN #define IP_ADDRSTRLEN INET6_ADDRSTRLEN #else #define IP_ADDRSTRLEN INET_ADDRSTRLEN #endif #if defined(INET6) && defined(HAVE_STRUCT_SOCKADDR_STORAGE) typedef struct sockaddr_storage sockaddr_storage_t; #define SSFAM(_x_) (((sockaddr_storage_t *)(_x_))->ss_family) #define cSSFAM(_x_) (((const sockaddr_storage_t *)(_x_))->ss_family) #else typedef struct sockaddr_in sockaddr_storage_t; #define SSFAM(_x_) (((sockaddr_storage_t *)(_x_))->sin_family) #define cSSFAM(_x_) (((const sockaddr_storage_t *)(_x_))->sin_family) #endif #ifdef HAVE_BROKEN_SS_FAMILY #undef SSFAM #undef cSSFAM #define SSFAM(_x_) (((sockaddr_storage_t *)(_x_))->__ss_family) #define cSSFAM(_x_) (((const sockaddr_storage_t *)(_x_))->__ss_family) #endif /* address to listen on (use NULL to listen on all addresses) */ #define FTP_ADDRESS NULL /* default port FTP server listens on (use 0 to listen on default port) */ #define FTP_PORT 0 /* ranges possible for command-line specified port numbers */ #define MIN_PORT 0 #define MAX_PORT 65535 /* default port FTP server listens on (use 0 to listen on default port) */ #define DEFAULT_PORTNAME "0.0.0.0:21" /* bounds on command-line specified number of clients */ #define MIN_NUM_CLIENTS 1 #define MAX_NUM_CLIENTS 300 enum parse_status_e { parse_status_init, // need to test for initial / parse_status_init2, // need to test for virginity (no wildness) parse_status_back, // .. still allowed parse_status_next, // figure out this level parse_status_last, // last level parse_status_tame, // no wildcard at all }; enum file_list_e { file_list_list, file_list_nlst, }; struct file_parse_s { ASCII buffer[PATH_MAX + 1]; ASCII *rest; enum parse_status_e pse; // state machine enum file_list_e fle; // long or short listing flag FILE_DESCRIPTOR_OR_ERROR out; // file descriptor to send result int ret; // return status int start; }; struct cd_parse_s { ASCII buffer[PATH_MAX + 1]; // working copy of current directory ASCII *rest; enum parse_status_e pse; // state machine int ret; // return status int solutions; // is the solution unique? ASCII *dir; }; void FileLexParse(struct file_parse_s *fps); void FileLexCD(struct cd_parse_s *cps); /* each watched thread gets one of these structures */ struct watched_s { /* thread to monitor */ pthread_t watched_thread; /* flag whether in a watchdog list */ int in_list; /* time when to cancel thread if no activity */ time_t alarm_time; /* for location in doubly-linked list */ struct watched_s *older; struct watched_s *newer; /* watchdog that this watched_s is in */ void *watchdog; }; /* the watchdog keeps track of all information */ struct watchdog_s { pthread_mutex_t mutex; int inactivity_timeout; /* the head and tail of our list */ struct watched_s *oldest; struct watched_s *newest; }; int watchdog_init(struct watchdog_s *w, int inactivity_timeout); void watchdog_add_watched(struct watchdog_s *w, struct watched_s *watched); void watchdog_defer_watched(struct watched_s *watched); void watchdog_remove_watched(struct watched_s *watched); /* size of buffer */ #define BUF_LEN 2048 /* information on a telnet session */ struct telnet_session_s { FILE_DESCRIPTOR_OR_ERROR in_fd; int in_errno; int in_eof; int in_take; int in_add; char in_buf[BUF_LEN]; int in_buflen; int in_status; FILE_DESCRIPTOR_OR_ERROR out_fd; int out_errno; int out_eof; int out_take; int out_add; char out_buf[BUF_LEN]; int out_buflen; }; #ifdef NDEBUG #define daemon_assert(expr) #else /* NDEBUG */ void daemon_assert_fail(const char *assertion, const char *file, int line, const char *function); #ifndef __STRING #define __STRING(x) #x #endif #define daemon_assert(expr) \ ((expr) ? 0 : \ (daemon_assert_fail(__STRING(expr), __FILE__, __LINE__, __func__)));\ assert(expr) // last assert is to silence static analyzers #endif /* NDEBUG */ /* data representation types supported */ #define TYPE_ASCII 0 #define TYPE_IMAGE 1 /* file structure types supported */ #define STRU_FILE 0 #define STRU_RECORD 1 /* data path chosen */ #define DATA_PORT 0 #define DATA_PASSIVE 1 /* space required for text representation of address and port, e.g. "192.168.0.1 port 1024" or "2001:3333:DEAD:BEEF:0666:0013:0069:0042 port 65535" */ #define ADDRPORT_STRLEN 58 /* structure encapsulating an FTP session's information */ struct ftp_session_s { /* flag whether session is active */ int session_active; /* incremented for each command */ unsigned long command_number; /* options about transfer set by user */ int data_type; int file_structure; /* offset to begin sending file from */ off_t file_offset; unsigned long file_offset_command_number; /* flag set if client requests ESPV ALL - this prevents subsequent use of PORT, PASV, LPRT, LPSV, or EPRT */ int epsv_all_set; /* address of client */ sockaddr_storage_t client_addr; char client_addr_str[ADDRPORT_STRLEN]; /* address of server (including IPv4 version) */ sockaddr_storage_t server_addr; struct sockaddr_in server_ipv4_addr; /* telnet session to encapsulate control channel logic */ struct telnet_session_s *telnet_session; /* current working directory of this connection */ char dir[PATH_MAX + 1]; /* data channel information, including type, and client address or server port depending on type */ int data_channel; sockaddr_storage_t data_port; FILE_DESCRIPTOR_OR_ERROR server_fd; /* watchdog to handle timeout */ struct watched_s *watched; }; int ftp_session_init(struct ftp_session_s *f, const sockaddr_storage_t * client_addr, const sockaddr_storage_t * server_addr, struct telnet_session_s *t, const char *dir); void ftp_session_drop(struct ftp_session_s *f, const char *reason); void ftp_session_run(struct ftp_session_s *f, struct watched_s *watched); void ftp_session_destroy(struct ftp_session_s *f); struct ftp_listener_s { /* file descriptor incoming connections arrive on */ FILE_DESCRIPTOR_OR_ERROR file_descriptor; /* maximum number of connections */ int max_connections; /* current number of connections */ int num_connections; /* timeout (in seconds) for connections */ int inactivity_timeout; /* watchdog monitoring this listener's connections */ struct watchdog_s watchdog; /* mutext to lock changes to this structure */ pthread_mutex_t mutex; /* starting directory */ char dir[3]; // only root directory for OWFS /* boolean defining whether listener is running or not */ int listener_running; /* thread identifier for listener */ pthread_t listener_thread; /* end of pipe to wake up listening thread with */ /* end of pipe listening thread waits on */ FILE_DESCRIPTOR_OR_ERROR shutdown_request_fd[2]; /* condition to signal thread requesting shutdown */ pthread_cond_t shutdown_cond; }; int ftp_listener_init(struct ftp_listener_s *f); int ftp_listener_start(struct ftp_listener_s *f); void ftp_listener_stop(struct ftp_listener_s *f); /* special macro for handling EPSV ALL requests */ #define EPSV_ALL (-1) /* maximum possible number of arguments */ #define MAX_ARG 2 /* maximum string length */ #define MAX_STRING_LEN PATH_MAX struct ftp_command_s { char command[5]; int num_arg; union { char string[MAX_STRING_LEN + 1]; sockaddr_storage_t host_port; int num; off_t offset; } arg[MAX_ARG]; }; /* methods */ int ftp_command_parse(const char *input, struct ftp_command_s *cmd); /* functions */ void telnet_session_init(struct telnet_session_s *t, FILE_DESCRIPTOR_OR_ERROR in, FILE_DESCRIPTOR_OR_ERROR out); int telnet_session_print(struct telnet_session_s *t, const char *s); int telnet_session_println(struct telnet_session_s *t, const char *s); int telnet_session_readln(struct telnet_session_s *t, char *buf, int buflen); void telnet_session_destroy(struct telnet_session_s *t); #endif /* OWFTPD_H */ owfs-3.1p5/module/owftpd/src/include/Makefile.in0000644000175000001440000004461113022537051016570 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owftpd/src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 HEADERS = $(noinst_HEADERS) 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)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = owftpd.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) --foreign module/owftpd/src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owftpd/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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 $(HEADERS) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am 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-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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool 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-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags 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: owfs-3.1p5/module/owtap/0000755000175000001440000000000013022537105012212 500000000000000owfs-3.1p5/module/owtap/Makefile.am0000644000175000001440000000017212654730021014170 00000000000000EXTRA_DIST = owtap.tcl install: @INSTALL@ -d $(DESTDIR)$(bindir) @INSTALL@ -m 755 owtap.tcl $(DESTDIR)$(bindir)/owtap owfs-3.1p5/module/owtap/Makefile.in0000644000175000001440000004055313022537053014210 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owtap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = owtap.tcl 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) --foreign module/owtap/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owtap/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: 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-libtool 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 mostlyclean-libtool 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 clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile install: @INSTALL@ -d $(DESTDIR)$(bindir) @INSTALL@ -m 755 owtap.tcl $(DESTDIR)$(bindir)/owtap # 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: owfs-3.1p5/module/owtap/owtap.tcl0000644000175000001440000013775612654730021014015 00000000000000#!/bin/sh # the next line restarts using wish \ if [ -z `which wish` ] ; then exec tclsh "$0" -- "$@" ; else exec wish "$0" -- "$@" ; fi # $Id$ package require Tk # Global: IPAddress() loose tap server # -- port number of this program (tap) and real owserver (server). loose is stray garbage set SocketVars {string version type payload size sg offset tokenlength totallength paylength typetext ping state sock versiontext flagtext persist return id } set MessageList {ERROR NOP READ WRITE DIR SIZE PRESENCE DIRALL GET DIRALLSLASH GETSLASH} set MessageListPlus $MessageList lappend MessageListPlus PING BadHeader Unknown Total # see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html set HttpList [list "GET " POST HEAD CONN "PUT " DELE TRAC] set stats(clientlist) {} set setup_flags(detail_list) {} # Global: setup_flags => For object-oriented initialization # Global: serve => information on current transaction # serve($sock.string) -- message to this point # serve($sock. version size payload sg offset type tokenlength ) -- message parsed parts # serve($sock.version size # serve(sockets) -- list of active sockets for timeout # Global: stats => statistical counts and flags for stats windows # Global: circ_buffer => data for the last n transactions displayed in the listboxes #Main procedure. We actually start it at the end, to allow Proc-s to be defined first. proc Main { argv } { ArgumentProcess CircBufferSetup 50 DisplaySetup StatsSetup SetupTap } # Command line processing # looks at command line arguments # two options "p" and "s" for (this) tap's _p_ort, and the target ow_s_erver port # Can handle command lines like # -p 3000 -s 3001 # -p3000 -s 3001 # etc proc ArgumentProcess { } { global IPAddress set mode "loose" # "Clear" ports # INADDR_ANY # tk_messageBox -message "$::argv" -type ok set IPAddress(tap.ip) "0.0.0.0" set IPAddress(tap.port) "0" set IPAddress(server.ip) "0.0.0.0" set IPAddress(server.port) "4304" foreach a $::argv { if { [regexp -- {^-p(.*)$} $a whole address] } { set mode "tap" } elseif { [regexp -- {^-s(.*)$} $a whole address] } { set mode "server" } else { set address $a } IPandPort $mode $address } MainTitle $IPAddress(tap.ip):$IPAddress(tap.port) $IPAddress(server.ip):$IPAddress(server.port) } proc IPandPort { mode argument_string } { global IPAddress if { [regexp -- {^(.*?):(.*)$} $argument_string wholestring firstpart secondpart] } { if { $firstpart != "" } { set IPAddress($mode.ip) $firstpart } if { $secondpart != "" } { set IPAddress($mode.port) $secondpart } } else { if { $argument_string != "" } { set IPAddress($mode.port) $argument_string } } } # Accept from client (our "server" portion) proc SetupTap { } { global IPAddress StatusMessage "Attempting to open surrogate server on $IPAddress(tap.ip):$IPAddress(tap.port)" if {[catch {socket -server TapAccept -myaddr $IPAddress(tap.ip) $IPAddress(tap.port)} result] } { ErrorMessage $result } StatusMessage "Success. Tap server address=[PrettySock $result]" MainTitle [PrettySock $result] $IPAddress(server.ip):$IPAddress(server.port) } #Main loop. Called whenever the server (listen) port accepts a connection. proc TapAccept { sock addr port } { global serve global stats # Start the State machine set serve($sock.state) "Open client" while {1} { #puts $serve($sock.state) switch $serve($sock.state) { "Open client" { StatusMessage "Reading client request from $addr port $port" 0 set persist 0 fconfigure $sock -buffering full -translation binary -encoding binary -blocking 0 set serve($sock.state) "Persistent loop" } "Persistent loop" { TapSetup $sock set serve($sock.sock) $sock set current [CircBufferAllocate] set serve($sock.state) "Read client" } "Read client" { # wait a long time (3hr) for very first packet ResetSockTimer $sock 10000000 fileevent $sock readable [list TapProcess $sock] # ShowMessage $sock vwait serve($sock.state) } "Process client packet" { fileevent $sock readable {} ClearSockTimer $sock StatusMessage "Success reading client request" 0 set message_type $serve($sock.typetext) CircBufferEntryRequest $current "$addr:$port $message_type $serve($sock.payload) bytes" $serve($sock.string) AddClient $addr:$port #stats RequestStatsIncr $sock 0 # now owserver if {$persist>0} { set serve($sock.state) "Send to server" } else { set serve($sock.state) "Open server" } } "Client early end" { StatusMessage "Client dropped connection" CircBufferEntryRequest $current "Client done" $serve($sock.string) CircBufferEntryResponse $current "" RequestStatsIncr $sock 1 set serve($sock.state) "Done with client" } "Web client" { StatusMessage "Error: owtap is not a web server" CircBufferEntryRequest $current "Not a web server" CircBufferEntryResponse $current "" RequestStatsIncr $sock 1 WebResponse $sock set serve($sock.state) "Done with client" } "Open server" { global IPAddress StatusMessage "Attempting to open connection to OWSERVER" 0 if {[catch {socket $IPAddress(server.ip) $IPAddress(server.port)} relay] } { set serve($sock.state) "Unopened server" } else { set serve($sock.state) "Send to server" } } "Unopened server" { StatusMessage "OWSERVER error: $relay at $IPAddress(server.ip):$IPAddress(server.port)" set serve($relay.string) {} CircBufferEntryResponse $current "owserver not responding" set serve($sock.state) "Done with client" } "Send to server" { StatusMessage "Sending client request to OWSERVER" 0 fconfigure $relay -translation binary -buffering full -encoding binary -blocking 0 set serve($relay.sock) $sock puts -nonewline $relay $serve($sock.string) flush $relay set serve($sock.state) "Read from server" } "Read from server" { StatusMessage "Reading OWSERVER response" 0 TapSetup $relay ResetSockTimer $relay fileevent $relay readable [list RelayProcess $relay] vwait serve($sock.state) } "Server early end" { StatusMessage "FAILURE reading OWSERVER response" 0 ResponseStatsIncr $relay 1 CircBufferEntryResponse $current "network read error" $serve($relay.string) set serve($sock.state) "Done with server" } "Process server packet" { StatusMessage "Success reading OWSERVER response" 0 ResponseAdd $relay fileevent $relay readable {} CircBufferEntryResponse $current $serve($relay.return) $serve($relay.string) #stats ResponseStatsIncr $relay 0 set serve($sock.state) "Send to client" } "Send to client" { ClearSockTimer $relay StatusMessage "Sending OWSERVER response to client" 0 puts -nonewline $sock $serve($relay.string) flush $sock # filter out the multi-response types and continue listening if { $serve($relay.ping) == 1 } { set serve($sock.state) "Ping received" } elseif { ( $message_type=="DIR" ) && ($serve($relay.paylength)>0)} { set serve($sock.state) "Dir element received" } else { set serve($sock.state) "Persistent test" } } "Ping received" { set serve($sock.state) "Read from server" } "Dir element received" { set serve($sock.state) "Read from server" } "Persistent test" { if { $serve($relay.persist)==1 } { StatPersistCounter $persist incr persist ClearTap $sock ClearTap $relay set serve($sock.state) "Persistent loop" } else { set serve($sock.state) "Done with server" } } "Server timeout" { CircBufferEntryResponse $current "owserver read timeout" set serve($sock.state) "Done with server" } "Done with server" { CloseSock $relay set serve($sock.state) "Done with client" } "Client timeout" { CircBufferEntryRequest $current "client read timeout" CircBufferEntryResponse $current "" set serve($sock.state) "Done with client" } "Done with client" { CloseSock $sock set serve($sock.state) "Done with all" } "Done with all" { StatusMessage "Ready" 0 return } default { StatusMessage "Internal error -- bad state: $serve($sock.state)" 1 return } } } } # initialize statistics proc StatsSetup { } { global stats global MessageListPlus foreach x $MessageListPlus { set stats($x.tries) 0 set stats($x.errors) 0 set stats($x.rate) 0 set stats($x.request_bytes) 0 set stats($x.response_bytes) 0 } foreach x { request_yes request_no grant refuse -1 0 denominator max request_rate grant_rate } { set stats(persistence_length.$x) 0 } set stats(persistence_length.15plus) 0 } # increment stats for request proc RequestStatsIncr { sock is_error} { global stats global serve set message_type $serve($sock.typetext) set length [string length $serve($sock.string)] incr stats($message_type.tries) incr stats($message_type.errors) $is_error set stats($message_type.rate) [expr {100 * $stats($message_type.errors) / $stats($message_type.tries)} ] incr stats($message_type.request_bytes) $length incr stats(Total.tries) incr stats(Total.errors) $is_error set stats(Total.rate) [expr {100 * $stats(Total.errors) / $stats(Total.tries)} ] incr stats(Total.request_bytes) $length # persistence stats if { [info exist serve($sock.persist)] } { if { $serve($sock.persist) == 0 } { incr stats(persistence_length.request_no) } else { incr stats(persistence_length.request_yes) incr stats(persistence_length.refuse) set stats(persistence_length.grant_rate) [expr {100 * $stats(persistence_length.grant) / $stats(persistence_length.request_yes)}] } set stats(persistence_length.request_rate) [expr { 100 * $stats(persistence_length.request_yes) / $stats(Total.tries) }] } } # increment stats for request proc ResponseStatsIncr { sock is_error} { global stats global serve set message_type $serve($serve($sock.sock).typetext) set length [string length $serve($sock.string)] incr stats($message_type.errors) $is_error set stats($message_type.rate) [expr {100 * $stats($message_type.errors) / $stats($message_type.tries)} ] incr stats($message_type.response_bytes) $length incr stats(Total.errors) $is_error set stats(Total.rate) [expr {100 * $stats(Total.errors) / $stats(Total.tries)} ] incr stats(Total.response_bytes) $length } # Counter of Persistence lengths proc StatPersistCounter { persist } { global stats # max persistence length if { $persist > $stats(persistence_length.max) } { set stats(persistence_length.max) $persist set stats(persistence_length.$persist) 0 } # increment this bin (and decrement prior) if { $persist==0 } { incr stats(persistence_length.denominator) } set old_persist [expr {$persist-1}] incr stats(persistence_length.$old_persist) -1 if { $persist == 16 } { incr stats(persistence_length.15plus) } incr stats(persistence_length.$persist) incr stats(persistence_length.grant) incr stats(persistence_length.refuse) -1 set stats(persistence_length.grant_rate) [expr {100 * $stats(persistence_length.grant) / $stats(persistence_length.request_yes)}] set length_sum 0 for {set x 0} {$x <= $stats(persistence_length.max)} {incr x} { incr length_sum [expr {$stats(persistence_length.$x) * $x}] } set stats(persistence_length.mean) [expr {($length_sum)/$stats(persistence_length.denominator)}] } # Initialize array for client request proc TapSetup { sock } { global serve set serve($sock.string) "" set serve($sock.totallength) 0 } # Clear out client request array after a connection (frees memory) proc ClearTap { sock } { global serve global SocketVars foreach x $SocketVars { if { [info exist serve($sock.$x)] } { unset serve($sock.$x) } } if { [info exist serve($sock.num] } { for {set i $serve($sock.num)} {$i >= 0} {incr i -1} { unset serve($sock.$i) } unset serve($sock.num) } } proc ResponseAdd { sock } { global serve if { [info exist serve($sock.num)] } { incr serve($sock.num) } else { set serve($sock.num) 0 } set serve($sock.$serve($sock.num)) $serve($sock.string) } # close client request socket proc SockTimeout { sock } { global serve switch $serve($serve($sock.sock).state) { "Read client" { set serve($serve($sock.sock).state) "Client timeout" } "Read from server" { set serve($serve($sock.sock).state) "Server timeout" } default { ErrorMessage "Strange timeout for $sock state=$serve($serve($sock.sock).state)" set serve($serve($sock.sock).state) "Server timeout" } } StatusMessage "Network read timeout [PrettySock $sock]" 1 } # close client request socket proc CloseSock { sock } { global serve ClearSockTimer $sock close $sock ClearTap $sock } proc ClearSockTimer { sock } { global serve if { [info exist serve($sock.id)] } { after cancel $serve($sock.id) unset serve($sock.id) } } proc ResetSockTimer { sock { msec 2000 } } { global serve ClearSockTimer $sock set serve($sock.id) [after $msec [list SockTimeout $sock ]] } # Wrapper for processing -- either change a vwait var, or just return waiting for more network traffic proc TapProcess { sock } { global serve set read_value [ReadProcess $sock] switch $read_value { "Web client" { set serve($sock.state) "Web client" } "Client early end" { set serve($sock.state) "Client early end" } "Packet reloop" { return } "Process packet" { set serve($sock.state) "Process client packet" } } TypeParser serve $sock } # Process a oncomming owserver packet, adjusting size from header information proc ReadProcess { sock } { global serve # test eof if { [eof $sock] } { return "Client early end" } # read what's waiting set new_string [read $sock] if { $new_string == {} } { return "Packet reloop" } append serve($sock.string) $new_string ResetSockTimer $sock set len [string length $serve($sock.string)] if { $len < 24 } { #do nothing -- reloop return "Packet reloop" } elseif { $serve($sock.totallength) == 0 } { # Look for web browser global HttpList if { [lsearch -exact $HttpList [string range $serve($sock.string) 0 3]] >= 0 } { return "Web client" } # at least header is in HeaderParser serve $sock $serve($sock.string) } #already in payload (and token) portion if { $len < $serve($sock.totallength) } { #do nothing -- reloop return "Packet reloop" } # Fully parsed set new_length [string length $serve($sock.string)] return "Process packet" } # Wrapper for processing -- either change a vwait var, or just return waiting for more network traffic proc RelayProcess { relay } { global serve set read_value [ReadProcess $relay] #puts "Current length [string length $serve($relay.string)] return val=$read_value" switch $read_value { "Web client" - "Client early end" { set serve($serve($relay.sock).state) "Server early end"} "Packet reloop" { return } "Process packet" { set serve($serve($relay.sock).state) "Process server packet" } } ErrorParser serve $relay #puts $serve($serve($relay.sock).typetext) # ShowMessage $relay } # Debugging routine -- show all the packet info proc ShowMessage { sock } { global serve global SocketVars foreach x $SocketVars { if { [info exist serve($sock.$x)] } { puts "\t$sock.$x = $serve($sock.$x)" } } } # callback from scrollbar, moves each listbox field proc ScrollTogether { args } { eval {.log.request_list yview} $args eval {.log.response_list yview} $args } # scroll other listbox and scrollbar proc Left_ScrollByKey { args } { eval { .log.transaction_scroll set } $args .log.response_list yview moveto [lindex [.log.request_list yview] 0 ] .log.response_list activate [.log.request_list index active ] } # scroll other listbox and scrollbar proc Right_ScrollByKey { args } { eval { .log.transaction_scroll set } $args .log.request_list yview moveto [lindex [.log.response_list yview] 0 ] .log.request_list activate [.log.response_list index active ] } # Selection from listbox proc SelectionMade { widget y } { set index [ $widget nearest $y ] if { $index >= 0 } { TransactionDetail [current_from_index $index] } } # create visual aspects of program proc DisplaySetup { } { global circ_buffer # Top pane, tranaction logs frame .log -bg yellow scrollbar .log.transaction_scroll -command [ list ScrollTogether ] label .log.request_title -text "Client request" -bg yellow -relief ridge label .log.response_title -text "Owserver response" -bg yellow -relief ridge listbox .log.request_list -width 40 -height 10 -selectmode single -yscroll [list Left_ScrollByKey ] -bg lightyellow listbox .log.response_list -width 40 -height 10 -selectmode single -yscroll [list Right_ScrollByKey] -bg lightyellow foreach lb {request_list response_list} { bind .log.$lb {+ SelectionMade %W %y } bind .log.$lb {+ SelectionMade %W } } grid .log.request_title -row 0 -column 0 -sticky news grid .log.response_title -row 0 -column 1 -sticky news grid .log.request_list -row 1 -column 0 -sticky news grid .log.response_list -row 1 -column 1 -sticky news grid .log.transaction_scroll -row 1 -column 2 -sticky news pack .log -side top -fill x -expand true #bottom pane, status label .status -anchor w -width 80 -relief sunken -height 1 -textvariable current_status -bg white pack .status -side bottom -fill x bind .status [list .main_menu.view invoke "Status messages"] SetupMenu } # Menu construction proc SetupMenu { } { global stats # toplevel . -menu .main_menu menu .main_menu -tearoff 0 . config -menu .main_menu # file menu menu .main_menu.file -tearoff 0 .main_menu add cascade -label File -menu .main_menu.file -underline 0 .main_menu.file add command -label "Log to File..." -underline 0 -command SaveLog -state disabled .main_menu.file add command -label "Stop logging" -underline 0 -command SaveAsLog -state disabled .main_menu.file add separator .main_menu.file add command -label "Restart" -underline 0 -command Restart .main_menu.file add separator .main_menu.file add command -label "Quit" -underline 0 -command exit # statistics menu menu .main_menu.view -tearoff 0 .main_menu add cascade -label View -menu .main_menu.view -underline 0 .main_menu.view add checkbutton -label "Statistics by Message type" -underline 14 -indicatoron 1 -command {StatByType} .main_menu.view add checkbutton -label "Persistence rates" -underline 12 -indicatoron 1 -command {RatePersist} .main_menu.view add checkbutton -label "Persistence lengths" -underline 12 -indicatoron 1 -command {LengthPersist} .main_menu.view add separator .main_menu.view add checkbutton -label "Detail window list" -underline 0 -indicatoron 1 -command {DetailList} .main_menu.view add separator .main_menu.view add checkbutton -label "Clients" -underline 0 -indicatoron 1 -command {StatByClient} .main_menu.view add separator .main_menu.view add checkbutton -label "Status messages" -underline 0 -indicatoron 1 -command {StatusWindow} # help menu menu .main_menu.help -tearoff 0 .main_menu add cascade -label Help -menu .main_menu.help -underline 0 .main_menu.help add command -label "About OWTAP" -underline 0 -command About .main_menu.help add command -label "Command Line" -underline 0 -command CommandLine .main_menu.help add command -label "OWSERVER Protocol" -underline 0 -command Protocol .main_menu.help add command -label "Version" -underline 0 -command Version } # error routine -- popup and exit proc ErrorMessage { msg } { StatusMessage "Fatal error -- $msg" tk_messageBox -title "Fatal error" -message $msg -type ok -icon error exit 1 } # status -- set status message # possibly store past messages # Use priority to test if should be stored proc StatusMessage { msg { priority 1 } } { global current_status set current_status $msg if { $priority > 0 } { global status_messages lappend status_messages $msg if { [llength $status_messages] > 50 } { set status_messages [lreplace $status_messages 0 0] } } } # Circular buffer for past connections # size is number of elements proc CircBufferSetup { size } { global circ_buffer set circ_buffer(size) $size set circ_buffer(total) -1 } # Save a spot for the coming connection proc CircBufferAllocate { } { global circ_buffer set size $circ_buffer(size) incr circ_buffer(total) set total $circ_buffer(total) set cb_index [ expr { $total % $size } ] if { $total >= $size } { # delete top listbox entry (oldest) .log.request_list delete 0 .log.response_list delete 0 # clear old entry if { [info exist circ_buffer($cb_index.num)] } { set num $circ_buffer($cb_index.num) for {set x 0} { $x < $num } {incr x} { unset circ_buffer($cb_index.response.$x) } } } set circ_buffer($cb_index.num) 0 set circ_buffer($cb_index.request) "" .log.request_list insert end "$total: pending" .log.response_list insert end "$total: pending" return $total } # place a new request packet proc CircBufferEntryRequest { current request {transaction_string "" } } { global circ_buffer set size $circ_buffer(size) set total $circ_buffer(total) if { [expr {$current + $size}] <= $total } { StatusMessage "Packet buffer history overflow. (nonfatal)" 0 return } # Still filling for the first time? if { $total < $size } { set index $current } else { set index [ expr $size - $total + $current - 1 ] } .log.request_list insert $index $request .log.request_list delete [expr $index + 1 ] #Now store packet set cb_index [ expr { $current % $size } ] set circ_buffer($cb_index.request) $transaction_string } # place a new response packet proc CircBufferEntryResponse { current response {transaction_string "" } } { global circ_buffer set size $circ_buffer(size) set total $circ_buffer(total) if { [expr {$current + $size}] <= $total } { StatusMessage "Packet buffer history overflow. (nonfatal)" 0 return } # Still filling for the first time? if { $total < $size } { set index $current } else { set index [ expr $size - $total + $current - 1 ] } .log.response_list insert $index "$current: $response" .log.response_list delete [expr $index + 1 ] #Now store packet set cb_index [ expr { $current % $size } ] set circ_buffer($cb_index.response.$circ_buffer($cb_index.num)) $transaction_string incr circ_buffer($cb_index.num) } # get the slot in the circ_buffer from the listbox index proc cb_from_index { index } { global circ_buffer set size $circ_buffer(size) set total $circ_buffer(total) if { $total < $size } { return $index } return [expr { ($total + $index) % $size }] } # get the total list from listbox index proc current_from_index { index } { global circ_buffer set size $circ_buffer(size) set total $circ_buffer(total) if { $total < $size } { return $index } return [expr { $total + $index - $size + 1 }] } # Popup giving attribution proc About { } { tk_messageBox -type ok -title {About owtap} -message { Program: owtap Synopsis: owserver protocol inspector Description: owtap is interposed between owserver and client. The communication is logged and shown on screen. All messages are transparently forwarded between client and server. Author: Paul H Alfille Copyright: July 2007 GPL 2.0 license Website: http://www.owfs.org } } # Popup giving commandline proc CommandLine { } { tk_messageBox -type ok -title {owtap command line} -message { syntax: owtap.tcl -s serverport -p tapport server port is the address of owserver tapport is the port assigned this program Usage (owdir example) If owserver was invoked as: owserver -p 3000 -u a client (say owdir) would normally call: owdir -s 3000 / To use owtap, invoke it with owtap.tcl -s 3000 -p 4000 and now call owdir with: owdir -s 4000 / } } # Popup giving version proc Version { } { regsub -all {[$:a-zA-Z]} {$Revision$} {} Version regsub -all {[$:a-zA-Z]} {$Date$} {} Date tk_messageBox -type ok -title {owtap version} -message " Version $Version Date $Date " } # Popup on protocol proc Protocol { } { tk_messageBox -type ok -title {owserver protocol} -message { The owserver protocol is a tcp/ip protocol for communication between owserver and clients. It is recognized as a "well known port" by the IANA (4304) and has an associated mDNS service (_owserver._tcp). Datails can be found at: http://www.owfs.org/index.php?page=owserver-protocol } } # Show a list of detail windows proc DetailList { } { set window_name .detaillist set menu_name .main_menu.view set menu_index "Detail window list" if { [ WindowAlreadyExists $window_name $menu_name $menu_index ] } { return } global setup_flags listbox $window_name.lb -listvariable setup_flags(detail_list) -width 30 -yscrollcommand [list $window_name.sb set] -selectmode extended -bg lightyellow scrollbar $window_name.sb -command [list $window_name.lb yview] set f [frame $window_name.f] set all [button $f.all -text All -command [list $window_name.lb selection set 0 end]] set none [button $f.none -text None -command [list $window_name.lb selection clear 0 end]] set delete [button $f.close -text "Close selected" -command [list DetailClear $window_name.lb]] pack $all -side left pack $none -side left pack $delete -side right pack $f -side bottom -fill x pack $window_name.sb -side right -fill y pack $window_name.lb -side left -fill both -expand true } proc DetailClear { list_box } { foreach i [$list_box curselection] { lappend windows [$list_box get $i] } foreach w $windows { DetailDelete $w } } proc DetailDelete { window_name } { global setup_flags set i [lsearch -exact $setup_flags(detail_list) $window_name] if { $i >= 0 } { set setup_flags(detail_list) [lreplace $setup_flags(detail_list) $i $i] } destroy $window_name } # Client list proc AddClient { client } { global ClientList if { [info exist ClientList($client)] } { incr ClientList($client) } else { set ClientList($client) 1 } global setup_flags if { [ info exist setup_flags(.clientlist) ] } { BuildClientList } } proc BuildClientList { } { global stats global ClientList set l {} foreach {k v} [array get ClientList] { lappend l [format {%20.20s %8d} $k $v] } set stats(clientlist) $l } # Show a table of Past status messages proc StatByClient { } { set window_name .clientlist set menu_name .main_menu.view set menu_index "Clients" if { [ WindowAlreadyExists $window_name $menu_name $menu_index ] } { return } global stats BuildClientList listbox $window_name.lb -listvariable stats(clientlist) -width 30 -yscrollcommand [list $window_name.sb set] -bg lightyellow scrollbar $window_name.sb -command [list $window_name.lb yview] pack $window_name.sb -side right -fill y pack $window_name.lb -side left -fill both -expand true } # Show a table of Past status messages proc LengthPersist { } { set window_name .lengthpersistwindow set menu_name .main_menu.view set menu_index "Persistence lengths" if { [ WindowAlreadyExists $window_name $menu_name $menu_index ] } { return } global stats label $window_name.at -text "Length" -bg blue -fg white grid $window_name.at -row 0 -column 0 -sticky news label $window_name.bt -text "Count" -bg blue -fg white grid $window_name.bt -row 0 -column 1 -sticky news label $window_name.ax -textvariable stats(persistence_length.max) -bg lightyellow grid $window_name.ax -row 1 -column 0 -sticky news label $window_name.bx -text "Max" -bg lightyellow grid $window_name.bx -row 1 -column 1 -sticky news label $window_name.am -textvariable stats(persistence_length.mean) -bg lightyellow grid $window_name.am -row 2 -column 0 -sticky news label $window_name.bm -text "Mean" -bg lightyellow grid $window_name.bm -row 2 -column 1 -sticky news set row 3 set bg white for {set x 0} {$x < 16} {incr x} { label $window_name.a${x} -text $x -bg $bg grid $window_name.a${x} -row $row -column 0 -sticky news label $window_name.b${x} -textvariable stats(persistence_length.$x) -bg $bg grid $window_name.b${x} -row $row -column 1 -sticky news if {$bg=="white"} { set bg lightyellow} else {set bg white} incr row } label $window_name.ap -text "> 15" -bg $bg grid $window_name.ap -row $row -column 0 -sticky news label $window_name.bp -textvariable stats(persistence_length.15plus) -bg $bg grid $window_name.bp -row $row -column 1 -sticky news } # Show a table of Past status messages proc RatePersist { } { set window_name .ratepersistwindow set menu_name .main_menu.view set menu_index "Persistence rates" if { [ WindowAlreadyExists $window_name $menu_name $menu_index ] } { return } global stats label $window_name.a0 -text "Persistence" -bg blue -fg white grid $window_name.a0 -row 0 -column 0 -sticky news label $window_name.a1 -text "Requests" -bg lightblue grid $window_name.a1 -row 1 -column 0 -sticky news label $window_name.a2 -text "Granted" -bg lightblue grid $window_name.a2 -row 2 -column 0 -sticky news label $window_name.b0 -text "number" -bg yellow grid $window_name.b0 -row 0 -column 1 -sticky news label $window_name.b1 -textvariable stats(persistence_length.request_yes) -bg white grid $window_name.b1 -row 1 -column 1 -sticky news label $window_name.b2 -textvariable stats(persistence_length.grant) -bg white grid $window_name.b2 -row 2 -column 1 -sticky news label $window_name.c0 -text "total" -bg orange grid $window_name.c0 -row 0 -column 2 -sticky news label $window_name.c1 -textvariable stats(Total.tries) -bg lightyellow grid $window_name.c1 -row 1 -column 2 -sticky news label $window_name.c2 -textvariable stats(persistence_length.request_yes) -bg lightyellow grid $window_name.c2 -row 2 -column 2 -sticky news label $window_name.d0 -text "rate %" -bg yellow grid $window_name.d0 -row 0 -column 3 -sticky news label $window_name.d1 -textvariable stats(persistence_length.request_rate) -bg white grid $window_name.d1 -row 1 -column 3 -sticky news label $window_name.d2 -textvariable stats(persistence_length.grant_rate) -bg white grid $window_name.d2 -row 2 -column 3 -sticky news } # Show a table of Past status messages proc StatusWindow { } { set window_name .statuswindow set menu_name .main_menu.view set menu_index "Status messages" if { [ WindowAlreadyExists $window_name $menu_name $menu_index ] } { return } global status_messages # create status window scrollbar $window_name.xsb -orient horizontal -command [list $window_name.lb xview] pack $window_name.xsb -side bottom -fill x -expand 1 scrollbar $window_name.ysb -orient vertical -command [list $window_name.lb yview] pack $window_name.ysb -fill y -expand 1 -side right listbox $window_name.lb -listvar status_messages -bg white -yscrollcommand [list $window_name.ysb set] -xscrollcommand [list $window_name.xsb set] -width 80 pack $window_name.lb -fill both -expand 1 -side left } #proc window handler for statistics and status windows #return 1 if old, 0 if new proc WindowAlreadyExists { window_name menu_name menu_index } { global setup_flags if { [ info exist setup_flags($window_name) ] } { if { $setup_flags($window_name) } { # hide window wm withdraw $window_name set setup_flags($window_name) 0 } else { # show window wm deiconify $window_name set setup_flags($window_name) 1 } return 1 } # create window toplevel $window_name wm title $window_name $menu_index # delete handler wm protocol $window_name WM_DELETE_WINDOW [list $menu_name invoke $menu_index] # now set flag set setup_flags($window_name) 1 return 0 } # Show a table of packets and bytes by type (DIR, READ,...) # Separate window that is pretty self contained. # Data values use -textvariable so auto-update # linked by "globals" for variables and types # linked my menu position and index (checkbox) # catches delete and hides instead (via menu action) proc StatByType { } { set window_name .statbytype set menu_name .main_menu.view set menu_index "Statistics by Message type" if { [ WindowAlreadyExists $window_name $menu_name $menu_index ] } { return } global stats global MessageListPlus # create stats window set column_number 0 label $window_name.l${column_number}0 -text "Type" -bg blue -fg white grid $window_name.l${column_number}0 -row 0 -column $column_number -sticky news label $window_name.l${column_number}1 -text "Packets" -bg lightblue grid $window_name.l${column_number}1 -row 1 -column $column_number -sticky news label $window_name.l${column_number}2 -text "Errors" -bg lightblue grid $window_name.l${column_number}2 -row 2 -column $column_number -sticky news label $window_name.l${column_number}3 -text "Error %" -bg lightblue grid $window_name.l${column_number}3 -row 3 -column $column_number -sticky news frame $window_name.ff4 -bg blue grid $window_name.ff4 -column 1 -row 0 label $window_name.l${column_number}5 -text "bytes in" -bg lightblue grid $window_name.l${column_number}5 -row 5 -column $column_number -sticky news label $window_name.l${column_number}6 -text "bytes out" -bg lightblue grid $window_name.l${column_number}6 -row 6 -column $column_number -sticky news set bgcolor white set bgcolor2 yellow foreach x $MessageListPlus { incr column_number label $window_name.${column_number}0 -text $x -bg $bgcolor2 grid $window_name.${column_number}0 -row 0 -column $column_number -sticky news label $window_name.${column_number}1 -textvariable stats($x.tries) -bg $bgcolor grid $window_name.${column_number}1 -row 1 -column $column_number -sticky news label $window_name.${column_number}2 -textvariable stats($x.errors) -bg $bgcolor grid $window_name.${column_number}2 -row 2 -column $column_number -sticky news label $window_name.${column_number}3 -textvariable stats($x.rate) -bg $bgcolor grid $window_name.${column_number}3 -row 3 -column $column_number -sticky news label $window_name.${column_number}5 -textvariable stats($x.request_bytes) -bg $bgcolor grid $window_name.${column_number}5 -row 5 -column $column_number -sticky news label $window_name.${column_number}6 -textvariable stats($x.response_bytes) -bg $bgcolor grid $window_name.${column_number}6 -row 6 -column $column_number -sticky news if { $bgcolor == "white" } { set bgcolor lightyellow } else { set bgcolor white } if { $bgcolor2 == "yellow" } { set bgcolor2 orange } else { set bgcolor2 yellow } } frame $window_name.f4 -bg yellow grid $window_name.f4 -column 1 -row 4 -columnspan [llength MessageListPlus] } #make a window that has to be dismissed by hand proc TransactionDetail { index } { # make a unique window name global setup_flags set window_name .transaction_$index # Does the window exist? if { [winfo exists $window_name] == 1 } { raise $window_name return } # Make the window toplevel $window_name -bg white wm title $window_name "Transaction $index" set cb_index [cb_from_index $index] RequestDetail $window_name $cb_index ResponseDetail $window_name $cb_index # Add to a list set l [concat $setup_flags(detail_list) $window_name] set setup_flags(detail_list) [lsort -unique $l] # delete handler wm protocol $window_name WM_DELETE_WINDOW [list DetailDelete $window_name ] } # Parse for return HeaderParser proc ErrorParser { array_name prefix } { upvar 1 $array_name a_name set a_name($prefix.return) [DetailReturn a_name $prefix] } # Parse for TYPE after HeaderParser proc TypeParser { array_name prefix } { upvar 1 $array_name a_name global MessageList if { $a_name($prefix.totallength) < 24 } { set a_name($prefix.typetext) BadHeader return } set type [lindex $MessageList $a_name($prefix.type)] if { $type == {} } { set a_name($prefix.typetext) Unknown return } set a_name($prefix.typetext) $type } #Parse header information and place in array # works for request or response (though type is "ret" in response) proc HeaderParser { array_name prefix string_value } { upvar 1 $array_name a_name set length [string length $string_value] foreach x {version payload type flags size offset typetext} { set a_name($prefix.$x) "" } foreach x {paylength tokenlength totallength ping} { set a_name($prefix.$x) 0 } binary scan $string_value {IIIIII} a_name($prefix.version) a_name($prefix.payload) a_name($prefix.type) a_name($prefix.flags) a_name($prefix.size) a_name($prefix.offset) if { $length < 24 } { set a_name($prefix.totallength) $length set a_name($prefix.typetext) BadHeader return } if { $a_name($prefix.payload) == -1 } { set a_name($prefix.paylength) 0 set a_name($prefix.ping) 1 } else { set a_name($prefix.paylength) $a_name($prefix.payload) } set version $a_name($prefix.version) set flags $a_name($prefix.flags) set tok [expr { $version & 0xFFFF}] set ver [expr { $version >> 16}] set a_name($prefix.persist) [expr {($flags&0x04)?1:0}] set a_name($prefix.versiontext) "T$tok V$ver" set a_name($prefix.flagtext) [DetailFlags $flags] set a_name($prefix.tokenlength) [expr {$tok * 16} ] set a_name($prefix.totallength) [expr {$a_name($prefix.tokenlength)+$a_name($prefix.paylength)+24}] } # Request portion proc RequestDetail { window_name cb_index } { global circ_buffer DetailRow $window_name yellow orange version payload type flags size offset # get request data HeaderParser q x $circ_buffer($cb_index.request) # request headers DetailRow $window_name white lightyellow $q(x.version) $q(x.payload) $q(x.type) $q(x.flags) $q(x.size) $q(x.offset) # request headers if { [string length $circ_buffer($cb_index.request)] >= 24 } { TypeParser q x DetailRow $window_name white lightyellow $q(x.versiontext) $q(x.paylength) $q(x.typetext) $q(x.flagtext) $q(x.size) $q(x.offset) if { $q(x.paylength) > 0 } { switch $q(x.typetext) { "WRITE" { DetailPayloadPlus $window_name lightyellow white $circ_buffer($cb_index.request) $q(x.paylength) $q(x.size) } default { DetailPayload $window_name lightyellow $circ_buffer($cb_index.request) $q(x.paylength) } } } wm title $window_name "[wm title $window_name]: $q(x.typetext)" } } # Response portion proc ResponseDetail { window_name cb_index } { global circ_buffer DetailRow $window_name #a6dcff #a6b1ff version payload return flags size offset # get response data set num $circ_buffer($cb_index.num) for {set i 0} {$i < $num} {incr i} { HeaderParser r x $circ_buffer($cb_index.response.$i) set offset $r(x.offset) DetailRowPlus $window_name white #EEEEFF $i $r(x.version) $r(x.payload) $r(x.type) $r(x.flags) $r(x.size) $offset if { [string length $circ_buffer($cb_index.response.$i)] >= 24 } { ErrorParser r x switch [$window_name.x22 cget -text] { "DIR" - "DIRALL" {set offset [DetailOffset $offset]} "DIRALLSLASH" {set offset [DetailOffset $offset]} } DetailRow $window_name white #EEEEFF $r(x.versiontext) [expr {$r(x.ping)?"PING":$r(x.paylength)}] $r(x.return) $r(x.flagtext) $r(x.size) $offset DetailPayload $window_name #EEEEFF $circ_buffer($cb_index.response.$i) $r(x.paylength) } } } proc DetailPayload { window_name color full_string payload } { DetailText $window_name $color [string range $full_string 24 [expr {$payload + 24}] ] } proc DetailPayloadPlus { window_name color1 color2 full_string payload size } { set endpay [expr {24+$payload-$size-1}] DetailText $window_name $color1 [string range $full_string 24 $endpay ] incr endpay DetailText $window_name $color2 [string range $full_string $endpay [expr {$payload + 24}] ] } proc DetailText { window_name color text_string } { set row [lindex [grid size $window_name] 1] set columns [lindex [grid size $window_name] 0] label $window_name.t${row} -text $text_string -bg $color -relief ridge -wraplength 640 -justify left -anchor w grid $window_name.t${row} -row $row -columnspan $columns -sticky news } # Standard detail row, one cell per value proc DetailRow { window_name color1 color2 v0 v1 v2 v3 v4 v5 } { set row [lindex [grid size $window_name] 1] set w0 [label $window_name.x${row}0 -text $v0 -bg $color1] DetailRowRest $window_name $color1 $color2 $row $w0 $v1 $v2 $v3 $v4 $v5 } # Augmented detail row, one cell per value, plus num in blue proc DetailRowPlus { window_name color1 color2 num v0 v1 v2 v3 v4 v5 } { set row [lindex [grid size $window_name] 1] set w0 [frame $window_name.x${row}0 -bd 0 -relief flat] set n0 [label $w0.n -text $num -bg #a6b1ff -fg white] set m0 [label $w0.m -text $v0 -bg $color1] pack $n0 -side left -anchor w -fill none pack $m0 -side right -fill x -expand 1 DetailRowRest $window_name $color1 $color2 $row $w0 $v1 $v2 $v3 $v4 $v5 } # first element could be augmented by packet number # adds row and widget for first cell instead of value proc DetailRowRest { window_name color1 color2 row w0 v1 v2 v3 v4 v5 } { label $window_name.x${row}1 -text $v1 -bg $color2 label $window_name.x${row}2 -text $v2 -bg $color1 label $window_name.x${row}3 -text $v3 -bg $color2 label $window_name.x${row}4 -text $v4 -bg $color1 label $window_name.x${row}5 -text $v5 -bg $color2 grid $w0 $window_name.x${row}1 $window_name.x${row}2 $window_name.x${row}3 $window_name.x${row}4 $window_name.x${row}5 -row $row -sticky news } proc DetailReturn { array_name prefix } { upvar 1 $array_name a_name if { [info exists a_name($prefix.type)] } { set ret $a_name($prefix.type) } else { return "ESHORT" } if { $ret >= 0 } { return "OK" } switch -- $ret { -1 { return "EPERM"} -2 { return "ENOENT"} -5 { return "EIO"} -12 { return "ENOMEM"} -14 { return "EFAULT"} -19 { return "ENODEV"} -20 { return "ENOTDIR"} -21 { return "EISDIR"} -22 { return "EINVAL"} -34 { return "ERANGE"} -42 { return "ENOMSG"} default { return "ERROR"} } } proc DetailOffset { offset } { return [expr {$offset&0x0001?"resume ":""}][expr {$offset&0x0002?"alarm ":""}][expr {$offset&0x0004?"ovdr ":""}][expr {$offset&0x8000?"temp ":""}][expr {$offset&0x4000?"volt ":""}][expr {$offset&0x2000?"chain ":""}] } proc DetailFlags { flags } { switch [expr {($flags >>16)&0xFF}] { 0 {set T "C"} 1 {set T "F"} 2 {set T "K"} 3 {set T "R"} default {set T "?temp"} } switch [expr {$flags >>24}] { 0 {set F " f.i"} 1 {set F " fi"} 2 {set F " f.i.c"} 3 {set F " f.ic"} 4 {set F " fi.c"} 5 {set F " fic"} default {set F " ?format"} } return $T$F[expr {$flags&0x10?" safe":""}][expr {$flags&0x08?" alias":""}][expr {$flags&0x04?" persist":""}][expr {$flags&0x02?" bus":""}][expr {$flags&0x01?" cache":""}] } proc WebResponse { sock } { set R [lindex {$Revision$} 1] fconfigure $sock -buffering full -translation crlf -blocking 0 puts $sock "HTTP/1.0 400 Bad Request" puts $sock "Date: [clock format [clock seconds] -gmt 1]" puts $sock "Server: OWTAP-$R" puts $sock "Last-Modified: [clock format [clock seconds] -gmt 1]" puts $sock "Content-Type: text/html" puts $sock "" puts $sock "OWTAP-$R owserver protocol inspector" puts $sock "

Attempt to access OWTAP directly. You probably meant to access OWHTTPD, the 1-wire web server.

" puts $sock "

For more information see OWFS website or the Sourceforge site." flush $sock } # socket name in readable format proc PrettySock { sock } { set socklist [fconfigure $sock -sockname] return [lindex $socklist 1]:[lindex $socklist 2] } proc PrettyPeer { sock } { set socklist [fconfigure $sock -peername] return [lindex $socklist 1]:[lindex $socklist 2] } proc MainTitle { tap server } { wm title . "OWTAP ($tap) tap of owserver ($server)" } proc Restart { } { # foreach ch [chan names] { close $ch } foreach channel [file channels] { if { [regexp -- {^std(out|in|err)$} $channel ] == 0 } { # change to non-blocking and close if { [ catch { fconfigure $channel -blocking 0 ; close $channel; } reason ] == 1 } { StatusMessage "Error closing channel $channel $reason" 1 } } } # exec [info nameofexecutable] $::argv0 "--" {*}$::argv & if { [info nameofexecutable] eq $::argv0 } { eval exec [list [info nameofexecutable]] "--" $::argv & } else { eval exec [list [info nameofexecutable]] [list $::argv0] "--" $::argv "&" } exit } #Finally, all the Proc-s have been defined, so run everything. Main $argv owfs-3.1p5/module/owmon/0000755000175000001440000000000013022537105012217 500000000000000owfs-3.1p5/module/owmon/Makefile.am0000644000175000001440000000017212654730021014175 00000000000000EXTRA_DIST = owmon.tcl install: @INSTALL@ -d $(DESTDIR)$(bindir) @INSTALL@ -m 755 owmon.tcl $(DESTDIR)$(bindir)/owmon owfs-3.1p5/module/owmon/Makefile.in0000644000175000001440000004055313022537052014214 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = module/owmon ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = owmon.tcl 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) --foreign module/owmon/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign module/owmon/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: 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-libtool 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 mostlyclean-libtool 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 clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile install: @INSTALL@ -d $(DESTDIR)$(bindir) @INSTALL@ -m 755 owmon.tcl $(DESTDIR)$(bindir)/owmon # 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: owfs-3.1p5/module/owmon/owmon.tcl0000644000175000001440000006660112654730021014015 00000000000000#!/bin/sh # the next line restarts using wish \ if [ -z `which wish` ] ; then exec tclsh "$0" -- "$@" ; else exec wish "$0" -- "$@" ; fi # $Id$ package require Tk # directories to monitor set PossiblePanels {system statistics structure settings interface} set SocketVars {string version type payload size sg offset tokenlength totallength paylength ping state id } # owserver message types set MessageTypes(READ) 2 set MessageTypes(DIR) 4 set MessageTypes(DIRALL) 7 set MessageTypes(PreferredDIR) $MessageTypes(DIRALL) set refresh_counter 0 # Global: window_exists => For object-oriented initialization # Global: serve => information on current transaction # serve(string) -- message to this point # serve(version size payload sg offset type tokenlength ) -- message parsed parts # Global: stats => statistical counts and flags for stats windows #Main procedure. We actually start it at the end, to allow Proc-s to be defined first. proc Main { } { ArgumentProcess global IsPanelVisible global PossiblePanels global DisplayLock global PanelDataField global SelectedBus global RefreshFrequency # wait till ready set DisplayLock 1 # Set panels to display at start foreach panel $PossiblePanels { #default set IsPanelVisible($panel) 0 # refresh rate set RefreshFrequency($panel) 0 } set IsPanelVisible(system) 1 set IsPanelVisible(statistics) 1 set IsPanelVisible(interface) 1 # Show screen SetupDisplay # bus list (and default) set SelectedBus "" SetBusList $PanelDataField(bus) selection set 0 0 # Show data for first time set DisplayLock 0 foreach panel $PossiblePanels { DirListValues $panel } # Start clock RefreshCounter } # Create the list of bus-es by doing recursive directory searches and selecting only bus.x entries # the list is put in DiscoveredBusList # No trailing "/" proc SetBusList { } { global DiscoveredBusList global PanelDataField # disable until data is complete $PanelDataField(bus) configure -state disabled set DiscoveredBusList "" BusListRecurser "" # enable now $PanelDataField(bus) configure -state normal } # path is searched and added. No trailing "/" proc BusListRecurser { path } { global DiscoveredBusList set value_from_owserver [OWSERVER_DirectoryRead "$path/"] if { [lindex $value_from_owserver 0] < 0 } { return } set busses [ lsearch -all -regexp -inline $value_from_owserver {/bus\.\d+$} ] foreach bus $busses { lappend DiscoveredBusList $bus BusListRecurser $bus } } proc SetDirList { bus type } { global data_array set path $bus/$type set data_array($bus.$type.path) {} set data_array($bus.$type.name) {} DirListRecurser $bus $path $type set data_array($bus.$type.path) [lrange $data_array($bus.$type.path) 1 end] set data_array($bus.$type.name) [lrange $data_array($bus.$type.name) 1 end] } proc DirListRecurser { bus path type } { global data_array lappend data_array($bus.$type.name) [regsub -all .*?/ [string range $path [string length $bus/$type] end] \t] set value_from_owserver [OWSERVER_DirectoryRead $path] if { [lindex $value_from_owserver 0] < 0 } { #puts "F $bus $path" lappend data_array($bus.$type.path) $path } else { #puts "D $bus $path" lappend data_array($bus.$type.path) NULL set dirlist [lsearch -all -regexp -inline -not [lrange $value_from_owserver 1 end] {\.ALL$|\.\d{3,}$} ] foreach dir $dirlist { DirListRecurser $bus $dir $type } } } # Get all the data values for a given bus/type proc DirListValues { type } { global IsPanelVisible global DisplayLock global SelectedBus global PanelDataField global data_array global MessageTypes # See if this is a displayed panel if { $IsPanelVisible($type) == 0 } { return } # prevent stacked refresh if { $DisplayLock } { return } set DisplayLock 1 if { ![info exists data_array($SelectedBus.$type.path)] } { $PanelDataField($type) delete 1.0 end $PanelDataField($type) insert end "First pass through $SelectedBus/$type\n ... getting parameter list...\n" #puts "bus=$bus type=$type" SetDirList $SelectedBus $type } $PanelDataField($type) delete 1.0 end foreach path $data_array($SelectedBus.$type.path) name $data_array($SelectedBus.$type.name) { if { $path != "NULL" } { set value_from_owserver [OWSERVER_Read $MessageTypes(READ) $path] set change_tag $type.black if {[lindex $value_from_owserver 0] < 0 } { set value_from_owserver "" } else { set value_from_owserver [lindex $value_from_owserver 1] } if { ![info exists data_array($SelectedBus.$type.$path)] } { set data_array($SelectedBus.$type.$path) $value_from_owserver } elseif { $data_array($SelectedBus.$type.$path) != $value_from_owserver } { set data_array($SelectedBus.$type.$path) $value_from_owserver set change_tag $type.red } elseif { $PanelDataField($type.diff) } { continue } $PanelDataField($type) insert end "[format {%12.12s} $value_from_owserver] $name\n" $change_tag } else { set value_from_owserver "" $PanelDataField($type) insert end " " $type.spacing "$name\n" $type.underline } } set DisplayLock 0 } proc OWSERVER_send_message { type path sock } { set length [string length $path] # add an entra char for null-termination string incr length # 262= f.i, busret and persist flags if { [catch {puts -nonewline $sock [binary format "IIIIIIa*a" 0 $length $type 262 1024 0 $path \0 ] }] } { return 1 } flush $sock return 0 } # Command line processing # looks at command line arguments # options "s" for the target ow_s_erver port # Can handle command lines like # -s 3001 # -s3001 # etc proc ArgumentProcess { } { global IPAddress # INADDR_ANY set IPAddress(ip) "0.0.0.0" # default port set IPAddress(port) "4304" foreach a $::argv { if { [regexp -- {^-s(.sock*)$} $a whole address] } { IPandPort $address } else { IPandPort $a } } MainTitle $IPAddress(ip):$IPAddress(port) } proc IPandPort { argument_string } { global IPAddress if { [regexp -- {^(.*?):(.*)$} $argument_string wholestring firstpart secondpart] } { if { $firstpart != "" } { set IPAddress(ip) $firstpart } if { $secondpart != "" } { set IPAddress(port) $secondpart } } else { if { $argument_string != "" } { set IPAddress(port) $argument_string } } } # open connection to owserver # return sock, or "" if unsuccessful proc OpenOwserver { } { global IPAddress # StatusMessage "Attempting to open connection to OWSERVER" 0 if {[catch {socket $IPAddress(ip) $IPAddress(port)} sock] } { return {} } else { return sock } } proc OWSERVER_DirectoryRead { path } { global MessageTypes set return_code [OWSERVER_Read $MessageTypes(PreferredDIR) $path] if { $return_code == -42 && $MessageTypes(PreferredDIR) == $dMessageTypes(DIRALL) } { set MessageTypes(PreferredDIR) $MessageTypes(DIR) set return_code [OWSERVER_Read $MessageTypes(PreferredDIR) $path] } return $return_code } #Main loop. Called whenever the server (listen) port accepts a connection. proc OWSERVER_Read { message_type path } { global serve # Start the State machine set serve(state) "Open server" set value_from_owserver {} set error_status 0 while {1} { #puts "State machine = $serve(state) message_type=$message_type path=$path" switch $serve(state) { "Open server" { global IPAddress StatusMessage "Attempting to open connection to OWSERVER" 0 if {[catch {socket $IPAddress(ip) $IPAddress(port)} sock] } { set serve(state) "Unopened server" } else { set serve(state) "Send to server" } } "Unopened server" { StatusMessage "OWSERVER error: $sock at $IPAddress(ip):$IPAddress(port)" set serve(state) "Server error" } "Send to server" { StatusMessage "Sending client request to OWSERVER" 0 set serve(sock) $sock fconfigure $sock -translation binary -buffering full -encoding binary -blocking 0 if { [OWSERVER_send_message $message_type $path $sock]==0 } { set serve(state) "Read from server" } elseif { [info exist serve(persist)] && $serve(persist)==1 } { CloseSock set serve(persist) 0 set serve(state) "Open server" } else { set serve(state) "Server wont listen" } } "Persistent server" { set sock $serve(sock) } "Read from server" { StatusMessage "Reading OWSERVER response" 0 TapSetup ResetSockTimer fileevent $sock readable [list OWSERVER_Process] vwait serve(state) } "Server wont listen" { StatusMessage "FAILURE sending to OWSERVER" 0 set serve(state) "Server error" } "Server early end" { StatusMessage "FAILURE reading OWSERVER response" 0 set serve(state) "Server error" } "Process server packet" { StatusMessage "Success reading OWSERVER response" 0 fileevent $sock readable {} set serve(state) "Packet complete" } "Packet complete" { ClearSockTimer # filter out the multi-response types and continue listening global MessageTypes if { $serve(ping) == 1 } { set serve(state) "Ping received" } elseif { $serve(type) < 0 } { # error -- return it (may help find non-DIRALL servers) set error_status $serve(type) set serve(state) "Done with server" } elseif { $message_type == $MessageTypes(DIRALL) } { set serve(state) "Dirall received" } elseif { $message_type == $MessageTypes(READ) } { set serve(state) "Read received" } else { set serve(state) "Dir element received" } } "Ping received" { set serve(state) "Read from server" } "Dir element received" { if { $serve(paylength)==0 } { # last (null) element set serve(state) "Done with server" } else { # add element to list lappend value_from_owserver [PayloadWithNULL] set serve(state) "Read from server" } } "Dirall received" { set value_from_owserver [split [PayloadWithNULL] ,] set serve(state) "Done with server" } "Read received" { lappend value_from_owserver [PayloadNoNULL] set serve(state) "Done with server" } "Server timeout" { ClearSockTimer StatusMessage "owserver read timeout" 1 set serve(state) "Server error" } "Server error" { set error_return 1 StatusMessage "Error code $error_return" 1 set serve(persist) 0 set serve(state) "Done with server" } "Done with server" { if { [info exist serve(persist)] && $serve(persist)==1 } { set serve(state) "Server persist" } else { set serve(state) "Server close" } } "Server persist" { ClearTap ClearSockTimer set serve(state) "Done with all" } "Server close" { CloseSock set serve(state) "Done with all" } "Done with all" { StatusMessage "Ready" 0 set serve(state) "Return" } "Return" { return [linsert $value_from_owserver 0 $error_status] } default { StatusMessage "Internal error -- bad state: $serve($sock.state)" 1 set serve(state) "Return" } } } } # Initialize array for client request proc TapSetup { } { global serve set serve(string) "" set serve(totallength) 0 } # Clear out client request array after a connection (frees memory) proc ClearTap { } { global serve global SocketVars foreach x $SocketVars { if { [info exist serve($x)] } { unset serve($x) } } } # close client request socket proc SockTimeout {} { global serve switch $serve(state) { "Read from server" { set serve(state) "Server timeout" } default { ErrorMessage "Strange timeout for state=$serve(state)" set serve(state) "Server timeout" } } StatusMessage "Network read timeout" 1 } # close client request socket proc CloseSock {} { global serve ClearSockTimer if { [info exists serve(sock)] } { close $serve(sock) unset serve(sock) } ClearTap } proc ClearSockTimer { } { global serve if { [info exist serve(id)] } { after cancel $serve(id) unset serve(id) } } proc ResetSockTimer { { msec 2000 } } { global serve ClearSockTimer set serve(id) [after $msec [list SockTimeout]] } # Process a oncomming owserver packet, adjusting size from header information proc ReadProcess {} { global serve set sock $serve(sock) # test eof if { [eof $sock] } { return 2 } # read what's waiting set new_string [read $sock] if { $new_string == {} } { return 0 } append serve(string) $new_string ResetSockTimer set len [string length $serve(string)] if { $len < 24 } { #do nothing -- reloop return 0 } elseif { $serve(totallength) == 0 } { # at least header is in HeaderParser $serve(string) } #already in payload (and token) portion if { $len < $serve(totallength) } { #do nothing -- reloop return 0 } # Fully parsed set new_length [string length $serve(string)] return 1 } # Wrapper for processing -- either change a vwait var, or just return waiting for more network traffic proc OWSERVER_Process { } { global serve set read_value [ReadProcess] #puts "Current length [string length $serve($relay.string)] return val=$read_value" switch $read_value { 3 - 2 { set serve(state) "Server early end"} 0 { return } 1 { set serve(state) "Process server packet" } } } # Debugging routine -- show all the packet info proc ShowMessage {} { global serve global SocketVars foreach x $SocketVars { if { [info exist serve($x)] } { puts "\t$x = $serve($x)" } } } # Selection from bus listbox (left panel) proc SelectionMade { widget y } { global PossiblePanels global PanelDataField global SelectedBus global data_array catch { unset data_array } set index [ $widget nearest $y ] if { $index >= 0 } { set bus [$widget get $index] set SelectedBus [expr { ($bus eq "") ? "" : $bus } ] foreach panel $PossiblePanels { DirListValues $panel } } } proc SetupDisplay {} { global IsPanelVisible global PossiblePanels global DiscoveredBusList global RefreshFrequency global PanelDataField panedwindow .main -orient horizontal # Bus list is a listbox set f_bus [frame .main.bus] set color [Color bus] set PanelDataField(bus) [ listbox $f_bus.lb \ -listvariable DiscoveredBusList \ -width 20 \ -yscrollcommand [list $f_bus.sb set] \ -selectmode browse \ -bg $color ] scrollbar $f_bus.sb -command [list $f_bus.lb yview] -troughcolor $color pack $f_bus.sb -side right -fill y pack $f_bus.lb -side left -fill both -expand true bind $PanelDataField(bus) {+ SelectionMade %W %y } bind $PanelDataField(bus) {+ SelectionMade %W } .main add .main.bus foreach dir $PossiblePanels { SetupPanel $dir } label .status -anchor w -relief sunken -height 1 -textvariable current_status -bg white pack .status -side bottom -fill x bind .status [list .main_menu.view invoke "Status messages"] pack .main -side top -fill both -expand true menu .main_menu -tearoff 0 . config -menu .main_menu # file menu menu .main_menu.file -tearoff 0 .main_menu add cascade -label File -menu .main_menu.file -underline 0 .main_menu.file add command -label "Log to File..." -underline 0 -command SaveLog -state disabled .main_menu.file add command -label "Stop logging" -underline 0 -command SaveAsLog -state disabled .main_menu.file add separator .main_menu.file add command -label "Restart" -underline 0 -command Restart .main_menu.file add separator .main_menu.file add command -label "Quit" -underline 0 -command exit menu .main_menu.view -tearoff 0 .main_menu add cascade -label View -menu .main_menu.view -underline 0 foreach dir $PossiblePanels { .main_menu.view add checkbutton -label $dir -indicatoron 1 -command [list PanelShow $dir] -variable IsPanelVisible($dir) } .main_menu.view add separator .main_menu.view add checkbutton -label "Status messages" -underline 0 -indicatoron 1 -command {StatusWindow} foreach panel $PossiblePanels { menu .main_menu.$panel -tearoff 0 .main_menu add cascade -label $panel -menu .main_menu.$panel -state [expr {$IsPanelVisible($panel)?"normal":"disabled"}] menu .main_menu.$panel.refresh -tearoff 0 .main_menu.$panel add cascade -menu .main_menu.$panel.refresh -label {Refresh rate} foreach {label value} {"Manual" 0 "20 seconds" 1 "1 minute" 3 "5 minutes" 15} { .main_menu.$panel.refresh add radiobutton -label $label -value $value -variable RefreshFrequency($panel) } .main_menu.$panel add checkbutton -label "Differences only" -underline 0 -variable PanelDataField($panel.diff) } # help menu menu .main_menu.help -tearoff 0 .main_menu add cascade -label Help -menu .main_menu.help -underline 0 .main_menu.help add command -label "About OWMON" -underline 0 -command About .main_menu.help add command -label "Command Line" -underline 0 -command CommandLine .main_menu.help add command -label "Version" -underline 0 -command Version } proc SetupPanel { panel } { global IsPanelVisible global PanelFrame global PanelDataField set color [Color $panel] if { $IsPanelVisible($panel) } { set f [frame .main.$panel] # top bar frame $f.top button $f.top.b -text $panel -command [list DirListValues $panel] -bg $color checkbutton $f.top.d -text "∆" -command [list DirListValues $panel] -variable PanelDataField($panel.diff) -bg $color button $f.top.x -text "X" -command [list .main_menu.view invoke $panel] -bg $color pack $f.top.x -side right pack $f.top.d -side right pack $f.top.b -side left -fill x -expand true # text and scroll bars set PanelDataField($panel) [ text $f.text \ -yscrollcommand [list $f.sby set] \ -xscrollcommand [list $f.sbx set] \ -tabs {12 right 15 20 25} \ -wrap none \ -width 40 \ -bg $color ] scrollbar $f.sby -command [list $f.text yview] -troughcolor $color scrollbar $f.sbx -command [list $f.text xview] -orient horizontal -troughcolor $color pack $f.top -side top -fill x pack $f.sby -side right -fill y pack $f.sbx -side bottom -fill x pack $f.text -side left -fill both -expand true set PanelFrame($panel) $f .main add $f -after .main.[PriorPanel $panel] $PanelDataField($panel) tag configure $panel.red -foreground red $PanelDataField($panel) tag configure $panel.black -foreground black $PanelDataField($panel) tag configure $panel.spacing -spacing1 5 -spacing3 3 $PanelDataField($panel) tag configure $panel.underline -underline 1 set PanelDataField($panel.diff) 0 } } proc PanelShow { panel } { global IsPanelVisible global PanelFrame if { $IsPanelVisible($panel) } { .main_menu entryconfigure $panel -state normal if { [info exist PanelFrame($panel)] } { .main add .main.$panel -after .main.[PriorPanel $panel] } else { SetupPanel $panel } DirListValues $panel } else { .main_menu entryconfigure $panel -state disabled .main forget $PanelFrame($panel) } } proc PriorPanel { dir } { global IsPanelVisible global PossiblePanels set prior bus foreach prior_dir $PossiblePanels { if { $prior_dir==$dir } { break } if { $IsPanelVisible($prior_dir) } { set prior $prior_dir } } return $prior } proc Color { dir } { switch $dir { bus { return #D6E2E0} system { return #DBF0FF} statistics { return #E2FFF1} alarm { return #FFC3C3} structure { return #F3DEFF} settings { return #FCFFDE} chain { return #DDDFC2} simultaneous { return #C3EEF9} interface { return #FFF6C8} default { return #C8C8C8} } } # error routine -- popup and exit proc ErrorMessage { msg } { StatusMessage "Fatal error -- $msg" tk_messageBox -title "Fatal error" -message $msg -type ok -icon error exit 1 } # status -- set status message # possibly store past messages # Use priority to test if should be stored proc StatusMessage { msg { priority 1 } } { global current_status set current_status $msg if { $priority > 0 } { global status_messages lappend status_messages $msg if { [llength $status_messages] > 50 } { set status_messages [lreplace $status_messages 0 0] } } } # Popup giving attribution proc About { } { tk_messageBox -type ok -title {About owmon} -message { Program: owmon Synopsis: owserver statistics inspector Description: owmon displays the internal statistics kept by owserver. The information can help diagnosing and predicting hardware problems. Author: Paul H Alfille Copyright: Aug 2007 GPL 2.0 license Website: http://www.owfs.org } } # Popup giving commandline proc CommandLine { } { tk_messageBox -type ok -title {owmon command line} -message { syntax: owmon.tcl -s serverport server port is the address of owserver owserver address can be in forms host:port :port port default is localhost:4304 } } # Popup giving version proc Version { } { regsub -all {[$:a-zA-Z]} {$Revision$} {} Version regsub -all {[$:a-zA-Z]} {$Date$} {} Date tk_messageBox -type ok -title {owmon version} -message " Version $Version Date $Date " } # Show a table of Past status messages proc StatusWindow { } { set window_name .statuswindow set menu_name .main_menu.view set menu_index "Status messages" if { [ WindowAlreadyExists $window_name $menu_name $menu_index ] } { return } global status_messages # create status window scrollbar $window_name.xsb -orient horizontal -command [list $window_name.lb xview] pack $window_name.xsb -side bottom -fill x -expand 1 scrollbar $window_name.ysb -orient vertical -command [list $window_name.lb yview] pack $window_name.ysb -fill y -expand 1 -side right listbox $window_name.lb -listvar status_messages -bg white -yscrollcommand [list $window_name.ysb set] -xscrollcommand [list $window_name.xsb set] -width 80 pack $window_name.lb -fill both -expand 1 -side left } #proc window handler for statistics and status windows #return 1 if old, 0 if new proc WindowAlreadyExists { window_name menu_name menu_index } { global window_exists if { [ info exist window_exists($window_name) ] } { if { $window_exists($window_name) } { # hide window wm withdraw $window_name set window_exists($window_name) 0 } else { # show window wm deiconify $window_name set window_exists($window_name) 1 } return 1 } # create window toplevel $window_name wm title $window_name $menu_index # delete handler wm protocol $window_name WM_DELETE_WINDOW [list $menu_name invoke $menu_index] # now set flag set window_exists($window_name) 1 return 0 } #Parse header information and place in array # works for request or response (though type is "ret" in response) proc HeaderParser { string_value } { global serve set length [string length $string_value] foreach x {version payload type flags size offset} { set serve($x) "" } foreach x {paylength tokenlength totallength ping} { set serve($x) 0 } binary scan $string_value {IIIIII} serve(version) serve(payload) serve(type) serve(flags) serve(size) serve(offset) if { $length < 24 } { set serve(totallength) $length set serve(typetext) BadHeader return } if { $serve(payload) == -1 } { set serve(paylength) 0 set serve(ping) 1 } else { set serve(paylength) $serve(payload) } set version $serve(version) set flags $serve(flags) set tok [expr { $version & 0xFFFF}] set ver [expr { $version >> 16}] set serve(persist) [expr {($flags&0x04)?1:0}] set serve(tokenlength) [expr {$tok * 16} ] set serve(totallength) [expr {$serve(tokenlength)+$serve(paylength)+24}] } proc PayloadWithNULL {} { global serve # remove trailing null string range $serve(string) 24 [expr {$serve(paylength) + 24 - 2}] } proc PayloadNoNULL {} { global serve # remove trailing null string range $serve(string) 24 [expr {$serve(paylength) + 24 - 1}] } proc RefreshCounter { } { global refresh_counter global PossiblePanels global RefreshFrequency incr refresh_counter foreach panel $PossiblePanels { if { $RefreshFrequency($panel)==0 } { continue } if { [expr { $refresh_counter % $RefreshFrequency($panel) }]==0 } { DirListValues $panel } } # set timer again after 20000 RefreshCounter } proc Restart { } { # foreach ch [chan names] { close $ch } foreach channel [file channels] { if { [regexp -- {^std(out|in|err)$} $channel ] == 0 } { # change to non-blocking and close if { [ catch { fconfigure $channel -blocking 0 ; close $channel; } reason ] == 1 } { StatusMessage "Error closing channel $channel $reason" 1 } } } # exec [info nameofexecutable] $::argv0 "--" {*}$::argv & if { [info nameofexecutable] eq $::argv0 } { eval exec [list [info nameofexecutable]] "--" $::argv & } else { eval exec [list [info nameofexecutable]] [list $::argv0] "--" $::argv "&" } exit } proc MainTitle { server_address } { wm title . "OWMON owserver ($server_address) monitor" } #Finally, all the Proc-s have been defined, so run everything. Main owfs-3.1p5/src/0000755000175000001440000000000013022537100010355 500000000000000owfs-3.1p5/src/scripts/0000755000175000001440000000000013022537100012044 500000000000000owfs-3.1p5/src/scripts/install/0000755000175000001440000000000013022537103013515 500000000000000owfs-3.1p5/src/scripts/install/compile0000755000175000001440000001624513022537051015025 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 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 ) 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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: owfs-3.1p5/src/scripts/install/config.guess0000755000175000001440000012367213022537043015773 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # This file 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 . # # 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: owfs-3.1p5/src/scripts/install/config.sub0000755000175000001440000010623213022537043015427 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # This file 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 . # # 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 Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: owfs-3.1p5/src/scripts/install/install-sh0000755000175000001440000003452313022537043015453 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # 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; won't work # if double slashes aren't ignored. 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 dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac 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=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: owfs-3.1p5/src/scripts/install/ltmain.sh0000755000175000001440000117077113022537043015301 00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! 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 # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! 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 ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: owfs-3.1p5/src/scripts/install/missing0000755000175000001440000001533013022537051015040 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 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=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: owfs-3.1p5/src/scripts/install/mkinstalldirs0000755000175000001440000000123712654730021016252 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id$ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here owfs-3.1p5/src/scripts/install/depcomp0000755000175000001440000005601613022537051015024 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: owfs-3.1p5/src/scripts/install/test-driver0000755000175000001440000000761112734055705015654 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2012-06-27.10; # UTC # Copyright (C) 2011-2013 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: owfs-3.1p5/src/scripts/m4/0000755000175000001440000000000013022537076012400 500000000000000owfs-3.1p5/src/scripts/m4/libtool.m40000644000175000001440000112475313022537043014235 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS owfs-3.1p5/src/scripts/m4/ltoptions.m40000644000175000001440000003426213022537043014616 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) owfs-3.1p5/src/scripts/m4/ltsugar.m40000644000175000001440000001044013022537044014235 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) owfs-3.1p5/src/scripts/m4/ltversion.m40000644000175000001440000000127313022537044014605 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) owfs-3.1p5/src/scripts/m4/lt~obsolete.m40000644000175000001440000001377413022537044015143 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # 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. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) owfs-3.1p5/src/scripts/m4/acx_pthread.m40000644000175000001440000002237412654730021015047 00000000000000dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl dnl @summary figure out how to build C programs using POSIX threads dnl dnl This macro figures out how to build C programs using POSIX threads. dnl It sets the PTHREAD_LIBS output variable to the threads library and dnl linker flags, and the PTHREAD_CFLAGS output variable to any special dnl C compiler flags that are needed. (The user can also force certain dnl compiler flags/libs to be tested by setting these environment dnl variables.) dnl dnl Also sets PTHREAD_CC to any special C compiler that is needed for dnl multi-threaded programs (defaults to the value of CC otherwise). dnl (This is necessary on AIX to use the special cc_r compiler alias.) dnl dnl NOTE: You are assumed to not only compile your program with these dnl flags, but also link it with them as well. e.g. you should link dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS dnl $LIBS dnl dnl If you are only building threads programs, you may wish to use dnl these variables in your default LIBS, CFLAGS, and CC: dnl dnl LIBS="$PTHREAD_LIBS $LIBS" dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" dnl CC="$PTHREAD_CC" dnl dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). dnl dnl ACTION-IF-FOUND is a list of shell commands to run if a threads dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the dnl default action will define HAVE_PTHREAD. dnl dnl Please let the authors know if this macro fails on any platform, or dnl if you have any other suggestions or comments. This macro was based dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros dnl posted by Alejandro Forero Cuervo to the autoconf macro repository. dnl We are also grateful for the helpful feedback of numerous users. dnl dnl @category InstalledPackages dnl @author Steven G. Johnson dnl @version 2006-05-29 dnl @license GPLWithACException AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_TRY_LINK([#include ], [int attr=$attr; return attr;], [attr_name=$attr; break]) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD owfs-3.1p5/src/scripts/Makefile.am0000644000175000001440000000007512654730021014031 00000000000000SUBDIRS = usb windows systemd EXTRA_DIST = m4/acx_pthread.m4 owfs-3.1p5/src/scripts/Makefile.in0000644000175000001440000005505513022537054014053 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/scripts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = usb windows systemd EXTRA_DIST = m4/acx_pthread.m4 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) --foreign src/scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/src/scripts/usb/0000755000175000001440000000000013022537100012635 500000000000000owfs-3.1p5/src/scripts/usb/Makefile.am0000644000175000001440000000012112654730021014612 00000000000000SUBDIRS = windows cygwin EXTRA_DIST = Readme.txt fedora_setup.sh suse_setup.sh owfs-3.1p5/src/scripts/usb/Makefile.in0000644000175000001440000005511313022537054014637 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/scripts/usb ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = windows cygwin EXTRA_DIST = Readme.txt fedora_setup.sh suse_setup.sh 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) --foreign src/scripts/usb/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/scripts/usb/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/src/scripts/usb/Readme.txt0000644000175000001440000000021012654730021014513 00000000000000The owfs/src/scripts/usb directory tree contains sample scripts used in configuring and installing OWFS on differenct types of systems. owfs-3.1p5/src/scripts/usb/fedora_setup.sh0000755000175000001440000000362312654730021015607 00000000000000#!/bin/sh # # $Id$ # OWFS setup routines for SUSE systems # Written by Paul Alfille and others. # udev routines by Peter Kropf # GPL v2 license (like all of OWFS) # copyrite 12/2006 Paul H Alfille # ### ------------------ ### -- Constants ----- ### ------------------ OWFS_GROUP=ow # # ### ----------------- ### -- Group -------- ### ----------------- groupadd $OWFS_GROUP # ### ----------------- ### -- Links -------- ### ----------------- # Put all the ninaries in /usr/bin # make them part of the "ow" group # and let only their owner and group read or execute them OWFS_bin="owfs owhttpd owftpd owserver owread owwrite owpresent owdir" for x in $OWFS_bin do ln -sfv /opt/owfs/bin/$x /usr/bin/$x done # ### ----------------- ### -- Rules -------- ### ----------------- cat >/etc/udev/rules.d/46_ds2490.rules << RULES BUS=="usb", ACTION=="add", SYSFS{idVendor}=="04fa", SYSFS{idProduct}=="2490", \ PROGRAM="/bin/sh -c 'K=%k; K=\$\${K#usbdev}; printf bus/usb/%%03i/%%03i \$\${K%%%%.*} \$\${K#*.}'", \ NAME="%c", MODE="0664", RUN+="/etc/udev/ds2490 '%c'" RULES # ### ----------------- ### -- Shell -------- ### ----------------- cat >/etc/udev/ds2490 << SHELL #! /bin/sh -x /sbin/rmmod ds9490r MATCH="no" if [ "\$1" != "" ]; then if [ -f /proc/\$1 ]; then chgrp $OWFS_GROUP /proc/\$1 && \ chmod g+rw /proc/\$1 && \ logger ow udev: group set to $OWFS_GROUP and permission g+rw on /proc/\$1 MATCH="yes" fi if [ -e /dev/\$1 ]; then chgrp $OWFS_GROUP /dev/\$1 && \ chmod g+rw /dev/\$1 && \ logger ow udev: group set to $OWFS_GROUP and permission g+rw on /dev/\$1 MATCH="yes" fi fi if [ "\$MATCH" = "no" ]; then echo ow udev: no device file found for "\$1" logger ow udev: no device file found for "\$1" fi SHELL chmod 755 /etc/udev/ds2490 owfs-3.1p5/src/scripts/usb/suse_setup.sh0000644000175000001440000000352012654730021015317 00000000000000#!/bin/sh # # $Id$ # OWFS setup routines for SUSE systems # Written by Paul Alfille and others. # udev routines by Peter Kropf # GPL v2 license (like all of OWFS) # copyrite 12/2006 Paul H Alfille # ### ------------------ ### -- Constants ----- ### ------------------ OWFS_GROUP=ow # # ### ----------------- ### -- Group -------- ### ----------------- groupadd $OWFS_GROUP # ### ----------------- ### -- Links -------- ### ----------------- # Put all the ninaries in /usr/bin # make them part of the "ow" group # and let only their owner and group read or execute them OWFS_bin="owfs owhttpd owftpd owserver owread owwrite owpresent owdir" for x in $OWFS_bin do ln -sfv /opt/owfs/bin/$x /usr/bin/$x done # ### ----------------- ### -- Rules -------- ### ----------------- cat >/etc/udev/rules.d/46_ds2490.rules << RULES BUS=="usb", SYSFS=="04fa", SYSFS=="2490", GROUP="users", MODE="0774", PROGRAM="/bin/sh -c 'K=%k; K=\$\$; printf bus/usb/%%03i/%%03i \$\$ \$\$'", NAME="%c", RUN="/etc/udev/ds2490 '%c'" RULES # ### ----------------- ### -- Shell -------- ### ----------------- cat >/etc/udev/ds2490 << SHELL #! /bin/sh -x /sbin/rmmod ds9490r MATCH="no" if [ "\$1" != "" ]; then if [ -f /proc/\$1 ]; then chgrp $OWFS_GROUP /proc/\$1 && \ chmod g+rw /proc/\$1 && \ logger ow udev: group set to $OWFS_GROUP and permission g+rw on /proc/\$1 MATCH="yes" fi if [ -e /dev/\$1 ]; then chgrp $OWFS_GROUP /dev/\$1 && \ chmod g+rw /dev/\$1 && \ logger ow udev: group set to $OWFS_GROUP and permission g+rw on /dev/\$1 MATCH="yes" fi fi if [ "\$MATCH" = "no" ]; then echo ow udev: no device file found for "\$1" logger ow udev: no device file found for "\$1" fi SHELL chmod 755 /etc/udev/ds2490 owfs-3.1p5/src/scripts/usb/windows/0000755000175000001440000000000013022537100014327 500000000000000owfs-3.1p5/src/scripts/usb/windows/Makefile.am0000644000175000001440000000043012654730021016307 00000000000000 EXTRA_DIST = ds9490.inf ds9490.cat README.txt #ds9490windriversdir = ${prefix}/drivers #ds9490windrivers_DATA = ds9490.inf ds9490.cat README.txt #install-ds9490windrivers-local: # @INSTALL@ -d ${DESTDIR}${prefix}/drivers # @INSTALL@ ${EXTRA_DIST} ${DESTDIR}${prefix}/drivers/ owfs-3.1p5/src/scripts/usb/windows/Makefile.in0000644000175000001440000004107513022537054016333 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/scripts/usb/windows ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = ds9490.inf ds9490.cat README.txt 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) --foreign src/scripts/usb/windows/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/scripts/usb/windows/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am 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 clean-libtool 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 mostlyclean-libtool 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 clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile #ds9490windriversdir = ${prefix}/drivers #ds9490windrivers_DATA = ds9490.inf ds9490.cat README.txt #install-ds9490windrivers-local: # @INSTALL@ -d ${DESTDIR}${prefix}/drivers # @INSTALL@ ${EXTRA_DIST} ${DESTDIR}${prefix}/drivers/ # 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: owfs-3.1p5/src/scripts/usb/windows/ds9490.inf0000755000175000001440000000415412654730021015717 00000000000000[Version] Signature = "$Chicago$" provider = %manufacturer% DriverVer = 04/15/2006,0.1.10.1 CatalogFile = ds9490.cat Class = LibUsbDevices ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567} [ClassInstall] AddReg=ClassInstall.AddReg [ClassInstall32] AddReg=ClassInstall.AddReg [ClassInstall.AddReg] HKR,,,,"LibUSB-Win32 Devices" HKR,,Icon,,"-20" [Manufacturer] %manufacturer%=Devices ;-------------------------------------------------------------------------- ; Files ;-------------------------------------------------------------------------- [SourceDisksNames] 1 = "Libusb-Win32 Driver Installation Disk",, [SourceDisksFiles] libusb0.sys = 1,, libusb0.dll = 1,, [DestinationDirs] LIBUSB.Files.Sys = 10,System32\Drivers LIBUSB.Files.Dll = 10,System32 [LIBUSB.Files.Sys] libusb0.sys [LIBUSB.Files.Dll] libusb0.dll ;-------------------------------------------------------------------------- ; Device driver ;-------------------------------------------------------------------------- [LIBUSB_DEV] CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll AddReg = LIBUSB_DEV.AddReg [LIBUSB_DEV.NT] CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll [LIBUSB_DEV.HW] DelReg = LIBUSB_DEV.DelReg.HW [LIBUSB_DEV.NT.HW] DelReg = LIBUSB_DEV.DelReg.HW [LIBUSB_DEV.NT.Services] AddService = libusb0, 0x00000002, LIBUSB.AddService [LIBUSB_DEV.AddReg] HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,libusb0.sys [LIBUSB_DEV.DelReg.HW] HKR,,"LowerFilters" ;-------------------------------------------------------------------------- ; Services ;-------------------------------------------------------------------------- [LIBUSB.AddService] DisplayName = "LibUsb-Win32 - Kernel Driver 04/15/2006, 0.1.10.1" ServiceType = 1 StartType = 3 ErrorControl = 0 ServiceBinary = %12%\libusb0.sys ;-------------------------------------------------------------------------- ; Devices ;-------------------------------------------------------------------------- [Devices] "DS9490 1-Wire USB adapter"=LIBUSB_DEV, USB\VID_04fa&PID_2490 [Strings] manufacturer = "Maxim/Dallas" owfs-3.1p5/src/scripts/usb/windows/ds9490.cat0000755000175000001440000000025012654730021015703 00000000000000This file will contain the digital signature of the files to be installed on the system. This file will be provided by Microsoft upon certification of your drivers. owfs-3.1p5/src/scripts/usb/windows/README.txt0000644000175000001440000000214412654730021015755 00000000000000 Some instructions how to install and use OWFS on Windows (without Cygwin). (This file is NOT complete yet...) Download and install libusb-win32-filter-bin-0.1.10.1.exe # testlibusb-win.exe This will check if libusb-win32 works. Download the OWFS Windows binary package. # unpack owfs-2.5p4_windows.tar.gz # C: # cd \owfs total 0 drwxr-xr-x+ 2 Mag Ingen 0 Oct 19 11:27 bin drwxr-xr-x+ 2 Mag Ingen 0 Oct 19 11:55 drivers drwxr-xr-x+ 2 Mag Ingen 0 Oct 19 11:28 include drwxr-xr-x+ 2 Mag Ingen 0 Oct 19 11:28 lib drwxr-xr-x+ 6 Mag Ingen 0 Oct 15 09:54 man Plugin the DS9490 USB-adapter. Manually install the driver by choosing C:\owfs\drivers\ds9490.inf You will be asked to point out the location of the files: C:\windows\system32\drivers\libusb0.sys C:\windows\system32\libusb0.dll You will now see your "DS9490 1-Wire USB Adapter" in your device list. # owserver.exe -u -p 3000 # owhttpd.exe -s 3000 -p 3001 # owdir.exe -s 3000 / bus.0 settings system statistics /10.94C7ED000800 /81.465723000000 /37.11A401000000 Visit the web-page http://127.0.0.1:3001/ to see the 1-Wire devices in your web-browser. owfs-3.1p5/src/scripts/usb/cygwin/0000755000175000001440000000000013022537100014135 500000000000000owfs-3.1p5/src/scripts/usb/cygwin/Makefile.am0000644000175000001440000000100012654730021016107 00000000000000 EXTRA_DIST = ds9490.inf ds9490.cat README.txt if HAVE_CYGWIN ds9490cygdriversdir = ${prefix}/drivers ds9490cygdrivers_DATA = ds9490.inf ds9490.cat README.txt install-data-local: @INSTALL@ -d ${DESTDIR}${bindir} -if test -f /bin/cygwin1.dll; then \ @INSTALL@ /bin/cygwin1.dll ${DESTDIR}${bindir}/ ; \ fi -if test -f /bin/cygusb0.dll; then \ @INSTALL@ /bin/cygusb0.dll ${DESTDIR}${bindir}/ ; \ fi # @INSTALL@ -d ${DESTDIR}${prefix}/drivers # @INSTALL@ ${EXTRA_DIST} ${DESTDIR}${prefix}/drivers/ endif owfs-3.1p5/src/scripts/usb/cygwin/Makefile.in0000644000175000001440000004657213022537054016150 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/scripts/usb/cygwin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(ds9490cygdriversdir)" DATA = $(ds9490cygdrivers_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = ds9490.inf ds9490.cat README.txt @HAVE_CYGWIN_TRUE@ds9490cygdriversdir = ${prefix}/drivers @HAVE_CYGWIN_TRUE@ds9490cygdrivers_DATA = ds9490.inf ds9490.cat README.txt 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) --foreign src/scripts/usb/cygwin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/scripts/usb/cygwin/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-ds9490cygdriversDATA: $(ds9490cygdrivers_DATA) @$(NORMAL_INSTALL) @list='$(ds9490cygdrivers_DATA)'; test -n "$(ds9490cygdriversdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ds9490cygdriversdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ds9490cygdriversdir)" || 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)$(ds9490cygdriversdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ds9490cygdriversdir)" || exit $$?; \ done uninstall-ds9490cygdriversDATA: @$(NORMAL_UNINSTALL) @list='$(ds9490cygdrivers_DATA)'; test -n "$(ds9490cygdriversdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ds9490cygdriversdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(ds9490cygdriversdir)"; 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." @HAVE_CYGWIN_FALSE@install-data-local: clean: clean-am clean-am: clean-generic clean-libtool 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-data-local install-ds9490cygdriversDATA 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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-ds9490cygdriversDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-ds9490cygdriversDATA 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-ds9490cygdriversDATA .PRECIOUS: Makefile @HAVE_CYGWIN_TRUE@install-data-local: @HAVE_CYGWIN_TRUE@ @INSTALL@ -d ${DESTDIR}${bindir} @HAVE_CYGWIN_TRUE@ -if test -f /bin/cygwin1.dll; then \ @HAVE_CYGWIN_TRUE@ @INSTALL@ /bin/cygwin1.dll ${DESTDIR}${bindir}/ ; \ @HAVE_CYGWIN_TRUE@ fi @HAVE_CYGWIN_TRUE@ -if test -f /bin/cygusb0.dll; then \ @HAVE_CYGWIN_TRUE@ @INSTALL@ /bin/cygusb0.dll ${DESTDIR}${bindir}/ ; \ @HAVE_CYGWIN_TRUE@ fi # @INSTALL@ -d ${DESTDIR}${prefix}/drivers # @INSTALL@ ${EXTRA_DIST} ${DESTDIR}${prefix}/drivers/ # 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: owfs-3.1p5/src/scripts/usb/cygwin/ds9490.inf0000755000175000001440000000415412654730021015525 00000000000000[Version] Signature = "$Chicago$" provider = %manufacturer% DriverVer = 04/15/2006,0.1.10.1 CatalogFile = ds9490.cat Class = LibUsbDevices ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567} [ClassInstall] AddReg=ClassInstall.AddReg [ClassInstall32] AddReg=ClassInstall.AddReg [ClassInstall.AddReg] HKR,,,,"LibUSB-Win32 Devices" HKR,,Icon,,"-20" [Manufacturer] %manufacturer%=Devices ;-------------------------------------------------------------------------- ; Files ;-------------------------------------------------------------------------- [SourceDisksNames] 1 = "Libusb-Win32 Driver Installation Disk",, [SourceDisksFiles] libusb0.sys = 1,, cygusb0.dll = 1,, [DestinationDirs] LIBUSB.Files.Sys = 10,System32\Drivers LIBUSB.Files.Dll = 10,System32 [LIBUSB.Files.Sys] libusb0.sys [LIBUSB.Files.Dll] cygusb0.dll ;-------------------------------------------------------------------------- ; Device driver ;-------------------------------------------------------------------------- [LIBUSB_DEV] CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll AddReg = LIBUSB_DEV.AddReg [LIBUSB_DEV.NT] CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll [LIBUSB_DEV.HW] DelReg = LIBUSB_DEV.DelReg.HW [LIBUSB_DEV.NT.HW] DelReg = LIBUSB_DEV.DelReg.HW [LIBUSB_DEV.NT.Services] AddService = libusb0, 0x00000002, LIBUSB.AddService [LIBUSB_DEV.AddReg] HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,libusb0.sys [LIBUSB_DEV.DelReg.HW] HKR,,"LowerFilters" ;-------------------------------------------------------------------------- ; Services ;-------------------------------------------------------------------------- [LIBUSB.AddService] DisplayName = "LibUsb-Win32 - Kernel Driver 04/15/2006, 0.1.10.1" ServiceType = 1 StartType = 3 ErrorControl = 0 ServiceBinary = %12%\libusb0.sys ;-------------------------------------------------------------------------- ; Devices ;-------------------------------------------------------------------------- [Devices] "DS9490 1-Wire USB adapter"=LIBUSB_DEV, USB\VID_04fa&PID_2490 [Strings] manufacturer = "Maxim/Dallas" owfs-3.1p5/src/scripts/usb/cygwin/ds9490.cat0000755000175000001440000000025012654730021015511 00000000000000This file will contain the digital signature of the files to be installed on the system. This file will be provided by Microsoft upon certification of your drivers. owfs-3.1p5/src/scripts/usb/cygwin/README.txt0000644000175000001440000000304412654730021015563 00000000000000 Some instructions how to install and use OWFS on Windows with Cygwin. Install Cygwin Install cygwin package libusb-win32-0.1.10.1-3) Easiest way is to use cygwin's setup.exe to download and install it. Source could be found at: http://brl.thefreecat.org/libusb-win32/ if you want to compile it by yourself. (haven't tried it myself) # /usr/sbin/libusb-install.exe This will install the Windows service called "Libusb-win32 daemon" # testlibusb This will check if libusb-win32 works. Download the OWFS Windows binary package. # tar -C/ -xvzf owfs-2.5p4_cygwin.tar.gz # ls -l /opt/owfs/ total 0 drwxr-xr-x+ 2 Mag Ingen 0 Oct 19 11:27 bin drwxr-xr-x+ 2 Mag Ingen 0 Oct 19 11:55 drivers drwxr-xr-x+ 2 Mag Ingen 0 Oct 19 11:28 include drwxr-xr-x+ 2 Mag Ingen 0 Oct 19 11:28 lib drwxr-xr-x+ 6 Mag Ingen 0 Oct 15 09:54 man Plugin the DS9490 USB-adapter. Manually install the driver by choosing C:\cygwin\opt\owfs\drivers\ds9490.inf You will be asked to point out the location of the files: C:\cygwin\lib\libusb\libusb0.sys C:\cygwin\usr\bin\cygusb0.dll Note: The reason to the different dll-prefix could be found here: http://comments.gmane.org/gmane.os.cygwin.applications/13209 You will now see your "DS9490 1-Wire USB Adapter" in your device list. # /opt/owfs/bin/owserver.exe -u -p 3000 # /opt/owfs/bin/owhttpd.exe -s 3000 -p 3001 # /opt/owfs/bin/owdir.exe -s 3000 / bus.0 settings system statistics /10.94C7ED000800 /81.465723000000 /37.11A401000000 Visit the web-page http://127.0.0.1:3001/ to see the 1-wire devices in your web-browser. owfs-3.1p5/src/scripts/windows/0000755000175000001440000000000013022537100013536 500000000000000owfs-3.1p5/src/scripts/windows/Makefile.am0000644000175000001440000000012512654730021015517 00000000000000 if HAVE_CYGWIN install-data-local: @INSTALL@ -d -m0755 ${DESTDIR}${bindir} endif owfs-3.1p5/src/scripts/windows/Makefile.in0000644000175000001440000004114713022537054015542 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/scripts/windows ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = owfs.nsi 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 $(srcdir)/owfs.nsi.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ 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) --foreign src/scripts/windows/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/scripts/windows/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): owfs.nsi: $(top_builddir)/config.status $(srcdir)/owfs.nsi.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am 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." @HAVE_CYGWIN_FALSE@install-data-local: clean: clean-am clean-am: clean-generic clean-libtool 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-data-local 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 mostlyclean-libtool 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 clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local 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 \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am .PRECIOUS: Makefile @HAVE_CYGWIN_TRUE@install-data-local: @HAVE_CYGWIN_TRUE@ @INSTALL@ -d -m0755 ${DESTDIR}${bindir} # 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: owfs-3.1p5/src/scripts/windows/owfs.nsi.in0000755000175000001440000001457112654730021015576 00000000000000# $Id$ # Part of the OWFS (One Wire Filesystem) # See http://www.owfs.org # Copyright 2006 Paul H Alfille # # Windows installer script # Using NSIS from Nullsoft # # file src/windows/owfs.nsi ######### # Interface ######### !include "MUI.nsh" # Use Logic Library to improve readability !include "LogicLib.nsh" ######### # Version ######### !ifndef VERSION !define VERSION '@VERSION@' !endif ######### # directories -- up from src/windows/scripts ######### !define ROOT_OWFS "..\..\.." !define OPTDIR "\cygwin\opt\owfs" !define ROOT_HOME "${ROOT_OWFS}\..\.." !define ROOT_CYGWIN "${ROOT_HOME}\.." !define ROOT_OWNET "$(ROOT_OWFS)\module\ownet" ######### # Install settings ######### SetCompressor /SOLID lzma SetOverwrite ifnewer CRCCheck on ######### # Name ######### Name "OWFS" Caption "OWFS (One Wire Filesystem) ${VERSION} Setup" BrandingText "One-Wire Filesystem http://www.owfs.org" Icon "owfs.ico" UninstallIcon "unowfs.ico" ######### # Location ######### # The default installation directory InstallDir $PROGRAMFILES\OWFS # Result !ifdef OUTFILE OutFile "${OUTFILE}" !else OutFile ${ROOT_OWFS}\owfs_${VERSION}.exe !endif InstType "Programs" InstType "Source" ######### # Pages ######### !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "${ROOT_OWFS}\COPYING" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH !define MUI_ABORTWARNING !insertmacro MUI_LANGUAGE "English" ######### # Kill running programs ######### Section "Terminate currently running OWFS programs" ExecWait '"tskill" "owdir"' ExecWait '"tskill" "owread"' ExecWait '"tskill" "owwrite"' ExecWait '"tskill" "owpresent"' ExecWait '"tskill" "owserver"' ExecWait '"tskill" "owhttpd"' ExecWait '"tskill" "owftpd"' SectionEnd ######### # Files ######### Section "OWFS program files" Bins SetDetailsPrint textonly DetailPrint "Installing OWFS Program Files..." SetDetailsPrint listonly SectionIn 1 2 RO SetOutPath $INSTDIR File /r "${OPTDIR}\*" File "*.ico" WriteUninstaller "$INSTDIR\owfs_uninstall.exe" WriteRegStr HKLM "Software\OWFS\Version" "String Value" "${VERSION}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OWFS" "DisplayName" "OWFS -- One Wire Filesystem" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OWFS" "UninstallString" '"$INSTDIR\owfs_uninstall.exe"' SetOutPath $INSTDIR\ownet File ..\..\..\module\ownet\python\ownet\* WriteRegStr HKLM "Software\Python\PythonCore\2.5\PythonPath\OWFS" "" '"$INSTDIR"' WriteRegStr HKLM "Software\Python\PythonCore\2.4.4\PythonPath\OWFS" "" '"$INSTDIR"' SectionEnd ######### # Start Menu ######### Section "Add to Start menu" SectionIn 1 CreateDirectory "$SMPROGRAMS\OWFS" Delete "$SMPROGRAMS\OWFS\owserver.lnk" Delete "$SMPROGRAMS\OWFS\owftpd.lnk" Delete "$SMPROGRAMS\OWFS\owhttpd.lnk" Delete "$SMPROGRAMS\OWFS\owfs_uninstall.lnk" CreateShortcut "$SMPROGRAMS\OWFS\owserver.lnk" "$INSTDIR\bin\owserver.exe" "" "$INSTDIR\owfs.ico" "" "" "" "OWFS ${VERSION} Server/Multiplexor" CreateShortcut "$SMPROGRAMS\OWFS\owftpd.lnk" "$INSTDIR\bin\owftpd.exe" "" "$INSTDIR\owfs.ico" "" "" "" "OWFS ${VERSION} FTP server" CreateShortcut "$SMPROGRAMS\OWFS\owhttpd.lnk" "$INSTDIR\bin\owhttpd.exe" "" "$INSTDIR\owfs.ico" "" "" "" "OWFS ${VERSION} Web server" CreateShortcut "$SMPROGRAMS\OWFS\owfs_uninstall.lnk" "$INSTDIR\owfs_uninstall.exe" "" "$INSTDIR\unowfs.ico" "" "" "" "Uninstall OWFS ${VERSION}" SectionEnd ######### # Desktop ######### Section "Add to Desktop" SectionIn 1 Delete "$DESKTOP\owserver.lnk" Delete "$DESKTOP\owftpd.lnk" Delete "$DESKTOP\owhttpd.lnk" Delete "$DESKTOP\owfs_uninstall.lnk" CreateShortcut "$DESKTOP\owserver.lnk" "$INSTDIR\bin\owserver.exe" "" "$INSTDIR\owfs.ico" "" "" "" "OWFS ${VERSION} Server/Multiplexor" CreateShortcut "$DESKTOP\owftpd.lnk" "$INSTDIR\bin\owftpd.exe" "" "$INSTDIR\owfs.ico" "" "" "" "OWFS ${VERSION} FTP server" CreateShortcut "$DESKTOP\owhttpd.lnk" "$INSTDIR\bin\owhttpd.exe" "" "$INSTDIR\owfs.ico" "" "" "" "OWFS ${VERSION} Web server" CreateShortcut "$DESKTOP\owfs_uninstall.lnk" "$INSTDIR\owfs_uninstall.exe" "" "$INSTDIR\unowfs.ico" "" "" "" "Uninstall OWFS ${VERSION}" SectionEnd ######### # USB driver ######### Section "USB (Universal Serial Bus) driver installation" SectionIn 1 MessageBox MB_OK "Going to Sourceforge for libusb-win32 installation." ExecShell "open" "http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/0.1.12.2/libusb-win32-filter-bin-0.1.12.2.exe/download" ExecWait 'rundll32 libusb0.dll,usb_install_driver_np_rundll $INSTDIR\driver\ds9490.inf' SectionEnd ######### # Bonjour ######### Section "Bonjour (zeroconf autodiscovery) installation" SectionIn 1 MessageBox MB_OK "Going to Apple site for Bonjour installation." ExecShell "open" "http://developer.apple.com/networking/bonjour/download/" SectionEnd ######### # Source ######### Section "OWFS source files" Source SectionIn 2 MessageBox MB_OK "Going to Sourceforge OWFS site for source file installation." ExecShell "open" "http://sourceforge.net/project/downloading.php?group_id=85502&filename=owfs-${VERSION}.zip" SectionEnd Section "USB Support Installation" MessageBox MB_OK "Going to LibUsb-Win32 site for installation." ExecShell "open" "http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/0.1.12.2/libusb-win32-src-0.1.12.2.tar.gz/download" SectionEnd Section "Cygwin Installation" MessageBox MB_OK "Going to RedHat's Cygwin site for installation." ExecShell "open" "http://www.cygwin.com" SectionEnd Section "Uninstall" RMDir /r /REBOOTOK $INSTDIR RMDir /r /REBOOTOK "$SMPROGRAMS\OWFS" Delete "$DESKTOP\owserver.lnk" Delete "$DESKTOP\owftpd.lnk" Delete "$DESKTOP\owhttpd.lnk" Delete "$DESKTOP\owfs_uninstall.lnk" DeleteRegKey HKLM "Software\OWFS\Version" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OWFS" DeleteRegKey HKLM "Software\Python\PythonCore\2.5\PythonPath\OWFS" DeleteRegKey HKLM "Software\Python\PythonCore\2.4.4\PythonPath\OWFS" SectionEnd owfs-3.1p5/src/scripts/systemd/0000755000175000001440000000000013022537100013534 500000000000000owfs-3.1p5/src/scripts/systemd/Makefile.am0000644000175000001440000000073312654730021015522 00000000000000systemdsystemunit_DATA = \ owfs.service \ owftpd.service \ owhttpd.service \ owserver.service \ owserver.socket CLEANFILES = $(systemdsystemunit_DATA) EXTRA_DIST = \ owfs.service.in \ owftpd.service.in \ owhttpd.service.in \ owserver.service.in \ owserver.socket.in do_subst = sed -e 's,[@]bindir[@],$(bindir),g' % :: %.in $(do_subst) < $(srcdir)/$< > $@ $(systemdsystemunit_DATA): Makefile owfs-3.1p5/src/scripts/systemd/Makefile.in0000644000175000001440000004625013022537054015540 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/scripts/systemd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)$(systemdsystemunitdir)" DATA = $(systemdsystemunit_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ systemdsystemunit_DATA = \ owfs.service \ owftpd.service \ owhttpd.service \ owserver.service \ owserver.socket CLEANFILES = $(systemdsystemunit_DATA) EXTRA_DIST = \ owfs.service.in \ owftpd.service.in \ owhttpd.service.in \ owserver.service.in \ owserver.socket.in do_subst = sed -e 's,[@]bindir[@],$(bindir),g' 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) --foreign src/scripts/systemd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/scripts/systemd/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-systemdsystemunitDATA: $(systemdsystemunit_DATA) @$(NORMAL_INSTALL) @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(systemdsystemunitdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" || 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)$(systemdsystemunitdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \ done uninstall-systemdsystemunitDATA: @$(NORMAL_UNINSTALL) @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(systemdsystemunitdir)"; 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 clean-libtool 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-systemdsystemunitDATA 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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-systemdsystemunitDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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 install-systemdsystemunitDATA installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-systemdsystemunitDATA .PRECIOUS: Makefile % :: %.in $(do_subst) < $(srcdir)/$< > $@ $(systemdsystemunit_DATA): 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: owfs-3.1p5/src/scripts/systemd/owfs.service.in0000644000175000001440000000042012711737666016444 00000000000000[Unit] Description=1-wire filesystem FUSE mount Documentation=man:owfs(1) [Service] Type=notify NotifyAccess=all ExecStart=@bindir@/owfs --server=127.0.0.1 --allow_other %t/owfs ExecStop=/usr/bin/umount %t/owfs RuntimeDirectory=owfs [Install] WantedBy=multi-user.target owfs-3.1p5/src/scripts/systemd/owftpd.service.in0000644000175000001440000000035712711737666017002 00000000000000[Unit] Description=Anonymous FTP server for 1-wire access Documentation=man:owftpd(1) [Service] Type=notify NotifyAccess=all ExecStart=@bindir@/owftpd --foreground --server=127.0.0.1 User=ow Group=ow [Install] WantedBy=multi-user.target owfs-3.1p5/src/scripts/systemd/owhttpd.service.in0000644000175000001440000000040712711737666017164 00000000000000[Unit] Description=Tiny webserver for 1-wire control Documentation=man:owhttpd(1) After=avahi-daemon.service [Service] Type=notify NotifyAccess=all ExecStart=@bindir@/owhttpd --foreground --server=127.0.0.1 User=ow Group=ow [Install] WantedBy=multi-user.target owfs-3.1p5/src/scripts/systemd/owserver.service.in0000644000175000001440000000037512711737666017353 00000000000000[Unit] Description=Backend server for 1-wire control Documentation=man:owserver(1) [Service] Type=notify NotifyAccess=all ExecStart=@bindir@/owserver --w1 Restart=on-failure #User=ow #Group=ow [Install] WantedBy=multi-user.target Also=owserver.socket owfs-3.1p5/src/scripts/systemd/owserver.socket.in0000644000175000001440000000021612654730021017155 00000000000000[Unit] Description=Listening socket for owserver Documentation=man:owserver(1) [Socket] ListenStream=4304 [Install] WantedBy=sockets.target owfs-3.1p5/src/Makefile.am0000644000175000001440000000004212654730021012334 00000000000000SUBDIRS = include man rpm scripts owfs-3.1p5/src/Makefile.in0000644000175000001440000005477213022537053012370 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include man rpm scripts 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) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign 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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/src/include/0000755000175000001440000000000013022537077012015 500000000000000owfs-3.1p5/src/include/Makefile.am0000644000175000001440000001053412711737666014006 00000000000000owfsincludedir = ${prefix}/include nodist_owfsinclude_HEADERS = owfs_config.h clean-generic: @RM@ -f *.o *.tmp *.cpp .*~ stamp-* lint_cmac.h lint_cppmac.h gcc-include-path.lnt size-options.lnt COMMON_GCC_OPTS:= $(COMMON_FLAGS) $(CPPFLAGS) -Wno-long-long # We want to enable 'long long' for the purpose of extracting the value of # 'sizeof(long long)'; see the 'size-options.lnt' target below. C_OPTS:= $(CFLAGS) $(COMMON_GCC_OPTS) CXX_OPTS:=$(CXXFLAGS) $(COMMON_GCC_OPTS) # Note, we're not *yet* able to handle some of the header contents when # -std=c++0x is given. GCC_BIN:=gcc GXX_BIN:=g++ GCC:=$(GCC_BIN) $(C_OPTS) #GXX:=$(GXX_BIN) $(CXX_OPTS) GXX:=$(GCC_BIN) $(C_OPTS) # We don't use any C++ code right now. TEMP_FILE_PREFIX:=co-gcc.mak.temp E:=$(TEMP_FILE_PREFIX)-empty SIZE_GEN:=$(TEMP_FILE_PREFIX)-generate-size-options ECHO:=echo TOUCH:=touch AWK:=awk lint_cmac.h: set -e ; $(TOUCH) $(E)$$$$.c ; $(GCC) -E -dM $(E)$$$$.c -o $@ ; $(RM) $(E)$$$$.c lint_cppmac.h: # set -e ; $(TOUCH) $(E)$$$$.c ; $(GXX) -E -dM $(E)$$$$.c -o $@ ; $(RM) $(E)$$$$.c set -e ; $(TOUCH) $(E)$$$$.cpp ; $(GXX) -E -dM $(E)$$$$.cpp -o $@ ; $(RM) $(E)$$$$.cpp gcc-include-path.lnt: @# Here we make options for the #include search path. @# Note, frameworks (a feature of Apple's GCC) are not supported @# yet so for now we filter them out. Each remaining search @# directory 'foo' is transformed into '--i"foo"' after @# superfluous directory separators are removed (as well as each @# CR character appearing immediately before a newline): $(TOUCH) $(E)$$$$.cpp ; \ $(GXX) -v -c $(E)$$$$.cpp >$(E)$$$$.tmp 2>&1 ; \ <$(E)$$$$.tmp $(AWK) ' \ BEGIN {S=0} \ /search starts here:/ {S=1;next;} \ S && /Library\/Frameworks/ {next;} \ S && /^ / { \ sub("^ ",""); \ gsub("//*","/"); \ sub("\xd$$",""); \ sub("/$$",""); \ printf("--i\"%s\"\n", $$0); \ next; \ } \ S {exit;} \ ' >gcc-include-path.lnt ; \ $(RM) $(E)$$$$.cpp $(E)$$$$.tmp $(E)$$$$.o @# Note, we deliberately use '--i' instead of '-i' here; the effect @# is that the directories named with the double-dash form are @# searched after directories named with the single-dash form. @# (See also the entry for '--i' in section 5.7 of the Lint @# manual.) @# @# We typically use '--i' when we want to name a system include @# directory, which GCC searches only after it searches all @# directories named in a '-I' option. The upshot is that the @# correct search order (i.e., project includes before system @# includes) is preserved even when double-dash-i options are given @# before single-dash-i options. @# @# Also note, no harm is done if '-I' options are passed to GCC @# here: directories named with '-I' will appear before the @# sys-include-dirs in GCC's output, so even though Lint might then @# see a project-include directory named with a '--i' option, that @# directory will still be searched before the sys-includes because @# of the ordering of '--i' options. (Just make sure you don't use @# the double-dash form with project include dirs outside of this @# limited & generated sub-sequence of options because this is the @# only place where we are certain that project directories always @# come before system directories.) @# @# XXX: We need to do something for people without an AWK @# implementation---hopefully not here, but perhaps we could @# provide an 'awk' with the Lint distro. size-options.lnt: @# 'echo' seems to vary in behavior with respect to its handling @# of '\n'. (Is it a newline, or a literal backslash followed by @# a literal 'n'? It seems to depend on your platform.) So we @# deliberately avoid the use of explicit newline characters here. @$(ECHO) '\ extern "C" int printf(const char*, ...);\ int main() {\ printf( "-ss%zu ", sizeof(short) );\ printf( "-si%zu ", sizeof(int) );\ printf( "-sl%zu ", sizeof(long) );\ printf( "-sll%zu ", sizeof(long long) );\ printf( "-sf%zu ", sizeof(float) );\ printf( "-sd%zu ", sizeof(double) );\ printf( "-sld%zu ", sizeof(long double) );\ printf( "-sp%zu ", sizeof(void*) );\ printf( "-sw%zu ", sizeof(wchar_t) );\ }' >$(SIZE_GEN).cc $(GCC) $(SIZE_GEN).cc -o $(SIZE_GEN) ./$(SIZE_GEN) >size-options.lnt @# ... and make it newline-terminated: @$(ECHO) "" >>size-options.lnt $(RM) $(SIZE_GEN)* html-am: lint_cmac.h lint_cppmac.h gcc-include-path.lnt size-options.lnt owfs-3.1p5/src/include/Makefile.in0000644000175000001440000006312613022537053014004 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = owfs_config.h 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)$(owfsincludedir)" HEADERS = $(nodist_owfsinclude_HEADERS) 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 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/owfs_config.h.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK := awk BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO := echo ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ owfsincludedir = ${prefix}/include nodist_owfsinclude_HEADERS = owfs_config.h COMMON_GCC_OPTS := $(COMMON_FLAGS) $(CPPFLAGS) -Wno-long-long # We want to enable 'long long' for the purpose of extracting the value of # 'sizeof(long long)'; see the 'size-options.lnt' target below. C_OPTS := $(CFLAGS) $(COMMON_GCC_OPTS) CXX_OPTS := $(CXXFLAGS) $(COMMON_GCC_OPTS) # Note, we're not *yet* able to handle some of the header contents when # -std=c++0x is given. GCC_BIN := gcc GXX_BIN := g++ GCC := $(GCC_BIN) $(C_OPTS) #GXX:=$(GXX_BIN) $(CXX_OPTS) GXX := $(GCC_BIN) $(C_OPTS) # We don't use any C++ code right now. TEMP_FILE_PREFIX := co-gcc.mak.temp E := $(TEMP_FILE_PREFIX)-empty SIZE_GEN := $(TEMP_FILE_PREFIX)-generate-size-options TOUCH := touch all: config.h $(MAKE) $(AM_MAKEFLAGS) 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) --foreign src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 src/include/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 owfs_config.h: $(top_builddir)/config.status $(srcdir)/owfs_config.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_owfsincludeHEADERS: $(nodist_owfsinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_owfsinclude_HEADERS)'; test -n "$(owfsincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(owfsincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(owfsincludedir)" || 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_HEADER) $$files '$(DESTDIR)$(owfsincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(owfsincludedir)" || exit $$?; \ done uninstall-nodist_owfsincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_owfsinclude_HEADERS)'; test -n "$(owfsincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(owfsincludedir)'; $(am__uninstall_files_from_dir) 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: $(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 $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(owfsincludedir)"; 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: 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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-nodist_owfsincludeHEADERS 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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nodist_owfsincludeHEADERS .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-hdr distclean-libtool \ 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-nodist_owfsincludeHEADERS install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-nodist_owfsincludeHEADERS .PRECIOUS: Makefile clean-generic: @RM@ -f *.o *.tmp *.cpp .*~ stamp-* lint_cmac.h lint_cppmac.h gcc-include-path.lnt size-options.lnt lint_cmac.h: set -e ; $(TOUCH) $(E)$$$$.c ; $(GCC) -E -dM $(E)$$$$.c -o $@ ; $(RM) $(E)$$$$.c lint_cppmac.h: # set -e ; $(TOUCH) $(E)$$$$.c ; $(GXX) -E -dM $(E)$$$$.c -o $@ ; $(RM) $(E)$$$$.c set -e ; $(TOUCH) $(E)$$$$.cpp ; $(GXX) -E -dM $(E)$$$$.cpp -o $@ ; $(RM) $(E)$$$$.cpp gcc-include-path.lnt: @# Here we make options for the #include search path. @# Note, frameworks (a feature of Apple's GCC) are not supported @# yet so for now we filter them out. Each remaining search @# directory 'foo' is transformed into '--i"foo"' after @# superfluous directory separators are removed (as well as each @# CR character appearing immediately before a newline): $(TOUCH) $(E)$$$$.cpp ; \ $(GXX) -v -c $(E)$$$$.cpp >$(E)$$$$.tmp 2>&1 ; \ <$(E)$$$$.tmp $(AWK) ' \ BEGIN {S=0} \ /search starts here:/ {S=1;next;} \ S && /Library\/Frameworks/ {next;} \ S && /^ / { \ sub("^ ",""); \ gsub("//*","/"); \ sub("\xd$$",""); \ sub("/$$",""); \ printf("--i\"%s\"\n", $$0); \ next; \ } \ S {exit;} \ ' >gcc-include-path.lnt ; \ $(RM) $(E)$$$$.cpp $(E)$$$$.tmp $(E)$$$$.o @# Note, we deliberately use '--i' instead of '-i' here; the effect @# is that the directories named with the double-dash form are @# searched after directories named with the single-dash form. @# (See also the entry for '--i' in section 5.7 of the Lint @# manual.) @# @# We typically use '--i' when we want to name a system include @# directory, which GCC searches only after it searches all @# directories named in a '-I' option. The upshot is that the @# correct search order (i.e., project includes before system @# includes) is preserved even when double-dash-i options are given @# before single-dash-i options. @# @# Also note, no harm is done if '-I' options are passed to GCC @# here: directories named with '-I' will appear before the @# sys-include-dirs in GCC's output, so even though Lint might then @# see a project-include directory named with a '--i' option, that @# directory will still be searched before the sys-includes because @# of the ordering of '--i' options. (Just make sure you don't use @# the double-dash form with project include dirs outside of this @# limited & generated sub-sequence of options because this is the @# only place where we are certain that project directories always @# come before system directories.) @# @# XXX: We need to do something for people without an AWK @# implementation---hopefully not here, but perhaps we could @# provide an 'awk' with the Lint distro. size-options.lnt: @# 'echo' seems to vary in behavior with respect to its handling @# of '\n'. (Is it a newline, or a literal backslash followed by @# a literal 'n'? It seems to depend on your platform.) So we @# deliberately avoid the use of explicit newline characters here. @$(ECHO) '\ extern "C" int printf(const char*, ...);\ int main() {\ printf( "-ss%zu ", sizeof(short) );\ printf( "-si%zu ", sizeof(int) );\ printf( "-sl%zu ", sizeof(long) );\ printf( "-sll%zu ", sizeof(long long) );\ printf( "-sf%zu ", sizeof(float) );\ printf( "-sd%zu ", sizeof(double) );\ printf( "-sld%zu ", sizeof(long double) );\ printf( "-sp%zu ", sizeof(void*) );\ printf( "-sw%zu ", sizeof(wchar_t) );\ }' >$(SIZE_GEN).cc $(GCC) $(SIZE_GEN).cc -o $(SIZE_GEN) ./$(SIZE_GEN) >size-options.lnt @# ... and make it newline-terminated: @$(ECHO) "" >>size-options.lnt $(RM) $(SIZE_GEN)* html-am: lint_cmac.h lint_cppmac.h gcc-include-path.lnt size-options.lnt # 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: owfs-3.1p5/src/include/config.h.in0000644000175000001440000002345013022537077013764 00000000000000/* src/include/config.h.in. Generated from configure.ac by autoheader. */ #ifndef OWCONFIG_H #define OWCONFIG_H /* Define to 1 if you have the `accept' function. */ #undef HAVE_ACCEPT /* Have AF_NETLINK in socket.h */ #undef HAVE_AF_NETLINK /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_ASM_TYPES_H /* Broken glibc implementations use __ss_family instead of ss_family. */ #undef HAVE_BROKEN_SS_FAMILY /* Define to 1 if you have the `daemon' function. */ #undef HAVE_DAEMON /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if you have dlopen */ #undef HAVE_DLOPEN /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FEATURES_H /* Define to 1 if you have the header file. */ #undef HAVE_FEATURE_TESTS_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `freeaddrinfo' function. */ #undef HAVE_FREEADDRINFO /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `gethostbyaddr_r' function. */ #undef HAVE_GETHOSTBYADDR_R /* Define to 1 if you have the `gethostbyname2_r' function. */ #undef HAVE_GETHOSTBYNAME2_R /* Define to 1 if you have the `gethostbyname_r' function. */ #undef HAVE_GETHOSTBYNAME_R /* Define to 1 if you have the `getline' function. */ #undef HAVE_GETLINE /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `getservbyname_r' function. */ #undef HAVE_GETSERVBYNAME_R /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `gmtime_r' function. */ #undef HAVE_GMTIME_R /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the `inet_pton' function. */ #undef HAVE_INET_PTON /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `launch_activate_socket' function. */ #undef HAVE_LAUNCH_ACTIVATE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_TYPES_H /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define if you have lrint */ #undef HAVE_LRINT /* Define to 1 if you have the `memchr' function. */ #undef HAVE_MEMCHR /* 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 if you have nanosleep */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_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 if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_RESOLV_H /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the header file. */ #undef HAVE_SEMAPHORE_H /* Define to 1 if you have the sem_timedwait function. */ #undef HAVE_SEM_TIMEDWAIT /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* 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_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 `strftime' function. */ #undef HAVE_STRFTIME /* 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 `strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if the system has the type `struct addrinfo'. */ #undef HAVE_STRUCT_ADDRINFO /* Define to 1 if the system has the type `struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EVENT_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_INOTIFY_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_MKDEV_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_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_TIMES_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_UIO_H /* Define to 1 if you have the `tdelete' function. */ #undef HAVE_TDELETE /* Define to 1 if you have the `tdestroy' function. */ #undef HAVE_TDESTROY /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the `tfind' function. */ #undef HAVE_TFIND /* Define to 1 if you have the `tsearch' function. */ #undef HAVE_TSEARCH /* Define to 1 if you have the `twalk' function. */ #undef HAVE_TWALK /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF /* 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 you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the `vsprintf' function. */ #undef HAVE_VSPRINTF /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if you have the `writev' function. */ #undef HAVE_WRITEV /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define if ipv6 support is present and available. */ #undef IPV6 /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if your system has no in6addr_any. */ #undef NO_IN6ADDR_ANY /* 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 necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define to 1 if sockaddr_in has a 'sin_len' member. */ #undef SOCKADDR_IN_HAS_LEN /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if string.h may be included along with strings.h */ #undef STRING_WITH_STRINGS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define on Darwin to activate all library features */ #undef _DARWIN_C_SOURCE /* No ipv6 support available. */ #undef __HAS_IPV6__ /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* If we do not have a real socklen_t, unsigned int is good enough. */ #undef socklen_t /* Define as `fork' if `vfork' does not work. */ #undef vfork #endif owfs-3.1p5/src/include/owfs_config.h.in0000644000175000001440000000640112672234566015026 00000000000000/* OW -- One-Wire filesystem Function naming scheme: OW -- Generic call to interaface LI -- LINK commands L1 -- 2480B commands FS -- filesystem commands UT -- utility functions Written 2003 Paul H Alfille Fuse code based on "fusexmp" {GPL} by Miklos Szeredi, mszeredi@inf.bme.hu Serial code based on "xt" {GPL} by David Querbach, www.realtime.bc.ca in turn based on "miniterm" by Sven Goldt, goldt@math.tu.berlin.de GPL license 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. Other portions based on Dallas Semiconductor Public Domain Kit, --------------------------------------------------------------------------- Copyright (C) 2000 Dallas Semiconductor Corporation, All Rights Reserved. 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 DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. --------------------------------------------------------------------------- */ #ifndef OWFS_CONFIG_H #define OWFS_CONFIG_H /* This file describes the version and features of the owfs-installation. */ #define OWFS_VERSION "@VERSION@" #define OWFS_MAJOR "@VERSION_MAJOR@" #define OWFS_MINOR "@VERSION_MINOR@" #define OWFS_PATCHLEVEL "@VERSION_PATCHLEVEL@" #define OW_ALLOC_DEBUG @OW_ALLOC_DEBUG@ #define OW_USB @OW_USB@ #define OW_AVAHI @OW_AVAHI@ #define OW_PARPORT @OW_PARPORT@ #define OW_FTDI @OW_FTDI@ #define OW_DEBUG @OW_DEBUG@ #define OW_MUTEX_DEBUG @OW_MUTEX_DEBUG@ #define OW_W1 @OW_W1@ #define OW_I2C @OW_I2C@ #define OW_ZERO @OW_ZERO@ #define OW_CYGWIN @OW_CYGWIN@ #define OW_DARWIN @OW_DARWIN@ #endif /* OWFS_CONFIG_H */ owfs-3.1p5/src/man/0000755000175000001440000000000013022537100011130 500000000000000owfs-3.1p5/src/man/Makefile.am0000644000175000001440000000003612654730021013112 00000000000000SUBDIRS = man1 man3 man5 mann owfs-3.1p5/src/man/Makefile.in0000644000175000001440000005501113022537053013126 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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 \ distdir 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 \ $(top_srcdir)/src/scripts/install/mkinstalldirs README 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = man1 man3 man5 mann 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) --foreign src/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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: $(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 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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ 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-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags 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: owfs-3.1p5/src/man/README0000644000175000001440000000174612654730021011747 00000000000000** Layout All man pages are stored in their respective section directories: man{1,3,5,n}. File extensions: .man : man page sources .1so, .3so, .5so, .nso : files to be included via .so requests .1 .3 .5 .n : man pages that point to an existing man page via a single .so request ** Operation: 'make' will run 'soelim' to build complete man pages (with the correct '.1' up to '.n' externsion) form '.man' sources 'make install' will install the buit man pages. If 'soelim' is not available, 'make install' will simply rename '.man' files to the correct man section extension ('.1' '.3' '.5' '.n') and install them along with '.*so' files. ** Notes According to man conventions, all .so requests must be relative to the parent 'man' directory, e.g. '.so man1/seealso.1so' To read a man page before installation one can run from the parent directory: 'man -M . owserver' (if soelim has already been run) or 'man -l man1/owserver.man' owfs-3.1p5/src/man/man1/0000755000175000001440000000000013022537077012001 500000000000000owfs-3.1p5/src/man/man1/Makefile.am0000644000175000001440000000156712665167763014003 00000000000000## man sources MANFILES = \ owcapi.man owfs.man owftpd.man owhttpd.man owmon.man ownet.man \ owserver.man owshell.man owtap.man ## .so includes SOFILES = \ cmdline_mini.1so configuration.1so description.1so \ device.1so format.1so help.1so job_control.1so \ persistent_thresholds.1so pressure.1so seealso.1so temperature.1so \ timeout.1so ## man files that need no preprocessing dist_man1_MANS = \ libowcapi.1 \ owdir.1 owget.1 owread.1 owwrite.1 owpresent.1 owexist.1 \ ownetapi.1 ownetlib.1 libownet.1 ## file to include in distribution EXTRA_DIST = $(SOFILES) $(MANFILES) if SOELIM man1_MANS = $(addsuffix .1,$(basename $(MANFILES))) CLEANFILES = $(man1_MANS) # preproc man pages via soelim $(man1_MANS): $(MANFILES) $(SOFILES) %.1 :: %.man $(SOELIM) -r -I $(srcdir)/.. $< > $@ else !SOELIM man1_MANS = $(MANFILES) $(SOFILES) endif !SOELIM owfs-3.1p5/src/man/man1/libowcapi.10000644000175000001440000000002212654730021013740 00000000000000.so man1/owcapi.1 owfs-3.1p5/src/man/man1/owdir.10000644000175000001440000000002312654730021013114 00000000000000.so man1/owshell.1 owfs-3.1p5/src/man/man1/owget.10000644000175000001440000000002312654730021013115 00000000000000.so man1/owshell.1 owfs-3.1p5/src/man/man1/owread.10000644000175000001440000000002312654730021013251 00000000000000.so man1/owshell.1 owfs-3.1p5/src/man/man1/owwrite.10000644000175000001440000000002312654730021013470 00000000000000.so man1/owshell.1 owfs-3.1p5/src/man/man1/owpresent.10000644000175000001440000000002312654730021014016 00000000000000.so man1/owshell.1 owfs-3.1p5/src/man/man1/owexist.10000644000175000001440000000002212665167763013514 00000000000000.so man1/owshell.1owfs-3.1p5/src/man/man1/ownetapi.10000644000175000001440000000002112654730021013614 00000000000000.so man1/ownet.1 owfs-3.1p5/src/man/man1/ownetlib.10000644000175000001440000000002112654730021013611 00000000000000.so man1/ownet.1 owfs-3.1p5/src/man/man1/libownet.10000644000175000001440000000002112654730021013611 00000000000000.so man1/ownet.1 owfs-3.1p5/src/man/man1/Makefile.in0000644000175000001440000005024513022537053013766 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/man/man1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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)" NROFF = nroff MANS = $(dist_man1_MANS) $(man1_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MANFILES = \ owcapi.man owfs.man owftpd.man owhttpd.man owmon.man ownet.man \ owserver.man owshell.man owtap.man SOFILES = \ cmdline_mini.1so configuration.1so description.1so \ device.1so format.1so help.1so job_control.1so \ persistent_thresholds.1so pressure.1so seealso.1so temperature.1so \ timeout.1so dist_man1_MANS = \ libowcapi.1 \ owdir.1 owget.1 owread.1 owwrite.1 owpresent.1 owexist.1 \ ownetapi.1 ownetlib.1 libownet.1 EXTRA_DIST = $(SOFILES) $(MANFILES) @SOELIM_FALSE@man1_MANS = $(MANFILES) $(SOFILES) @SOELIM_TRUE@man1_MANS = $(addsuffix .1,$(basename $(MANFILES))) @SOELIM_TRUE@CLEANFILES = $(man1_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) --foreign src/man/man1/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/man/man1/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man1_MANS) $(man1_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man1_MANS) $(man1_MANS)'; \ list2=''; \ 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='$(dist_man1_MANS) $(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | 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) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -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 clean-libtool 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-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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man1 .PRECIOUS: Makefile # preproc man pages via soelim @SOELIM_TRUE@$(man1_MANS): $(MANFILES) $(SOFILES) @SOELIM_TRUE@%.1 :: %.man @SOELIM_TRUE@ $(SOELIM) -r -I $(srcdir)/.. $< > $@ # 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: owfs-3.1p5/src/man/man1/cmdline_mini.1so0000644000175000001440000000056112654730021014770 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" [ .I \-c config ] .I \-d serialport | .I \-u | .I \-s [host:]port owfs-3.1p5/src/man/man1/configuration.1so0000644000175000001440000000066612654730021015216 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SH CONFIGURATION FILE .SS -c file | --configuration file Name of an .B owfs (5) configuration file with more command line parameters owfs-3.1p5/src/man/man1/description.1so0000644000175000001440000000373712665167763014717 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SS 1-Wire .I 1-wire is a wiring protocol and series of devices designed and manufactured by Dallas Semiconductor, Inc. The bus is a low-power low-speed low-connector scheme where the data line can also provide power. .PP Each device is uniquely and unalterably numbered during manufacture. There are a wide variety of devices, including memory, sensors (humidity, temperature, voltage, contact, current), switches, timers and data loggers. More complex devices (like thermocouple sensors) can be built with these basic devices. There are also 1-wire devices that have encryption included. .PP The 1-wire scheme uses a single .I bus master and multiple .I slaves on the same wire. The bus master initiates all communication. The slaves can be individually discovered and addressed using their unique ID. .PP Bus masters come in a variety of configurations including serial, parallel, i2c, network or USB adapters. .SS OWFS design .I OWFS is a suite of programs that designed to make the 1-wire bus and its devices easily accessible. The underlying principle is to create a virtual filesystem, with the unique ID being the directory, and the individual properties of the device are represented as simple files that can be read and written. .PP Details of the individual slave or master design are hidden behind a consistent interface. The goal is to provide an easy set of tools for a software designer to create monitoring or control applications. There are some performance enhancements in the implementation, including data caching, parallel access to bus masters, and aggregation of device communication. Still the fundemental goal has been ease of use, flexibility and correctness rather than speed. owfs-3.1p5/src/man/man1/device.1so0000644000175000001440000002374012672234566013621 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SH "Device Options (1-wire Bus Master)" These options specify the device (bus master) connecting the computer to the 1-wire bus. The 1-wire slaves are connected to the 1-wire bus, and the bus master connects to a port on the computer and controls the 1-wire bus. The bus master is either an actual physical device, the kernel w1 module, or an .B owserver (1). .P At least one device option is required. There is no default. More than one device can be listed, and all will be used. (A logical union unless you explore the \fI/bus.n/\fR directories.) .P Linux and BSD enforce a security policy restricting access to hardware ports. You must have sufficient rights to access the given port or access will silently fail. .SH "* Serial devices" .I port specifies a serial port, e.g. .I /dev/ttyS0 .P If OWFS was built with \fBlibftdi\fR support, you may be able to use the .I ftdi: prefix to address a FTDI-based USB device. .br For details, see the FTDI ADDRESSING section. .TP \fI-d port\fI \fR|\fR \fI--device=port\fI \fB(DS2480B)\fB DS2480B-based bus master (like the DS9097U or the LINK in emulation mode). If the adapter doesn't respond, a passive type (DS9907E or diode/resistor) circuit will be assumed. .TP .I --serial_flextime | --serial_regulartime \fB(DS2480B)\fB .br Changes details of bus timing (see DS2480B datasheet). Some devices, like the .I Swart LCD cannot work with .I flextime. .TP \fI--baud=\fI\fR1200|9600|19200|38400|57600|115200\fR \fB(DS2480B,LINK,HA5)\fB Sets the initial serial port communication speed for all bus masters. Not all serial devices support all speeds. You can change the individual bus master speed for the .B LINK and .B DS2880B in the interface/settings directory. The .B HA5 speed is set in hardware, so the command line buad rate should match that rate. .br Usually the default settings (9600 for .B LINK and .B DS2480B ) and 115200 for the .B HA5 are sane and shouldn't be changed. .TP \fI--straight_polarity\fI \fR|\fR \fI--reverse_polarity\fI \fB(DS2480B)\fB Reverse polarity of the DS2480B output transistors? Not needed for the DS9097U, but required for some other designs. .TP \fI--link=port\fI \fB(LINK)\fB .B iButtonLink .I LINK adapter (all versions) in non-emulation mode. Uses an ascii protocol over serial. .br This supports the simplified \fIftdi:\fB\fR addressing scheme. .TP \fI--ha7e=port\fI \fB(HA7E)\fB .B Embedded Data Systems .I HA7E adapter ( and .I HA7S ) in native ascii mode. .TP \fI\-\-ha5=port | \-\-ha5=port:a | \-\-ha5=port:acg\fI \fB(HA5)\fB .B Embedded Data Systems .I HA5 mutidrop adapter in native ascii mode. Up to 26 adapters can share the same port, each with an assigned letter. If no letter specified, the program will scan for the first response (which may be slow). .TP .I --checksum | --no_checksum \fB(HA5)\fB .br Turn on (default) or off the checksum feature of the HA5 communication. .TP \fI--passive=port\fR | \fI--ha2=port\fR | \fI--ha3=port\fR | \fI--ha4b=port \fB(Passive)\fB Passive 1-wire adapters. Powered off the serial port and using passive electrical components (resitors and diodes). .TP .I --8bit | --6bit \fB(Passive)\fB .br Synthesize the 1-wire waveforme using a 6-bit (default) serial word, or 8-bit word. Not all UART devices support 6 bit operation. .TP \fI--timeout_serial=5\fI Timeout (in seconds) for all serial communications. 5 second default. Can be altered dynamically under .I /settings/timeout/serial .SH "* USB devices" The only supported true USB bus masters are based on the DS2490 chip. The most common is the DS9490R which has an included 1-wire ID slave with family code 81. .P There are also bus masters based on the serial chip with a USB to serial conversion built in. These are supported by the serial bus master protocol. .TP .I \-u \fR|\ \fI\-\-usb DS2490 based bus master (like the DS9490R). .TP .I \-u2 \fR|\ \fI\-\-usb=2 Use the second USB bus master. (The order isn't predicatble, however, since the operating system does not conssitently order USB devices). .TP .I \-uall \fR|\ \fI\-\-usb=ALL Use all the USB devices. .TP .I \-\-usb_flextime | \-\-usb_regulartime Changes the details of 1-wire waveform timing for certain network configurations. .TP .I \-\-altusb Willy Robion's alternative USB timing. .TP .I \-\-timeout_usb=5 Timeout for USB communications. This has a 5 second default and can be changed dynamically under .I /settings/timeout/usb .SH "* I2C devices" I2C is 2 wire protocol used for chip-to-chip communication. The bus masters: .I DS2482-100, DS2482-101 and .I DS2482-800 can specify (via pin voltages) a subset of addresses on the i2c bus. Those choices are .P .I i2c_address .TP 0,1,2,3 0x18,0x19,0x1A,0x1B .TP 4,5,6,7 0x1C,0x1D,0x1E,0x1F (DS2482-800 only) .P .I port for i2c masters have the form .I /dev/i2c-0, /dev/i2c-1, ... .TP \fI\-d port\fR | \fI\-\-device=port This simple form only permits a specific .I port and the first available .I i2c_address .TP \fI\-\-i2c=port\fR | \fI\-\-i2c=port:i2c_address\fR | \fI\-\-i2c=port:ALL Specific i2c .I port and the .I i2c_address is either the first, specific, or all or them. The .I i2c_address is 0,1,2,... .TP \fI\-\-i2c\fR | \fI\-\-i2c=:\fR | \fI\-\-i2c=ALL:ALL Search the available i2c buses for either the first, the first, or every i2c adapter. .P The .I DS2482-800 masters 8 1-wire buses and so will generate 8 .I /bus.n entries. .SH "* Network devices" These bus masters communicate via the tcp/ip network protocol and so can be located anywhere on the network. The .I network_address is of the form tcp_address:port .P E.g. 192.168.0.1:3000 or localhost:3000 .TP .I \-\-link=network_address LinkHubE network LINK adapter by .B iButtonLink .TP .I \-\-ha7net=network_address | \-\-ha7net HA7Net network 1-wire adapter with specified tcp address or discovered by udp multicast. By .B Embedded Data Systems .br .I \-\-timeout_ha7=60 specific timeout for HA7Net communications (60 second default). .TP .I \-\-etherweather=network_address Etherweather adapter .TP \fI\-s network_address\fR | \fI\-\-server=network_address Location of an .B owserver (1) program that talks to the 1-wire bus. The default port is 4304. .TP .I \-\-timeout_network=5 Timeout for network bus master communications. This has a 1 second default and can be changed dynamically under .I /settings/timeout/network .SH "* Simulated devices" Used for testing and development. No actual hardware is needed. Useful for separating the hardware development from the rest of the software design. .TP .I devices is a list of comma-separated 1-wire devices in the following formats. Note that a valid CRC8 code is created automatically. .TP 10,05,21 Hexidecimal .I family codes (the DS18S20, DS2405 and DS1921 in this example). .TP 10.12AB23431211 A more complete hexidecimal unique address. Useful when an actual hardware device should be simulated. .TP DS2408,DS2489 The 1-wire device name. (Full ID cannot be speciifed in this format). .TP .I \-\-fake=devices Random address and random values for each read. The device ID is also random (unless specified). .TP .I \-\-temperature_low=12 \-\-temperature_high=44 Specify the temperature limits for the .I fake adapter simulation. These should be in the same temperature scale that is specified in the command line. It is possible to change the limits dynamically for each adapter under .I /bus.x/interface/settings/simulated/[temperature_low|temperature_high] .TP .I \-\-tester=devices Predictable address and predictable values for each read. (See the website for the algorhythm). .SH "* w1 kernel module" This a linux-specific option for using the operating system's access to bus masters. Root access is required and the implementation was still in progress as of owfs v2.7p12 and linux 2.6.30. .P Bus masters are recognized and added dynamically. Details of the physical bus master are not accessible, bu they include USB, i2c and a number of GPIO designs on embedded boards. .P Access is restrict to superuser due to the netlink broadcast protocol employed by w1. Multitasking must be configured (threads) on the compilation. .TP .I \-\-w1 Use the linux kernel w1 virtual bus master. .TP .I \-\-timeout_w1=10 Timeout for w1 netlink communications. This has a 10 second default and can be changed dynamically under .I /settings/timeout/w1 .SH "FTDI ADDRESSING" FTDI is a brand of USB-to-serial chips which are very common. If your serial device is connected via a USB serial dongle based on a FTDI chip, or if your adapter uses a built-in FTDI USB chip (for example, the LinkUSB), you can use this FTDI addressing. .P The main benifit with this mode of access is that we can decrease the communication delay, yielding twice as fast 1-Wire communication in many cases. .P The following values for \fIport\fR can be used to identify a specific FTDI port. Note that this requires that OWFS is built with libftdi support. .TP \fIftdi:d:\fB\fB path of bus and device-node (e.g. "003/001") within usb device tree (usually at /proc/bus/usb/) .TP \fIftdi:i:\fI\fB:\fB first device with given vendor and product id, ids can be decimal, octal (preceded by "0") or hex (preceded by "0x") .TP \fIftdi:i:\fI\fB::\fB as above with index being the number of the device (starting with 0) if there are more than one .TP \fIftdi:s:\fI\fB::\fB first device with given vendor id, product id and serial string .P The above formats are parsed fully by libftdi (minus the \fIftdi:\fR prefix). .SS Simplified device \fBserial-only\fB support An additional format is supported, for certain bus types. This only specifies the USB serial number. .TP \fIftdi:\fI\fB\fB Identifies a FTDI device by serial only. Currently, this is only valid for the VID/PID found on the LinkUSB (i.e. --link). Note that those VID/PID's are the default for any FT232R device, and in no way exclusive to LinkUSB. owfs-3.1p5/src/man/man1/format.1so0000644000175000001440000000231512654730021013630 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SH FORMAT OPTIONS Choose the representation of the 1-wire unique identifiers. OWFS uses these identifiers as unique directory names. .PP Although several display formats are selectable, all must be in .I family-id-crc8 form, unlike some other programs and the labelling on iButtons, which are .I crc8-id-family form. .SS \-f \-\-format="f[.]i[[.]c]" Display format for the 1-wire devices. Each device has a 8byte address, consisting of: .TP .I f family code, 1 byte .TP .I i ID number, 6 bytes .TP .I c CRC checksum, 1 byte .PP Possible formats are .I f.i (default, 01.A1B2C3D4E5F6), .I fi fic f.ic f.i.c and .I fi.c .PP All formats are accepted as input, but the output will be in the specified format. .PP The address elements can be retrieved from a device entry in owfs by the .I family, id and crc8 properties, and as a whole with .I address. The reversed id and address can be retrieved as .I r_id and .I r_address. owfs-3.1p5/src/man/man1/help.1so0000644000175000001440000000142312654730021013267 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SH HELP OPTIONS See also this man page and the web site http://www.owfs.org .SS \-h \-\-help=[device|cache|program|job|temperature] Shows basic summary of options. .TP .I device 1-wire bus master options .TP .I cache cache and communication size and timing .TP .I program mountpoint or TCP server settings .TP .I job control and debugging options .TP .I temperature Unique ID display format and temperature scale .SS \-V \-\-version .I Version of this program and related libraries. owfs-3.1p5/src/man/man1/job_control.1so0000644000175000001440000000236412654730021014656 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SH JOB CONTROL OPTIONS .SS \-r \-\-readonly .SS \-w \-\-write Do we allow writing to the 1-wire bus (writing memory, setting switches, limits, PIOs)? The .I write option is available for symmetry, it's the default. .SS \-P \-\-pid-file "filename" Places the PID -- process ID of owfs into the specified filename. Useful for startup scripts control. .SS \-\-background | \-\-foreground Whether the program releases the console and runs in the .I background after evaluating command line options. .I background is the default. .SS \-\-error_print=0|1|2|3 .TP .I =0 default mixed destination: stderr foreground / syslog background .TP .I =1 syslog only .TP .I =2 stderr only .TP .I =3 /dev/null (quiet mode). .SS \-\-error_level=0..9 .TP .I =0 default errors only .TP .I =1 connections/disconnections .TP .I =2 all high level calls .TP .I =3 data summary for each call .TP .I =4 details level .TP .I >4 debugging chaff .PP .I --error_level=9 produces a lot of output owfs-3.1p5/src/man/man1/persistent_thresholds.1so0000644000175000001440000000264012654730021017000 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SH PERSISTENT THRESHOLD OPTIONS These settings control the behavior of .B owserver (1) in granting and dropping persistent tcp connections. The default settings are shown. .PP In general no changes should be needed. In general the purpose is to limit total resource usage from an errant or rogue client. .SS --timeout_persistent_low=600 Minimum seconds that a persistent tcp connection to .B owserver (1) is kept open. This is the limit used when the number of connections is above .I --clients_persistent_low .SS --timeout_persistent_high=3600 Maximum seconds that a persistent tcp connection to .B owserver (1) is kept open. This is the limit used when the number of connections is below .I --clients_persistent_low .SS --clients_persistent_low=10 Maximum number of persistent tcp connections to .B owserver (1) before connections start getting the more stringent time limitation .I --timeout_persistent_low .SS --clients_persistent_high=20 Maximum number of persistent tcp connections to before no more are allowed (only non-persistent at this point). .B owserver (1) before no more are allowed (only non-persistent at this point). owfs-3.1p5/src/man/man1/pressure.1so0000644000175000001440000000106012654730021014204 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SH PRESSURE SCALE OPTIONS .SS \-\-mbar (default) .SS \-\-atm .SS \-\-mmHg .SS \-\-inHg .SS \-\-psi .SS \-\-Pa Pressure scale used for data output. Millibar is the default. .PP Can also be changed within the program at .I /settings/units/pressure_scale owfs-3.1p5/src/man/man1/seealso.1so0000644000175000001440000000222412654730021013772 00000000000000.SS Programs .B owfs (1) owhttpd (1) owftpd (1) owserver (1) .B owdir (1) owread (1) owwrite (1) owpresent (1) .B owtap (1) .SS Configuration and testing .B owfs (5) owtap (1) owmon (1) .SS Language bindings .B owtcl (3) owperl (3) owcapi (3) .SS Clocks .B DS1427 (3) DS1904(3) DS1994 (3) DS2404 (3) DS2404S (3) DS2415 (3) DS2417 (3) .SS ID .B DS2401 (3) DS2411 (3) DS1990A (3) .SS Memory .B DS1982 (3) DS1985 (3) DS1986 (3) DS1991 (3) DS1992 (3) DS1993 (3) DS1995 (3) DS1996 (3) DS2430A (3) DS2431 (3) DS2433 (3) DS2502 (3) DS2506 (3) DS28E04 (3) DS28EC20 (3) .SS Switches .B DS2405 (3) DS2406 (3) DS2408 (3) DS2409 (3) DS2413 (3) DS28EA00 (3) .SS Temperature .B DS1822 (3) DS1825 (3) DS1820 (3) DS18B20 (3) DS18S20 (3) DS1920 (3) DS1921 (3) DS1821 (3) DS28EA00 (3) DS28E04 (3) .SS Humidity .B DS1922 (3) .SS Voltage .B DS2450 (3) .SS Resistance .B DS2890 (3) .SS Multifunction (current, voltage, temperature) .B DS2436 (3) DS2437 (3) DS2438 (3) DS2751 (3) DS2755 (3) DS2756 (3) DS2760 (3) DS2770 (3) DS2780 (3) DS2781 (3) DS2788 (3) DS2784 (3) .SS Counter .B DS2423 (3) .SS LCD Screen .B LCD (3) DS2408 (3) .SS Crypto .B DS1977 (3) .SS Pressure .B DS2406 (3) -- TAI8570 owfs-3.1p5/src/man/man1/temperature.1so0000644000175000001440000000106512654730021014676 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SH TEMPERATURE SCALE OPTIONS .SS \-C \-\-Celsius .SS \-F \-\-Fahrenheit .SS \-K \-\-Kelvin .SS \-R \-\-Rankine Temperature scale used for data output. Celsius is the default. .PP Can also be changed within the program at .I /settings/units/temperature_scale owfs-3.1p5/src/man/man1/timeout.1so0000644000175000001440000000325412654730021014031 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SH TIME OPTIONS Timeouts for the bus masters were previously listed in .I Device options. Timeouts for the cache affect the time that data stays in memory. Default values are shown. .SS --timeout_volatile=15 Seconds until a .I volatile property expires in the cache. Volatile properties are those (like temperature) that change on their own. .PP Can be changed dynamically at .I /settings/timeout/volatile .SS --timeout_stable=300 Seconds until a .I stable property expires in the cache. Stable properties are those that shouldn't change unless explicitly changed. Memory contents for example. .PP Can be changed dynamically at .I /settings/timeout/stable .SS --timeout_directory=60 Seconds until a .I directory listing expires in the cache. Directory lists are the 1-wire devices found on the bus. .PP Can be changed dynamically at .I /settings/timeout/directory .SS --timeout_presence=120 Seconds until the .I presence and bus location of a 1-wire device expires in the cache. .PP Can be changed dynamically at .I /settings/timeout/presence .P .B There are also timeouts for specific program responses: .SS --timeout_server=5 Seconds until the expected response from the .B owserver (1) is deemed tardy. .PP Can be changed dynamically at .I /settings/timeout/server .SS --timeout_ftp=900 Seconds that an ftp session is kept alive. .PP Can be changed dynamically at .I /settings/timeout/ftp owfs-3.1p5/src/man/man1/owcapi.man0000644000175000001440000001621412654730021013676 00000000000000'\" '\" Copyright (c) 2003-2006 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Library manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWCAPI 1 2004 "OWFS Manpage" "One-Wire File System" .SH NAME .B owcapi \- easy C-language 1-wire interface .SH SYNOPSIS .B libowcapi library to link with your program .SS Initialization .B ssize_t OW_init( .I device name or full parameter string .B ) .br .B ssize_t OW_init_args( .I int argc, char ** args .B ) .PP The full set of initialization options is extensive. They correspond roughly to the command line options of .B owfs (1) .B owhttpd (1) and .B owftpd (1) .SS Get data .B int OW_present( .I const char * path .B ) .br .B int OW_get( .I const char * path, char ** buffer, size_t * buffer_length .B ) .br .B ssize_t OW_lread( .I const char * path, unsigned char * buffer, const size_t size, const off_t offset .B ) .SS Set data .B ssize_t OW_put( .I const char * path, const char * buffer, size_t * buffer_length .B ) .br .B ssize_t OW_lwrite( .I const char * path, const unsigned char * buffer, const size_t size, const off_t offset .B ) .SS Debug .B void OW_set_error_level( .I const char *param .B ) .br .B void OW_set_error_print( .I const char *param .B ) .SS Close .B void OW_finish( .I void .B ) .SH FUNCTIONS .SS OW_init .I OW_init_string offers the full flexibility of the .B owfs (1) and .B owhttpd (1) command line. .TP .I Arguments Can be as simple as jus the device name, a full parameter specification. One or more device names (includes tcp, serial, usb...) and command line switches. See .B owfs (1) for full syntax. .TP .I Returns 0 for success. \-1 on error and .I errno will be set. .I OW_finish does not need to be called if .I OW_init fails. .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_init_args .I OW_init_args offers the full flexibility of the .B owfs (1) and .B owhttpd (1) command line. .TP .I Arguments One or more device names (includes tcp, serial, usb...) and command line switches. See .B owfs (1) for full syntax. Unlike .I OW_init_string the arguments are in argv/argc format. .TP .I Returns 0 for success. \-1 on error and .I errno will be set. .I OW_finish does not need to be called if .I OW_init fails. .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_present .I OW_present is used to check presence of a 1-wire device. .TP .I Arguments .I path is the path to the directory or file (property). .TP .I Returns 0 on success. \-1 on error (and .I errno is set). .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_get .I OW_get is used to get directory listings and file contents. The results are put in a dynamically allocated buffer. .TP .I Arguments .I path is the path to the directory or file (property). .I *buffer returns a pointer to a buffer containing the directory (comma separated) or value. .I buffer_length returns the length of the value/string in .I buffer .TP .I Returns number of bytes on success. \-1 on error (and .I errno is set). .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .TP .I Important note .I buffer is allocated ( with malloc ) by .I OW_get but must be freed in your program. See .B malloc (3) and .B free (3) .SS OW_lread .I OW_lread is used to read 1-wire memory chips. Think of it as a combination of .I lseek and .I read It allows random-access to the memory, specifying location and length. Unlike .I OW_get directories cannot be obtained and the buffer must be pre-allocated rather than allocated by the routine. .I buffer must be at least .I size length. .TP .I Arguments .I path is the path to the file (property). .I buffer is the (pre-allocated) memory area where the value will be placed. .I size is the length of bytes requested. .I offset is the position in file to start reading. .TP .I Returns number of bytes on success. \-1 on error (and .I errno is set). .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_put .I OW_put is an easy way to write to 1-wire chips. .TP .I Arguments .I path is the path to the file (property). .I buffer is the value to be written. .I buffer_length is the length of the value .I buffer. .I Returns number of bytes on success. \-1 on error (and .I errno is set). .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_lwrite .I OW_lwrite is the companion of .I OW_lread. It allows writing to arbitrary positions in 1-wire memory. Think of it as a combination of .I lseek and .I write. .I buffer must be at least .I size length. .TP .I Arguments .I path is the path to the file (property). .I buffer is the data to be written. .I size is the length of bytes to be written. .I offset is the position in file to start writing. .TP .I Returns number of bytes on success. \-1 on error (and .I errno is set). .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_set_error_level .I OW_set_error_level sets the debug output to a certain level. 0 is default, and higher value gives more output. .br (0=default, 1=err_connect, 2=err_call, 3=err_data, 4=err_detail, 5=err_debug, 6=err_beyond) .TP .I Arguments .I params is the level. Should be an integer. .TP .I Returns None .TP .I Sequence One of the .I init functions must be called before setting the level, since .I init defaults to level 0. .SS OW_set_error_print .I OW_set_error_print sets where the debug output should be directed. 0=mixed output, 1=syslog, 2=console. .TP .I Arguments .I params is the level. Should be an integer between 0 and 2. .TP .I Returns None .TP .I Sequence One of the .I init functions must be called before setting the level, since .I init defaults to 0 (mixed output). .SS OW_finish .I OW_finish cleans up the .I OWFS 1-wire routines, releases devices and memory. .TP .I Arguments None. .TP .I Returns None .TP .I Sequence .I OW_finish is optional since cleanup is automatic on program exit. .SH "DESCRIPTION" .so man1/description.1so .SS libowcapi .B libowcapi (1) is an encapsulation of the full .B libow library for C programs. .PP .B libowcapi (1) allows a C program to use .I OWFS principles (consistent naming scheme, multiple adapters, devices, and compatibility) directly from a C program. There are analogous modules for other programming languages: .TP .I C libowcapi .TP .I perl owperl .TP .I php owphp .TP .I python owpython .TP .I tcl owtcl .SH EXAMPLE /* Simple directory listing -- no error checking */ .br #include .br unsigned char * buf; .br size_t s ; .br OW_init("/dev/ttyS0"); .br OW_set_error_print("2"); .br OW_set_error_level("6"); .br OW_get("/",&buf,&s) ; .br printf("Directory %s\n",buf); .br free(buf); .br OW_finish() ; .SH SEE ALSO .so man1/seealso.1so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man1/owfs.man0000644000175000001440000000431612654730021013372 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWFS 1 2004 "OWFS Manpage" "One-Wire File System" .SH NAME .B owfs \- 1-wire filesystem .SH SYNOPSIS .B owfs .so man1/cmdline_mini.1so .I \-m mountdir .SH "DESCRIPTION" .so man1/description.1so .SS owfs .B owfs (1) is the filesystem client of the .I OWFS family of programs. It runs on linux, freebsd and Mac OS X, and requires the .I fuse kernel module and library. (http://fuse.sourceforge.net) which is a user-mode filesystem driver. .PP Essentially, the entire 1-wire bus is mounted to a place in your filesystem. All the 1-wire devices are accessible using standard file operations (read, write, directory listing). The system is safe, no actual files are exposed, these files are virtual. Not all operations are supported. Specifically, file creation, deletion, linking and renaming are not allowed. (You can link from outside to a owfs file, but not the other way around). .so man1/device.1so .SH SPECIFIC OPTIONS .SS \-m \-\-mountpoint=directory_path Path of a directory to mount the 1-wire file system .PP The mountpoint is required. There is no default. .SS \-\-allow_other Shorthand for fuse mount option "\-o allow_other" Allows uther users to see the fuse (owfs) mount point and file system. Requires a setting in /etc/fuse.conf as well. .SS \-\-fuse-opt "options" Sends options to the fuse-mount process. Options should be quoted, e.g. "\"\-o allow_other\"" . .so man1/temperature.1so .so man1/pressure.1so .so man1/format.1so .so man1/job_control.1so .so man1/configuration.1so .so man1/help.1so .so man1/timeout.1so .SH EXAMPLE .TP owfs \-d /dev/ttyS0 \-m /mnt/1wire Bus master on serial port .TP owfs \-F \-u \-m /mnt/1wire USB adapter, temperatures reported in Fahrenheit .TP owfs \-s 10.0.1.2:4304 \-m /mnt/1wire Connect to an .B owserver (1) process that was started on another machine at tcp port 4304 .SH SEE ALSO .so man1/seealso.1so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man1/owftpd.man0000644000175000001440000000371612654730021013722 00000000000000'\" '\" Copyright (c) 2003-2006 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWFTPD 1 2004 "OWFS Manpage" "One-Wire File System" .SH NAME .B owftpd \- Anoymous FTP server for 1-wire access .SH SYNOPSIS .B owftpd .so man1/cmdline_mini.1so [ .I \-p host:tcp-port ] .SH "DESCRIPTION" .so man1/description.1so .SS owftpd .B owhttpd (1) is an anonymous ftp (file-transfer-protocol) server that shows the Dallas/Maxim 1-Wire bus attached to a computer. The main directory shows the devices found, You can then navigate to individual devices, view and set their properties. .PP .B owftpd (1) uses the same naming convention as .B owfs (1) and .B owhppt (1) , where the URL corresponds to the filename. .PP The ftp server is a modified version of oftpd by Shane Kerr. It serves no files from the disk, only virtual files from the 1-wire bus. Security should therefore be good. Only the 1-wire bus is at risk. .so man1/device.1so .SH SPECIFIC OPTIONS .SS \-p host:portnum (Optional) Sets the tcp port the ftp server runs on. Access with the URL ftp://anonymous@servernameoripaddress:portnum .PP The well known ftp port, 21, will be used by default. Since this port number is in the restricted range, special permission is usually required. .so man1/temperature.1so .so man1/pressure.1so .so man1/format.1so .so man1/job_control.1so .so man1/configuration.1so .so man1/help.1so .so man1/timeout.1so .SH EXAMPLE .TP owftpd \-d /dev/ttyS0 Ftp server runs on default tcp port 21, serial adapter at ttyS0 .TP owftpd \-s littlehost:4304 \-\-error_level=3 Ftp server on default port 21, from .B owserver (1) process on host "littlehost", extensive error messages. .SH AVAILABILITY http://www.owfs.org .SH SEE ALSO .so man1/seealso.1so .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man1/owhttpd.man0000644000175000001440000000373112654730021014105 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWHTTPD 1 2004 "OWFS Manpage" "One-Wire File System" .SH NAME .B owhttpd \- Tiny webserver for 1-wire control .SH SYNOPSIS .B owhttpd .so man1/cmdline_mini.1so .I \-p tcp-port .SH "DESCRIPTION" .so man1/description.1so .SS owhttpd .B owhttpd (1) is a small webserver that shows the Dallas/Maxim 1-Wire bus attached to a serial port. The main view shows the devices found, You can then navigate to individual devices, and view/alter their properties. .PP .B owhttpd (1) uses the same naming convention as .B owfs (1) , where the URL corresponds to the filename. .PP The web server is a modified version of chttpd by Greg Olszewski. It serves no files from the disk, only virtual files from the 1-wire bus. Security should therefore be good. Only the 1-wire bus is at risk. .SH SPECIFIC OPTIONS .SS \-p portnum Sets the tcp port the web server runs on. Access with the URL http://servernameoripaddress:portnum .PP If no port is specified, an ephemeral port is selected by the operating system. Use .I zeroconf (Bonjour) to discover the assigned port. .so man1/device.1so .so man1/temperature.1so .so man1/pressure.1so .so man1/format.1so .so man1/job_control.1so .so man1/configuration.1so .so man1/help.1so .so man1/timeout.1so .SH EXAMPLE .TP owhttpd \-p 3001 \-d /dev/ttyS0 Web server runs on tcp port 3001, serial adapter at ttyS0 .TP owhttpd \-p 3001 \-s littlehost:4304 \-\-error_level=3 Web server on port 3001, from .I owserver process on host "littlehost", extensive error messages. .TP owhttpd \-p 3001 \-u \-u2 \-r Read-only web server on port 3001, using two usb adapters. .SH AVAILABILITY http://www.owfs.org .SH SEE ALSO .so man1/seealso.1so .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man1/owmon.man0000644000175000001440000000434612654730021013556 00000000000000'\" '\" Copyright (c) 2007 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for owtap -- 1-wire filesystem package '\" Protocol sniffer for owserver tcp protocol '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWMON 1 2007 "OWTAP Manpage" "One-Wire File System" .SH NAME .B owmon \- Monitor for owserver settings and statistics .SH SYNOPSIS .B owmon .I \-s owserver-tcp-port .br .SH "DESCRIPTION" .so man1/description.1so .SS owserver .B owserver (1) is the backend component of the OWFS 1-wire bus control system. .B owserver (1) arbitrates access to the bus from multiple client processes. The physical bus is usually connected to a serial or USB port, and other processes connect to .B owserver (1) over network sockets (tcp port). .PP Frontend clients include a filesystem representation: .B owfs (1) , and a webserver: .B owhttpd (1). Direct language bindings are also available, e.g: .B owperl (3). .PP There are also many light-weight clients that can only talk to .B owserver (1) and not to the 1-Wire bus directly. They include shell and multiple language modules (perl, Visual Basic, python,...) .SS owserver protocol All the .B owserver (1) clients use the .B owserver protocol for communication. The .B owserver protocol is a well documented tcp/ip client/server protocol. Assigned the "well known port" default of 4304. .SS owmon .B owmon (1) is connects to .B owserver (1) and displays the bus structure and contents of the interface, statistics and settings directories. .SH SPECIFIC OPTIONS .SS \-s TCP port or IPaddress:port for .I owserver .br The tcp port (IP:port) for the "upstream" owserver. .SH EXAMPLE If .B owserver (1) is started: .br .B owserver -p 4304 -d /dev/ttyS0 .br owserver on tcp port 4304 and connects to a physical 1-wire bus on a serial port. .PP You can monitor .B owserver (1) with .br .B owmon -s 4304 / .SH PLATFOMS .B owmon (1) is a pure .I Tcl/TK program and will run whereever .I Tcl/TK is available (Windows, Macintosh, Linux, Unix) .SH LINKS .SS owserver protocol http://www.owfs.org/index.php?page=owserver-protocol .SS Tcl/TK http://www.tcl.tk .SH SEE ALSO .so man1/seealso.1so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man1/ownet.man0000644000175000001440000001722212654730021013550 00000000000000'\" '\" Copyright (c) 2008 Paul H Alfille, MD '\" (palfille@gmail.com) '\" '\" Library manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWNET 1 2008 "OWFS Manpage" "One-Wire File System" .SH NAME .B ownet , .B (libownet) \- easy C-language 1-wire interface to the owserver protocol .SH SYNOPSIS .B libownet library to link with your program .SS Handle .B OWNET_HANDLE .br Handle to each owserver connection .SS Initialization .B OWNET_HANDLE OWNET_init( const char * .I owserver_tcp_address_and_port .B ) .br Associate an .B owserver (1) tcp/ip address with a handle. .SS Directory listing .B int OWNET_dirlist( OWNET_HANDLE .I owserver_handle .B , const char * .I onewire_path .B , char ** .I comma_separated_list .B ) .br Create a comma-separated list of directory elements. .PP .B int OWNET_dirprocess( OWNET_HANDLE .I owserver_handle .B , const char * .I onewire_path .B , void (* .I dirfunc .B ) (void *, const char *), void * .I passed_on_value .B ) .br .B void .I dirfunc .B ( void * .I passed_on_value .B , const char * .I directory_element .B ) .br Apply function .I dirfunc to each directory element, along with an arbitrary passed_on_value. .SS Get data .B int OWNET_read( OWNET_HANDLE .I owserver_handle .B , const char * .I onewire_path .B , const char ** .I return_string .B ) .br Read a value (of specified size) from a 1-wire device. .PP .B int OWNET_lread( OWNET_HANDLE .I owserver_handle .B , const char * .I onewire_path .B , const char ** .I return_string .B , size_t .I size .B , off_t .I offset .B ) .br Read a value (of specified size and offset) from a 1-wire device. .PP .B int OWNET_present( OWNET_HANDLE .I owserver_handle .B , const char * .I onewire_path .B ) .br Check if a 1-wire device is present. .SS Set data .B int OWNET_put( OWNET_HANDLE .I owserver_handle .B , const char * .I onewire_path .B , const char * .I value_string .B , size_t .I size .B ) .br Write a value (of specified size) to a 1-wire device. .PP .B int OWNET_lwrite( OWNET_HANDLE .I owserver_handle .B , const char * .I onewire_path .B , const char * .I value_string .B , size_t .I size .B , off_t .I offset .B ) .br Write a value (of specified size and offset) to a 1-wire device. .SS Close .B void OWNET_close( OWNET_HANDLE .I owserver_handle .B ) .br Close the connection to a particular owserver. .PP .B void OWNET_closeall( void ) .br Close all open owserver connections. .PP .B void OWNET_finish( void ) .br Close all open owserver connections and free all memory. .SS Temperature scale .B void OWNET_set_temperature_scale( char .I temperature_scale .B ) .br .B char OWNET_get_temperature_scale( void ) .br Set and retrieve the temperature scale used for all communications. .SS Device format .B void OWNET_set_device_format( const char * .I device_format .B ) .br .B const char * OWNET_get_device_format( void ) .br Set and retrieve the 1-wire device serial number format used for all communications. .SH FUNCTIONS .SS OW_init .I OW_init_string offers the full flexibility of the .B owfs (1) and .B owhttpd (1) command line. .TP .I Arguments Can be as simple as jus the device name, a full parameter specification. One or more device names (includes tcp, serial, usb...) and command line switches. See .B owfs (1) for full syntax. .TP .I Returns 0 for success. \-1 on error and .I errno will be set. .I OW_finish does not need to be called if .I OW_init fails. .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_init_args .I OW_init_args offers the full flexibility of the .B owfs (1) and .B owhttpd (1) command line. .TP .I Arguments One or more device names (includes tcp, serial, usb...) and command line switches. See .B owfs (1) for full syntax. Unlike .I OW_init_string the arguments are in argv/argc format. .TP .I Returns 0 for success. \-1 on error and .I errno will be set. .I OW_finish does not need to be called if .I OW_init fails. .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_get .I OW_get is used to get directory listings and file contents. The results are put in a dynamically allocated buffer. .TP .I Arguments .I path is the path to the directory or file (property). .I *buffer returns a pointer to a buffer containing the directory (comma separated) or value. .I buffer_length returns the length of the value/string in .I buffer .TP .I Returns number of bytes on success. \-1 on error (and .I errno is set). .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .TP .I Important note .I buffer is allocated ( with malloc ) by .I OW_get but must be freed in your program. See .B malloc (3) and .B free (3) .SS OW_lread .I OW_lread is used to read 1-wire memory chips. Think of it as a combination of .I lseek and .I read It allows random-access to the memory, specifying location and length. Unlike .I OW_get directories cannot be obtained and the buffer must be pre-allocated rather than allocated by the routine. .I buffer must be at least .I size length. .TP .I Arguments .I path is the path to the file (property). .I buffer is the (pre-allocated) memory area where the value will be placed. .I size is the length of bytes requested. .I offset is the position in file to start reading. .TP .I Returns number of bytes on success. \-1 on error (and .I errno is set). .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_put .I OW_put is an easy way to write to 1-wire chips. .TP .I Arguments .I path is the path to the file (property). .I buffer is the value to be written. .I buffer_length is the length of the value .I buffer. .I Returns number of bytes on success. \-1 on error (and .I errno is set). .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_lwrite .I OW_lwrite is the companion of .I OW_lread. It allows writing to arbitrary positions in 1-wire memory. Think of it as a combination of .I lseek and .I write. .I buffer must be at least .I size length. .TP .I Arguments .I path is the path to the file (property). .I buffer is the data to be written. .I size is the length of bytes to be written. .I offset is the position in file to start writing. .TP .I Returns number of bytes on success. \-1 on error (and .I errno is set). .TP .I Sequence One of the .I init functions must be called before accessing the 1-wire bus. .I OW_finish is optional. .SS OW_finish .I OW_finish cleans up the .I OWFS 1-wire routines, releases devices and memory. .TP .I Arguments None. .TP .I Returns None .TP .I Sequence .I OW_finish is optional since cleanup is automatic on program exit. .SH "DESCRIPTION" .so man1/description.1so .SS libowcapi .B libowcapi (1) is an encapsulation of the full .B libow library for C programs. .PP .B libowcapi (1) allows a C program to use .I OWFS principles (consistent naming scheme, multiple adapters, devices, and compatibility) directly from a C program. There are analogous modules for other programming languages: .TP .I C libowcapi .TP .I perl owperl .TP .I php owphp .TP .I python owpython .TP .I tcl owtcl .SH EXAMPLE /* Simple directory listing -- no error checking */ .br #include .br char * buf; .br size_t s ; .br OWNET_init("localhost:4304"); .br OWNET_dirlist("/",&buf,&s) ; .br printf("Directory %s\n",buf); .br free(buf); .br OWNET_finish() ; .SH SEE ALSO .so man1/seealso.1so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man1/owserver.man0000644000175000001440000000613712654730021014273 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWSERVER 1 2004 "OWSERVER Manpage" "One-Wire File System" .SH NAME .B owserver \- Backend server (daemon) for 1-wire control .SH SYNOPSIS .B owserver .so man1/cmdline_mini.1so .I \-p tcp-port .SH "DESCRIPTION" .so man1/description.1so .SS owserver .B owserver (1) is the backend component of the OWFS 1-wire bus control system. .B owserver (1) arbitrates access to the bus from multiple client processes. The physical bus is usually connected to a serial or USB port, and other processes connect to .B owserver (1) over network sockets (tcp port). Communication can be local or over a network. Secure tunneling can be implemented using standard techniques. .PP Frontend clients include a filesystem representation: .B owfs (1) , and a webserver: .B owhttpd (1). Direct language bindings are also available, e.g: .B owperl (3). Several instances of each client can be initiated. .PP Each client can also connect directly to the physical bus, skipping .B owserver (1) but only one client can connect to the physical bus safely. Simultaneous access is prevented by the operating system for USB ports, but unfortunately not serial ports. The safe way to share access to the 1-wire bus is via .B owserver (1) with the clients connecting. Note: .B owserver (1) can connect to another .B owserver (1) process, though the utility of this technique is limited (perhaps as a .I readonly buffer?) .PP .B owserver (1) is by default multithreaded. Optional data caching is in the server, not clients, so all the clients gain efficiency. .so man1/device.1so .SH SPECIFIC OPTIONS .SS \-p TCP port or IPaddress:port for .I owserver .PP Other OWFS programs will access owserver via this address. (e.g. owfs \-s IP:port /1wire) .PP If no port is specified, the default well-known port (4304 -- assigned by the IANA) will be used. .so man1/temperature.1so .so man1/pressure.1so .so man1/format.1so .so man1/job_control.1so .so man1/configuration.1so .so man1/help.1so .so man1/timeout.1so .so man1/persistent_thresholds.1so .SH DEVELOPER OPTIONS .SS --no_dirall Reject DIRALL messages (requests directory as a single message), forcing client to use older DIR method (each element is an individual message) .SS --no_get Reject GET messages (lets owserver determine if READ or DIRALL is appropriate). Client will fall back to older methods. .SS --no_persistence Reject persistence in requests. All transactions will have to be new connections. .SS --pingcrazy Interject many "keep-alive" (PING) responses. Usually PING responses are only sent when processing is taking a long time to inform client that owserver is still there. .SH EXAMPLE .B owserver -p 3001 -d /dev/ttyS0 runs owserver on tcp port 3001 and connects to a physical 1-wire bus on a serial port. .SH SEE ALSO .so man1/seealso.1so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man1/owshell.man0000644000175000001440000001403612665167763014114 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWSHELL 1 2004 "OWSHELL Manpage" "One-Wire File System" .SH NAME owdir, owread, owwrite, owget, owexist, owpresent \- lightweight owserver access .SH SYNOPSIS .SS Minimal options .B owdir .I -s [host:]port [directory] .br .B owread .I -s [host:]port filepath .br .B owwrite .I -s [host:]port filepath value .br .B owget .I -s [host:]port [directory] | filepath .br .SS Server discovery .B owdir .I --autoserver [directory] .br .B owread .I --autoserver filepath .br .B owwrite .I --autoserver filepath value .br .B owget .I --autoserver [directory] | filepath .br .SS Full options .B owdir .I -q --quiet .I -f --format f[.]i[[.]c] ] [ .I --dir ] .I -s [host:]port [directory] [directory2 ...] .PP .B owread .I -q --quiet .I -C --celsius .I -K --kelvin .I -F --fahrenheit .I -R --rankine [ .I --hex ] [ .I --start= offset ] [ .I --size= bytes ] .I -s [host:]port filepath [filepath2 ...] .PP .B owwrite .I -q --quiet .I -C --celsius .I -K --kelvin .I -F --fahrenheit .I -R --rankine [ .I --hex ] [ .I --start= offset ] .I -s [host:]port filepath value [filepath2 value2 ...] .PP .B owget .I -q --quiet .I -f --format f[.]i[[.]c] .I -C --celsius .I -K --kelvin .I -F --fahrenheit .I -R --rankine [ .I --hex ] [ .I --start= offset ] [ .I --size= bytes ] [ .I --dir ] .I -s [host:]port [directory] | filepath .br .SS Version .B owdir .I \-V \-\-version .br .B owread .I \-V \-\-version .br .B owwrite .I \-V \-\-version .br .B owget .I \-V \-\-version .br .SS Help .B owdir .I \-h | \-\-help .br .B owread .I \-h | \-\-help .br .B owwrite .I \-h | \-\-help .br .B owget .I \-h | \-\-help .br .SH "DESCRIPTION" .so man1/description.1so .SS OWSHELL programs .B owdir owread owwrite and .B owget are collectively called the .B owshell programs. They allow lightweight access to an .B owserver (1) for use in command line scripts. .PP Unlike .B owserver (1) owhttpd (1) owftpd (1) owhttpd (1) there is not persistent connection with the 1-wire bus, no caching and no multithreading. Instead, each program connects to a running .B owserver (1) and performs a quick set of queries. .PP .B owserver (1) performs the actual 1-wire connection (to physical 1-wire busses or other .B owserver programs), performs concurrency locking, caching, and error collection. .PP .B owshell programs are intended for use in command line scripts. An alternative approach is to mount an .B owfs (1) filesystem and perform direct file lists, reads and writes. .SS owdir .B owdir performs a .I directory listing. With no argument, all the devices on the main 1-wire bus will be listed. Given the name of a 1-wire device, the available properties will be listed. It is the equivalent of .IP .I ls directory .P in the .B owfs (1) filesystem. .SS owread .B owread obtains for value of a 1-wire device property. e.g. 28.0080BE21AA00/temperature gives the DS18B20 temperature. It is the equivalent of .IP .I cat filepath .P in the .B owfs (1) filesystem. .SS owwrite .B owwrite performs a change of a property, changing a 1-wire device setting or writing to memory. It is the equivalent of .IP .I echo "value" > filepath .P in the .B owfs (1) filesystem. .SS owget .B owget (1) is a convenience program, combining the function of .B owdir (1) and .B owread (1) by first trying to read the argument as a directory, and if that fails as a 1-wire property. .SH STANDARD OPTIONS .SS \-\-autoserver Find an .I owserver using the Service Discovery protocol. Essentially Apple's Bonjour (aka zeroconf). Only the first .I owserver will be used, and that choice is probably arbitrary. .SS \-s [host:]port Connect via tcp (network) to an .I owserver process that is connected to a physical 1-wire bus. This allows multiple processes to share the same bus. The .I owserver process can be local or remote. .PP If the server option is not specified, the default is the local machine and the IANA allocated default port of 4304. Thus "\-s localhost:4304" is the equivalent. .SH DATA OPTIONS .SH \-\-hex Hexidecimal mode. For reading data, each byte of character will be displayed as two characrters 0-9ABCDEF. Most useful for reading memory locations. No spaces between data. .P Writing data in hexidecimal mode just means that the data should be given as one long hexidecimal string. .SH \-\-start=offset Read or write memory locations starting at the offset byte rather than the beginning. An offset of 0 means the beginning (and is the default). .P .SH \-\-size=bytes Read up to the specified number of bytes of a memory location. .SH HELP OPTIONS .SS \-h \-\-help Shows (this) basic summary of options. .SS \-V \-\-version .I Version of this program. .SH DISPLAY OPTIONS .SS \-\-dir Modify the display of directories to indicate which entries are also directories. A directory member will have a trailing '/' if it is a directory itself. This aids recursive searches. .SS \-f \-\-format "f[.]i[[.]c]" Display format for the 1-wire devices. Each device has a 8 byte address, consisting of: .TP .I f family code, 1 byte .TP .I i ID number, 6 bytes .TP .I c CRC checksum, 1 byte .PP Possible formats are .I f.i (default, 01.A1B2C3D4E5F6), .I fi fic f.ic f.i.c and .I fi.c .PP All formats are accepted as input, but the output will be in the specified format. .SH EXAMPLE .TP owdir \-s 3000 \-\-format fic Get the device listing (full 16 hex digits, no dots) from the local .I owserver at port 3000 .TP owread \-F \-\-autoserver 51.125499A32000/typeK/temperature Read temperature from the DS2751-based thermocouple on an auto-discovered .I owserver Temperature in fahrenheit. .TP owwrite \-s 10.0.1.2:3001 32.000800AD23110/pages/page.1 "Passed" Connect to a OWFS server process ( .I owserver ) that was started on another machine at tcp port 3001 and write to the memory of a DS2780 .SH SEE ALSO .so man1/seealso.1so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man1/owtap.man0000644000175000001440000000534512654730021013551 00000000000000'\" '\" Copyright (c) 2007 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for owtap -- 1-wire filesystem package '\" Protocol sniffer for owserver tcp protocol '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWTAP 1 2007 "OWTAP Manpage" "One-Wire File System" .SH NAME .B owtap \- Packet sniffer for the owserver protocol .SH SYNOPSIS .B owtap .I \-p owtap-tcp-port .I \-s owserver-tcp-port .br .SH "DESCRIPTION" .so man1/description.1so .SS owserver .B owserver (1) is the backend component of the OWFS 1-wire bus control system. .B owserver (1) arbitrates access to the bus from multiple client processes. The physical bus is usually connected to a serial or USB port, and other processes connect to .B owserver (1) over network sockets (tcp port). .PP Frontend clients include a filesystem representation: .B owfs (1) , and a webserver: .B owhttpd (1). Direct language bindings are also available, e.g: .B owperl (3). .PP There are also many light-weight clients that can only talk to .B owserver (1) and not to the 1-Wire bus directly. They include shell and multiple language modules (perl, Visual Basic, python,...) .SS owserver protocol All the .B owserver (1) clients use the .B owserver protocol for communication. The .B owserver protocol is a well documented tcp/ip client/server protocol. Assigned the "well known port" default of 4304. .SS owtap .B owtap (1) is interposed between .B owserver (1) and clients, to display and help resolve communication problems. Network communication is forwarded in both directions, but a visual display is also created, with statistics and "drill-down" of individual packets. .SH SPECIFIC OPTIONS .SS \-p TCP port or IPaddress:port for .I owtap .br Other OWFS programs will access owtap via this address. (e.g. owdir \-s IP:port /) .SS \-s TCP port or IPaddress:port for .I owserver .br The tcp port (IP:port) for the "upstream" owserver. .SH EXAMPLE If .B owserver (1) is started: .br .B owserver \-p 4304 \-d /dev/ttyS0 .br owserver on tcp port 4304 and connects to a physical 1-wire bus on a serial port. .PP You can directly query .B owserver (1) with .br .B owdir \-s 4304 / .PP To see the protocol in action: .br .B owtap \-s 4304 \-p 3000 .br .B owdir \-p 3000 / .PP In this case .B owtap (1) is connecting to .B owserver (1) on the original port (4304) and offering a new port (3000) for clients. .SH PLATFOMS .B owtap (1) is a pure .I Tcl/TK program and will run whereever .I Tcl/TK is available (Windows, Macintosh, Linux, Unix) .SH LINKS .SS owserver protocol http://www.owfs.org/index.php?page=owserver-protocol .SS Tcl/TK http://www.tcl.tk .SH SEE ALSO .so man1/seealso.1so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/0000755000175000001440000000000013022537100011766 500000000000000owfs-3.1p5/src/man/man3/Makefile.am0000644000175000001440000000335112756603325013764 00000000000000## man sources MANFILES = \ DS1821.man DS1822.man DS1825.man DS18B20.man DS18S20.man DS1921.man \ DS1963L.man DS1963S.man DS1977.man DS1991.man DS1992.man DS1993.man \ DS1995.man DS1996.man DS2401.man DS2404.man DS2405.man DS2406.man \ DS2408.man DS2409.man DS2413.man DS2415.man DS2423.man DS2430A.man \ DS2431.man DS2433.man DS2436.man DS2437.man DS2438.man DS2450.man \ DS2502.man DS2505.man DS2506.man DS2720.man DS2740.man DS2751.man \ DS2755.man DS2760.man DS2770.man DS2780.man DS2781.man DS2890.man \ DS28E04.man DS28EA00.man DS28EC20.man EDS.man EEEF.man LCD.man mAM001.man \ mCM001.man mDI001.man mRS001.man owperl.man ## .so includes SOFILES = \ addressing.3so description.3so seealso.3so standard.3so standard_mini.3so \ temperature_errata.3so temperature_threshold.3so temperature_resolution.3so temperatures_mini.3so ## man files that need no preprocessing dist_man3_MANS = \ DS1427.3 DS1904.3 DS1920.3 DS1971.3 DS1982.3 DS1982U.3 DS1985.3 DS1985U.3 \ DS1986.3 DS1986U.3 DS1990A.3 DS1994.3 DS2404S.3 DS2407.3 DS2411.3 \ DS2417.3 DS2502-E48.3 DS2502-UNW.3 DS2505-UNW.3 DS2506-UNW.3 DS2756.3 \ DS2761.3 DS2762.3 DS2788.3 DS2804.3 EDS0064.3 EDS0065.3 EDS0066.3 \ EDS0067.3 EDS0068.3 EDS0070.3 EDS0071.3 EDS0072.3 EDS0080.3 EDS0082.3 \ EDS0083.3 EDS0085.3 EDS0090.3 MAX31820.3 MAX31826.3 MAX31850.3 MAX31851.3 \ OWNet.3 Thermachron.3 UVI.3 ## file to include in distribution EXTRA_DIST = $(SOFILES) $(MANFILES) if SOELIM man3_MANS = $(addsuffix .3,$(basename $(MANFILES))) CLEANFILES = $(man3_MANS) # preproc man pages via soelim $(man3_MANS): $(MANFILES) $(SOFILES) %.3 :: %.man $(SOELIM) -r -I $(srcdir)/.. $< > $@ else !SOELIM man3_MANS = $(MANFILES) $(SOFILES) endif !SOELIM owfs-3.1p5/src/man/man3/DS1427.30000644000175000001440000000002212756371512012630 00000000000000.so man3/DS2404.3 owfs-3.1p5/src/man/man3/DS1904.30000644000175000001440000000002212756371512012630 00000000000000.so man3/DS2415.3 owfs-3.1p5/src/man/man3/DS1920.30000644000175000001440000000002312756371512012627 00000000000000.so man3/DS18S20.3 owfs-3.1p5/src/man/man3/DS1971.30000644000175000001440000000002312756371512012635 00000000000000.so man3/DS2430A.3 owfs-3.1p5/src/man/man3/DS1982.30000644000175000001440000000002212756371512012636 00000000000000.so man3/DS2502.3 owfs-3.1p5/src/man/man3/DS1982U.30000644000175000001440000000002212756371512012763 00000000000000.so man3/DS2502.3 owfs-3.1p5/src/man/man3/DS1985.30000644000175000001440000000002212756371512012641 00000000000000.so man3/DS2505.3 owfs-3.1p5/src/man/man3/DS1985U.30000644000175000001440000000002212756371512012766 00000000000000.so man3/DS2505.3 owfs-3.1p5/src/man/man3/DS1986.30000644000175000001440000000002212756371512012642 00000000000000.so man3/DS2506.3 owfs-3.1p5/src/man/man3/DS1986U.30000644000175000001440000000002212756371512012767 00000000000000.so man3/DS2506.3 owfs-3.1p5/src/man/man3/DS1990A.30000644000175000001440000000002212756371512012736 00000000000000.so man3/DS2401.3 owfs-3.1p5/src/man/man3/DS1994.30000644000175000001440000000002212756371512012641 00000000000000.so man3/DS2404.3 owfs-3.1p5/src/man/man3/DS2404S.30000644000175000001440000000002212756371512012747 00000000000000.so man3/DS2404.3 owfs-3.1p5/src/man/man3/DS2407.30000644000175000001440000000002212756371512012627 00000000000000.so man3/DS2406.3 owfs-3.1p5/src/man/man3/DS2411.30000644000175000001440000000002212756371512012622 00000000000000.so man3/DS2401.3 owfs-3.1p5/src/man/man3/DS2417.30000644000175000001440000000002212756371512012630 00000000000000.so man3/DS2415.3 owfs-3.1p5/src/man/man3/DS2502-E48.30000644000175000001440000000002212756371512013161 00000000000000.so man3/DS2502.3 owfs-3.1p5/src/man/man3/DS2502-UNW.30000644000175000001440000000002212756371512013272 00000000000000.so man3/DS2502.3 owfs-3.1p5/src/man/man3/DS2505-UNW.30000644000175000001440000000002212756371512013275 00000000000000.so man3/DS2505.3 owfs-3.1p5/src/man/man3/DS2506-UNW.30000644000175000001440000000002212756371512013276 00000000000000.so man3/DS2506.3 owfs-3.1p5/src/man/man3/DS2756.30000644000175000001440000000002212756371512012636 00000000000000.so man3/DS2755.3 owfs-3.1p5/src/man/man3/DS2761.30000644000175000001440000000002212756371512012632 00000000000000.so man3/DS2760.3 owfs-3.1p5/src/man/man3/DS2762.30000644000175000001440000000002212756371512012633 00000000000000.so man3/DS2760.3 owfs-3.1p5/src/man/man3/DS2788.30000644000175000001440000000002212756371512012643 00000000000000.so man3/DS2780.3 owfs-3.1p5/src/man/man3/DS2804.30000644000175000001440000000002312756371512012631 00000000000000.so man3/DS28E04.3 owfs-3.1p5/src/man/man3/EDS0064.30000644000175000001440000000001712756371512012735 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0065.30000644000175000001440000000001712756371512012736 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0066.30000644000175000001440000000001712756371512012737 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0067.30000644000175000001440000000001712756371512012740 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0068.30000644000175000001440000000001712756371512012741 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0070.30000644000175000001440000000001712756371512012732 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0071.30000644000175000001440000000001712756371512012733 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0072.30000644000175000001440000000001712756371512012734 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0080.30000644000175000001440000000001712756371512012733 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0082.30000644000175000001440000000001712756371512012735 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0083.30000644000175000001440000000001712756371512012736 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0085.30000644000175000001440000000001712756371512012740 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/EDS0090.30000644000175000001440000000001712756371512012734 00000000000000.so man3/EDS.3 owfs-3.1p5/src/man/man3/MAX31820.30000644000175000001440000000002312756371512013030 00000000000000.so man3/DS18B20.3 owfs-3.1p5/src/man/man3/MAX31826.30000644000175000001440000000002212756371512013035 00000000000000.so man3/DS1825.3 owfs-3.1p5/src/man/man3/MAX31850.30000644000175000001440000000002212756371512013032 00000000000000.so man3/DS1825.3 owfs-3.1p5/src/man/man3/MAX31851.30000644000175000001440000000002212756371512013033 00000000000000.so man3/DS1825.3 owfs-3.1p5/src/man/man3/OWNet.30000644000175000001440000004713112756371512013014 00000000000000.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "OWNet 3" .TH OWNet 3 "2010-06-15" "perl v5.10.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" OWNet \- Light weight access to \fBowserver\fR .SH "SYNOPSIS" .IX Header "SYNOPSIS" OWNet is an easy way to access \fBowserver\fR and thence the 1\-wire bus. .PP Dallas Semiconductor's 1\-wire system uses simple wiring and unique addresses for its interesting devices. The \fBOne Wire File System (\s-1OWFS\s0)\fR is a suite of programs that hide 1\-wire details behind a file system metaphor. \fBowserver\fR connects to the 1\-wire bus and provides network access. .PP \&\fBOWNet\fR is a perl module that connects to \fBowserver\fR and allows reading, writing and listing the 1\-wire bus. .PP Example perl program that prints the temperature: .PP .Vb 2 \& use OWNet ; \& print OWNet::read( "localhost:4304" , "/10.67C6697351FF/temperature" ) ."\en" ; .Ve .PP There is the alternative object oriented form: .PP .Vb 3 \& use OWNet ; \& my $owserver = OWNet\->new( "localhost:4304" ) ; \& print $owserver\->read( "/10.67C6697351FF/temperature" ) ."\en" ; .Ve .SH "SYNTAX" .IX Header "SYNTAX" .SS "methods" .IX Subsection "methods" .IP "\fBnew\fR" 4 .IX Item "new" .Vb 1 \& my $owserver = OWNet \-> new( address ) ; .Ve .IP "\fBread\fR" 4 .IX Item "read" .Vb 2 \& OWNet::read( address, path [,size [,offset]] ) \& $owserver \-> read( path [,size [,offset]] ) .Ve .IP "\fBwrite\fR" 4 .IX Item "write" .Vb 2 \& OWNet::write( address, path, value [,offset] ) \& $owserver \-> write( path, value [,offset] ) .Ve .IP "\fBdir\fR" 4 .IX Item "dir" .Vb 2 \& OWNet::dir( address, path ) \& $owserver \-> dir( path ) .Ve .SS "\fIaddress\fP" .IX Subsection "address" \&\s-1TCP/IP\s0 \fIaddress\fR of \fBowserver\fR. Valid forms: .IP "\fIname\fR test.owfs.net:4304" 4 .IX Item "name test.owfs.net:4304" .PD 0 .IP "\fIquad\fR number: 123.231.312.213:4304" 4 .IX Item "quad number: 123.231.312.213:4304" .IP "\fIhost\fR localhost:4304" 4 .IX Item "host localhost:4304" .IP "\fIport\fR 4304" 4 .IX Item "port 4304" .PD .SS "\fIadditional arguments\fP" .IX Subsection "additional arguments" Additional arguments to add to address .PP Temperature scale can also be specified in the \fIaddress\fR. Same syntax as the other \s-1OWFS\s0 programs: .IP "\-C Celsius (Centigrade)" 4 .IX Item "-C Celsius (Centigrade)" .PD 0 .IP "\-F Fahrenheit" 4 .IX Item "-F Fahrenheit" .IP "\-K Kelvin" 4 .IX Item "-K Kelvin" .IP "\-R Rankine" 4 .IX Item "-R Rankine" .PD .PP Pressure scale can also be specified in the \fIaddress\fR. Same syntax as the other \s-1OWFS\s0 programs: .IP "\-\-mbar millibar (default)" 4 .IX Item "--mbar millibar (default)" .PD 0 .IP "\-\-atm atmosphere" 4 .IX Item "--atm atmosphere" .IP "\-\-mmHg mm Mercury" 4 .IX Item "--mmHg mm Mercury" .IP "\-\-inHg inch Mercury" 4 .IX Item "--inHg inch Mercury" .IP "\-\-psi pounds per inch^2" 4 .IX Item "--psi pounds per inch^2" .IP "\-\-Pa pascal" 4 .IX Item "--Pa pascal" .PD .PP Device display format (1\-wire unique address) can also be specified in the \fIaddress\fR, with the general form of \-ff[.]i[[.]c] (\fIf\fRamily \fIi\fRd \fIc\fRrc): .IP "\-ff.i /10.67C6697351FF (default)" 4 .IX Item "-ff.i /10.67C6697351FF (default)" .PD 0 .IP "\-ffi /1067C6697351FF" 4 .IX Item "-ffi /1067C6697351FF" .IP "\-ff.i.c /10.67C6697351FF.8D" 4 .IX Item "-ff.i.c /10.67C6697351FF.8D" .IP "\-ff.ic /10.67C6697351FF8D" 4 .IX Item "-ff.ic /10.67C6697351FF8D" .IP "\-ffi.c /1067C6697351FF.8D" 4 .IX Item "-ffi.c /1067C6697351FF.8D" .IP "\-ffic /1067C6697351FF8D" 4 .IX Item "-ffic /1067C6697351FF8D" .PD .PP Show directories that are themselves directories with a '/' suffix ( e.g. /10.67C6697351FF/ ) .IP "\-slash show directory elements" 4 .IX Item "-slash show directory elements" .PP Warning messages will only be displayed if verbose flag is specified in \fIaddress\fR .IP "\-v verbose" 4 .IX Item "-v verbose" .SS "\fIpath\fP" .IX Subsection "path" \&\fBowfs\fR\-type \fIpath\fR to an item on the 1\-wire bus. Valid forms: .IP "main directories" 4 .IX Item "main directories" Used for the \fIdir\fR method. E.g. \*(L"/\*(R" \*(L"/uncached\*(R" \*(L"/1F.321432320000/main\*(R" .IP "device directory" 4 .IX Item "device directory" Used for the \fIdir\fR and \fIpresent\fR method. E.g. \*(L"/10.4300AC220000\*(R" \*(L"/statistics\*(R" .IP "device properties" 4 .IX Item "device properties" Used to \fIread\fR, \fIwrite\fR. E.g. \*(L"/10.4300AC220000/temperature\*(R" .SS "\fIvalue\fP" .IX Subsection "value" New \fIvalue\fR for a device property. Used by \fIwrite\fR. .SH "METHODS" .IX Header "METHODS" .IP "\fBnew\fR" 4 .IX Item "new" Object-oriented (only): .Sp \&\fBOWNet::new\fR( \fIaddress\fR ) .Sp Create a new OWNet object \*(-- corresponds to an \fBowserver\fR. .Sp Error (and undef return value) if: .RS 4 .IP "1 Badly formed tcp/ip \fIaddress\fR" 4 .IX Item "1 Badly formed tcp/ip address" .PD 0 .IP "2 No \fBowserver\fR at \fIaddress\fR" 4 .IX Item "2 No owserver at address" .IP "" 4 .RE .RS 4 .RE .IP "\fBread\fR" 4 .IX Item "read" .RS 4 .IP "Non object-oriented:" 4 .IX Item "Non object-oriented:" .PD \&\fBOWNet::read\fR( \fIaddress\fR , \fIpath\fR [ , \fIsize\fR [ , \fIoffset\fR ] ] ) .IP "Object-oriented:" 4 .IX Item "Object-oriented:" \&\f(CW$ownet\fR\->\fBread\fR( \fIpath\fR [ , \fIsize\fR [ , \fIoffset\fR ] ] ) .RE .RS 4 .Sp Read the value of a 1\-wire device property. Returns the (scalar string) value of the property. .Sp \&\fIsize\fR (number of bytes to read) is optional .Sp \&\fIoffset\fR (number of bytes from start of field to start write) is optional .Sp Error (and undef return value) if: .IP "1 (Non object) No \fBowserver\fR at \fIaddress\fR" 4 .IX Item "1 (Non object) No owserver at address" .PD 0 .IP "2 (Object form) Not called with a valid OWNet object" 4 .IX Item "2 (Object form) Not called with a valid OWNet object" .IP "3 Bad \fIpath\fR" 4 .IX Item "3 Bad path" .IP "4 \fIpath\fR not a readable device property" 4 .IX Item "4 path not a readable device property" .IP "" 4 .RE .RS 4 .RE .IP "\fBwrite\fR" 4 .IX Item "write" .RS 4 .IP "Non object-oriented:" 4 .IX Item "Non object-oriented:" .PD \&\fBOWNet::write\fR( \fIaddress\fR , \fIpath\fR , \fIvalue\fR [ , \fIoffset\fR ] ) .IP "Object-oriented:" 4 .IX Item "Object-oriented:" \&\f(CW$ownet\fR\->\fBwrite\fR( \fIpath\fR , \fIvalue\fR [ , \fIoffset\fR ] ) .RE .RS 4 .Sp Set the value of a 1\-wire device property. Returns \*(L"1\*(R" on success. .Sp \&\fIoffset\fR (number of bytes from start of field to start write) is optional .Sp Error (and undef return value) if: .IP "1 (Non object) No \fBowserver\fR at \fIaddress\fR" 4 .IX Item "1 (Non object) No owserver at address" .PD 0 .IP "2 (Object form) Not called with a valid OWNet object" 4 .IX Item "2 (Object form) Not called with a valid OWNet object" .IP "3 Bad \fIpath\fR" 4 .IX Item "3 Bad path" .IP "4 \fIpath\fR not a writable device property" 4 .IX Item "4 path not a writable device property" .IP "5 \fIvalue\fR incorrect size or format" 4 .IX Item "5 value incorrect size or format" .IP "" 4 .RE .RS 4 .RE .IP "\fBdir\fR" 4 .IX Item "dir" .RS 4 .IP "Non object-oriented:" 4 .IX Item "Non object-oriented:" .PD \&\fBOWNet::dir\fR( \fIaddress\fR , \fIpath\fR ) .IP "Object-oriented:" 4 .IX Item "Object-oriented:" \&\f(CW$ownet\fR\->\fBdir\fR( \fIpath\fR ) .RE .RS 4 .Sp Return a comma-separated list of the entries in \fIpath\fR. Entries are equivalent to \*(L"fully qualified names\*(R" \*(-- full path names. .Sp Error (and undef return value) if: .IP "1 (Non object) No \fBowserver\fR at \fIaddress\fR" 4 .IX Item "1 (Non object) No owserver at address" .PD 0 .IP "2 (Object form) Not called with a valid OWNet object" 4 .IX Item "2 (Object form) Not called with a valid OWNet object" .IP "3 Bad \fIpath\fR" 4 .IX Item "3 Bad path" .IP "4 \fIpath\fR not a directory" 4 .IX Item "4 path not a directory" .IP "" 4 .RE .RS 4 .RE .IP "\fBpresent\fR (deprecated)" 4 .IX Item "present (deprecated)" .RS 4 .IP "Non object-oriented:" 4 .IX Item "Non object-oriented:" .PD \&\fBOWNet::present\fR( \fIaddress\fR , \fIpath\fR ) .IP "Object-oriented:" 4 .IX Item "Object-oriented:" \&\f(CW$ownet\fR\->\fBpresent\fR( \fIpath\fR ) .RE .RS 4 .Sp Test if a 1\-wire device exists. .Sp Error (and undef return value) if: .IP "1 (Non object) No \fBowserver\fR at \fIaddress\fR" 4 .IX Item "1 (Non object) No owserver at address" .PD 0 .IP "2 (Object form) Not called with a valid OWNet object" 4 .IX Item "2 (Object form) Not called with a valid OWNet object" .IP "3 Bad \fIpath\fR" 4 .IX Item "3 Bad path" .IP "4 \fIpath\fR not a device" 4 .IX Item "4 path not a device" .IP "" 4 .RE .RS 4 .RE .PD .SH "DESCRIPTION" .IX Header "DESCRIPTION" .SS "\s-1OWFS\s0" .IX Subsection "OWFS" \&\fI\s-1OWFS\s0\fR is a suite of programs that allows easy access to \fIDallas Semiconductor\fR's 1\-wire bus and devices. \&\fI\s-1OWFS\s0\fR provides a consistent naming scheme, safe multplexing of 1\-wire traffice, multiple methods of access and display, and network access. The basic \fI\s-1OWFS\s0\fR metaphor is a file-system, with the bus beinng the root directory, each device a subdirectory, and the the device properties (e.g. voltage, temperature, memory) a file. .SS "1\-Wire" .IX Subsection "1-Wire" \&\fI1\-wire\fR is a protocol allowing simple connection of inexpensive devices. Each device has a unique \s-1ID\s0 number (used in its \s-1OWFS\s0 address) and is individually addressable. The bus itself is extremely simple \*(-- a data line and a ground. The data line also provides power. 1\-wire devices come in a variety of packages \*(-- chips, commercial boxes, and iButtons (stainless steel cans). 1\-wire devices have a variety of capabilities, from simple \s-1ID\s0 to complex voltage, temperature, current measurements, memory, and switch control. .SS "Programs" .IX Subsection "Programs" Connection to the 1\-wire bus is either done by bit-banging a digital pin on the processor, or by using a bus master \*(-- \s-1USB\s0, serial, i2c, parallel. The heavy-weight \fI\s-1OWFS\s0\fR programs: \fBowserver\fR \fBowfs\fR \fBowhttpd\fR \fBowftpd\fR and the heavy-weight perl module \fB\s-1OW\s0\fR all link in the full \fI\s-1OWFS\s0\fR library and can connect directly to the bus master(s) and/or to \fBowserver\fR. .PP \&\fBOWNet\fR is a light-weight module. It connects only to an \fBowserver\fR, does not link in the \fI\s-1OWFS\s0\fR library, and should be more portable.. .SS "Object-oriented" .IX Subsection "Object-oriented" \&\fBOWNet\fR can be used in either a classical (non-object-oriented) manner, or with objects. The object stored the ip address of the \fBowserver\fR and a network socket to communicate. \&\fBOWNet\fR will use persistent tcp connections for the object form \*(-- potentially a performance boost over a slow network. .SH "EXAMPLES" .IX Header "EXAMPLES" .SS "owserver" .IX Subsection "owserver" \&\fBowserver\fR is a separate process that must be accessible on the network. It allows multiple clients, and can connect to many physical 1\-wire adapters and 1\-wire devices. It's address must be discoverable \*(-- either set on the command line, or at it's default location, or by using Bonjour (zeroconf) service discovery. .PP An example owserver invocation for a serial adapter and explicitly chooses the default port: .PP .Vb 1 \& owserver \-d /dev/ttyS0 \-p 4304 .Ve .SS "OWNet" .IX Subsection "OWNet" .Vb 1 \& use OWNet ; \& \& # Create owserver object \& my $owserver = OWNet\->new(\*(Aqlocalhost:4304 \-v \-F\*(Aq) ; #default location, verbose errors, Fahrenheit degrees \& # my $owserver = OWNet\->new() ; #simpler, again default location, no error messages, default Celsius \& \& #print directory \& print $owserver\->dir(\*(Aq/\*(Aq) ; \& \& #print temperature from known device (DS18S20, ID: 10.13224366A280) \& print "Temperature: ".$owserver\->read(\*(Aq/uncached/10.13224366A280/temperature\*(Aq) ; \& \& # Now for some fun \-\- a tree of everything: \& sub Tree($$) { \& my $ow = shift ; \& my $path = shift ; \& \& print "$path\et" ; \& \& # first try to read \& my $value = $ow\->read($path) ; \& if ( defined($value) ) { \& print "$value\en"; \& return ; \& } \& \& # not readable, try as directory \& my $dirstring = $ow\->dir($path) ; \& if ( defined($dirstring) ) { \& print "\en" ; \& my @dir = split /,/ , $ow\->dir($path) ; \& foreach (@dir) { \& Tree($ow,$_) ; \& } \& return ; \& } \& \& # can\*(Aqt read, not directory \& print "\en" ; \& return ; \& } \& \& Tree( $owserver, \*(Aq/\*(Aq ) ; .Ve .SH "INTERNALS" .IX Header "INTERNALS" .SS "Object properties (All private)" .IX Subsection "Object properties (All private)" .IP "\s-1ADDR\s0" 4 .IX Item "ADDR" literal sting for the \s-1IP\s0 address, in dotted-quad or host format. This property is also used to indicate a substantiated object. .IP "\s-1PORT\s0" 4 .IX Item "PORT" string for the port number (or service name). Service name must be specified as :owserver or the like. .IP "\s-1SG\s0" 4 .IX Item "SG" Flag sent to server, and returned, that encodes temperature scale and display format. Persistence is also encoded in this word in the actual tcp message, but kept separately in the object. .IP "\s-1VERBOSE\s0" 4 .IX Item "VERBOSE" Print error messages? Set by \*(L"\-v\*(R" in object invocation. .IP "\s-1SLASH\s0" 4 .IX Item "SLASH" Add \*(L"/\*(R" to the end of directory entries. Set by \*(L"\-slash\*(R" in object invocation. .IP "\s-1SOCK\s0" 4 .IX Item "SOCK" Socket address (object) for communication. Stays defined for persistent connections, else deleted between calls. .IP "\s-1PERSIST\s0" 4 .IX Item "PERSIST" State of socket connection (persistent means the same socket is used which speeds network communication). .IP "\s-1VER\s0" 4 .IX Item "VER" owprotocol version number (currently 0) .SS "Private methods" .IX Subsection "Private methods" .IP "_self" 4 .IX Item "_self" Takes either the implicit object reference (if called on an object) or the ip address in non-object format. In either case a socket is created, the persistence bit is properly set, and the address parsed. Returns the object reference, or undef on error. Called by each external method (read,write,dir) on the first parameter. .IP "_new" 4 .IX Item "_new" Takes command line invocation parameters (for an object or not) and properly parses and sets up the properties in a hash array. .IP "_Sock" 4 .IX Item "_Sock" Socket processing, including tests for persistence and opening. If no host is specified, localhost (127.0.0.1) is used. If no port is specified, uses the \s-1IANA\s0 allocated well known port (4304) for owserver. First looks in /etc/services, then just tries 4304. .IP "_ToServer" 4 .IX Item "_ToServer" Sends a message to owserver. Formats in owserver protocol. If a persistent socket fails, retries after new socket created. .IP "_FromServerBinaryParse" 4 .IX Item "_FromServerBinaryParse" Reads a specified length from server .IP "_FromServer" 4 .IX Item "_FromServer" Reads whole packet from server, using _FromServerBinaryParse (first for header, then payload). Discards ping packets silently. .IP "_BonjourLookup" 4 .IX Item "_BonjourLookup" Uses the mDNS service discovery protocol to find an available owserver. Employs NET::Rendezvous (an earlier name or Apple's Bonjour) This module is loaded only if available. (Uses the method of http://sial.org/blog/2006/12/optional_perl_module_loading.html) .SH "AUTHOR" .IX Header "AUTHOR" Paul H Alfille paul.alfille@gmail.com .SH "BUGS" .IX Header "BUGS" Support for proper timeout using the \*(L"select\*(R" function seems broken in perl. This might leave the routines vulnerable to network timing errors. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "http://www.owfs.org" 4 .IX Item "http://www.owfs.org" Documentation for the full \fBowfs\fR program suite, including man pages for each of the supported 1\-wire devices, and more extensive explanatation of owfs components. .IP "http://owfs.sourceforge.net/projects/owfs" 4 .IX Item "http://owfs.sourceforge.net/projects/owfs" Location where source code is hosted. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2007 Paul H Alfille. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. owfs-3.1p5/src/man/man3/Thermachron.30000644000175000001440000000002212756371512014256 00000000000000.so man3/DS1921.3 owfs-3.1p5/src/man/man3/UVI.30000644000175000001440000000002012756371512012445 00000000000000.so man3/EEEF.3 owfs-3.1p5/src/man/man3/Makefile.in0000644000175000001440000005202713022537053013770 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/man/man3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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; }; \ } man3dir = $(mandir)/man3 am__installdirs = "$(DESTDIR)$(man3dir)" NROFF = nroff MANS = $(dist_man3_MANS) $(man3_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(dist_man3_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MANFILES = \ DS1821.man DS1822.man DS1825.man DS18B20.man DS18S20.man DS1921.man \ DS1963L.man DS1963S.man DS1977.man DS1991.man DS1992.man DS1993.man \ DS1995.man DS1996.man DS2401.man DS2404.man DS2405.man DS2406.man \ DS2408.man DS2409.man DS2413.man DS2415.man DS2423.man DS2430A.man \ DS2431.man DS2433.man DS2436.man DS2437.man DS2438.man DS2450.man \ DS2502.man DS2505.man DS2506.man DS2720.man DS2740.man DS2751.man \ DS2755.man DS2760.man DS2770.man DS2780.man DS2781.man DS2890.man \ DS28E04.man DS28EA00.man DS28EC20.man EDS.man EEEF.man LCD.man mAM001.man \ mCM001.man mDI001.man mRS001.man owperl.man SOFILES = \ addressing.3so description.3so seealso.3so standard.3so standard_mini.3so \ temperature_errata.3so temperature_threshold.3so temperature_resolution.3so temperatures_mini.3so dist_man3_MANS = \ DS1427.3 DS1904.3 DS1920.3 DS1971.3 DS1982.3 DS1982U.3 DS1985.3 DS1985U.3 \ DS1986.3 DS1986U.3 DS1990A.3 DS1994.3 DS2404S.3 DS2407.3 DS2411.3 \ DS2417.3 DS2502-E48.3 DS2502-UNW.3 DS2505-UNW.3 DS2506-UNW.3 DS2756.3 \ DS2761.3 DS2762.3 DS2788.3 DS2804.3 EDS0064.3 EDS0065.3 EDS0066.3 \ EDS0067.3 EDS0068.3 EDS0070.3 EDS0071.3 EDS0072.3 EDS0080.3 EDS0082.3 \ EDS0083.3 EDS0085.3 EDS0090.3 MAX31820.3 MAX31826.3 MAX31850.3 MAX31851.3 \ OWNet.3 Thermachron.3 UVI.3 EXTRA_DIST = $(SOFILES) $(MANFILES) @SOELIM_FALSE@man3_MANS = $(MANFILES) $(SOFILES) @SOELIM_TRUE@man3_MANS = $(addsuffix .3,$(basename $(MANFILES))) @SOELIM_TRUE@CLEANFILES = $(man3_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) --foreign src/man/man3/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/man/man3/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(dist_man3_MANS) $(man3_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man3_MANS) $(man3_MANS)'; \ list2=''; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || 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 '/\.3[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,^[^3][0-9a-z]*$$,3,;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)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$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)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list='$(dist_man3_MANS) $(man3_MANS)'; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man3dir)"; 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 clean-libtool 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-man3 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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man3 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-man3 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man3 .PRECIOUS: Makefile # preproc man pages via soelim @SOELIM_TRUE@$(man3_MANS): $(MANFILES) $(SOFILES) @SOELIM_TRUE@%.3 :: %.man @SOELIM_TRUE@ $(SOELIM) -r -I $(srcdir)/.. $< > $@ # 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: owfs-3.1p5/src/man/man3/addressing.3so0000644000175000001440000000133412654730021014467 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" All 1-wire devices are factory assigned a unique 64-bit address. This address is of the form: .TP .B Family Code 8 bits .TP .B Address 48 bits .TP .B CRC 8 bits .IP .PP Addressing under OWFS is in hexidecimal, of form: .IP .B 01.123456789ABC .PP where .B 01 is an example 8-bit family code, and .B 12345678ABC is an example 48 bit address. .PP The dot is optional, and the CRC code can included. If included, it must be correct. owfs-3.1p5/src/man/man3/description.3so0000644000175000001440000000373712665167763014723 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SS 1-Wire .I 1-wire is a wiring protocol and series of devices designed and manufactured by Dallas Semiconductor, Inc. The bus is a low-power low-speed low-connector scheme where the data line can also provide power. .PP Each device is uniquely and unalterably numbered during manufacture. There are a wide variety of devices, including memory, sensors (humidity, temperature, voltage, contact, current), switches, timers and data loggers. More complex devices (like thermocouple sensors) can be built with these basic devices. There are also 1-wire devices that have encryption included. .PP The 1-wire scheme uses a single .I bus master and multiple .I slaves on the same wire. The bus master initiates all communication. The slaves can be individually discovered and addressed using their unique ID. .PP Bus masters come in a variety of configurations including serial, parallel, i2c, network or USB adapters. .SS OWFS design .I OWFS is a suite of programs that designed to make the 1-wire bus and its devices easily accessible. The underlying principle is to create a virtual filesystem, with the unique ID being the directory, and the individual properties of the device are represented as simple files that can be read and written. .PP Details of the individual slave or master design are hidden behind a consistent interface. The goal is to provide an easy set of tools for a software designer to create monitoring or control applications. There are some performance enhancements in the implementation, including data caching, parallel access to bus masters, and aggregation of device communication. Still the fundemental goal has been ease of use, flexibility and correctness rather than speed. owfs-3.1p5/src/man/man3/seealso.3so0000644000175000001440000000252612766364606014023 00000000000000.SS Programs .B owfs (1) owhttpd (1) owftpd (1) owserver (1) .B owdir (1) owread (1) owwrite (1) owpresent (1) .B owtap (1) .SS Configuration and testing .B owfs (5) owtap (1) owmon (1) .SS Language bindings .B owtcl (3) owperl (3) owcapi (3) .SS Clocks .B DS1427 (3) DS1904 (3) DS1994 (3) DS2404 (3) DS2404S (3) DS2415 (3) DS2417 (3) .SS ID .B DS2401 (3) DS2411 (3) DS1990A (3) .SS Memory .B DS1982 (3) DS1985 (3) DS1986 (3) DS1991 (3) DS1992 (3) DS1993 (3) DS1995 (3) DS1996 (3) DS2430A (3) DS2431 (3) DS2433 (3) DS2502 (3) DS2506 (3) DS28E04 (3) DS28EC20 (3) .SS Switches .B DS2405 (3) DS2406 (3) DS2408 (3) DS2409 (3) DS2413 (3) DS28EA00 (3) .SS Temperature .B DS1822 (3) DS1825 (3) DS1820 (3) DS18B20 (3) DS18S20 (3) DS1920 (3) DS1921 (3) DS1821 (3) DS28EA00 (3) DS28E04 (3) EDS0064 (3) EDS0065 (3) EDS0066 (3) EDS0067 (3) EDS0068 (3) EDS0071 (3) EDS0072 (3) MAX31826 (3) .SS Humidity .B DS1922 (3) DS2438 (3) EDS0065 (3) EDS0068 (3) .SS Voltage .B DS2450 (3) .SS Resistance .B DS2890 (3) .SS Multifunction (current, voltage, temperature) .B DS2436 (3) DS2437 (3) DS2438 (3) DS2751 (3) DS2755 (3) DS2756 (3) DS2760 (3) DS2770 (3) DS2780 (3) DS2781 (3) DS2788 (3) DS2784 (3) .SS Counter .B DS2423 (3) .SS LCD Screen .B LCD (3) DS2408 (3) .SS Crypto .B DS1977 (3) .SS Pressure .B DS2406 (3) TAI8570 (3) EDS0066 (3) EDS0068 (3) .SS Moisture .B EEEF (3) DS2438 (3) owfs-3.1p5/src/man/man3/standard.3so0000644000175000001440000000364712654730021014155 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SS address .SS r_address .I read-only, ascii .br The entire 64-bit unique ID. Given as upper case hexidecimal digits (0-9A-F). .br .I address starts with the .I family code .br .I r address is the .I address in reverse order, which is often used in other applications and labeling. .SS crc8 .I read-only, ascii .br The 8-bit error correction portion. Uses cyclic redundancy check. Computed from the preceding 56 bits of the unique ID number. Given as upper case hexidecimal digits (0-9A-F). .SS family .I read-only, ascii .br The 8-bit family code. Unique to each .I type of device. Given as upper case hexidecimal digits (0-9A-F). .SS id .SS r_id .I read-only, ascii .br The 48-bit middle portion of the unique ID number. Does not include the family code or CRC. Given as upper case hexidecimal digits (0-9A-F). .br .I r id is the .I id in reverse order, which is often used in other applications and labeling. .SS locator .SS r_locator .I read-only, ascii .br Uses an extension of the 1-wire design from iButtonLink company that associated 1-wire physical connections with a unique 1-wire code. If the connection is behind a .B Link Locator the .I locator will show a unique 8-byte number (16 character hexidecimal) starting with family code FE. .br If no .B Link Locator is between the device and the master, the .I locator field will be all FF. .br .I r locator is the .I locator in reverse order. .SS present (DEPRECATED) .I read-only, yes-no .br Is the device currently .I present on the 1-wire bus? .SS type .I read-only, ascii .br Part name assigned by Dallas Semi. E.g. .I DS2401 Alternative packaging (iButton vs chip) will not be distiguished. owfs-3.1p5/src/man/man3/standard_mini.3so0000644000175000001440000000061312654730021015157 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .B address | .B crc8 | .B id | .B locator | .B r_address | .B r_id | .B r_locator | .B type owfs-3.1p5/src/man/man3/temperature_errata.3so0000644000175000001440000000207112654730021016236 00000000000000.SH TEMPERATURE ERRATA There are a group of obscure internal properties exposed to protect against an hardware defect in certain batches of the B7 die of some DS18x20 chips. See http://www.1wire.org/en-us/pg_18.html or request AN247.pdf from Dallas directly. .SS errata/die .I read-only,ascii .br Two character manufacturing die lot. "B6" "B7" or "C2" .SS errata/trim .I read-write,unsigned integer .br 32 bit trim value in the EEPROM of the chip. When written, it does not seem to read back. Used for a production problem in the B7 .I die. .PP Read allowed for all chips. Only the B7 chips can be written. .SS errata/trimblanket .I read-write,yes-no .br Writing non-zero (=1) puts a default trim value in the chip. Only applied to the B7 .I die. Reading will be true (non-zero) if trim value is the blanket value. Again, only B7 chips will register true, and since the written trim values cannot be read, this value may have little utility. .SS errata/trimvalid .I read-only,yes-no .br Is the .I trim value in the valid range? Non-zero if true, which includes all non-B7 chips. owfs-3.1p5/src/man/man3/temperature_threshold.3so0000644000175000001440000000137012654730021016755 00000000000000.SH TEMPERATURE ALARM LIMITS When the device exceeds either .I temphigh or .I templow temperature threshold the device is in the alarm state, and will appear in the alarm directory. This provides an easy way to poll for temperatures that are unsafe, especially if .I simultaneous temperature conversion is done. .PP Units for the temperature alarms are in the same .I temperature scale that was set for .I temperature measurements. .PP Temperature thresholds are stored in non-volatile memory and persist until changed, even if power is lost. .SS temphigh .I read-write, integer .br Shows or sets the lower limit for the high temperature alarm state. .SS templow .I read-write, integer .br Shows or sets the upper limit for the low temperature alarm state. owfs-3.1p5/src/man/man3/temperature_resolution.3so0000644000175000001440000000137712756374331017206 00000000000000.SH TEMPERATURE RESOLUTION DEFAULT VALUE .SS tempres .I read-write, integer .br The device employs a non-volatile memory to store the default temperature resolution (9, 10, 11 or 12 bits) to be applied after power-up. This is useful if you use .I simultaneous temperature conversions. Reading this node gives you the value stored in the non-volatile memory. Writing sets a new power-on resolution value. .PP As a side effect, reading this node resets the temperature resolution used by .I simultaneous temperature conversions to its power-on value. It also affects the resolution value used by .B latesttemp, to scale the latest conversion value, so make sure to re-sample the temperature before accessing .B latesttemp after writing or reading the .B tempres value. owfs-3.1p5/src/man/man3/temperatures_mini.3so0000644000175000001440000000015012654730021016073 00000000000000.B fasttemp | .B temperature | .B temperature9 | .B temperature10 | .B temperature11 | .B temperature12 owfs-3.1p5/src/man/man3/DS1821.man0000644000175000001440000000675612654730021013252 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1821 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1821 \- Programmable Digital Thermostat and Thermometer .SH SYNOPSIS Thermostat. .PP .B thermostat [/[ .B temperature | .B temphigh | .B templow | .B temphighflag | .B templowflag | .B thermostatmode | .B polarity | .B 1shot ]] .SH FAMILY CODE .PP .I none .SH SPECIAL PROPERTIES .SS temperature .I read-only, floating point .br 9-bit resolution temperature. Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. Conversion takes 1 second. .SS temphigh templow .I read-write. floating point .br Temperature limits for alarms. Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. .br Note that alarms are not implemented. .SS temphighflag, templowflag .I read-write. yes-no .br .B temphighflag goes to 1 when .B temperature exceeds .B temphigh and stays at 1 until it is reset by writing it to zero. This state persists across power cycles and operates in both 1-wire and thermostat modes. .B templowflag behaves in the same way, monitoring the temperature with respect to .B templow. .SS thermostatmode .I read-write. yes-no .br When this bit is set to 1 the chip will enter thermostat mode on the next power-up. See the datasheet for further information on thermostat mode. .B NOTE: Once the DS1821 has entered thermostat mode it cannot be taken out back to 1-wire mode using a 1-wire interface. Special electrical incantations on the power and data lines must be performed that are not possible with a normal 1-wire bus master. A special circuit is required - see the datasheet for complete details. .SS polarity .I read-write. yes-no .br Controls the output sense of the thermostat output (DQ) while in thermostat mode. If .B polarity is 0 the output is active low. If it is 1, active high. .SS 1shot .I read-write. yes-no .br If this bit is 1, a START CONVERT command will begin a conversion and the chip will enter a low power state when the conversion is complete. If the bit is 0 then START CONVERT will begin a conversion and start another one as soon as it is done. STOP CONVERSION must be performed to get the conversion cycle to stop. This interface automatically issues a STOP CONVERSION command when going out of continuous mode. .so man3/temperature_threshold.3so .SH STANDARD PROPERTIES .SS type .I read-only, ascii .br Chip type: DS1821 .SH DESCRIPTION .so man3/description.3so .SS DS1821 The .B DS1821 (3) is a unique 1-wire device. It is unaddressable, and therefore there can be only one on a given bus. It is meant to be programmed once using 1-wire and then permanently installed in a thermostat circuit. Once in thermostat mode, it is no longer programmable from a 1-wire interface. It is possible to recover it into 1-wire mode but only with a special circuit. .SH ADDRESSING Unlike all other 1-wire chips, the ,B DS1821 (3) has no unique address. It is addressed as .B thermostat and will not announce itself in device discovery (directory listing). .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS1821.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1822.man0000644000175000001440000000452712756371575013267 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1822 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1822 \- Econo 1-Wire Digital Thermometer .SH SYNOPSIS Thermometer. .PP .B 22 [.]XXXXXXXXXXXX[XX][/[ .so man3/temperatures_mini.3so | .B latesttemp | .B die | .B power | .B temphigh | .B templow | .B tempres | .B trim | .B trimblanket | .B trimvalid | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 22 .SH SPECIAL PROPERTIES .SS power .I read-only,yes-no .br Is the chip powered externally (=1) or from the parasitically from the data bus (=0)? .SS temperature .I read-only, floating point .br Measured temperature with 12 bit resolution. .SS temperature9 temperature10 temperature11 temperature12 .I read-only, floating point .br Measured temperature at 9 to 12 bit resolution. There is a tradeoff of time versus accuracy in the temperature measurement. .SS latesttemp .I read-only, floating point .br Measured temperature at 9 to 12 bit resolution, depending on the resolution of the latest conversion on this chip. Reading this node will never trigger a temperature conversion. Intended for use in conjunction with .B /simultaneous/temperature. .SS fasttemp .I read-only, floating point .br Equivalent to .I temperature9 .so man3/temperature_threshold.3so .so man3/temperature_resolution.3so .so man3/temperature_errata.3so .SH STANDARD PROPERTIES .so man3/standard.3so .SH DESCRIPTION .so man3/description.3so .SS DS1822 The .B DS1822 (3) is one of several available 1-wire temperature sensors. Alternatives are the .B DS18S20 (3), .B DS18B20 (3) as well as temperature/voltage measurements in the .B DS2436 (3) and .B DS2438 (3). For truly versatile temperature measurements, see the protean .B DS1921 (3) Thermachron (3). .PP Although the .B DS1822 (3) can select between 4 resolutions, this program simplifies the interface by only implementing the fastest/roughest and slowest/best. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS1822.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1825.man0000644000175000001440000001222712756371542013260 00000000000000'\" '\" Copyright (c) 2003-2006 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1825 3 2006 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1825 \- Programmable Resolution 1-Wire Digital Thermometer with ID .TP .B MAX31826 \- Digital Temperature Sensor with 1Kb Lockable EEPROM .TP .B MAX31850 MAX31851 \- Cold-Junction Compensated Thermocouple .SH SYNOPSIS .SS Thermometer with hardware address pins (DS1825) .PP .B 3B [.]XXXXXXXXXXXX[XX][/[ .so man3/temperatures_mini.3so | .B latesttemp | .B power | .B prog_addr | .B temphigh | .B templow | .B tempres | .so man3/standard_mini.3so ]] .SS Digital Temperature Sensor with 1Kb Lockable EEPROM (MAX31826) .PP .B 3B [.]XXXXXXXXXXXX[XX][/[ .B temperature | .B latesttemp | .B power | .B memory | .B pages/page.[0-15|ALL] | .B prog_addr | .so man3/standard_mini.3so ]] .SS Cold-Junction Compensated Thermocouple (MAX31850 and MAX31851) .PP .B 3B [.]XXXXXXXXXXXX[XX][/[ .B temperature | .B latesttemp | .B thermocouple | .B fault | .B open_circuit | .B ground_short | .B vdd_short | .B power | .B prog_addr | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 3B .SH SPECIAL PROPERTIES .SS power .I read-only,yes-no .br Is the chip powered externally (=1) or from the parasitically from the data bus (=0)? .SS prog_addr .I read-only, 0-15 .br A distiguishing feature of the .B DS1825 (3) is the ability to set hardware pins for an address (0-15). This is an alternative to the unique 64-bit .I address that is set in the factory. .SS temperature .I read-only, floating point .br Measured temperature with 12 bit resolution. .P For the .B MAX31850 MAX 31851 this is the .I cold-junction temperature -- the temperature at the chip. See .I thermocouple .SS temperature9 temperature10 temperature11 temperature12 .I read-only, floating point ( .B DS1825 only) .P Measured temperature at 9 to 12 bit resolution. There is a tradeoff of time versus accuracy in the temperature measurement. .PP The .B MAX31826 MAX31850 MAX31851 measure all temperatures at 12 bit resoltion and will return that resolution to all the possible temperature properties. .SS latesttemp .I read-only, floating point .br Measured temperature at 9 to 12 bit resolution, depending on the resolution of the latest conversion on this chip. Reading this node will never trigger a temperature conversion. Intended for use in conjunction with .B /simultaneous/temperature. .SS fasttemp .I read-only, floating point .br Equivalent to .I temperature9 .SS thermocouple .I read-only, floating point ( .B MAX31850 MAX31851 only) .P Measured temperature of the thermocouple at 16bit resolution. Cold-junction temperature compensated. .PP The actual thermocouple type used is set by the selected chip type, and is not discoverable in software. .so man3/temperature_threshold.3so .PP The .B MAX31826 does NOT have temperature thresholds and temperature alarm. .so man3/temperature_resolution.3so .SH MEMORY Only the .B MAX31826 supports memory functions. .SS pages/page.0 .. pages/page.15 pages/page.ALL .I read/write, binary .br EEPROM memory pages of 8 bytes each. See the datasheet about locking contents. .SS memory .I read/write, binary .br EEPROM memory of 128 bytes. See the datasheet about locking contents. .SH FAULT REPORTING Only the .B MAX31850 MAX31851 supports fault reporting. .SS fault .I read-only, yes-no .br Fault in last thermocouple conversion .SS open_circuit .I read-only, yes-no .br Thermocouple leads disconnected. .SS ground_short .I read-only, yes-no .br Thermocouple lead shorted to ground. .SS vdd_short .I read-only, yes-no .br Thermocouple lead shorted to supply voltage. .SH STANDARD PROPERTIES .so man3/standard.3so .SH DESCRIPTION .so man3/description.3so .SS DS1825 The .B DS1825 (3) is one of several available 1-wire temperature sensors. Alternatives are the .B DS18S20 (3), .B DS18B20 (3), and .B DS1822 (3) as well as temperature/voltage measurements in the .B DS2436 (3) and .B DS2438 (3). For truly versatile temperature measurements, see the protean .B DS1921 (3) Thermachron (3). .PP The .B DS1825 (3) can select between 4 resolutionsspanning the fastest/roughest and slowest/best. .SS MAX31826 The .B MAX31826 shares a family code with the .B DS1825 but has differences in some of its functions. .PP The .B MAX31826 has 128 btes of EEPROM memory (as 16 pages of 8 bytes) while the .B DS1825 has no memory available. .PP The .B MAX31826 measures temperature at 12 bit resolution as fast as the .B DS1825's lowest resolution (and always uses 12-bit resolution). On the other hand it has no temperature thresholds or alarm function. .SH ADDRESSING .so man3/addressing.3so .PP Both the .B MAX31826 and the .B DS1825 allow hardware selection of part of the address, which can assist selecting between chips is some circuit designs. .SH DATASHEET .TP .B DS1825 http://pdfserv.maxim-ic.com/en/ds/DS1825.pdf .TP .B MAX31826 http://datasheets.maxim-ic.com/en/ds/MAX31826.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS18B20.man0000644000175000001440000000507212756374333013356 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS18B20 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .TP .B DS18B20 \- Programmable Resolution 1-Wire Digital Thermometer .TP .B MAX31820 \- Ambient Temperature Sensor .SH SYNOPSIS Thermometer. .PP .B 28 [.]XXXXXXXXXXXX[XX][/[ .so man3/temperatures_mini.3so | .B latesttemp | .B die | .B power | .B temphigh | .B templow | .B tempres | .B errata/die | .B errata/trim | .B errata/trimblanket | .B errata/trimvalid | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 28 .SH SPECIAL PROPERTIES .SS power .I read-only,yes-no .br Is the chip powered externally (=1) or from the parasitically from the data bus (=0)? .SS temperature .I read-only, floating point .br Measured temperature with 12 bit resolution. .SS temperature9 temperature10 temperature11 temperature12 .I read-only, floating point .br Measured temperature at 9 to 12 bit resolution. There is a tradeoff of time versus accuracy in the temperature measurement. .SS latesttemp .I read-only, floating point .br Measured temperature at 9 to 12 bit resolution, depending on the resolution of the latest conversion on this chip. Reading this node will never trigger a temperature conversion. Intended for use in conjunction with .B /simultaneous/temperature. .SS fasttemp .I read-only, floating point .br Equivalent to .I temperature9 .so man3/temperature_threshold.3so .so man3/temperature_resolution.3so .so man3/temperature_errata.3so .SH STANDARD PROPERTIES .so man3/standard.3so .SH DESCRIPTION .so man3/description.3so .SS DS18B20 The .B DS18B20 (3) is one of several available 1-wire temperature sensors. It is the replacement for the .B DS18S20 (3) Alternatives are .B DS1822 (3) as well as temperature/voltage measurements in the .B DS2436 (3) and .B DS2438 (3). For truly versatile temperature measurements, see the protean .B DS1921 (3) Thermachron (3). .P The .B MAX31820 is functionally identical to the .B DS18B20 except for it's voltage requirements. .br The .B DS18B20 (3) can select between 4 resolutions. In general, high resolution is the best choice unless your application is truly time-constrained. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS18B20.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS18S20.man0000644000175000001440000000434212665167763013404 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS18S20 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .TP .B DS18S20 \- High-Precision 1-Wire Digital Thermometer .TP .B DS1920 \- iButton version of the thermometer .SH SYNOPSIS Thermometer. .PP .B 10 [.]XXXXXXXXXXXX[XX][/[ .so man3/temperatures_mini.3so | .B latesttemp | .B die | .B power | .B temphigh | .B templow | .B trim | .B trimblanket | .B trimvalid | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 10 .SH SPECIAL PROPERTIES .SS power .I read-only,yes-no .br Is the chip powered externally (=1) or from the parasitically from the data bus (=0)? .SS temperature .I read-only, floating point .br Measured temperature with 12 bit resolution. .SS temperature9 temperature10 temperature11 temperature12 .I read-only, floating point .br Measured temperature at 9 to 12 bit resolution. There is a tradeoff of time versus accuracy in the temperature measurement. .SS latesttemp .I read-only, floating point .br Measured temperature at 9 to 12 bit resolution, depending on the resolution of the latest conversion on this chip. Reading this node will never trigger a temperature conversion. Intended for use in conjunction with .B /simultaneous/temperature. .SS fasttemp .I read-only, floating point .br Equivalent to .I temperature9 .so man3/temperature_threshold.3so .so man3/temperature_errata.3so .SH STANDARD PROPERTIES .so man3/standard.3so .SH DESCRIPTION .so man3/description.3so .SS DS18S20 DS1920 The .B DS18S20 (3) is one of several available 1-wire temperature sensors. It has been largely replaced by the .B DS18B20 (3) and .B DS1822 (3) as well as temperature/vlotage measurements in the .B DS2436 (3) and .B DS2438 (3). For truly versatile temperature measurements, see the protean .B DS1921 (3) Thermachron (3). .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS18S20.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1921.man0000644000175000001440000002064112654730021013240 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1921-Thermochron 3 2005 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1921 \- Thermochron temperature logging iButton. .SH SYNOPSIS Temperature logging iButton. .PP .B 21 [.]XXXXXXXXXXXX[XX][/[ .br .B about/[measuring| resolution| samples| templow| temphigh| version] | .br .B clock/[date| running| udate] | .br .B histotgram/[counts[0-62|ALL]| gap| temperature[counts[0-62|ALL]] | .br .B log[date[0-2047|ALL]| elements| temperature[0-2047|ALL]| udate[0-2047|ALL]] | .br .B memory | .br .B mission/[date| delay| easystart| frequency| rollover| running| samples| sampling| udate] | .br .B overtemp/[date[0-11|ALL]| elements| end[0-11|ALL]| count[0-11|ALL]| temperature[0-11|ALL]| udate[0-11|ALL]] | .br .B pages/page.[0-15|ALL] | .br .B temperature | .br .B undertemp/[date[0-11|ALL]| elements|end[0-11|ALL]| count[0-11|ALL]| temperature[0-11|ALL]| udate[0-11|ALL]] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 21 .SH SPECIAL PROPERTIES .SS about/measuring .I read-only, yes-no .br Is this .I DS1921 currently .I measuring a temperature? .SS about/resolution .I read-only, floating point .br What is the .I resolution of the temperature measurments (in the current temperature scale). .SS about/samples .I read-only, unsigned integer .br How many total temperature measurements has this .I DS1921 performed? .SS about/temphigh .I read-only, floating point .br Highest temperature this .I DS1921 can measure (in the current temperature scale). .SS about/templow .I read-only, floating point .br Lowest temperature this .I DS1921 can measure (in the current temperature scale). .SS about/version .I read-only, ascii .br Specific .I version of this .I DS1921. .SS clock/date .I read-write, ascii .br 26 character date representation of the internal time stored in this .I DS1921. Increments once per second while .I clock/running .br Setting .I date to a null string will put the current system time. .br Accepted date formats are: .br Sat[urday] March 12 12:23:59 2001 .br Apr[il] 4 9:34:56 2002 .br 3/23/04 23:34:57 .br current locale setting (your system's format) .SS clock/running .I read-write, yes-no .br Whether the internal clock is running. This can be explicitly set, and is automatically started by setting .I clock/date or .I clock/udate or by starting a mission with .I mission/easystart or .I mission/frequency .PP The main reason to stop the clock is to conserve the internal battery. The clock cannot be stopped during a mission, and the clock is essential for a mission. .SS clock/udate .I read-write, unsigned integer .br A numeric representation of .I clock/date .br The number of seconds in UNIX time (since Jan 1, 1970). .SS histogram/counts.0 ... histogram/counts.62 histogram/counts.ALL .I read-only, unsigned integer .br The number of samples in the current mission whose temperature fell within the .I histogram/temperature to .I histogram/temperature+histogram/gap range. .SS histogram/elements .I read-only, unsigned integer .br The number of bins in the histogram. Always 63. .SS histogram/gap .I read-only, floating point .br The size of the histogram bin. Depends on the Thermochron version ( .I about/version ) and is usually 4 times .I about/resolution .PP Given in the current temperatature scale. .SS histogram/temperature.0 ... histogram/temperature.62 histogram/temperature.ALL .I read-only, floating point .br Lower limit of the temperature range for the corresponding histogram bin. In the current temperature scale. .SS log/date.0 ... log/date.2047 log/date.ALL .I read-only, ascii .br Date that the corresponding .I log/temperature was taken, in ascii format. (See .I clock/date for more on the format). The number of valid entries is actually .I log/elements since the log may not be full. .PP .I mission/samples gives the total number of samples that have been taken but there is only room in the log for 2048 entries. Once the log is full, .I mission/rollover determines the Thermochron's behavior. .PP If .I mission/rollover is false(0), the log will hold the .B first 2048 samples and .I log/date.0 will always be the same as .I mission/date .PP If .I mission/rollover is true (1) then the log will hold the .B last 2048 samples and the entries will be shifted down with each new sample. .PP Note the .I OWFS code "untwists" the rollover behavior. The data will always be a linear array of earliest to latest. .PP .I ALL is the all data elements comma separated. .SS log/elements .I read-only, unsigned integer .br Number of valid entries in the log. .I OWFS offers the full 2048 values in the log memory, but not that many samples may yet have been taken. .I log/elements will range from 0 to 2048 and always be less than or equal to .I mission/samples .SS log/temperature.0 ... log/temperature.2047 log/temperature.ALL .I read-write, floating point .br The temperature readings (in the current temperature scale) that correspond to the .I log/date sample. See .I log/date for details on the indexing scheme and rollover behavior. .SS log/udate.0 ... log/udate.2047 log/udate.ALL .I read-write, unsigned integer .br A numeric representation of .I log/date .br The number of seconds in UNIX time (since Jan 1, 1970). .SS memory .I read-write, binary .br User available storage space. 512 bytes. Can also be accessed as 16 pages of 32 bytes with the .I pages/page.x properties. .SS overtemp/count.0 ... overtemp/count.11 overtemp/count.ALL .SS undertemp/count.0 ... undertemp/count.11 undertemp/count.ALL .I read-only, unsigned integer .br Number of sampling periods that the Thermochron stayed out of range durring a mission. Each sampling period is .I mission/frequency minutes long. .SS overtemp/end.0 ... overtemp/end.11 overtemp/end.ALL .SS undertemp/end.0 ... undertemp/end.11 undertemp/end.ALL .I read-only, ascii .br End of time that the Thermochron went out of range during the current mission. See .I clock/date for format. .PP Each period can be up to 255 samples in length, and span the time .I overtemp/date to .I overtemp/end ( or .I undertemp/date to .I undertemp/end ). .SS overtemp/date.0 ... overtemp/date.11 overtemp/date.ALL .SS undertemp/date.0 ... undertemp/date.11 undertemp/date.ALL .I read-only, ascii .br Time that the Thermochron went out of range during the current mission. See .I clock/date for format. .SS overtemp/elements .SS undertemp/elements .I read-only, unsigned integer .br Number of entries (0 to 12) in the .I overtemp or .I undertemp array. .SS overtemp/temperature .SS undertemp/temperature .I read-write, floating point .br Temperature limit to trigger alarm and error log. .I overtemp/temperature gives upper limit and .I undertemp/temperature gives lower limit. .br In current temperature scale. .SS overtemp/udate.0 ... overtemp/udate.11 overtemp/udate.ALL .SS undertemp/udate.0 ... undertemp/udate.11 undertemp/udate.ALL .I read-only, unsigned integer .br A numeric representation of .I overtemp/date or .I undertemp/date .br The number of seconds in UNIX time (since Jan 1, 1970). .SS pages/page.0 ... pages/page.15 pages/page.ALL .I read-write, binary .br Memory is split into 16 pages of 32 bytes each. User available. The log memory, register banks and histogram data area are all separate from this memory area. .br .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS temperature .I read-only, floating point .br Last temperature explicitly requested. Only available when the mission is not in progress. Value returned in in the current temperature scale. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS1921 Thermochron The .B DS1921 (3) is an iButton device with many intriguing functions. Essentially it monitors temperature, giving both a log of readings, and a histogram of temperature ranges. The specification is somewhat complex, but OWFS hides many of the implementation details. .PP While on a .I mission the .B DS1921 (3) records temperature readings in a 2048-sample log and adds them to a 62-bin histogram. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2438.pdf .br http://pdfserv.maxim-ic.com/en/an/humsensor.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1963L.man0000644000175000001440000000303512654730021013360 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1963L 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1963L \- 256 byte Monetary iButton .SH SYNOPSIS Non-volatile R/W memory with counters .PP .B 1A [.]XXXXXXXXXXXX[XX][/[ .B pages/count.[0-15|ALL] | .B memory | .B pages/page.[0-15|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 1A .SH SPECIAL PROPERTIES .SS page/count.[0-15|ALL] .I read-only, unsigned .br Each write to the memory page increments the counter. An application can tell if the memory has been changed by another process. .P Only 4 pages are actually connected to counters: .TP Counter1 .I page/counter.12 .TP Counter2 .I page/counter.13 .TP Counter3 .I page/counter.14 .TP Counter4 .I page/counter.15 .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS1963L The .B DS1963L (3) is used for read/write storage. It's main advantage is for audit trails (i.e. a digital purse). Each write to pages 12-15 will increment the read-only counter. .I OWFS system handles this automatically. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://datasheets.maxim-ic.com/en/ds/DS1963L.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1963S.man0000644000175000001440000000320312654730021013364 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1963S 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1963S \- 256 byte Monetary iButton with SHA-1 .SH SYNOPSIS Non-volatile R/W memory with counters, SHA-1 (under NDA) .PP .B 18 [.]XXXXXXXXXXXX[XX][/[ .B pages/count.[0-15|ALL] | .B memory | .B pages/page.[0-15|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 18 .SH SPECIAL PROPERTIES .SS page/count.[0-15|ALL] .I read-only, unsigned .br Each write to the memory page increments the counter. An application can tell if the memory has been changed by another process. .P Only 4 pages are actually connected to counters: .TP Counter1 .I page/counter.12 .TP Counter2 .I page/counter.13 .TP Counter3 .I page/counter.14 .TP Counter4 .I page/counter.15 .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS1963S The .B DS1963S (3) is used for read/write storage. It has SHA-1 authentication. Most of the information is under NDA and was not available for either the implementation of this man page. .P This man page corresponds to the non-secret .B DS1963L (3) .I OWFS system handles this automatically. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2822 .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1977.man0000644000175000001440000000572312654730021013257 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1977 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1977 \- Password Protected 32kbit Memory iButton .SH SYNOPSIS Non-volatile memory. .PP .B 37 [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-510|ALL] | .B set_number/full | .B set_number/read | .B set_password/enabled | .B set_password/full | .B set_password/read | .B use_number/full | .B use_number/read | .B use_password/full | .B use_password/read | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 37 DS1977 .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 32704 bytes of memory. Possibly protected by a password. .SS pages/page.0 ... pages/page.510 pages/page.ALL .I read-write, binary .br Memory is split into 511 pages of 64 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS set_number/full set_number/read .I write-only, ascii .br Passwords entered as numbers, either decimal, or hex of form 0x0123456789ABCDEF. Handled the same as .I set_password/xxx .SS set_password/enable .I read-write, yes-no .br Turn on/off password protection for the DS1977, or return the current state. .SS set_password/full set_password/read .I write-only, binary .br Passwords (8 byte values) that allow read or full access to the DS1977 memory. The password set by .I set_password/xxx are stored in the DS1977 and locally in the program as well (as if .I use_password/xxx was also called). .SS use_password/full use_password/read .I write-only, binary .br Passwords (8 byte values) that allow read or full access to the DS1977 memory. The password set by .SS use_number/full use_number/read .I write-only, ascii .br Passwords entered as numbers, either decimal, or hex of form 0x0123456789ABCDEF. Handled the same as .I use_password/xxx .SS use_password/full use_password/read .I write-only, binary .br Passwords (8 byte values) that allow read or full access to the DS1977 memory. The password set by .I use_password/xxx are stored in the program and must match the passwords stored in the DS1977. Changing the DS1977 passwords using .I set_password/xxx will change these values as well. .I use_password/xxx are stored in the program and must match the passwords stored in the DS1977. Changing the DS1977 passwords using .I set_password/xxx will change these values as well. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS1977 The .B DS1977 (3) is an iButton with static memory that is optionally protected by a password. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS1977.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1991.man0000644000175000001440000000703312654730021013247 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1991 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1991 \- 1152bit MultiKey iButton .SH SYNOPSIS Non-volatile memory with password protection. .PP .B 02 [.]XXXXXXXXXXXX[XX][/[ .B subkey0/reset. .I hex_pwd | .B subkey0/password. .I hex_pwd | .B subkey0/secure_data. .I hex_pwd | .B subkey0/id. .I hex_pwd .PP .B 02 [.]XXXXXXXXXXXX[XX][/[ .B subkey1/reset. .I hex_pwd | .B subkey1/password. .I hex_pwd | .B subkey1/secure_data. .I hex_pwd | .B subkey1/id. .I hex_pwd .PP .B 02 [.]XXXXXXXXXXXX[XX][/[ .B subkey0/reset. .I hex_pwd | .B subkey2/password. .I hex_pwd | .B subkey2/secure_data. .I hex_pwd | .B subkey2/id. .I hex_pwd .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 02 .SH SPECIAL PROPERTIES .SS subkey[0|1|2]/reset.hex_pwd .I write-only, yes-no .br Initialize one of the three secure data areas and set a new password. .PP The extension (hex_pwd) is the new 8-byte password in hexidecimal (e.g. password.000204006080A0C0E for bytes 0,2,4,6,8,10,12,14) .PP The data must be "1" or "yes" to actually reset the subkey. .PP .I Note: writing a password will clear any existing data and ID. .SS subkey[0|1|2]/password.hex_pwd .I write-only, binary .br Change the .I password of one of the secure subkey areas .I without losing data. .PP The extension (hex_pwd) is the existing 8-byte .I password in hexidecimal (e.g. password.00020406080A0C0E for bytes 0,2,4,6,8,10,12,14) .PP The data portion is 8 bytes that will be used as a new .I password. .SS subkey[0|1|2]/secure_data.hex_pwd .I read-write, binary .br Read or write data in one of the three sucure data areas. .PP The extension (hex_pwd) is the existing 8-byte password in hexidecimal (e.g. password.00020406080A0C0E for bytes 0,2,4,6,8,10,12,14) .PP The data portion binary data. Up to 48 bytes in each subkey area, starting at location 0. If the wrong password is specified, "random data" is returned on read and data is silently ignored on write. .SS subkey[0|1|2]/id.hex_pwd .I read-write, binary .br Read or write the subkey .I id. .PP The extension (hex_pwd) is the existing 8-byte password in hexidecimal (e.g. password.00020406080A0C0E for bytes 0,2,4,6,8,10,12,14) .PP The data portion 8 binary bytes. This is the subkey .I id. The correct password must be used to write a new .I id but not to read it. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS1991 The .B DS1991 (3) is an iButton with password protected non-volatile memory. Data is read/written with error checking (transparent to the user). The memory is divided into 3 different pages with 3 separate passwords. .PP In theory, choosing an incorrect password is hard to discern because the chip responds normally but with incorrect data. There is a published analysis suggesting that the "random data" follows a pattern and so a concerted attack might be successful. .PP The password (in hexidecimal) is used a the file extension .B 02.1234123414/subkey0/id. .I password allowing a password to be passed to the program within the filesystem paradigm. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS1991.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Christian Magnusson (mag@mag.cx) and Paul Alfille owfs-3.1p5/src/man/man3/DS1992.man0000644000175000001440000000302112654730021013241 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1992 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1992 \- 1kbit Memory iButton .SH SYNOPSIS Non-volatile memory. .PP .B 08 [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-3|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .TP .I 08 DS1996 .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 128 bytes of memory. .SS pages/page.0 ... pages/page.3 pages/page.ALL .I read-write, binary .br Memory is split into 4 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS1992 The .B DS1992 (3) is an iButton with static memory. Data is read/written with error checking (transparent to the user). The .B DS1992 (3) , .B DS1993 (3) , .B DS1995 (3) , and .B DS1996 (3) differ in their function by the amount of on-board memory they possess. (The internal protocols are slightly different, but the .I OWFS system handles this automatically.) .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS1992-DS1993.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1993.man0000644000175000001440000000300312654730021013242 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1993 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1993 \- 4kbit Memory iButton .SH SYNOPSIS Non-volatile memory. .PP .B 06 [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-15|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .TP .I 06 DS1996 .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 512 bytes of memory. .SS pages/page.0 ... pages/page.15 pages/page.ALL .I read-write, binary .br Memory is split into 16 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS1993 The .B DS1993 (3) is an iButton with static memory. Data is read/written with error checking (transparent to the user). The .B DS1992 , .B DS1993 , .B DS1995 , and .B DS1996 differ in their function by the amount of on-board memory they possess. (The internal protocols are slightly different, but the .I OWFS system handles this automatically.) .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS1992-DS1993.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1995.man0000644000175000001440000000277612654730021013264 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1995 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1995 \- 16kbit Memory iButton .SH SYNOPSIS Non-volatile memory. .PP .B 0A [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-63|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .TP .I 0A DS1996 .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 2048 bytes of memory. .SS pages/page.0 ... pages/page.63 pages/page.ALL .I read-write, binary .br Memory is split into 64 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS1995 The .B DS1995 (3) is an iButton with static memory. Data is read/written with error checking (transparent to the user). The .B DS1992 , .B DS1993 , .B DS1995 , and .B DS1996 differ in their function by the amount of on-board memory they possess. (The internal protocols are slightly different, but the .I OWFS system handles this automatically.) .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS1995.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS1996.man0000644000175000001440000000300112654730021013243 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS1996 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS1996 \- 64kbit Memory iButton .SH SYNOPSIS Non-volatile memory. .PP .B 0C [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-255|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .TP .I 0C DS1996 .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 8192 bytes of memory. .SS pages/page.0 ... pages/page.255 pages/page.ALL .I read-write, binary .br Memory is split into 256 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS1996 The .B DS1996 (3) is an iButton with static memory. Data is read/written with error checking (transparent to the user). The .B DS1992 , .B DS1993 , .B DS1995 , and .B DS1996 differ in their function by the amount of on-board memory they possess. (The internal protocols are slightly different, but the .I OWFS system handles this automatically.) .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS1996.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2401.man0000644000175000001440000000235512654730021013234 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2401 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2401 \- Silicon Serial Number .TP .B DS1990A \- Serial Number iButton .PP .B 01 [.]XXXXXXXXXXXX[XX][/[ .so man3/standard_mini.3so ]] .SH SYNOPSIS Unique serial number only. .SH FAMILY CODE .PP .I 01 .SH SPECIAL PROPERTIES None. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2401 DS1990A The .B DS2401 (3) and .B DS1990A (3) are the most basic of 1-wire devices. Their sole property is it's unique address. It can be used for unique identification. Nonetheless, many keylocks, night watchman systems, and tracking systems use this device. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2401.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1990A-F3-DS1990A-F5.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2404.man0000644000175000001440000001364612654730021013244 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2404 3 2006 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2404 \- EconoRAM time chip .TP .B DS2404S \- Dual port memory plus time .TP .B DS1994 \- 4k plus time iButton .TP .B DS1427 \- Time iButton .SH SYNOPSIS Real time clock, 4kbit memory. 3-wire interface, too. .P .B 04.XXXXXXXXXXXX / .B alarm | .B auto | .B cycle | .B date | .B delay | .B interval | .B memory | .B pages/page.[0-15|ALL] | .B readonly/[memory|clock|cycle|interval] | .B memory | .B pages/page.[0-15|ALL] | .B readonly/[memory|clock|cycle|interval] | .B running | .B set_alarm | .B start | .B trigger/[cycle,date,interval,udate,uinterval] | .B udate | .B uinterval | .so man3/standard_mini.3so .P .B 84.XXXXXXXXXXXX / .B alarm | .B auto | .B cycle | .B date | .B delay | .B interval | .B memory | .B pages/page.[0-15|ALL] | .B readonly/[memory|clock|cycle|interval] | .B running | .B set_alarm | .B start | .B trigger/[cycle,date,interval,udate,uinterval] | .B udate | .B uinterval | .B address | .B crc8 | .B id | .B present | .B type .SH FAMILY CODE .TP .I 04 DS2404 DS1994 .TP .I 84 DS1427 DS2404S .SH SPECIAL PROPERTIES .SS alarm .I read-write, unsigned integer (0-111) .br .I Alarm state of the .I DS2404 (3) triggered by time or counter events. Reading the alarm state clears the alarm. .br The .I alarm value is of the form CIR, where: .TP C .I cycle counter alarm .br .I 0 no .br .I 1 yes .TP I .I interval timer alarm .br .I 0 no .br .I 1 yes .TP R real-time clock alarm .br .I 0 no .br .I 1 yes .SS auto .I read-write, yes-no .br Flag for mode of .I interval counter operation. 0=manual 1=auto .br See the .I datasheet for details. .SS date .I read-write, ascii .br 26 character date representation of the .I udate value. Increments once per second while .I running .br Actual internal representation has higher precision. .br Cannot be altered if .I readonly/clock is set. .br Setting .I date to a null string will put the current system time. .br Accepted date formats are: .br Sat[urday] March 12 12:23:59 2001 .br Apr[il] 4 9:34:56 2002 .br 3/23/04 23:34:57 .br current locale setting (your system's format) .SS delay .I read-write, yes-no .br Flag for adding a delay to .I cycle counter. 0=short 1-long .br See the .I datasheet under "IDEL" for details. .SS interval .I read-write, date .br Interval timer value, represented as a .I date string. More typically will be used as .I uinterval to read the actual elapsed seconds. .SS memory .I read-write, binary .br 512 bytes of memory. The .I readonly/memory flag prevents further change. .SS pages/page.0 ... pages/page.15 pages/page.ALL .I read-write, yes-no .br Memory is split into 16 pages of 32 bytes each. The .I readonly/memory flag prevents further change. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS readonly/[memory|clock|interval|cycle] .I read-write, yes-no .br Permanently protect part of the chip's function from alteration. .TP .I readonly/memory .I page.X and . I memory .TP .I readonly/clock .I date and .I udate .TP .I readonly/interval .I interval .TP .I readonly/cycle .I cycle .SS running .I read-write, yes-no .br State of the clock. 0=off 1=running. .SS set_alarm .I read-write, unsigned integer (0-111) .br Which of the .I alarm triggers are enabled in the .I DS2404 (3) .br The .I set_alarm value is of the form CIR, where: .TP C .I cycle counter alarm .br .I 0 no .br .I 1 yes .TP I .I interval timer alarm .br .I 0 no .br .I 1 yes .TP R real-time clock alarm .br .I 0 no .br .I 1 yes .SS start .I read-write, yes-no .br Flag for starting the .I interval counter operation if not in .I auto mode. 0=stop 1=start .br See the .I datasheet for details. .SS trigger/[cycle,date,interval,udate,uinterval] .I read-write,varies .br Target value that will .I trigger the .I alarm if the corresponding .I set_alarm field is set. .br The format is the same as the similarly named field (i.e. .I date for .I trigger/date ) .SS udate .I read-write, unsigned integer .br Time represented as a number. .I udate increments once per second, while .I running is on. .br Usually set to unix time standard: number of seconds since Jan 1, 1970. The .I date field will be the unix representation of .I udate and setting either will change the other. .SS uinterval .I read-write, unsigned interval .br Similar to the .I udate field, except corresponds to the .I interval value. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None implemented. .SH DESCRIPTION .so man3/description.3so .SS DS1427 DS1994 DS2404 DS2404S The .B DS1427 (3), DS1994 (3), DS2404 (3), and .B DS2404S (3) family of 1-wire devices includes clock functions, with timers, memory, counters and alarms. It is possible to write-protect regians of memory. Uses include software or hardware timing and control. .P .SS Chips Both the .B DS2404 (3) and .B DS2404S (3) have 1-wire and 3-wire interfaces, which might be useful for transferring data between the 2 buses. They act as a passive slave to both busses. The .B DS2404 (3) and .B DS2404S (3) require an external source of power and an external crystal. They also offer a reset and 1HZ clock pin. .P .SS iButtons Both the .B DS1427 and .B DS1994 offer the memory, alarms, and clock function in iButton format. Because the iButton is a complete sealed package, battery and crystal are internal. Everything is access via the 1-wire interface. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2404.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS2404S-C01.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1994.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1427.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2405.man0000644000175000001440000000330512654730021013234 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2405 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2405 \- Addressable Switch .SH SYNOPSIS 1-wire network branch controller. .PP .B 05 [.]XXXXXXXXXXXX[XX][/[ .B PIO | .B sensed | .so man3/standard_mini.3so ]] .SH FAMILY CODE .TP .I 05 .SH SPECIAL PROPERTIES .SS PIO .I read-write, yes-no .br State of the open-drain output ( .I PIO ) pin. 0 = non-conducting (off), 1 = conducting (on). .br Writing zero will turn off the switch, non-zero will turn on the switch. Reading the .I PIO state will return the switch setting. To determine the actual logic level at the switch, refer to the .I sensed property. .SS sensed .I read-only, yes-no .br Logic level at the .I PIO pin. 0 = ground. 1 = high (~2.4V - 5V ). Really makes sense only if the .I PIO state is set to zero (off), else will read zero. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None implemented. .SH DESCRIPTION .so man3/description.3so .SS DS2405 The .B DS2405 (3) allows control of other devices, like LEDs and relays. It is an early design and has been superceeded by the .B DS2406 and .B DS2408 or even .B DS2450 that have more PIO pins, and do not employ an arcane use the the alarm state to signal PIO status. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2405.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2406.man0000644000175000001440000001356412654730021013245 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2406 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2406, DS2407 \- Dual Addressable Switch with 1kbit Memory, Hidable Dual Addressable Switch with 1kbit Memory .SH SYNOPSIS Dual Switch, Write-once Memory .PP .B 12 [.]XXXXXXXXXXXX[XX][/[ .B channels | .B latch.[A|B|ALL|BYTE] | .B memory | .B pages/page.[0-3|ALL] | .B PIO.[A|B|ALL|BYTE] | .B power | .B sensed.[A|B|ALL|BYTE] | .B set_alarm | .B TAI8570/[sibling|temperature|pressure] | .B T8A/volt.[0-7,ALL] .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 12 .SH SPECIAL PROPERTIES .SS channels .I read-only, unsigned integer .br Is this a 1 or 2 channel switch? The .I DS2406 comes in two forms, one has only one .I PIO pin (PIO.A). Returns 1 or 2. .SS latch.A latch.B latch.ALL latch.BYTE .I read-write, yes-no .br The activity latch is set to 1 with the first negative or positive edge detected on the associated PIO channel. .br Writing any data will clear latch for all (both)) channels. This is a hardware "feature" of the chip. .br .I ALL references both channels simultaneously, comma separated .br .I BYTE references both channels simultaneously as a single byte, with channel A in bit 0. .SS memory .I read-write, binary .br 128 bytes of non-volatile, write-once data. .SS pages/page.0 ... pages/page.3 pages/page.ALL .I read-write, binary .br Memory organized as 4 pages or 32 bytes. Memory is write-once. .br .I ALL is the aggregate of all 4 pages, sequentially accessed. .SS PIO.A PIO.B PIO.ALL PIO.BYTE .I read-write, yes-no .br State of the open-drain output ( .I PIO ) pin. 0 = non-conducting (off), 1 = conducting (on). .br Writing zero will turn off the switch, non-zero will turn on the switch. Reading the .I PIO state will return the switch setting (flipflop in the data sheet). To determine the actual logic level at the switch, refer to the .I sensed property. .br Note that the actual pin setting for the chip uses the opposite polarity -- 0 for conducting, 1 for non-conducting. However, to turn a connected device on (i.e. to deliver power) we use the software concept of 1 as conducting or "on". .br .I ALL references both channels simultaneously, comma separated. .br .I BYTE references both channels simultaneously as a single byte, with channel A in bit 0. .SS power .I read-only, yes-no .br Is the .I DS2406 powered parasitically =0 or separately on the Vcc pin =1 .SS sensed.A sensed.B sensed.ALL sensed.BYTE .I read-only, yes-no .br Logic level at the .I PIO pin. 0 = ground. 1 = high (~2.4V - 5V ). Really makes sense only if the .I PIO state is set to zero (off), else will read zero. .br .I ALL references both channels simultaneously, comma separated. .br .I BYTE references both channels simultaneously as a single byte, with channel A in bit 0. .SS set_alarm .I read-write, unsigned integer (0-331) .br A number consisting of three digits XYZ, where: .TP X channel selection .br .I 0 neither .br .I 1 A only .br .I 2 B only .br .I 3 A or B .TP Y source selection .br .I 0 undefined .br .I 1 latch .br .I 2 PIO .br .I 3 sensed .TP Z polarity selection .br .I 0 low .br .I 1 high .PP All digits will be truncated to the 0-3 (or 0-1) range. Leading zeroes are optional (and may be problematic for some shells). .PP Example: .TP 311 Responds on Conditional Search when either latch.A or latch.B (or both) are set to 1. .TP <100 Never responds to Conditional Search. .SS TAI8570/ .I subdirectory .br Properties when the .I DS2406 (3) is built into a .I TAI8570. .br If the .I DS2406 (3) is not part of a .I TAI8570 or is not the controlling switch, attempts to read will result in an error. .SS TAI8570/pressure .I read-only, floating point .br Barometric .I pressure in millibar. .SS TAI8570/sibling .I read-only, ascii .br Hex address of the .I DS2406 (3) paired with this chip in a .I TAI8570. .SS TAI8570/temperature .I read-only, floating-point .br Ambient .I temperature measured by the .I TAI8570 in prevailing temperature units (Centigrade is the default). .SS T8A/volt.[0-7|ALL] .I read-only, floating-point .br Uses the T8A (by .I Embedded Data Systems ) 8 channel voltage converter. Units in volts, 0 to 5V range. 12 bit resolution. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS Use the .I set_alarm property to set the alarm triggering criteria. .SH DESCRIPTION .so man3/description.3so .SS DS2406 The .B DS2406 (3) allows control of other devices, like LEDs and relays. It superceeds the .B DS2405 and .B DS2407 Alternative switches include the .B DS2408 or even .B DS2450 .br The .B DS2407 is practically identical to the .I DS2406 except for a strange .I hidden mode. It is supported just like the .B DS2406 .SS TAI8570 The .I TAI-8570 Pressure Sensor is based on a 1-wire composite device by .I AAG Electronica. The .I TAI8570 uses 2 .I DS2406 (3) chips, paired as a reader and writer to synthesize 3-wire communication. Only 1 of the .I DS2406 (3) will allow .I temperature or .I pressure readings. It's mate's address can be shown as .I sibling. .PP The .I TAI8570 uses the .I Intersema MS5534a pressure sensor, and stores calibration and temperature compensation values internally. .PP Design and code examples are available from AAG Electronica http://aag.com.mx , specific permission to use code in a GPL product was given by Mr. Aitor Arrieta of AAG and Dr. Simon Melhuish of OWW. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2406.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS2407.pdf .br http://www.embeddeddatasystems.com/page/EDS/PROD/IO/T8A .br http://oww.sourceforge.net/hardware.html#bp .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2408.man0000644000175000001440000002133612654730021013243 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2408 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2408 \- 1-Wire 8 Channel Addressable Switch .SH SYNOPSIS 8 port switch .PP .B 29 [.]XXXXXXXXXXXX[XX][/[ .B latch.[0-7|ALL|BYTE] | .B LCD_M/[clear|home|screen|message] | .B LCD_H/[clear|home|yxscreen|screen|message|onoff] | .B LCD_H/redefchar.[0-7|ALL] LCD_H/redefchar_hex.[0-7|ALL] | .B PIO.[0-7|ALL|BYTE] | .B power | .B sensed.[0-7|ALL|BYTE] | .B strobe | .B por | .B set_alarm | .B out_of_testmode | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 29 .SH SPECIAL PROPERTIES .SS latch.0 ... latch.7 latch.ALL latch.BYTE .I read-write, binary .br The 8 pins (PIO) latch a bit when their state changes, either externally, or through a write to the pin. .br Reading the .I latch property indicates that the latch has been set. .br Writing "true" (non-zero) to ANY .I latch will reset them all. (This is the hardware design). .br .I ALL is all .I latch states, accessed simultaneously, comma separated. .br .I BYTE references all channels simultaneously as a single byte. Channel 0 is bit 0. .SS PIO.0 ... PIO.7 PIO.ALL PIO.BYTE .I read-write, yes-no .br State of the open-drain output ( .I PIO ) pin. 0 = non-conducting (off), 1 = conducting (on). .br Writing zero will turn off the switch, non-zero will turn on the switch. Reading the .I PIO state will return the switch setting. To determine the actual logic level at the switch, refer to the .I sensed.0 ... sensed.7 sensed.ALL sensed.BYTE property. .br .I ALL references all channels simultaneously, comma separated. .br .I BYTE references all channels simultaneously as a single byte. Channel 0 is bit 0. .SS power .I read-only, yes-no .br Is the .I DS2408 powered parasitically (0) or separately on the Vcc pin (1)? .SS sensed.0 ... sensed.7 sensed.ALL .I read-only, yes-no .br Logic level at the .I PIO pin. 0 = ground. 1 = high (~2.4V - 5V ). Really makes sense only if the .I PIO state is set to zero (off), else will read zero. .br .I ALL references all channels simultaneously, comma separated. .br .I BYTE references all channels simultaneously as a single byte. Channel 0 is bit 0. .SS strobe .I read-write, yes-no .br RSTZ Pin Mode Control. Configures RSTZ as either RST input or STRB output: .TP .I 0 configured as RST input (default) .TP .I 1 configured as STRB output .PP .SS por .I read-write, yes-no .br Specifies whether the device has performed power-on reset. This bit can only be cleared to 0 under software control. As long as this bit is 1 the device will allways respond to a conditional search. .SS out_of_testmode .I write-only, yes-no .br Write "1" to this property to make sure the device has been properly initialized on startup. .PP The datasheet says that under some conditions the startup (power-up) will leave the device in the "testmode" state. Any problems with "Channel Access Write" will trigger this property automaticlly, but this property makes explicit initialization possible as well. .SS set_alarm .I read-write, integer unsigned (0-333333333) .br A number consisting of 9 digits XYYYYYYYY, where: .TP X select source and logical term .br .I 0 PIO OR .br .I 1 latch OR .br .I 2 PIO AND .br .I 3 latch AND .TP Y select channel and polarity .br .I 0 Unselected (LOW) .br .I 1 Unselected (HIGH) .br .I 2 Selected LOW .br .I 3 Selected HIGH .PP All digits will be truncated to the 0-3 range. Leading zeroes are optional. Low-order digit is channel 0. .PP Example: .TP 100000033 Responds on Conditional Search when latch.1 or latch.0 are set to 1. .TP 222000000 Responds on Conditional Search when sensed.7 and sensed.6 are set to 0. .TP 000000000 (0) Never responds to Conditional Search. .SH LCD_H LCD SCREEN PROPERITES This mode uses the .I DS2408 attached to a Hitachi HD44780 LCD controller in 4-bit mode. See .I DATASHEET for published details. Based on a commercial product from .I HobbyBoards by Erik Vickery. .SS LCD_H/clear .I write-only, yes-no .br This will .I clear the screen and place the cursor at the start. .SS LCD_H/home .I write-only, yes-no .br Positions the cursor in the .I home (upper left) position, but leaves the current text intact. .SS LCD_H/screen .I write-only, ascii text .br Writes to the LCD .I screen at the current position. .SS LCD_H/screenyc .I write-only, ascii text .br Writes to an LCD screen at a specified location. The controller doesn't know the true LCD dimensions, but typical selections are: 2x16 2x20 4x16 and 4x20. .TP Y (row) range 1 to 2 (or 4) .TP X (column) range 1 to 16 (or 20) .P There are two formats allowed for the .I screenyx text, either ascii (readable text) or a binary form. .TP 2 binary bytes The two first characters of the passed string have the line and row: e.g. "\\x02\\x04string" perl string writes "string" at line 2 column 4. .TP ascii 2,12: Two numbers giving line and row: Separate with a comma and end with a colon e.g. "2,4:string" writes "string" at line 2 column 4. .TP ascii 12: Single column number on the (default) first line: End with a colon e.g. "12:string" writes "string" at line 1 column 12. .P The positions are 1-based (i.e. the first position is 1,1). .SS LCD_H/onoff .I write-only, unsigned .br Sets several screen display functions. The selected choices should be added together. .TP 4 Display on .TP 2 Cursor on .TP 1 Cursor blinking .SS LCD_H/message .I write-only, ascii text .br Writes a .I message to the LCD screen after clearing the screen first. This is the easiest way to display a message. .SS LCD_H/redefchar.0-7|ALL .I write-only, binary .br Redefines one of 8 user-designed character glyphs for the LCD screen (5x8 pixels). .PP Each byte defines a horizontal line top to bottom. All 5 pixels corresponds to 0x1F and a blank line is 0x00. .PP Format is 8 binary bytes. .SS LCD_H/redefchar_hex.0-7|ALL .I write-only, ascii .br Redefines one of 8 user-designed character glyphs for the LCD screen (5x8 pixels). .PP Each byte defines a horizontal line top to bottom. All 5 pixels corresponds to 0x1F and a blank line is 0x00. .PP Format is 8 hexidecomal bytes (16 characters). .SH LCD_M LCD SCREEN PROPERITES This mode uses the .I DS2408 attached to a Hitachi HD44780 LCD controller in 8-bit mode. See .I DATASHEET for published details. Based on a design from Maxim and a commercial product from .I AAG. .SS LCD_M/clear .I write-only, yes-no .br This will .I clear the screen and place the cursor at the start. .SS LCD_M/home .I write-only, yes-no .br Positions the cursor in the .I home (upper left) position, but leaves the current text intact. .SS LCD_M/screen .I write-only, ascii text .br Writes to the LCD .I screen at the current position. .SS LCD_M/screenyc .I write-only, ascii text .br Writes to an LCD screen at a specified location. The controller doesn't know the true LCD dimensions, but typical selections are: 2x16 2x20 4x16 and 4x20. .TP Y (row) range 1 to 2 (or 4) .TP X (column) range 1 to 16 (or 20) .P There are two formats allowed for the .I screenyx text, either ascii (readable text) or a binary form. .TP 2 binary bytes The two first characters of the passed string have the line and row: e.g. "\\x02\\x04string" perl string writes "string" at line 2 column 4. .TP ascii 2,12: Two numbers giving line and row: Separate with a comma and end with a colon e.g. "2,4:string" writes "string" at line 2 column 4. .TP ascii 12: Single column number on the (default) first line: End with a colon e.g. "12:string" writes "string" at line 1 column 12. .P The positions are 1-based (i.e. the first position is 1,1). .SS LCD_M/onoff .I write-only, unsigned .br Sets several screen display functions. The selected choices should be added together. .TP 4 Display on .TP 2 Cursor on .TP 1 Cursor blinking .SS LCD_M/message .I write-only, ascii text .br Writes a .I message to the LCD screen after clearing the screen first. This is the easiest way to display a message. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS Use the .I set_alarm property to set the alarm triggering criteria. .SH DESCRIPTION .so man3/description.3so .SS DS2408 The .B DS2408 (3) allows control of other devices, like LEDs and relays. It extends the .B DS2406 to 8 channels and includes memory. .br Alternative switches include the .B DS2406, DS2407 and even .B DS2450 .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2408.pdf .br http://www.hobby-boards.com/catalog/howto_lcd_driver.php .br http://www.maxim-ic.com/appnotes.cfm/appnote_number/3286 .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2409.man0000644000175000001440000001111612665167763013262 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2409 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2409 \- MicroLAN Coupler .SH SYNOPSIS 1-wire network branch controller. .PP .B 1F [.]XXXXXXXXXXXX[XX][/[ .B aux | .B branch.[0|1|ALL|BYTE] | .B control | .B discharge | .B event.[0|1|ALL|BYTE] | .B clearevent | .B main | .B sensed.[0|1|ALL|BYTE] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 1F .SH SPECIAL PROPERTIES .SS aux .I directory .br This is the .I aux branch of the .I DS2409 network branch. It is implicitly accessed (via the .I aux smart-on command) when it is listed or devices on this branch are addressed. .SS branch.0 branch.1 branch.ALL branch.BYTE .I read-write, yes-no .br Writing a value of .I 1 to the branch properties explicitly selects the meant branch ( .I 0=main or .I 1=aux ). Writing .I 0 deselects the branch. This is an addition to the directory branch selection scheme available by simply accessing the .I main and .I aux directories. Both ways to select a branch coexist nicely but the latest scheme used wins. Attempting to select both branches, either by setting both bits at the same time or subsequently, fails. Clearing both branch selection bits, either by clearing both bits at the same time or subsequently, resets the event flags inside the .I DS2409 as a side effect. Reading the branch properties returns which branch (if any) is connected to the master bus. .P .B After using the directory branch selection scheme, both branches are deselected automatically. .P .I ALL is an aggregate of the properties, comma separated. It is an atomic operation. .br .I BYTE is an aggregate of the branches as a byte, .I main is bit 0. It is an atomic operation. .SS control .I read-write, unsigned integer .br Setting of the PIO .I control pin. There are 4 possible settings: .TP .B 0 Unconditionally off (non-conducting) .TP .B 1 Unconditionally on (conducting) .TP .B 2 Auto on when .I main branch switched in .TP .B 3 Auto on when .I aux branch switched in .SS discharge .I write-only, yes-no .br Writing a non-zero value to this property will electrically reset both the main and auxillary branches of the 1-wire bus by dropping power for 100 milliseconds. All devices on those branches will lose parasitic power and reset to power-up defaults. As a side effect, both .I event flags and thus, the alarm state, are cleared, too. .SS event.0 event.1 event.ALL event.BYTE .I read-only, yes-no .br Has the .I event flag for the branch been triggered? A negative edge on the disconnected branch ( .I 0=main or .I 1=aux ) sets the flag. This is achieved by e.g. connecting an iButton to the branch. Value returned is 1 (yes) or 0 (no). .P After accessing the .I main or .I aux directory, both branches are deselected automatically and thus, the event flags and alarm state are cleared. .P .I ALL is an aggregate of the properties, comma separated. It is an atomic operation. .br .I BYTE is an aggregate of the branches as a byte, .I main is bit 0. It is an atomic operation. .SS clearevent .I write-only, yes-no .br Writing a non-zero value to this property will reset both .I event flags and thus, clear the alarm state, too. .br .SS main .I directory .br This is the .I main branch of the .I DS2409 network branch. It is implicitly accessed (via the .I main smart-on command) when it is listed or devices on this branch are addressed. .SS sensed.0 sensed.1 sensed.ALL sensed.BYTE .I read-only, yes-no .br Voltage sensed at the .I 0=main or .I 1=aux branch pin. Valid only when the branch is switched out. Value returned is 0 (low) or 1 (high). .P .I ALL is an aggregate of the properties, comma separated. It is an atomic operation. .br .I BYTE is an aggregate of the branches as a byte, .I main is bit 0. It is an atomic operation. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS The .I DS2409 will respond to a conditional search if the .I main event flag is set. .SH DESCRIPTION .so man3/description.3so .SS DS2409 The .B DS2409 (3) allows complex 1-wire network topology. Each branch has it's power preserved, even when isolated from the master. A separate PIO pin can be configured to show branch switching, or controlled explicitly. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2409.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2413.man0000644000175000001440000000446212654730021013240 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2413 3 2005 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2413 \- Dual Channel Addressable Switch .SH SYNOPSIS Dual Switch .PP .B 3A [.]XXXXXXXXXXXX[XX][/[ .B PIO.[A|B|ALL|BYTE] | .B sensed.[A|B|ALL|BYTE] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 3A .SH SPECIAL PROPERTIES .SS PIO.A PIO.B PIO.ALL PIO.BYTE .I read-write, yes-no .br State of the open-drain output ( .I PIO ) pin. 0 = non-conducting (off), 1 = conducting (on). .br Writing zero will turn off the switch, non-zero will turn on the switch. Reading the .I PIO state will return the switch setting. To determine the actual logic level at the switch, refer to the .I sensed property. .br .I ALL references both channels simultaneously, comma separated. .br .I BYTE references both channels simultaneously as a single byte, with channel A in bit 0. .SS sensed.A sensed.B sensed.ALL sensed.BYTE .I read-only, yes-no .br Logic level at the .I PIO pin. 0 = ground. 1 = high (~2.4V - 5V ). Really makes sense only if the .I PIO state is set to zero (off), else will read zero. .br .I ALL references both channels simultaneously, comma separated. .br .I BYTE references both channels simultaneously as a single byte, with channel A in bit 0. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS Use the .I set_alarm property to set the alarm triggering criteria. .SH DESCRIPTION .so man3/description.3so .SS DS2413 The .B DS2413 (3) allows control of other devices, like LEDs and relays. It differs from the .I DS2405 with a cleaner interface and two channels The .I DS2413 also has two channels like the .I DS2406 and .I DS2407 but has no memory, and no alarm. There is also varying types of switch and sensing in the .I DS2408, DS2409, LCD, DS276x, DS2450. .br Unique among the switches, the .I DS2413 can switch higher voltages, up to 28V. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://datasheets.maxim-ic.com/en/ds/DS2413.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2415.man0000644000175000001440000000601712665167763013263 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2415 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2415, DS1904, DS2417 \- 1-Wire Time Chip, RTC (real time clock) iButton, 1-Wire Time Chip with Interrupt .SH SYNOPSIS Real time clock. .br .B 24 [.]XXXXXXXXXXXX[XX][/[ .B date | .B flags | .B running | .B udate | .so man3/standard_mini.3so ]] .PP Clock with interrupts .br .B 27 [.]XXXXXXXXXXXX[XX][/[ .B date | .B enable | .B interval | .B itime | .B running | .B udate | .so man3/standard_mini.3so ]] .SH FAMILY CODE .TP .I 24 DS2415 DS1904 .TP .I 27 DS2417 .SH SPECIAL PROPERTIES .SS date .I read-write, ascii .br 26 character date representation of the .I counter value. Increments once per second while .I running .br Setting .I date to a null string will put the current system time. .br Accepted date formats are: .br Sat[urday] March 12 12:23:59 2001 .br Apr[il] 4 9:34:56 2002 .br 3/23/04 23:34:57 .br current locale setting (your system's format) .SS enable .I read-write, yes-no .br State of the timer interrupt. 0=off 1=running. .SS interval .I read-write, unsigned integer .br Interval between timer interrupts. Values: 0-7. See table under .I DESCRIPTION for interpretation. .I itime will reflect the .I interval chosen. .SS itime .I read-write, unsigned integer .br Interval between timer interrupts. Value in seconds. See table under .I DESCRIPTION for interpretation and acceptable values. .I interval will reflect the .I itime chosen. .SS flags .I read-write, unsigned integer .br General use data. 4 bits (0-15 accepted values). .SS running .I read-write, yes-no .br State of the clock. 0=off 1=running. .SS udate .I read-write, unsigned integer .br Time represented as a number. .I udate increments once per second, while .I running is on. .br Usually set to unix time standard: number of seconds since Jan 1, 1970. The .I date field will be the unix representation of .I udate and setting either will change the other. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None implemented. .SH DESCRIPTION .so man3/description.3so .SS DS2415 DS1904 The .B DS2415 (3) and .B DS1904 (3) are simple clocks that can be read on the 1-wire bus. They can also be used the time an event, for remote confirmation. .P .SS DS2417 The .B DS2417 has the same clock function, but also includes a programmable interval interrupt. Values Allowed are: .br 0 1sec .br 1 4sec .br 2 32s = .5m .br 3 6 = 1m .br 4 2048s = .5h .br 5 4096s = 1h .br 6 65536s = 18h .br 7 131072s = 36h .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2415.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1904.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS2417.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2423.man0000644000175000001440000000465412654730021013244 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2423 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2423 \- 4kbit 1-Wire RAM with Counter .SH SYNOPSIS RAM and counters. .PP .B 1D [.]XXXXXXXXXXXX[XX][/[ .B counter.[A|B|ALL] | .B memory | .B pages/page.[0-15|ALL] | .B pages/count.[0-15|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 1D .SH SPECIAL PROPERTIES .SS counter.A counter.B counter.ALL .I read-only, unsigned integer .br Debounced external counter. Associated with RAM .I page.14 and .I page.15 Note: counter increments only. It is reset when the chip loses power. .br .I ALL returns the two values, separated by a comma. They are read sequentially. .P The property was called .I counters prior to OWFS version 2.9p1 and the old name is invisibly recognized for backwards compatibility. .SS memory .I read-write, binary .br 512 bytes of memory. .SS pages/page.0 ... pages/page.15 pages/page.ALL .I read-write, binary .br Memory is split into 16 pages of 32 bytes each. Memory is RAM, contents are lost when power is lost. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS pages/count.0 ... pages/count.15 pages/count.ALL .I read-only, unsigned integer .br Write access to each page of memory. Actually only .I page.12 and .I page.13 have write counters. .br .I page14 and .I page.15 \'s counters are associated with the external .I counters.A and .I counters.B triggers. .br The value 0xFFFFFFFF is returned for .I pages/count.0 through .I pages/count.11 .br .I ALL is an aggregate of the counters, comma separated. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2423 The .B DS2423 (3) is used for its counters. The internal counters (associated with pages 12 and 13) can detect memory tampering. .PP The external counters A and B page been used in circuit design, such as a wind anometer. .I OWFS system handles this automatically. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2423.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2430A.man0000644000175000001440000000272312654730021013336 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2430A 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2430A, DS1971 \- 256-bit 1-wire EEPROM, 256-bit EEPROM ibutton .SH SYNOPSIS EEPROM .PP .B 14 [.]XXXXXXXXXXXX[XX][/[ .B application | .B status | .B memory | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 14 .SH SPECIAL PROPERTIES .SS application .I read-write, binary .br 8 bytes of data. Write once, then .I status is 0xFC and further writing is impossible. .SS status .I read-only, unsigned integer .br Is the .I application area locked? .TP 0xFF Application area untouched .TP 0xFC Applcation area locked .SS memory .I read-write, binary .br 32 bytes of data. (256 bits) .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2430A The .B DS2430A (3) is a memory 1-wire chip. It is considered obsolete and newer designs are supposed to use the .B DS2431 (3) .P The .B DS1971 (3) is an iButton version of the same device. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2430A-DS2430AP.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2431.man0000644000175000001440000000273112654730021013235 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2431 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2431 \- EEPROM (1 kBit) .SH SYNOPSIS Erasable programmable read-only memory (EEPROM) .PP .B 2D [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-3|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 2D DS2431 .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 128 bytes of EEPROM memory. Initially all bits are set to 1. Memory is non-volatile. .SS pages/page.0 ... pages/page.3 pages/page.ALL .I read-write, yes-no .br Memory is split into 4 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2431 The .B DS2431 (3) is used for storing memory which should be available even after a reset or power off. It is also switch to erase-only mode (EPROM) although this isn't implemented in OWFS. .I OWFS system handles this automatically. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2431.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Christian Magnusson (mag@mag.cx) owfs-3.1p5/src/man/man3/DS2433.man0000644000175000001440000000272312654730021013240 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2433 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2433 \- EEPROM (4 kBit) .SH SYNOPSIS Erasable programmable read-only memory (EEPROM) .PP .B 23 [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-15|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 23 DS2433 .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 512 bytes of memory. Initially all bits are set to 1. Writing zero permanently alters the memory. .SS pages/page.0 ... pages/page.15 pages/page.ALL .I read-write, yes-no .br Memory is split into 16 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2433 The .B DS2433 (3) is used for storing memory which should be available even after a reset or power off. It's main advantage is for audit trails (i.e. a digital purse). .I OWFS system handles this automatically. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2433.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Christian Magnusson (mag@mag.cx) owfs-3.1p5/src/man/man3/DS2436.man0000644000175000001440000000441712654730021013245 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2436 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2436 \- Battery ID/Monitor Chip .SH SYNOPSIS Temperature Voltage and Memory. .PP .B 1B [.]XXXXXXXXXXXX[XX][/[ .B pages/page.[0-4|ALL] | .B temperature | .B volts | .B counter/cycles | .B counter/reset | .B counter/increment | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 1B .SH SPECIAL PROPERTIES .SS pages/page.0 ... pages/page.4 pages/page.ALL .I read-write, binary .br Memory is split into 5 pages of 32 bytes each. Only the first 3 pages are really available, and some of that appears to be reserved. See the datasheet for details. .P .I pages/page.0 is locked and unlocked transparently for every write. .P .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS temperature .I read-only, floating point .br .I Temperature read by the chip at high resolution (~13 bits). Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. Conversion takes ~20 msec. .SS volts .I read-only, floating point .br Voltage read (~10 bits) at the chip's supply voltage Vdd. Range 2.4V to 10V. .SS counter/ A resettable non-volatile counter intended for counting battery discharge cycles. .SS counter/cycles .I read-only, unsigned integer .br Cycle counter value. Stored at memory location 0x82. .SS counter/increment .I write-only, yes/no .br Any non-zero (true) value will increment .I counter/cycles by one. .SS counter/reset .I write-only, yes/no .br Any non-zero (true) value will reset .I counter/cycles to zero. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2436 The .B DS2436 (3) is a simpler form of the .B DS2438 battery chip. It has no counter, and only one voltage sensor. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2436.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2437.man0000644000175000001440000001013412654730021013237 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2437 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2437 \- Smart Battery Monitor .SH SYNOPSIS Temperature Voltages and Memory. .PP .B 1E [.]XXXXXXXXXXXX[XX][/[ .B current | .B date | .B disconnect/date | .B disconnect/udate | .B endcharge/date | .B endcharge/udate | .I Ienable | .B pages/page.[0-7|ALL] | .B temperature | .B udate | .B VAD | .B VDD | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 1E .SH SPECIAL PROPERTIES .SS date .I read-write, ascii .br 26 character date representation of the .I counter value. Increments once per second. .br Setting .I date to a null string will put the current system time. .br Accepted date formats are: .br Sat[urday] March 12 12:23:59 2001 .br Apr[il] 4 9:34:56 2002 .br 3/23/04 23:34:57 .br current locale setting (your system's format) .SS current .I read-only, integer .br Current reading. Actual current depends on Rsens resistor (see datasheet). .br The formula for current is I = .I current /(4096*Rsens) .br with units in Amps and Ohms. .br Current measurement will be temporarily enabled (see .I Ienable ) if not currently enabled (pun intended) for this reading. .SS disconnect/date .I read-write, ascii .br 26 character date representation of the .I disconnect/udate value. Time when the battery pack waws removed from the charger. Format is the same as the .I date property. .SS disconnect/udate .I read-write, unsigned integer .br Representation of .I disconnect/date as a number. See .I udate for details. .SS endcharge/date .I read-write, ascii .br 26 character date representation of the .I endcharge/udate value. Format is the same as the .I date property. .SS endcharge/udate .I read-write, unsigned integer .br Representation of .I endcharge/date as a number. See .I udate for details. .SS Ienable .I read-write, unsigned integer .br Status of .I current monitoring. When enabled, current sensing is performed 36.41 times/second. Values of .I Ienable are: .TP .B 0 no current conversion .TP .B 1 current conversion enabled .TP .B 2 current conversion and accumulation .TP .B 3 current conversion and accumulation with EEPROM backup .SS pages/page.0 ... pages/page.7 pages/page.ALL .I read-write, binary .br Memory is split into 8 pages of 8 bytes each. Only the pages 3-7 are really available, and some of that appears to be reserved. See the datasheet for details. .br .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS temperature .I read-only, floating point .br .I Temperature read by the chip at high resolution (~13 bits). Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. Conversion takes ~20 msec. .SS udate .I read-write, unsigned integer .br Time represented as a number. .I udate increments once per second. .br Usually set to unix time standard: number of seconds since Jan 1, 1970. The .I date field will be the unix representation (ascii text) of .I udate and setting either will change the other. .SS VAD VDD .I read-only, floating point .br Voltage read (~10 bits) at the one of the chip's two supply voltages. Range VDD= 2.4V to 10V, VAD=1.5 to 10V. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2437 The .B DS2437 (3) is an obsolete version of the .B DS2438 (3) battery chip. Current sensing is available, but not implemented. The major advantage compared to the .B DS2436 is that two voltages can be read, allowing correcting circuit nmeasurements to supply voltage and temperature. A better comparison is the .B DS276x family of chips. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2437.pdf .br http://pdfserv.maxim-ic.com/en/an/humsensor.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2438.man0000644000175000001440000002231312665167763013265 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2438 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2438 \- Smart Battery Monitor .SH SYNOPSIS .SS Temperature Voltages and Current. .PP .B 26 [.]XXXXXXXXXXXX[XX][/[ .B CA | .B EE | .B date | .B disconnect/date | .B disconnect/udate | .B endcharge/date | .B endcharge/udate | .B IAD | .B offset | .B pages/page.[0-7|ALL] | .B temperature | .B latesttemp | .B udate | .B VAD | .B VDD | .B vis | .so man3/standard_mini.3so ]] .SS Humidity sensor .PP .B 26 [.]XXXXXXXXXXXX[XX][/[ .B HIH4000/humidity | .B HTM1735/humidity | .B DATANAB/reset | .B DATANAB/humidity | .B humidity | .B temperature ]] .SS Barometer .PP .B 26 [.]XXXXXXXXXXXX[XX][/[ .B B1-R1-A/pressure | .B B1-R1-A/gain | .B B1-R1-A/offset | ]] .SS Light .PP .B 26 [.]XXXXXXXXXXXX[XX][/[ .B S3-R1-A/current | .B S3-R1-A/illuminance | .B S3-R1-A/gain ]] .SH FAMILY CODE .PP .I 26 .SH SPECIAL PROPERTIES .SS pages/page.0 ... pages/page.7 pages/page.ALL .I read-write, binary .br Memory is split into 8 pages of 8 bytes each. Only the pages 3-7 are really available, and some of that appears to be reserved. See the datasheet for details. .\" page.3/0 = Multisensor .\" page.3/2-7 = Hobby Boards Calibration data .\" page.4 = .\" page.5 = .\" page.7/4-7 = current storage .br .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS temperature .I read-only, floating point .br .I Temperature read by the chip at high resolution (~13 bits). Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. Conversion takes ~20 msec. .SS latesttemp .I read-only, floating point .br Latest measured temperature. Reading this node will never trigger a temperature conversion. Intended for use in conjunction with .B /simultaneous/temperature. .SS VAD VDD .I read-only, floating point .br Voltage read (~10 bits) at the one of the chip's two supply voltages. Range VDD= 2.4V to 10V, VAD=1.5 to 10V. .SS vis .I read-only, floating point .br Current sensor reading, as a voltage difference. Value is in volts. .br Actual current depends on Rsens resistor (see datasheet). .br The formula for current is I = vis / Rsens .br with units in Amps and Ohms. .br Current measurement will be temporarily enabled (see .I Ienable ) if not currently enabled (pun intended) for this reading. .SH CONFIGURATION PROPERTIES .SS CA .I read-write, yes-no .br .I Current Accumulator Configuration flag bit. If "on" (1) current is stored in page 7 bytes 4-7. If "off" (0) that page can be used for general storage. See the datasheet for more information. .SS EE .I read-write, yes-no .br .I Current Accumulator Shadow flag bit. If "on" (1) current reading is stored to EEPROM. If "off" (0) that data will be lost when chip loses power. See the datasheet for more information .SS IAD .I read-write, yes-no .br .I Current A/D Control flag bit. If "on" (1) current measured at 36.41 Hz. If "off" (0) current measurements won't be made. See the datasheet for more information. .SH DATE PROPERTIES .SS date .I read-write, ascii .br 26 character date representation of the .I counter value. Increments once per second. .br Setting .I date to a null string will put the current system time. .br Accepted date formats are: .br Sat[urday] March 12 12:23:59 2001 .br Apr[il] 4 9:34:56 2002 .br 3/23/04 23:34:57 .br current locale setting (your system's format) .SS disconnect/date .I read-write, ascii .br 26 character date representation of the .I disconnect/udate value. Time when the battery pack waws removed from the charger. Format is the same as the .I date property. .SS disconnect/udate .I read-write, unsigned integer .br Representation of .I disconnect/date as a number. See .I udate for details. .SS endcharge/date .I read-write, ascii .br 26 character date representation of the .I endcharge/udate value. Format is the same as the .I date property. .SS endcharge/udate .I read-write, unsigned integer .br Representation of .I endcharge/date as a number. See .I udate for details. .SS udate .I read-write, unsigned integer .br Time represented as a number. .I udate increments once per second. .br Usually set to unix time standard: number of seconds since Jan 1, 1970. The .I date field will be the unix representation (ascii text) of .I udate and setting either will change the other. .SH HUMIDITY PROPERTIES .SS HIH4000/humidity .I read-only, floating point .br Relative humidity, as percent (1-100 scale). .br This value is for a design based on Honeywell's HIH-4000 humidity sensor. .SS HTM1735/humidity .I read-only, floating point .br Relative humidity, as percent (1-100 scale). .br This value is for a design based on Humirel's HTM-1735 humidity sensor. .SS DATANAB/humidity .I read-only, floating point .br Based on DataNAB's humidity sensor. It uses a HIH-4000 sensor and the current sensning rather than voltage readings from the DS2438. Calibration values are stored on chip, and a check field is stored in chip memory. .SS DATANAB/reset .I write-only, yes-no .br Used to read calibration values and set the chip to current reading more. Should be automatically called when a humidity reading is requested. .SS humidity .I read-only, floating point .br Relative humidity, as percent (1-100 scale). .br The .B DS2438 actually does not read humidity, but a widely available and publicised circuit based on the chip, does. This design is for the common Honeywell HIH-3610 humidity chip. The mostly compatible HIH-4000 chip uses different temperature compensation, so is better read from the .I HIH4000/humidity value. See the datasheets for details. .br If the chip is instead a DATANAB design, the .I DATANAB/humidity value will be automatically used. .SH BAROMETER PROPERTIES .SS B1-R1-A/pressure .I read-only, floating point .br Pressure reading, as milli-bars, or other unit depending on .IR settings/units/pressure_scale . .br This value is for the B1-R1-A barometer from Hobby-Boards, and assumes the standard calibration. .SS B1-R1-A/gain .I read/write, floating point .br Calibration of pressure gain, as signed number, expressed as the same units as .I B1-R1-A/pressure per volt. .br This value will be multiplied with the measured voltage to get the .I B1-R1-A/pressure reading. It may have to be fine tuned for calibration purposes, although with the standard sensor, it will often be good enough to keep it as is. .SS B1-R1-A/offset .I read/write, floating point .br Calibration of pressure offset, as signed number, same units as .I B1-R1-A/pressure. .br This value will be added to the .I B1-R1-A/pressure reading. The default value is 904.7 millibars, which may be altered to to compensate for elevation. .SH SOLAR SENSOR PROPERTIES .SS S3-R1-A/current .I read-only, floating point .br Photo-diode current, in micro-amperes. .br This value is for the S3-R1-A solar radiation sensor from Hobby-Boards. Due to noise and offsets, this value may read as a negative number in low light conditions. The .I offset register can be modified to reduce the offset as much as possible. .SS S3-R1-A/illumination .I read-only, floating point .br Illumination, in lux. Always a positive number. .br This value is the lux reading from the solar sensor, taking .I S3-R1-A/gain into consideration. .SS S3-R1-A/gain .I read/write, floating point .br Calibration of photo-diode gain expressed as lux per micro-amperes. The default value is for the SFH203P photo-diode from Osram, used bare. A different gain may be used for instance to compensate for an integrathing, white sphere placed over the diode. .br This value is for the S3-R1-A solar radiation sensor from Hobby-Boards, using the SFH203P photo-diode from Osram. .SH MULTISENSOR PROPERTIES .SS MultiSensor/type .I read-only, ascii .br For .I iButtonLink's MultiSensor line of 1-wire devices, give the specific configuration based on a data byte set in memory. (Byte 0 of page 3). This can help interpretation of the sensor values, distinguishing, current from water from light. .SS offset .I read-write, integer .br Correction for .I current readings. A value between \-256 and 255. See the datasheet for details. Should be set to the negative of a true zero .I current reading. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2438 The .B DS2438 (3) is a more complete form of the .B DS2436 battery chip. Current sensing is available, but not implemented. The major advantage compared to the .B DS2436 is that two voltages can be read, allowing one to correct circuit measurements for supply voltage and temperature. A better comparison is the .B DS276x family of chips. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2438.pdf .br http://pdfserv.maxim-ic.com/en/an/humsensor.pdf .br http://goo.gl/o9DH0 (Redirects to 009012_2.pdf PDF file on honeywell.com website) .br http://www.phanderson.com/hih-4000.pdf .br http://www.humirel.com/product/fichier/HTM1735%20RevG%20.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) Egil Kvaleberg owfs-3.1p5/src/man/man3/DS2450.man0000644000175000001440000001561012665167763013261 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2450 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2450 \- Quad A/D Converter .SH SYNOPSIS .SS Voltage * 4 and Memory. .PP .B 20 [.]XXXXXXXXXXXX[XX][/[ .B PIO.[A-D|ALL] | .B volt.[A-D|ALL] | .B volt2.[A-D|ALL] | .B latestvolt.[A-D|ALL] | .B latestvolt2.[A-D|ALL] ]] .PP .B 20 [.]XXXXXXXXXXXX[XX][/[ .B 8bit/volt.[A-D|ALL] | .B 8bit/volt2.[A-D|ALL] | .B 8bit/latestvolt.[A-D|ALL] | .B 8bit/latestvolt2.[A-D|ALL] ]] .PP .B 20 [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-3|ALL] | .B power ] .PP .B 20 [.]XXXXXXXXXXXX[XX][/[ .B alarm/high.[A-D|ALL] | .B alarm/low.[A-D|ALL] | .B set_alarm/high.[A-D|ALL] | .B set_alarm/low.[A-D|ALL] | .B set_alarm/unset | .B set_alarm/volthigh.[A-D|ALL] | .B set_alarm/volt2high.[A-D|ALL] | .B set_alarm/voltlow.[A-D|ALL] | .B set_alarm/volt2low.[A-D|ALL] ] .PP .B 20 [.]XXXXXXXXXXXX[XX][/[ .so man3/standard_mini.3so ]] .SS CO2 sensor .PP .B 20 [.]XXXXXXXXXXXX[XX][/[ .B CO2/ppm | .B CO2/power | .B CO2/status ] .SH FAMILY CODE .PP .I 20 .SH SPECIAL PROPERTIES .SS alarm/high.A ... alarm/high.D alarm.high.ALL .SS alarm/high.A ... alarm/high.D alarm.high.ALL .I read-write, binary .br The alarm state of the voltage channel. The alarm state is set one of two ways: .TP voltage conversion Whenever the .I DS2450 measures a voltage on a channel, that voltage is compared to the high and low limits .I set_alarm/volthigh and/or .I set_alarm/voltlow and if the alarm is enabled .I set_alarm/high and/or .I set_alarm/low the corresponding flag is set in .I alarm/high and/or .I alarm/low .TP manual set The flag can be set by a direct write to .I alarm/high or .I alarm/low .SS memory .I read-write, binary .br 32 bytes of data. Much has special implications. See the datasheet. .SS pages/page.0 ... pages/page.3 pages/page.ALL .I read-write, binary .br Memory is split into 4 pages of 8 bytes each. Mostly for reading and setting device properties. See the datasheet for details. .br .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS PIO.A ... PIO.D PIO.ALL .I read-write, yes-no .br Pins used for digital control. 1 turns the switch on (conducting). 0 turns the switch off (non-conducting). .br Control is specifically enabled. Reading .I volt will turn off this control. .br .I ALL is an aggregate of the voltages. Readings are made separately. .SS power .I read-write, yes-no .br Configure whether the .I DS2450 is externally powered (as opposed to parasitically powered from the data line). .br If configured as powered, the A/D coverter will be set to continuous sampling, and the bus will be released during a single conversion allowing other devices to communicate. .br Setting this to 1 when no power is applied to the chip's Vcc will result in wrong voltage readouts. Setting this to 0 when power is applied to the chip's Vcc allows a simultaneous conversion trigger on all .I DS2450 on a bus. The (always safe) default is 0. .SS set_alarm/high.A ... set_alarm/high.D set_alarm/high.ALL .SS set_alarm/low.A ... set_alarm/low.D set_alarm/low.ALL .I read-write, yes-no .br Enabled status of the voltage threshold. 1 is on. 0 is off. .SS set_alarm/volthigh.A ... set_alarm/volthigh.D set_alarm/volthigh.ALL .SS set_alarm/volt2high.A ... set_alarm/volt2high.D set_alarm/volt2high.ALL .SS set_alarm/voltlow.A ... set_alarm/voltlow.D set_alarm/voltlow.ALL .SS set_alarm/volt2low.A ... set_alarm/volt2low.D set_alarm/volt2low.ALL .I read-write, floating point .br The upper or lower limit for the voltage measured before triggering an alarm. .br Note that the alarm must be enabled .I alarm/high or .I alarm.low and an actual reading must be requested .I volt for the alarm state to actually be set. The alarm state can be sensed at .I alarm/high and .I alarm/low .SS set_alarm/unset .I read-write, yes-no .br Status of the power-on-reset (POR) flag. .br The POR is set when the .I DS2450 is first powered up, and will match the alarm state until explicitly cleared. (By writing 0 to it). .br The purpose of the POR is to alert the user that the chip is not yet fully configured, especially alarm thresholds and enabling. .SS volt.A ... volt.D volt.ALL .SS volt2.A ... volt2.D volt2.ALL .SS 8bit/volt.A ... 8bit/volt.D 8bit/volt.ALL .SS 8bit/volt2.A ... 8bit/volt2.D 8bit/volt2.ALL .I read-only, floating point .br Reading one of these nodes triggers a conversion on the specified voltage input(s) with the selected resolution (16 or 8 bit) and returns the sampled voltage(s) with the selected scaling (0 - 5.10V or 0 - 2.55V). The conversion time is about 1.4ms per input for 16-bit and 0.8ms per input for 8-bit. The output feature ( .I PIO ) is disabled by reading the corresponding node. .br .I ALL is an aggregate of the voltages. Sampling is controlled by the chip and done in the order A, B, C, D, one after another. .SS latestvolt.A ... latestvolt.D latestvolt.ALL .SS latestvolt2.A ... latestvolt2.D latestvolt2.ALL .SS 8bit/latestvolt.A ... 8bit/latestvolt.D 8bit/latestvolt.ALL .SS 8bit/latestvolt2.A ... 8bit/latestvolt2.D 8bit/latestvolt2.ALL .I read-only, floating point .br Returns previously measured voltage on the specified input(s) with the selected scaling (0 - 5.10V or 0 - 2.55V). Resolution and scaling are set by sampling a voltage, not here; the correct latestvolt nodes have to be read to make the result meaningful. .br .I ALL is an aggregate of the voltages and returns all voltage values from the chip. .br Reading these nodes will never trigger a voltage conversion. Intended for use in conjunction with .B /simultaneous/voltage. .SH CO2 (Carbon Dioxide) SENSOR PROPERTIES The CO2 sensor is a device constructed from a SenseAir K30 and a .I DS2450 .SS CO2/power .I read-only, floating point .br Supply voltage to the CO2 sensor (should be around 5V) .SS CO2/ppm .I read-only, unsigned .br CO2 level in ppm (parts per million). Range 0-5000. .SS CO2/status .I read-only, yes-no .br Is the internal voltage correct (around 3.2V)? .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2450 The .B DS2450 (3) is a (supposedly) high resolution A/D converter with 4 channels. Actual resolutin is reporterd to be 8 bits. The channels can also function as switches. Voltage sensing (with temperature and current, but sometimes restricted voltrage ranges) can also be obtained with the .B DS2436 , .B DS2438 and .B DS276x .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .TP DS2450 http://pdfserv.maxim-ic.com/en/ds/DS2450.pdf .TP CO2 sensor http://www.senseair.se/Datablad/k30%20.pdf .TP CO2 device https://www.m.nu/co2meter-version-2-p-259.html?language=en .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2502.man0000644000175000001440000000524712654730021013241 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2502 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2502 \- Add-Only Memory (1 kBit) .TP .B DS2502-E48, DS2502-UNW \- 48-bit Node Address Chip, UniqueWare Add-Only Memory (1 kBit) .TP .B DS1982, DS1982U \- Add-Only iButton (1 kBit), UniqueWare iButton (1 kBit) .SH SYNOPSIS EPROM add-only memory. .PP .B 09 [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-3|ALL] | .so man3/standard_mini.3so ]] .PP .B 89 [.]XXXXXXXXXXXX[XX][/[ .B mac_e | .B mac_fw | .B memory | .B pages/page.[0-3|ALL] | .B project | .so man3/standard_mini.3so ]] .SH FAMILY CODE .TP .I 09 DS2502 DS1982 .TP .I 89 DS2502-UNW DS2502-E48 DS1982U .SH SPECIAL PROPERTIES .SS mac_e mac_fw .I read-only, binary .br 64 bit or 80 bit .I media access control number. Unique, and unrelated to the 1-wire address. It is apparently used for ethernet or FireWire addressing, respectively. .SS memory .I read-write, binary .br 128 bytes of memory. Initially all bits are set to 1. Writing zero permanently alters the memory. .SS pages/page.0 ... pages/page.3 pages/page.ALL .I read-write, yes-no .br Memory is split into 4 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS project .I read-only, binary .br 32 bit .I project id. Constant 0x0000 for ethernet and 0x00001128 for firewire. See Datasheets. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2502 DS1982 The .B DS2502 (3) is used for write-once incremental storage. It's main advantage is for audit trails (i.e. a digital purse). .PP The .B DS2502-E48 and .B DS2502-UNW are some of the .I UniqueWare class of devices. Some of the memory was preprogramed at the factory. See the datasheet for specifics. The .B DS2502 , .B DS2505 , and .B DS2506 differ in their function by the amount of on-board memory they possess. (The internal protocols are slightly different, but the .I OWFS system handles this automatically. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2502.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS2502-E48.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS2502-UNW-DS2506S-UNW.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1982-F3-DS1982-F5.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1982U-DS1986U.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2505.man0000644000175000001440000000426212654730021013240 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2505 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2505, DS2505-UNW \- Add-Only Memory (16 kBit), UniqueWare Add-Only Memory (16 kBit) .TP .B DS1985, DS1985U \- Add-Only iButton (16 kBit), UniqueWare iButton (16 kBit) .SH SYNOPSIS EPROM add-only memory. .PP .B 0B [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-63|ALL] | .so man3/standard_mini.3so ]] .PP .B 8B [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-63|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .TP .I 0B DS2505 DS1985 .TP .I 8B DS2505-UNW DS1985U .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 2048 bytes of memory. Initially all bits are set to 1. Writing zero permanently alters the memory. .SS pages/page.0 ... pages/page.63 pages/page.ALL .I read-write, yes-no .br Memory is split into 64 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2505 DS1985 The .B DS2505 (3) is used for write-once incremental storage. It's main advantage is for audit trails (i.e. a digital purse). .PP The .B DS2505-UNW is one of the .I UniqueWare class of devices. Some of the memory was preprogramed at the factory. See the datasheet for specifics. The .B DS2502 , .B DS2505 , and .B DS2506 differ in their function by the amount of on-board memory they possess. (The internal protocols are slightly different, but the .I OWFS system handles this automatically. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2505.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS2502-UNW-DS2506S-UNW.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1985-F3-DS1985-F5.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1982U-DS1986U.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2506.man0000644000175000001440000000426612654730021013245 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2506 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2506, DS2506-UNW \- Add-Only Memory (64 kBit), UniqueWare Add-Only Memory (64 kBit) .TP .B DS1986, DS1986U \- Add-Only iButton (64 kBit), UniqueWare iButton (64 kBit) .SH SYNOPSIS EPROM add-only memory. .PP .B 0F [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-255|ALL] | .so man3/standard_mini.3so ]] .HP .B 8F [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-255|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .TP .I 0F DS2506 DS1986 .TP .I 8F DS2506-UNW DS1986U .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 8192 bytes of memory. Initially all bits are set to 1. Writing zero permanently alters the memory. .SS pages/page.0 ... pages/page.255 pages/page.ALL .I read-write, yes-no .br Memory is split into 256 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2506 DS1986 The .B DS2506 (3) is used for write-once incremental storage. It's main advantage is for audit trails (i.e. a digital purse). .PP The .B DS2506-UNW is one of the .I UniqueWare class of devices. Some of the memory was preprogramed at the factory. See the datasheet for specifics. The .B DS2502 , .B DS2505 , and .B DS2506 differ in their function by the amount of on-board memory they possess. (The internal protocols are slightly different, but the .I OWFS system handles this automatically. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2506.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS2502-UNW-DS2506S-UNW.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1986-F3-DS1986-F5.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS1982U-DS1986U.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2720.man0000644000175000001440000000415412654730021013237 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2720 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2720 \- Efficient Addressable Single-cell Rechargeable Lithium Protection IC .SH SYNOPSIS Memory and warnings. .PP .B 31 [.]XXXXXXXXXXXX[XX][/[ .B lock.[0-1|ALL] | .B memory | .B pages/page.[0-1|ALL] | .br .B cc | .B ce | .B dc | .B de | .B doc | .B ot | .B ov | .B psf | .B uv | .br .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 31 .SH SPECIAL PROPERTIES .SS lock.[0-1|ALL] .I read-write, yes-no .br Lock either of the two eprom pages to prevent further writes. Apparently setting .I lock is permanent. .SS memory .I read-write, binary .br Access to the full 256 byte memory range. Much of this space is reserved or special use. User space is the .I page area. .br See the .I DATASHEET for a full memory map. .SS pages/pages.[0-1|ALL] .I read-write, binary Two 8 byte areas of memory for user application. The .I lock property can prevent further alteration. .br NOTE that the .I page property is different from the common .I OWFS implementation in that all of .I memory is not accessible. .SH OBSCURE PROPERTIES .SS cc ce dc de doc ot ov uv .I varies, yes-no .br Bit flags corresponding to various battery management functions of the chip. See the .I DATASHEET for details of the identically named entries. .br In general, writing "0" corresponds to a 0 bit value, and non-zero corresponds to a 1 bit value. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2720 The .B DS2720 (3) is a battery charging monitor. Besides it's intended use, it may have use in monitoring for device failures. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2720.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2740.man0000644000175000001440000000630212654730021013236 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2740 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2740 \- High-Precision Coulomb Counter .SH SYNOPSIS Voltage and Switch .PP .B 36 [.]XXXXXXXXXXXX[XX][/[ .B memory | .B PIO | .B sensed | .B vis | .B vis_B | .B volthours | .br .B smod | .br .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 36 .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br Access to the full 256 byte memory range. Much of this space is reserved or special use. User space is the .I page area. .br See the .I DATASHEET for a full memory map. .SS PIO .I write-only, yes-no .br Controls the PIO pin allowing external switching. .br Writing "1" turns the PIO pin on (conducting). Writing "0" makes the pin non-conducting. The logical state of the voltage can be read with the .I sensed property. This will reflect the current voltage at the pin, not the value sent to .I PIO .br Note also that .I PIO will also be altered by the power-status of the .I DS2670 See the datasheet for details. .SS sensed .I read-only, yes-no .br The logical voltage at the PIO pin. Useful only if the .I PIO property is set to "0" (non-conducting). .br Value will be 0 or 1 depending on the voltage threshold. .SS vis .I read-only, floating point .br Current sensor reading (unknown external resistor). Measures the voltage gradient between the Vis pins. Units are in .B Volts .br The .I vis readings are integrated over time to provide the .I volthours property. .br The .I current reading is derived from .I vis assuming the internal 25 mOhm resistor is employed. There is no way to know this through software. .SS vis_B .I read-only, floating point .br Current sensor reading (unknown external resistor). Measures the voltage gradient between the Vis pins. Units are in .B Volts .br The .I vis readings are integrated over time to provide the .I volthours property. .br The .I vis_B is from a different tuning of the .I DS2740 (3) chip with faster sampling and lower resolution. There is no way to know this through software. .SS volthours .I read-write, floating point .br Integral of .I vis over time. Units are in .B volthours .SH OBSCURE PROPERTIES .SS smod .I read-write, yes-no .br Bit flags corresponding to various battery management functions of the chip. See the .I DATASHEET for details of the identically named entries. .br In general, writing "0" corresponds to a 0 bit value, and non-zero corresponds to a 1 bit value. .br Default power-on state for the corresponding properties. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2740 The .B DS2740 (3) is a class of battery charging controllers. This chip measures voltage and volthours, and has a pin that can be used for control. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2740.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2751.man0000644000175000001440000001405312654730021013242 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2751 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2751 \- Multichemistry Battery Fuel Gauge .SH SYNOPSIS .SS Temperature Voltage, Current, Memory, and Switch. .PP .B 51 [.]XXXXXXXXXXXX[XX][/[ .B amphours | .B current | .B currentbias | .B lock.[0-1|ALL] | .B memory | .B pages/page.[0-1|ALL] | .B PIO | .B sensed | .B temperature | .B typeX/range_low | .B typeX/range_high | .B typeX/temperature | .B vbias | .B vis | .B volt | .B volthours | .br .B defaultpmod | .B pmod | .B por | .B uven | .br .so man3/standard_mini.3so ]] .SS Thermocouple .PP .B 51 [.]XXXXXXXXXXXX[XX][/[ .B temperature | .B typeX/range_low | .B typeX/range_high | .B typeX/temperature .SH FAMILY CODE .PP .I 51 .SH SPECIAL PROPERTIES .SS amphours .I read-write, floating point .br Accumulated amperage read by current sensor. Units are in .B Amp-hr (Assumes internal 25mOhm resistor). Derived from .I volthours / Rinternal. .br Formally .I amphours is the integral of .I current - currentbias over time. .SS current .I read-only, floating point .br Current reading. Units are in .B Amp (Assumes internal 25 mOhm resistor). Derived from .I vis / Rinternal. .SS currentbias .I read-write, floating point .br Fixed offset applied to each .I current measurement. Used in the .I amphours value. Assumes internal 25mOhm resistor. Units are .B Amp and range from -.08A to .08A. .br Derived from .I vbias / Rinternal. .SS lock.[0-1|ALL] .I read-write, yes-no .br Lock either of the two eprom pages to prevent further writes. Apparently setting .I lock is permanent. .SS memory .I read-write, binary .br Access to the full 256 byte memory range. Much of this space is reserved or special use. User space is the .I page area. .br See the .I DATASHEET for a full memory map. .SS pages/pages.[0-1|ALL] .I read-write, binary Two 16 byte areas of memory for user application. The .I lock property can prevent further alteration. .br NOTE that the .I page property is different from the common .I OWFS implementation in that all of .I memory is not accessible. .SS PIO .I write-only, yes-no .br Controls the PIO pin allowing external switching. .br Writing "1" turns the PIO pin on (conducting). Writing "0" makes the pin non-conducting. The logical state of the voltage can be read with the .I sensed property. This will reflect the current voltage at the pin, not the value sent to .I PIO .br Note also that .I PIO will also be altered by the power-status of the .I DS2670 See the datasheet for details. .SS sensed .I read-only, yes-no .br The logical voltage at the PIO pin. Useful only if the .I PIO property is set to "0" (non-conducting). .br Value will be 0 or 1 depending on the voltage threshold. .SS temperature .I read-only, floating point .br .I Temperature read by the chip at high resolution (~13 bits). Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. .br Conversion is continuous. .SS vbias .I read-write, floating point .br Fixed offset applied to each .I vis measurement. Used for the .I volthours value. Units are in .B Volts. .br Range \-2.0mV to 2.0mV .SS vis .I read-only, floating point .br Current sensor reading (unknown external resistor). Measures the voltage gradient between the Vis pins. Units are in .B Volts .br The .I vis readings are integrated over time to provide the .I volthours property. .br The .I current reading is derived from .I vis assuming the internal 25 mOhm resistor is employed. There is no way to know this through software. .SS volt .I read-only, floating point .br Voltage read at the voltage sensor;. This is separate from the .I vis voltage that is used for .I current measurement. Units are .B Volts .br Range is between 0 and 4.75V .SS volthours .I read-write, floating point .br Integral of .I vis - vbias over time. Units are in .B volthours .SH THERMOCOUPLE .SS typeX/ .I directory .br Thermocouple circuit using the .I DS2760 to read the Seebeck voltage and the reference temperature. Since the type interpretation of the values read depends on the type of thermocouple, the correct directory must be chosen. Supported thermocouple types include types B, E, J, K, N, R, S and T. .SS typeX/range_low typeX/ranges_high .I read-only, flaoting point .br The lower and upper temperature supported by this thermocouple (at least by the conversion routines). In the globally chosen temperature units. .SS typeX/temperature .I read-only, floating point .br Thermocouple temperature. Requires a voltage and temperature conversion. Returned in globally chosen temperature units. .br Note: there are two types of temperature measurements possible. The .I temperature value in the main device directory is the reference temperature read at the chip. The .I typeX/temperature value is at the thermocouple junction, probably remote from the chip. .SH OBSCURE PROPERTIES .SS pmod por uven .I varies, yes-no .br Bit flags corresponding to various battery management functions of the chip. See the .I DATASHEET for details of the identically named entries. .br In general, writing "0" corresponds to a 0 bit value, and non-zero corresponds to a 1 bit value. .SS defaultpmod .I read-write, yes-no .br Default power-on state for the corresponding properties. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2751 The .B DS2751 (3) is battery charging controllers similar to the .B DS2760 (3) .PP A number of interesting devices can be built with the .B DS2751 (3) including thermocouples. Support for thermocouples in built into the software, using the embedded thermister as the cold junction temperature. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2751.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2755.man0000644000175000001440000001361612654730021013252 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2755 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2755, DS2756 \- Multichemistry Battery Fuel Gauge .SH SYNOPSIS .SS Temperature Voltage, Current, Memory, and Switch. .PP .B 35 [.]XXXXXXXXXXXX[XX][/[ .B alarm_set/[volthigh|voltlow|temphigh|templow] | .B lock.[0-2|ALL] | .B memory | .B pages/page.[0-2|ALL] | .B PIO | .B sensed | .B temperature | .B vbias | .B vis | .B volt | .B volthours | .br .B defaultpmod | .B pie0 | .B pie1 | .B rnaop | .B ios | .B uben | .B ovd | .B pmod | .B por | .B uven | .br .so man3/standard_mini.3so ]] .SS Thermocouple .PP .B 35 [.]XXXXXXXXXXXX[XX][/[ .B temperature | .B typeX/range_low | .B typeX/range_high | .B typeX/temperature .SH FAMILY CODE .PP .I 35 .SH SPECIAL PROPERTIES .SS alarm_set/templow alarm_set/temphigh .I read-write, integer .br High and low alarm settings for .I temperature .SS alarm_set/voltlow alarm_set/volthigh .I read-write, floating point .br High and low alarm settings for .I volts .SS lock.[0-2|ALL] .I read-write, yes-no .br Lock any of the three eprom pages to prevent further writes. Apparently setting .I lock is permanent. .SS memory .I read-write, binary .br Access to the full 256 byte memory range. Much of this space is reserved or special use. User space is the .I page area. .br See the .I DATASHEET for a full memory map. .SS pages/pages.[0-2|ALL] .I read-write, binary Three 32 byte areas of memory for user application. The .I lock property can prevent further alteration. .br NOTE that the .I page property is different from the common .I OWFS implementation in that all of .I memory is not accessible. .SS PIO .I write-only, yes-no .br Controls the PIO pin allowing external switching. .br Writing "1" turns the PIO pin on (conducting). Writing "0" makes the pin non-conducting. The logical state of the voltage can be read with the .I sensed property. This will reflect the current voltage at the pin, not the value sent to .I PIO .br Note also that .I PIO will also be altered by the power-status of the .I DS2670 See the datasheet for details. .SS sensed .I read-only, yes-no .br The logical voltage at the PIO pin. Useful only if the .I PIO property is set to "0" (non-conducting). .br Value will be 0 or 1 depending on the voltage threshold. .SS temperature .I read-only, floating point .br .I Temperature read by the chip at high resolution (~13 bits). Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. .br Conversion is continuous. .SS vbias .I read-write, floating point .br Fixed offset applied to each .I vis measurement. Used for the .I volthours value. Units are in .B Volts. .br Range \-2.0mV to 2.0mV .SS vis .I read-only, floating point .br Current sensor reading (unknown external resistor). Measures the voltage gradient between the Vis pins. Units are in .B Volts .br The .I vis readings are integrated over time to provide the .I volthours property. .br The .I current reading is derived from .I vis assuming the internal 25 mOhm resistor is employed. There is no way to know this through software. .SS volt .I read-only, floating point .br Voltage read at the voltage sensor;. This is separate from the .I vis voltage that is used for .I current measurement. Units are .B Volts .br Range is between 0 and 4.75V .SS volthours .I read-write, floating point .br Integral of .I vis - vbias over time. Units are in .B volthours .SH THERMOCOUPLE .SS typeX/ .I directory .br Thermocouple circuit using the .I DS2755 to read the Seebeck voltage and the reference temperature. Since the type interpretation of the values read depends on the type of thermocouple, the correct directory must be chosen. Supported thermocouple types include types B, E, J, K, N, R, S and T. .SS typeX/range_low typeX/ranges_high .I read-only, flaoting point .br The lower and upper temperature supported by this thermocouple (at least by the conversion routines). In the globally chosen temperature units. .SS typeX/temperature .I read-only, floating point .br Thermocouple temperature. Requires a voltage and temperature conversion. Returned in globally chosen temperature units. .br Note: there are two types of temperature measurements possible. The .I temperature value in the main device directory is the reference temperature read at the chip. The .I typeX/temperature value is at the thermocouple junction, probably remote from the chip. .SH OBSCURE PROPERTIES .SS pmod por uven pie0 pie1 ios uben ovd rnaop .I varies, yes-no .br Bit flags corresponding to various battery management functions of the chip. See the .I DATASHEET for details of the identically named entries. .br In general, writing "0" corresponds to a 0 bit value, and non-zero corresponds to a 1 bit value. .SS defaultpmod .I read-write, yes-no .br Default power-on state for the corresponding properties. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS Temperature and voltage. .SH DESCRIPTION .so man3/description.3so .SS DS2755 DS2756 The .B DS2755 (3) and .B DS2756 (3) are battery charging controllers similar to the .B DS2751 (3) except no internal resistor option and a larger EEPROM memory. .PP The .B DS2756 (3) adds suspend modes ( .I pie0 pie1 ) to the .B DS2755 (3) .PP A number of interesting devices can be built with the .B DS2755 (3) and .B DS2756 (3) including thermocouples. Support for thermocouples in built into the software, using the embedded thermister as the cold junction temperature. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2755.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS2756.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2760.man0000644000175000001440000002203412654730021013240 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2760 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2760, DS2761, DS2762 \- High-Precision Li+ Battery Monitor .SH SYNOPSIS .SS Temperature Voltage and Current. .PP .B 30 [.]XXXXXXXXXXXX[XX][/[ .B amphours | .B current | .B currentbias | .B lock.[0-1|ALL] | .B memory | .B pages/page.[0-1|ALL] | .B PIO | .B sensed | .B temperature | .B vbias | .B vis | .B volt | .B volthours | .br .B cc | .B ce | .B coc | .B defaultpmod | .B defaultswen | .B dc | .B de | .B doc | . B mstr | .B ov | .B ps | .B pmod | .B swen | .B uv | .br .so man3/standard_mini.3so ]] .SS Thermocouple .PP .B 30 [.]XXXXXXXXXXXX[XX][/[ .B temperature | .B typeX/range_low | .B typeX/range_high | .B typeX/temperature ]] .SS Weather Station .PP .B 30 [.]XXXXXXXXXXXX[XX][/[ .B WS603/temperature | .B WS603/wind_speed | .B WS603/direction | .B WS603/volt | .br .B WS603/LED/status | .B WS603/LED/control.ALL | .B WS603/LED/model | .br .B WS603/calibrationwind_speed | .B WS603/calibration/direction | .br .B WS603/light/intensity | .B WS603/light/threshold .SH FAMILY CODE .PP .I 30 .SH SPECIAL PROPERTIES .SS amphours .I read-write, floating point .br Accumulated amperage read by current sensor. Units are in .B Amp-hr (Assumes internal 25mOhm resistor). Derived from .I volthours / Rinternal. .br Formally .I amphours is the integral of .I current - currentbias over time. .SS current .I read-only, floating point .br Current reading. Units are in .B Amp (Assumes internal 25 mOhm resistor). Derived from .I vis / Rinternal. .SS currentbias .I read-write, floating point .br Fixed offset applied to each .I current measurement. Used in the .I amphours value. Assumes internal 25mOhm resistor. Units are .B Amp and range from -.08A to .08A. .br Derived from .I vbias / Rinternal. .SS lock.[0-1|ALL] .I read-write, yes-no .br Lock either of the two eprom pages to prevent further writes. Apparently setting .I lock is permanent. .SS memory .I read-write, binary .br Access to the full 256 byte memory range. Much of this space is reserved or special use. User space is the .I page area. .br See the .I DATASHEET for a full memory map. .SS pages/pages.[0-1|ALL] .I read-write, binary Two 16 byte areas of memory for user application. The .I lock property can prevent further alteration. .br NOTE that the .I page property is different from the common .I OWFS implementation in that all of .I memory is not accessible. .SS PIO .I write-only, yes-no .br Controls the PIO pin allowing external switching. .br Writing "1" turns the PIO pin on (conducting). Writing "0" makes the pin non-conducting. The logical state of the voltage can be read with the .I sensed property. This will reflect the current voltage at the pin, not the value sent to .I PIO .br Note also that .I PIO will also be altered by the power-status of the .I DS2670 See the datasheet for details. .SS sensed .I read-only, yes-no .br The logical voltage at the PIO pin. Useful only if the .I PIO property is set to "0" (non-conducting). .br Value will be 0 or 1 depending on the voltage threshold. .SS temperature .I read-only, floating point .br .I Temperature read by the chip at high resolution (~13 bits). Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. .br Conversion is continuous. .SS vbias .I read-write, floating point .br Fixed offset applied to each .I vis measurement. Used for the .I volthours value. Units are in .B Volts. .br Range \-2.0mV to 2.0mV .SS vis .I read-only, floating point .br Current sensor reading (unknown external resistor). Measures the voltage gradient between the Vis pins. Units are in .B Volts .br The .I vis readings are integrated over time to provide the .I volthours property. .br The .I current reading is derived from .I vis assuming the internal 25 mOhm resistor is employed. There is no way to know this through software. .SS volt .I read-only, floating point .br Voltage read at the voltage sensor;. This is separate from the .I vis voltage that is used for .I current measurement. Units are .B Volts .br Range is between 0 and 4.75V .SS volthours .I read-write, floating point .br Integral of .I vis - vbias over time. Units are in .B volthours .SH THERMOCOUPLE .SS typeX/ .I directory .br Thermocouple circuit using the .I DS2760 to read the Seebeck voltage and the reference temperature. Since the type interpretation of the values read depends on the type of thermocouple, the correct directory must be chosen. Supported thermocouple types include types B, E, J, K, N, R, S and T. .SS typeX/range_low typeX/ranges_high .I read-only, flaoting point .br The lower and upper temperature supported by this thermocouple (at least by the conversion routines). In the globally chosen temperature units. .SS typeX/temperature .I read-only, floating point .br Thermocouple temperature. Requires a voltage and temperature conversion. Returned in globally chosen temperature units. .br Note: there are two types of temperature measurements possible. The .I temperature value in the main device directory is the reference temperature read at the chip. The .I typeX/temperature value is at the thermocouple junction, probably remote from the chip. .SH WEATHER STATION .SS WS603 .I directory .br Weather station from .I AAG electronica that includes temperature, wind speed, wind direction, light sensor and LED lights. .SS WS603/temperature .I read-only, floating-point .br Uses the .I DS2760 temperature sensor. This is equivalent to the .I temperature value. Again in the specificed temperature scale, default Celsius. .SS WS603/wind_speed .I read_only, floating-point .br Readings from the anometer, scaled using the .I WS603/calibration/wind_speed .SS WS603/direction .I read_only, unsigned integer .br Wind direction, using the following table .TP 1 N .TP 2 NNE .TP 3 NE .TP 4 NEE .TP 5 E .TP 6 EES .TP 7 ES .TP 8 ESS .TP 9 S .TP 10 SSW .TP 11 SW .TP 12 SWW .TP 13 W .TP 14 WWN .TP 15 WN .TP 16 WWN .PP Values are adjusted (internally) by the .I WS603/calibration/direction property .SS WS603/volt .I read-only, unsigned integer .br Voltage value from the .I WS603 device. Units and significance is unclear. .SS WS603/calibration/wind_speed .I read-write, unsigned integer .br Value between 1 and 200 for wind speed scaling. Values on of this range are ignored and the default value of 100 used. .SS WS603/calibration/direction .I read-write, unsigned integer .br Adjustment of wind direction. See datasheet. .SS WS603/light/intensity .I read-only, unsigned integer .br Uncalibrated value from an internal light sensor. Used for control of LED display (daytime vs nighttime). .SS WS603/light/threshold .I read-only, unsigned integer .br Threshold for internal light sensor. Used for control of LED display (daytime vs nighttime). .PP Value is set as value 4 of the array passed to .I WS603/LED/control .SS WS603/LED/status .I read-only, unsigned integer .br Status of LED lights intensities. See datasheet. .PP Value is set as values 2 and 3 of the array passed to .I WS603/LED/control .SS WS603/LED/model .I read-only, unsigned integer .br What factors control LED display. See datasheet. .PP Value is set as value 1 of the array passed to .I WS603/LED/control.ALL .SS WS603/LED/model .I write-only, unsigned integer array of 4 values .br Four integers sent to control LED display. All four values must be sent, comma separated. .TP 0 Light mode .TP 1 Light status .TP 2 Light level .TP 3 Light threshold .SH OBSCURE PROPERTIES .SS cc ce coc dc de doc mstr ov pmod swen uv .I varies, yes-no .br Bit flags corresponding to various battery management functions of the chip. See the .I DATASHEET for details of the identically named entries. .br In general, writing "0" corresponds to a 0 bit value, and non-zero corresponds to a 1 bit value. .SS defaultpmod defaultswen .I read-write, yes-no .br Default power-on state for the corresponding properties. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2760 DS2761 DS2762 The .B DS2760 (3) is a class of battery charging controllers. There are minor hardware difference between the .B DS2760, DS2761 and .B DS2762 battery chip, but they are indistiguishable to the software. .PP A number of interesting devices can be built with the .B DS276x including thermocouples. Support for thermocouples in built into the software, using the embedded thermister as the cold junction temperature. .PP For an explanation of the differences between the .B DS276x variants, see Dallas Application Note 221. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2760.pdf .br http://pdfserv.maxim-ic.com/en/an/app221.pdf .br http://www.aag.com.mx/aagusa/contents/en-us/Description%20of%20WSV3%20Interface%20(1-wire).pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2770.man0000644000175000001440000001467312654730021013253 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2770 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2770 \- Battery Monitor and Charge Controller .SH SYNOPSIS .SS Temperature Voltage Current Memory and Switch. .PP .B 2E [.]XXXXXXXXXXXX[XX][/[ .B amphours | .B current | .B currentbias | .B lock.[0-2|ALL] | .B memory | .B pages/page.[0-2|ALL] | .B PIO | .B sensed | .B temperature | .B vbias | .B vis | .B volt | .B volthours | .br .B charge | .B cini | .B cstat0 | .B cstat1 | .B ctype | .B defaultpmod | .B pmod | .B refresh | .B timer | .br .so man3/standard_mini.3so ]] .SS Thermocouple .PP .B 2E [.]XXXXXXXXXXXX[XX][/[ .B temperature | .B typeX/range_low | .B typeX/range_high | .B typeX/temperature .SH FAMILY CODE .PP .I 2E .SH SPECIAL PROPERTIES .SS amphours .I read-write, floating point .br Accumulated amperage read by current sensor. Units are in .B Amp-hr (Assumes internal 25mOhm resistor). Derived from .I volthours / Rinternal. .br Formally .I amphours is the integral of .I current - currentbias over time. .SS current .I read-only, floating point .br Current reading. Units are in .B Amp (Assumes internal 25 mOhm resistor). Derived from .I vis / Rinternal. .SS currentbias .I read-write, floating point .br Fixed offset applied to each .I current measurement. Used in the .I amphours value. Assumes internal 25mOhm resistor. Units are .B Amp and range from -.08A to .08A. .br Derived from .I vbias / Rinternal. .SS lock.[0-2|ALL] .I read-write, yes-no .br Lock either of the three eprom pages to prevent further writes. Apparently setting .I lock is permanent. .SS memory .I read-write, binary .br Access to the full 256 byte memory range. Much of this space is reserved or special use. User space is the .I page area. .br See the .I DATASHEET for a full memory map. .SS pages/pages.[0-2|ALL] .I read-write, binary Two 16 byte and one 8 byte areas of memory for user application. The .I lock property can prevent further alteration. .br NOTE that the .I page property is different from the common .I OWFS implementation in that all of .I memory is not accessible. .SS PIO .I write-only, yes-no .br Controls the PIO pin allowing external switching. .br Writing "1" turns the PIO pin on (conducting). Writing "0" makes the pin non-conducting. The logical state of the voltage can be read with the .I sensed property. This will reflect the current voltage at the pin, not the value sent to .I PIO .br Note also that .I PIO will also be altered by the power-status of the .I DS2670 See the datasheet for details. .SS sensed .I read-only, yes-no .br The logical voltage at the PIO pin. Useful only if the .I PIO property is set to "0" (non-conducting). .br Value will be 0 or 1 depending on the voltage threshold. .SS temperature .I read-only, floating point .br .I Temperature read by the chip at high resolution (~13 bits). Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. .br Conversion is continuous. .SS vbias .I read-write, floating point .br Fixed offset applied to each .I vis measurement. Used for the .I volthours value. Units are in .B Volts. .br Range \-2.0mV to 2.0mV .SS vis .I read-only, floating point .br Current sensor reading (unknown external resistor). Measures the voltage gradient between the Vis pins. Units are in .B Volts .br The .I vis readings are integrated over time to provide the .I volthours property. .br The .I current reading is derived from .I vis assuming the internal 25 mOhm resistor is employed. There is no way to know this through software. .SS volt .I read-only, floating point .br Voltage read at the voltage sensor;. This is separate from the .I vis voltage that is used for .I current measurement. Units are .B Volts .br Range is between 0 and 4.75V .SS volthours .I read-write, floating point .br Integral of .I vis - vbias over time. Units are in .B volthours .SH THERMOCOUPLE .SS typeX/ .I directory .br Thermocouple circuit using the .B DS2770 (3) to read the Seebeck voltage and the reference temperature. Since the type interpretation of the values read depends on the type of thermocouple, the correct directory must be chosen. Supported thermocouple types include types B, E, J, K, N, R, S and T. .SS typeX/range_low typeX/ranges_high .I read-only, flaoting point .br The lower and upper temperature supported by this thermocouple (at least by the conversion routines). In the globally chosen temperature units. .SS typeX/temperature .I read-only, floating point .br Thermocouple temperature. Requires a voltage and temperature conversion. Returned in globally chosen temperature units. .br Note: there are two types of temperature measurements possible. The .I temperature value in the main device directory is the reference temperature read at the chip. The .I typeX/temperature value is at the thermocouple junction, probably remote from the chip. .SH OBSCURE PROPERTIES .SS charge .I write-only, yes-no .br Trigger the start (1) or stop(0) of charging. see the .I DATASHEET for details. .SS cini cstat0 cstat1 ctype pmod .I varies, yes-no .br Bit flags corresponding to various battery management functions of the chip. See the .I DATASHEET for details of the identically named entries. .br In general, writing "0" corresponds to a 0 bit value, and non-zero corresponds to a 1 bit value. .SS defaultpmod .I read-write, yes-no .br Default power-on state for the corresponding properties. .SS refresh .I write-only, yes-no .br Writing anything to this file causes a refresh of parameters. See the .SS timer .I read-write, floating point .br A charge timer in units of .B hours. See the .I DATASHEET for details. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2770 The .B DS2770 (3) is a battery charging controller. It has elaborate charge estimation algorithms built in. .PP A number of interesting devices can be built with the .B DS2770 including thermocouples. Support for thermocouples in built into the software, using the embedded thermister as the cold junction temperature. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2770.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2780.man0000644000175000001440000001261012654730021013241 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2760 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2780 \- Stand-alone Fuel Gauge IC .TP .B DS2788 \- Stand-alone Fuel Gauge with LED Drivers .SH SYNOPSIS .SS Temperature Voltage Current Memory and Switch. .PP .B 32 [.]XXXXXXXXXXXX[XX][/[ .B lock.[0-1|ALL] | .B memory | .B pages/page.[0-1|ALL] | .B PIO | .B sensed | .B temperature | .B vbias | .B vis | .B volt | .B volthours | .br .B aef | .B chgtf | .B ds | .B learnf | .B pmod | .B porf | .B rnaop | .B sef | .B uven | .B uvf | .br .so man3/standard_mini.3so ]] .SS Thermocouple .PP .B 32 [.]XXXXXXXXXXXX[XX][/[ .B temperature | .B typeX/range_low | .B typeX/range_high | .B typeX/temperature .SH FAMILY CODE .PP .I 32 .SH SPECIAL PROPERTIES .SS lock.[0-1|ALL] .I read-write, yes-no .br Lock either of the two eprom pages to prevent further writes. Apparently setting .I lock is permanent. .SS memory .I read-write, binary .br Access to the full 256 byte memory range. Much of this space is reserved or special use. User space is the .I page area. .br See the .I DATASHEET for a full memory map. .SS pages/pages.[0-1|ALL] .I read-write, binary Two 16 byte areas of memory for user application. The .I lock property can prevent further alteration. .br NOTE that the .I page property is different from the common .I OWFS implementation in that all of .I memory is not accessible. .SS PIO .I write-only, yes-no .br Controls the PIO pin allowing external switching. .br Writing "1" turns the PIO pin on (conducting). Writing "0" makes the pin non-conducting. The logical state of the voltage can be read with the .I sensed property. This will reflect the current voltage at the pin, not the value sent to .I PIO .br Note also that .I PIO will also be altered by the power-status of the .I DS2680 See the datasheet for details. .SS sensed .I read-only, yes-no .br The logical voltage at the PIO pin. Useful only if the .I PIO property is set to "0" (non-conducting). .br Value will be 0 or 1 depending on the voltage threshold. .SS temperature .I read-only, floating point .br .I Temperature read by the chip at high resolution (~13 bits). Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. .br Conversion is continuous. .SS vbias .I read-write, floating point .br Fixed offset applied to each .I vis measurement. Used for the .I volthours value. Units are in .B Volts. .br Range \-2.0mV to 2.0mV .SS vis .I read-only, floating point .br Current sensor reading (unknown external resistor). Measures the voltage gradient between the Vis pins. Units are in .B Volts .br The .I vis readings are integrated over time to provide the .I volthours property. .br The .I current reading is derived from .I vis assuming the internal 25 mOhm resistor is employed. There is no way to know this through software. .SS volt .I read-only, floating point .br Voltage read at the voltage sensor;. This is separate from the .I vis voltage that is used for .I current measurement. Units are .B Volts .br Range is between 0 and 4.75V .SS volthours .I read-write, floating point .br Integral of .I vis - vbias over time. Units are in .B volthours .SH THERMOCOUPLE .SS typeX/ .I directory .br Thermocouple circuit using the .I DS2780 to read the Seebeck voltage and the reference temperature. Since the type interpretation of the values read depends on the type of thermocouple, the correct directory must be chosen. Supported thermocouple types include types B, E, J, K, N, R, S and T. .SS typeX/range_low typeX/ranges_high .I read-only, flaoting point .br The lower and upper temperature supported by this thermocouple (at least by the conversion routines). In the globally chosen temperature units. .SS typeX/temperature .I read-only, floating point .br Thermocouple temperature. Requires a voltage and temperature conversion. Returned in globally chosen temperature units. .br Note: there are two types of temperature measurements possible. The .I temperature value in the main device directory is the reference temperature read at the chip. The .I typeX/temperature value is at the thermocouple junction, probably remote from the chip. .SH OBSCURE PROPERTIES .SS aef chgtf dc learnf pmod porf rnaop sef uven uvf .I varies, yes-no .br Bit flags corresponding to various battery management functions of the chip. See the .I DATASHEET for details of the identically named entries. .br In general, writing "0" corresponds to a 0 bit value, and non-zero corresponds to a 1 bit value. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2780 The .B DS2780 (3) is a battery charging controller. It has elaborate algorithms for estimating battery capacity. .PP A number of interesting devices can be built with the .B DS2780 including thermocouples. Support for thermocouples in built into the software, using the embedded thermister as the cold junction temperature. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2780.pdf .br http://pdfserv.maxim-ic.com/en/ds/DS2788.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2781.man0000644000175000001440000001314112654730021013242 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2760 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2781 \- Stand-alone Fuel Gauge IC .SH SYNOPSIS .SS Temperature Voltage Current Memory and Switch. .PP .B 3D [.]XXXXXXXXXXXX[XX][/[ .B lock.[0-1|ALL] | .B memory | .B pages/page.[0-1|ALL] | .B PIO | .B sensed | .B temperature | .B vbias | .B vis | .B vis_avg | .B vis_offset | .B volt | .B volthours | .br .B aef | .B chgtf | .B learnf | .B pmod | .B porf | .B sef | .B uven | .B uvf | .br .so man3/standard_mini.3so ]] .SS Thermocouple .PP .B 3D [.]XXXXXXXXXXXX[XX][/[ .B temperature | .B typeX/range_low | .B typeX/range_high | .B typeX/temperature .SH FAMILY CODE .PP .I 3D .SH SPECIAL PROPERTIES .SS lock.[0-1|ALL] .I read-write, yes-no .br Lock either of the two eprom pages to prevent further writes. Apparently setting .I lock is permanent. .SS memory .I read-write, binary .br Access to the full 256 byte memory range. Much of this space is reserved or special use. User space is the .I page area. .br See the .I DATASHEET for a full memory map. .SS pages/pages.[0-1|ALL] .I read-write, binary Two 16 byte areas of memory for user application. The .I lock property can prevent further alteration. .br NOTE that the .I page property is different from the common .I OWFS implementation in that all of .I memory is not accessible. .SS PIO .I write-only, yes-no .br Controls the PIO pin allowing external switching. .br Writing "1" turns the PIO pin on (conducting). Writing "0" makes the pin non-conducting. The logical state of the voltage can be read with the .I sensed property. This will reflect the current voltage at the pin, not the value sent to .I PIO .br Note also that .I PIO will also be altered by the power-status of the .I DS2680 See the datasheet for details. .SS sensed .I read-only, yes-no .br The logical voltage at the PIO pin. Useful only if the .I PIO property is set to "0" (non-conducting). .br Value will be 0 or 1 depending on the voltage threshold. .SS temperature .I read-only, floating point .br .I Temperature read by the chip at high resolution (~13 bits). Units are selected from the invoking command line. See .B owfs(1) or .B owhttpd(1) for choices. Default is Celsius. .br Conversion is continuous. .SS vbias .I read-write, floating point .br Fixed offset applied to each .I vis measurement. Used for the .I volthours value. Units are in .B Volts. .br Range \-2.0mV to 2.0mV .SS vis .I read-only, floating point .br Current sensor reading (unknown external resistor). Measures the voltage gradient between the Vis pins. Units are in .B Volts .br The .I vis readings are integrated over time to provide the .I volthours property. .br The .I current reading is derived from .I vis assuming the internal 25 mOhm resistor is employed. There is no way to know this through software. .SS vis_avg .I read-only, floating point .br Average current sensor reading (unknown external resistor). Measures the voltage gradient between the Vis pins. Units are in .B Volts .SS vis_offset .I read-write, floating point .br Offset to .I vis for current sensor reading (unknown external resistor). Units are in .B Volts .SS volt .I read-only, floating point .br Voltage read at the voltage sensor;. This is separate from the .I vis voltage that is used for .I current measurement. Units are .B Volts .br Range is between 0 and 4.75V .SS volthours .I read-write, floating point .br Integral of .I vis - vbias over time. Units are in .B volthours .SH THERMOCOUPLE .SS typeX/ .I directory .br Thermocouple circuit using the .I DS2781 to read the Seebeck voltage and the reference temperature. Since the type interpretation of the values read depends on the type of thermocouple, the correct directory must be chosen. Supported thermocouple types include types B, E, J, K, N, R, S and T. .SS typeX/range_low typeX/ranges_high .I read-only, flaoting point .br The lower and upper temperature supported by this thermocouple (at least by the conversion routines). In the globally chosen temperature units. .SS typeX/temperature .I read-only, floating point .br Thermocouple temperature. Requires a voltage and temperature conversion. Returned in globally chosen temperature units. .br Note: there are two types of temperature measurements possible. The .I temperature value in the main device directory is the reference temperature read at the chip. The .I typeX/temperature value is at the thermocouple junction, probably remote from the chip. .SH OBSCURE PROPERTIES .SS aef chgtf learnf pmod porf sef uven uvf .I varies, yes-no .br Bit flags corresponding to various battery management functions of the chip. See the .I DATASHEET for details of the identically named entries. .br In general, writing "0" corresponds to a 0 bit value, and non-zero corresponds to a 1 bit value. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS2781 The .B DS2781 (3) is a battery charging controller. It has elaborate algorithms for estimating battery capacity. .PP A number of interesting devices can be built with the .B DS2781 including thermocouples. Support for thermocouples in built into the software, using the embedded thermister as the cold junction temperature. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2781.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS2890.man0000644000175000001440000000434212654730021013246 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS2890 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS2890 \- 1-Wire Digital Potentiometer .SH SYNOPSIS Variable resistance .PP .B 2C [.]XXXXXXXXXXXX[XX][/[ .B chargepump | .B wiper | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 2C .SH SPECIAL PROPERTIES .SS chargepump .I read-write, yes-no .br State of the .I chargepump in the chip (0 = off 1 = on). Only available if external power is available (hence not in the TO-92 packaging) at pin Vdd. .br When .I chargepump is on, the .I wiper resistance will range between Rh and Rl relatively linearly. .br When .I chargepump is off, the .I wiper resistance (to ground) will range relatively linearly (to 100kOhms). .SS wiper .I read-write, unsigned integer .br Value of the variable element, 0 to 255. The actual interpretation of .I wiper depands on the .I chargepump state, but in general 0 is low and 255 is high. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS The device condition that will cause individual .B DS2890s to participate in a Conditional Search is a wiper position located at the power-on default setting (00h). This feature enables the bus master to easily determine whether a potentiometer has gone through a power-on reset and needs to be re-configured with a required wiper position setting. .SH DESCRIPTION .so man3/description.3so .SS DS2890 The .B D2890 (3) allows variable resistance under 1-wire control. Possible uses are analog feedback mechanisms (sound pitch, light level). .P Although there are provisions in the datasheet for different .B DS2890 configurations (non-linear wiper ranges, multiple wipers, different resistance scales) non are in production. To simplify implementation, this driver assumes the standard .B DS2890 design. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS2890.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS28E04.man0000644000175000001440000000775612654730021013362 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS28E04-100 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS28E04 \- 1-Wire EEPROM chip (4096-bit) with seven address inputs .SH SYNOPSIS 4096-bit EEPROM, 2 port switch .PP .B 1C [.]XXXXXXXXXXXX[XX][/[ .B latch.[0-1|ALL|BYTE] | .B PIO.[0-1|ALL|BYTE] | .B power | .B sensed.[0-1|ALL|BYTE] | .B polarity | .B por | .B set_alarm | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 1C .SH SPECIAL PROPERTIES .SS latch.0 latch.1 latch.ALL latch.BYTE .I read-write, binary .br The 2 pins (PIO) latch a bit when their state changes, either externally, or through a write to the pin. .br Reading the .I latch property indicates that the latch has been set. .br Writing any data to ANY .I latch will reset them all. (This is the hardware design). .br .I ALL is all .I latch states, accessed simultaneously, comma separated. .br .I BYTE references all channels simultaneously as a single byte. Channel 0 is bit 0. .SS PIO.0 PIO.1 PIO.ALL PIO.BYTE .I read-write, yes-no .br State of the open-drain output ( .I PIO ) pin. 0 = non-conducting = off, 1 = conducting = on. .br Writing zero will turn off the switch, non-zero will turn on the switch. Reading the .I PIO state will return the switch setting. To determine the actual logic level at the switch, refer to the .I sensed.0 sensed.1 sensed.ALL sensed.BYTE property. .br .I ALL references all channels simultaneously, comma separated. .br .I BYTE references all channels simultaneously as a single byte. Channel 0 is bit 0. .SS power .I read-only, yes-no .br Is the .I DS28E04 powered parasitically (=0) or separately on the Vcc pin (=1)? .SS sensed.0 sensed.1 sensed.ALL sensed.BYTE .I read-only, yes-no .br Logic level at the .I PIO pin. 0 = ground. 1 = high (~2.4V - 5V ). Really makes sense only if the .I PIO state is set to zero (off), else will read zero. .br .I ALL references all channels simultaneously, comma separated. .br .I BYTE references all channels simultaneously as a single byte. Channel 0 is bit 0. .SS polarity .I read-only, yes-no .br Reports the state of the POL pin. The state of the POL pin specifies whether the PIO pins P0 and P1 power up high or low. The polarity of a pulse generated at a PIO pin is the opposite of the pin's power-up state. .TP .I 0 PIO powers up 0 .TP .I 1 PIO powers up 1 .PP .SS por .I read-write, yes-no .br Specifies whether the device has performed power-on reset. This bit can only be cleared to 0 under software control. As long as this bit is 1 the device will allways respond to a conditional search. .SS set_alarm .I read-write, integer unsigned (0-333) .br A number consisting of 3 digits XYY, where: .TP X select source and logical term .br .I 0 PIO OR .br .I 1 latch OR .br .I 2 PIO AND .br .I 3 latch AND .TP Y select channel and polarity .br .I 0 Unselected (LOW) .br .I 1 Unselected (HIGH) .br .I 2 Selected LOW .br .I 3 Selected HIGH .PP All digits will be truncated to the 0-3 range. Leading zeroes are optional. Low-order digit is channel 0. .PP Example: .TP 133 Responds on Conditional Search when latch.1 or latch.0 are set to 1. .TP 222 Responds on Conditional Search when sensed.1 and sensed.0 are set to 0. .TP 000 (0) Never responds to Conditional Search. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS Use the .I set_alarm property to set the alarm triggering criteria. .SH DESCRIPTION .so man3/description.3so .SS DS28E04 The .B DS28E04 (3) is a memory chip that bends the unique addressing capabilities of the .I 1-wire design. Some of the ID bits can be assigned by hardware. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS28E04.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS28EA00.man0000644000175000001440000000640512756371551013461 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS28EA00 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS28EA00 \- 1-Wire Digital Thermometer with Sequence Detect and PIO .SH SYNOPSIS Thermometer, PIO and Chain. .PP .B 42 [.]XXXXXXXXXXXX[XX][/[ .so man3/temperatures_mini.3so | .B latesttemp | .B die | .B power | .B temphigh | .B templow | .B tempres | .B PIO.A|B|ALL.BYTE | .B latch.A|B|ALL.BYTE | .B sensed.A|B|ALL.BYTE .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 42 .SH SPECIAL PROPERTIES .SS power .I read-only,yes-no .br Is the chip powered externally (=1) or from the parasitically from the data bus (=0)? .SH TEMPERATURE PROPERTIES .SS temperature .I read-only, floating point .br Measured temperature with 12 bit resolution. .SS temperature9 temperature10 temperature11 temperature12 .I read-only, floating point .br Measured temperature at 9 to 12 bit resolution. There is a tradeoff of time versus accuracy in the temperature measurement. .SS latesttemp .I read-only, floating point .br Measured temperature at 9 to 12 bit resolution, depending on the resolution of the latest conversion on this chip. Reading this node will never trigger a temperature conversion. Intended for use in conjunction with .B /simultaneous/temperature. .SS fasttemp .I read-only, floating point .br Equivalent to .I temperature9 .SH PIO PROPERTIES .SS PIO.A|B|ALL|BYTE .I read-write, yes-no .br Two channels of sensors/switches. We use the logical raqther than eletrical interpretation: 0=off (non-conducting) 1=on (conducting -- to ground) .PP The .I PIO channels are alternatively used for the sequence-detect (chain) mode. .PP Reading .I sensed gives the inverse value of the cooresponding .I PIO. .PP Reading .I PIO gives the actual pin values. Use the .I latch property to see how the pin is set. .SS latch.A|B|ALL|BYTE .I read-only, yes-no .br Set (intended) va;ue of the .I PIO pins. .SS sensed.A|B|ALL|BYTE .I read-only, yes-no .br Actual logical level at the .I PIO pins. .SH SPECIAL PROPERTIES .SS power .I read-only,yes-no .br Is the chip powered externally (=1) or from the parasitically from the data bus (=0)? .so man3/temperature_threshold.3so .so man3/temperature_resolution.3so .SH STANDARD PROPERTIES .so man3/standard.3so .SH DESCRIPTION .so man3/description.3so .SS DS28EA00 The .B DS28EA00 (3) is one of several available 1-wire temperature sensors. It is the replacement for the .B DS18S20 (3) Alternatives are .B DS1822 (3) as well as temperature/vlotage measurements in the .B DS2436 (3) and .B DS2438 (3). For truly versatile temperature measurements, see the protean .B DS1921 (3) Thermachron (3). .br The .B DS28EA00 has special switch/sequence detect properties. In sequence mode, the PIO pins are daisy-chained to the next DS28EA00, allowing the system to step through the physical sequence of the DS28EA00s. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://pdfserv.maxim-ic.com/en/ds/DS28EA00.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/DS28EC20.man0000644000175000001440000000274312654730021013452 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH DS28EC20 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B DS28EC20 \- EEPROM (20 kBit) .SH SYNOPSIS Erasable programmable read-only memory (EEPROM) .PP .B 43 [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-79|ALL] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I 23 DS28EC20 .SH SPECIAL PROPERTIES .SS memory .I read-write, binary .br 512 bytes of memory. Initially all bits are set to 1. Writing zero permanently alters the memory. .SS pages/page.0 ... pages/page.79 pages/page.ALL .I read-write, yes-no .br Memory is split into 80 pages of 32 bytes each. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS DS28EC20 The .B DS28EC20 (3) is used for storing memory which should be available even after a reset or power off. It's main advantage is for audit trails (i.e. a digital purse). .I OWFS system handles this automatically. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br http://datasheets.maxim-ic.com/en/ds/DS28EC20.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Christian Magnusson (mag@mag.cx) owfs-3.1p5/src/man/man3/EDS.man0000644000175000001440000004247612665167763013065 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH EDS00xx 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME EDS \- Embedded Data Systems Sensors .TP .B EDS0064 \- Temperature .TP .B EDS0065 \- Temperature and Humidity .TP .B EDS0066 \- Temperature and Barometric Pressure .TP .B EDS0067 \- Temperature and Light .TP .B EDS0068 \- Temperature, Barometric Pressure and Light .TP .B EDS0070 \- Vibration .TP .B EDS0071 \- RTD 4-wire temperature .TP .B EDS0072 \- RTD 3-wire temperature .TP .B EDS0080 \- 8 Channel Analog Current Input .TP .B EDS0082 \- 8 Channel Analog Voltage Input .TP .B EDS0083 \- 4 Channel Analog Current Input .TP .B EDS0085 \- 4 Channel Analog Voltage Input .TP .B EDS0090 \- 8 Discrete I/O .SH SYNOPSIS .B Embedded Data Systems microprocessor-based sensors .SS Sub-type ( all ) .B 7E [.]XXXXXXXXXXXX[XX][/[ .B device_id | .B device_type | .B tag ]] .SS Memory ( all ) .B 7E [.]XXXXXXXXXXXX[XX][/[ .B memory | .B pages/page.[0-2|ALL] ]] .SS Standard ( all ) .B 7E [.]XXXXXXXXXXXX[XX][/[ .B .so man3/standard_mini.3so ]] .SS Temperature ( EDS0064/5/6/7/8 ) .B 7E.XXXXXXXXXXXX/EDS006X [/[ .B temperature | .B counters/seconds | .B alarm/temp_[hi|low] | .B alarm/clear | .B set_alarm/temp_[hi|low] | .B threshold/temp_[hi|low] ]] .SS Humidity ( EDS0065/8 ) .B 7E.XXXXXXXXXXXX/EDS006X [/[ .B humidity | .B humidex | .B dew_point | .B heat_index | .B alarm/humidity_[hi|low] | .B alarm/humidex_[hi|low] | .B alarm/dew_point_[hi|low] | .B alarm/heat_index_[hi|low] | .B alarm/clear | .B set_alarm/humidity_[hi|low] | .B set_alarm/humidex_[hi|low] | .B set_alarm/dew_point_[hi|low] | .B set_alarm/heat_index_[hi|low] | .B threshold/humidity_[hi|low] | .br .B threshold/humidex_[hi|low] | .B threshold/dew_point_[hi|low] | .B threshold/heat_index_[hi|low] ]] .SS Barometric Pressure ( EDS0066/8 ) .B 7E.XXXXXXXXXXXX/EDS006X [/[ .B pressure | .B inHg | .B alarm/pressure_[hi|low] | .B alarm/inHg_[hi|low] | .B alarm/clear | .B set_alarm/pressure_[hi|low] | .B set_alarm/inHg_[hi|low] | .B threshold/pressure_[hi|low] | .B threshold/inHg_[hi|low] ]] .SS Light ( EDS0067/8 ) .B 7E.XXXXXXXXXXXX/EDS006X [/[ .B light | .B alarm/light_[hi|low] | .B alarm/clear | .B set_alarm/light_[hi|low] | .B threshold/light_[hi|low] ]] .SS Vibration ( EDS0070 ) .B 7E.XXXXXXXXXXXX/EDS0070 [/[ .B vib_level | .B vib_peak | .B vib_min | .B vib_max | .B counter/seconds | .B alarm/vib_[hi|low] | .B alarm/clear | .B set_alarm/vib_[hi|low] | .B threshold/vib_[hi|low] ]] .SS RTD Temperature ( EDS0071/2 ) .B 7E.XXXXXXXXXXXX/EDS007X [/[ .B temperature | .B resistance | .B raw | .B delay | .B user_byte | .B calibration/[key|constant] | .B counter/[seconds|samples] | .B alarm/temp_[hi|low] | .B alarm/RTD_[hi_low] | .B alarm/clear | .B set_alarm/temp_[hi|low] | .B set_alarm/RTD_[hi_low] | .B threshold/temp_[hi|low] | .B threshold/RTD_[hi_low] ]] .SS Analog Current ( EDS0080 [0-7] EDS0083 [0-3] ) .B 7E.XXXXXXXXXXXX/EDS0080 [/[ .B current.[0-7|ALL] | .B max_current.[0-7|ALL] | .B min_current.[0-7|ALL] | .B threshold/current_hi.[0-7|ALL] | .B threshold/current_low.[0-7|ALL] | .B alarm/current_hi.[0-7|ALL|BYTE] | .B alarm/current_low.[0-7|ALL|BYTE] | .B set_alarm/current_hi.[0-7|ALL|BYTE] | .B set_alarm/current_low.[0-7|ALL|BYTE] | .B counter/seconds | .B memory | .B pages/page.[0-4|ALL] .SS Analog Voltage ( EDS0082 [0-7] EDS0085 [0-3] ) .B 7E.XXXXXXXXXXXX/EDS0082 [/[ .B volts.[0-7|ALL] | .B max_volts.[0-7|ALL] | .B min_volts.[0-7|ALL] | .B threshold/volts_hi.[0-7|ALL] | .B threshold/volts_low.[0-7|ALL] | .B alarm/volts_hi.[0-7|ALL|BYTE] | .B alarm/volts_low.[0-7|ALL|BYTE] | .B set_alarm/volts_hi.[0-7|ALL|BYTE] | .B set_alarm/volts_low.[0-7|ALL|BYTE] | .B counter/seconds | .B memory | .B pages/page.[0-4|ALL] .SS I/O ( EDS0090 ) .B 7E.XXXXXXXXXXXX/EDS009X [/[ .B input.[0-7|ALL] | .B counter/[seconds | pulses.[0-7|ALL]|reset.[0-7|ALL|BYTE]] | .B output/[set.[0-7|ALL|BYTE]|off.[0-7|ALL|BYTE]|reset.[0-7|ALL|BYTE]] | .B latch/[state.[0-7|ALL|BYTE]|reset.[0-7|ALL|BYTE]] | .B alarm/[hi.[0-7|ALL]|low.[0-7|ALL]|clear] | .B set_alarm/[hi.[0-7|ALL]|low.[0-7|ALL]] .SS LED ( all ) .B 7E.XXXXXXXXXXXX/EDS00XX/LED/[state|control] .SS relay ( all ) .B 7E.XXXXXXXXXXXX/EDS00XX/relay/[state|control] .SH FAMILY CODE .TP .I 7E .SH TEMPERATURE .SS EDS006X/temperature .I read-only, floating-point .br Temperature for the EDS006X series of chips. In the \-55C to 125C range, with 0.0636C precision. The temperature is read every second, continually. Data is presented in the specified temperature scale, Celsius by default. .SS EDS007X/temperature .I read-only, floating-point .br Temperature for the EDS007X series of chips. Read using a wide-range precise RTD sensor. Typical range is \-60C to 260C with 0.15C accuracy, although a range of \-200C to 850C is possible. The temperature is read every second unless a longer .I EDS007X/delay is given. Data is presented in the specified temperature scale, Celsius by default. .SS EDS007X/resistance .I read-only, floating-point .br Actual measured resistance (Ohms) of the RTD element. Useful if the RTD element doesn't conform to the typical European IEC 60751 standard. .SH HUMIDITY .SS EDS006X/humidity .I read-only, floating-point .br Relative humidity in the 0-100 range (percent). Read every 0.2 seconds. .SS EDS006X/dew_point .I read-only, floating-point .br Dew point computed from .I EDS006X/temperature and .I EDS006X/humidity computered every 0.2 seconds. Data is a calculated temperature and is reported in the specified temperature scale. Default Celsius. .SS EDS006X/heat_index .I read-only, floating-point .br Heat index computed from .I EDS006X/temperature and .I EDS006X/humidity computered every 0.2 seconds. Data is a calculated temperature and is reported in the specified temperature scale. Default Celsius. .SS EDS006X/humidex .I read-only, floating-point .br Humidex (popular in Canada) computed from .I EDS006X/temperature and .I EDS006X/humidity computed every 0.2 seconds. Data is a percent and reported in the 0-100 range. .SH LIGHT .SS EDS006X/light .I read-only, unsigned integer .br Ambient light in Lux. Measured every 0.2 seconds. .SH PRESSURE .SS EDS006X/pressure .I read-only, floating-point .br Ambient pressure, measured every 0.2 seconds. Data in the selected pressure scale (default mBar). .SS EDS006X/inHg .I read-only, floating-point .br Ambient pressure, measured every 0.2 seconds. Data in the inHg scale. .SH VIBRATION .SS EDS0070/vib_level .I read_only, unsigned integer .br Vibration registered by sensor (instantaneous value) in 0-1023 range. .SS EDS0070/vib_peak .I read_only, unsigned integer .br Vibration registered by sensor (highest recent value -- slowly decays) in 0-1023 range. .SS EDS0070/vib_min .I read_only, unsigned integer .br Vibration registered by sensor (lowest value) in 0-1023 range. .SS EDS0070/vib_max .I read_only, unsigned integer .br Vibration registered by sensor (highest value) in 0-1023 range. .SH CURRENT The .B EDS0080 and .B EDS0083 measure current in the 4-20mA range, with upper and threshold limits and the ability to set an alarm and independently trigger a relay if the value is out of range. .SS EDS0080/current.[0-7|ALL] EDS0083/current.[0-3|ALL] .I read-only, floating point .br Current current level. (4-20mA) .SS EDS0080/max_current.[0-7|ALL] EDS0080/max_current.[0-3|ALL] .SS EDS0083/min_current.[0-7|ALL] EDS0083/min_current.[0-3|ALL] .I read-only, floating point .br Maximum and minimum current readings since last .I alarm/clear command. .SH VOLTAGE The .B EDS0082 and .B EDS0085 measure voltage in the 0-10V range, with upper and threshold limits and the ability to set an alarm and independently trigger a relay if the value is out of range. .SS EDS0082/volts.[0-7|ALL] EDS0085/volts.[0-3|ALL] .I read-only, floating point .br Current voltage level. (0-10V) .SS EDS0082/max_volts.[0-7|ALL] EDS0085/max_volts.[0-3|ALL] .SS EDS0082/min_volts.[0-7|ALL] EDS0085/min_volts.[0-3|ALL] .I read-only, floating point .br Maximum and minimum voltage readings since last .I alarm/clear command. .SH THRESHOLD High and low range of acceptable sensor readings. Values outside this range will trigger an alarm if the corresponding .I EDS00XX/set_alarm flag is set. .SS EDS00XX/threshold/temp_hi EDS00XX/threshold/temp_low .I read-write, floating-point .br Threshold temperatures in the specified temperature scale. Default Celsius. .SS EDS006X/threshold/humidity_hi EDS006X/threshold/humidity_low .SS EDS006X/threshold/dew_point_hi EDS006X/threshold/dew_point_low .SS EDS006X/threshold/heat_index_hi EDS006X/threshold/heat_index_low .SS EDS006X/threshold/humidex_hi tEDS006X/threshold/humidex_low .I read-write, floating-point .br Threshold humidity values. .I Dew point and .I Heat index are in the specified temperature scale. Default Celsius. .SS EDS006X/threshold/pressure_hi EDS006X/threshold/pressure_low .SS EDS006X/threshold/inHg_hi EDS006X/threshold/inHg_low .I read-write, floating-point .br Threshold barometric pressure values. .I Pressure is the specified pressure scale. Default mBar. .SS EDS006X/threshold/light_hi EDS006X/threshold/light_low .I read-write, unsigned .br Threshold light (lux) values. .SS EDS0070/threshold/vib_hi EDS0070/threshold/vib_low .I read-write, unsigned .br Vibration sensor alarm limits in 0-1023 range. .SS EDS007X/threshold/resistance_hi EDS007X/threshold/resistance_low .I read-write, floating-point .br Threshold RTD resistance values (Ohm). .SS EDS0080/threshold/current_hi.[0-7|ALL] EDS0080/threshold/current_low.[0-7|ALL] .SS EDS0082/threshold/volts_hi.[0-7|ALL] EDS0082/threshold/volts_low.[0-7|ALL] .SS EDS0083/threshold/current_hi.[0-3|ALL EDS0083/threshold/current_low.[0-3|ALL] .SS EDS0085/threshold/volts_hi.[0-3|ALL] EDS0085/threshold/volts_low.[0-3|ALL|] .I read-write, floating-point .br Voltage or current threshold limits .SH SET ALARM Set conditional alarm to trigger if corresponding flag is set. Also must set high and low .I threshold. .SS EDS00XX/set_alarm/temp_hi EDS00XX/set_alarm/temp_low .SS EDS006X/set_alarm/humidity_hi EDS006X/set_alarm/humidity_low .SS EDS006X/set_alarm/dew_point_hi EDS006X/set_alarm/dew_point_low .SS EDS006X/set_alarm/heat_index_hi EDS006X/set_alarm/heat_index_low .SS EDS006X/set_alarm/humidex_hi EDS006X/set_alarm/humidex_low .SS EDS006X/set_alarm/pressure_hi EDS006X/set_alarm/pressure_low .SS EDS006X/set_alarm/inHg_hi EDS006X/set_alarm/inHg_low .SS EDS006X/set_alarm/light_hi EDS006X/set_alarm/light_low .SS EDS0070/set_alarm/vib_hi EDS0070/set_alarm/vib_low .SS EDS007X/set_alarm/resistance_hi EDS007X/set_alarm/resistance_low .SS EDS0080/set_alarm/current_hi.[0-7|ALL|BYTE] .SS EDS0080/set_alarm/current_low.[0-7|ALL|BYTE] .SS EDS0082/set_alarm/volts_hi.[0-7|ALL|BYTE] .SS EDS0082/set_alarm/volts_low.[0-7|ALL|BYTE] .SS EDS0083/set_alarm/current_hi.[0-3|ALL|BYTE] .SS EDS0083/set_alarm/current_low.[0-3|ALL|BYTE] .SS EDS0085/set_alarm/volts_hi.[0-3|ALL|BYTE] .SS EDS0085/set_alarm/volts_low.[0-3|ALL|BYTE] .I read-write, yes-no .br Flag to set corresponding out-of-range alarm. "1" turns on flag, and "0" turns off. .SH ALARM Show or clear the out-of-range flags. When set, the device will respond to a conditional search. Clearing the flags is performed with the .I EDS00XX/alarm/clear command, not just having the measured value return to the center range. .SS EDS00XX/alarm/clear .I write-only, yes-no .br Write "1" to clear .B ALL the alarm flags. .SS EDS00XX/alarm/temp_hi EDS00XX/alarm/temp_low .SS EDS006X/alarm/humidity_hi EDS006X/alarm/humidity_low .SS EDS006X/alarm/dew_point_hi EDS006X/alarm/dew_point_low .SS EDS006X/alarm/heat_index_hi EDS006X/alarm/heat_index_low .SS EDS006X/alarm/humidex_hi EDS006X/alarm/humidex_low .SS EDS006X/alarm/pressure_hi EDS006X/alarm/pressure_low .SS EDS006X/alarm/inHg_hi EDS006X/alarm/inHg_low .SS EDS006X/alarm/light_hi EDS006X/alarm/light_low .SS EDS0070/alarm/vib_hi EDS007X/alarm/vib_low .SS EDS007X/alarm/resistance_hi EDS007X/alarm/resistance_low .SS EDS0080/alarm/current_hi.[0-7|ALL|BYTE] .SS EDS0080/alarm/current_low.[0-7|ALL|BYTE] .SS EDS0082/alarm/volts_hi.[0-7|ALL|BYTE] .SS EDS0082/alarm/volts_low.[0-7|ALL|BYTE] .SS EDS0083/alarm/current_hi.[0-3|ALL|BYTE] .SS EDS0083/alarm/current_low.[0-3|ALL|BYTE] .SS EDS0085/alarm/volts_hi.[0-3|ALL|BYTE] .SS EDS0085/alarm/volts_low.[0-3|ALL|BYTE] .SS EDS0090/alarm/hi[0-7|ALL] EDS0090/alarm/low[0-7|ALL] .I read-only, yes-no .br Show corresponding out-of-range alarm. "1" means in alarm state. Can only be turned off with .I clear .SH RELAY Optionally found on the EDS006X and EDS007X. Can be controlled by software or the alarm condition. .SS EDS00XX/relay/control .I read-write, unsigned .br Set the relay control scheme: .TP 0 alarm control with hysteresis .TP 1 alarm control but need .I EDS00XX/alarm/clear to unset .TP 2 Control with .I EDS00XX/relay/state .TP 3 Always off .SS EDS00XX/relay/state .I read-write, yes-no .br Turn the relay on or off if the .I EDS00XX/relay/control is set to "2" .SH LED light Found on the EDS006X and EDS007X. Can be controlled by software or the alarm condition. .SS EDS00XX/LED/control .I read-write, unsigned .br Set the LED control scheme: .TP 0 alarm control with hysteresis .TP 1 alarm control but need .I EDS00XX/alarm/clear to unset .TP 2 Control with .I EDS00XX/LED/state .TP 3 Always off .SS EDS00XX/LED/state .I read-write, yes-no .br Turn the LED on or off if the .I EDS00XX/LED/control is set to "2" .SH COUNTER .SS EDS00XX/counter/seconds .I read-only, unsigned integer .br Approximate seconds since power up. .SS EDS0090/counter/pulses.0-7 | ALL .I read-only, unsigned integer .br Pulses on each channel since power up or reset. Channel should be set to input ( .I EDS0090/output/set.x =0 ) .SS EDS0090/counter/reset.0-7 | ALL | BYTE .I read-write, yes-no .br Clear the pulse count on the corresponding channel. .SS EDS007X/counter/samples .I read-only, unsigned integer .br Approximate samples since power up. .SH MEMORY .SS memory .I read-write, binary .br 96 bytes of memory. Not all is writable. Access to .I EDS00XX functions is better accomplished through the data fields, which expose all the chip features. .SS pages/page.0 ... pages/page.2 pages/page.ALL .I read-write, binary .br Memory is split into 3 pages of 32 bytes each. Only page 2 is writable. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SS EDS008X/memory .I read-write, binary .br 160 bytes of memory. Not all is writable. Access to .I EDS008X functions is better accomplished through the data fields, which expose all the chip features. The .I EDS008X has more memory than the other chips, so a separate entry in the sudbirectory makes it available. .SS EDS008X/pages/page.0-4 EDS008X/pages/page.ALL .I read-write, binary .br Memory is split into 5 pages of 32 bytes each. Only page 5 is writable. The .I EDS008X has more memory than the other chips, so a separate entry in the sudbirectory makes the extra pages available. .I ALL is an aggregate of the pages. Each page is accessed sequentially. .SH SUB-TYPE .SS tag .I read-only, ascii .br Text description of the device. Up to 30 characters. .SS device_type .I read-only, ascii .br Device name. E.g: "EDS0071" .SS device_id .I read-only, unsigned .br Number corresponding to the hexidecimal type. E.g: .br EDS0071 -> 0x0071 -> 113 in decimal .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS EDS00XX Overview The EDS00XX sensors are a family of devices from .I Embedded Data Systems. Although provisional support for several types is included, only early .I EDS0071 has been tested with .I OWFS. .PP The sensors all share the same .I 7E family code. They have the same first memory page layout with a text .I tag property that describes them, and a .I sub-type field giving the particular sensor. The data properties shown in a directory listing will be specific to the sensor .I sub-type. .SS EDS0071 The .B EDS0071 (3) is a micro-processor based 1-wire slave made by EDS (Embedded Data Systams). Is uses a high accuracy and extended range RTD sensor to accurately measure temperatures. .SS Memory The .I EDS00XX sensors are read and controlled by accessing parts of their on-chip memory. Although the raw memory contents are exposed in the .I memory and .I pages fields, all the available functionality is best accessed by the other fields. In fact, directly changing memory will confuse .I OWFS. .SS Relay and LED All the .I EDS00XX sensors have an LED and optional relay. Both can be controlled either directly, or when the sensors reaches an alarm state. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .TP .B EDS0064 EDS0065 EDS0066 EDS0067 EDS0068 https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B_K3iXLLAI7vN2E4NGUwMGItMzc5MS00NDNmLTljZGYtN2NmM2Q3YWE5NmVh&hl=en .TP .B EDS0070 http://www.embeddeddatasystems.com/assets/images/supportFiles/manuals/EN-UserMan%20%20OW-Vibration%20V01.pdf .TP .B EDS0071 EDS0072 https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B_K3iXLLAI7vMjVhNWQzYzItZTRhMi00NGY2LWI4NTQtYjZlYTgzYzY0NmNm&hl=en .TP .B EDS0080 EDS0083 https://eds.zendesk.com/attachments/token/ulnpj6mvpp6yzwo/?name=EN-USERMAN+OW-IO-AIX-420+v1p0.pdf .TP .B EDS0082 EDS0085 https://eds.zendesk.com/attachments/token/vyai6ylpw6edala/?name=EN-USERMAN+OW-IO-AIX-10V+v1p0.pdf .TP .B EDS0090 8 Discrete I/O .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/EEEF.man0000644000175000001440000001402212665167763013140 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH HobbyBoards_EE/EF 3 2009 "OWFS Manpage" "One-Wire File System" .SH NAME .TP .B UVI, Moisture, Barometer, HUB \- HobbyBoards EE/EF Microprocessor-based slaves: Ultra Violet (UV) Index sensor, Soil and Leaf moisture measurements, Barometer, 4-channel hub with switchable branches .SH SYNOPSIS .SS General EE device .B EE [.]XXXXXXXXXXXX[XX][/[ .B temperature | .B version | .B type_number | .B temperature_offset | .so man3/standard_mini.3so ]] .SS UVI sensor .B EE [.]XXXXXXXXXXXX[XX][/[ .B UVI/UVI | .B UVI/UVI_offset | .B UVI/in_case | .B UVI/valid | .B temperature | .B version | .B type_number | .B temperature_offset ]] .SS General EF device .B EF [.]XXXXXXXXXXXX[XX][/[ .B version | .B type_number | .so man3/standard_mini.3so ]] .SS Moisture Meter .B moisture/sensor.[0-3|ALL] .br .B moisture/is_moisture.[0-3|ALL|BYTE] | .B moisture/is_leaf.[0-3|ALL|BYTE] .br .B moisture/calibrate/min | .B moisture/calibrate/max | .B moisture/calibrate/raw.[0-4|ALL] .SS Hub . B hub/branch.[0-3|ALL|BYTE] | . B hub/short.[0-3|ALL|BYTE] .SH FAMILY CODE .TP .I EE Device with temperature .TP .I EE UVI .TP .I EF Device without temperature .TP .I EF Moisture Meter .TP .I EF Hub .SH TEMPERATURE PROPERTIES .SS temperature .I read-only, floating point .br Temperature read every 30 seconds. Resolution .5C (uses an on-board DS18B20). Temperature is only present in the EE-series devices. .SS temperature_offset .I read-write, floating point .br Offset stored on device to apply to temperature readings. .SH UVI PROPERTIES .SS UVI/UVI .I read-only floating point .br UV Index (ultraviolet index) in the range 0.0 to 16.0 resolution .1 .PP Only the UVI version of the EE device has a UVI sensor. Readings made every .5 seconds. .SS UVI/UVI_offset .I read-write, floating point .br Signed offset to apply to the UVI measurement. Stored on-device non-volatile. .SS UVI/in_case .I read-write, yes-no .br Flag to apply compensation for the protective case. Stored on-device non-volatile. .SS UVI/valid .I read-only, yes-no Flag the the EE device type matches the known UVI type. .SH Moisture Meter .SS moisture/sensor.0 .. moisture/sensor.3 moisture/sensor.ALL .I read-only integer .br Up to 4 sensors reading moisture can be attached. .I OWFS addresses the sensors as 0 through 3 while the datasheet uses 1-4. Two types of external sensors are supported (and the data range): .TP Watermark Soil Moisture Sensor 0-199 .TP Leaf Wetness Sensor 0-99 .SS moisture/is_moisture.0 .. moisture/is_moisture.3 moisture/is_moisture.ALL .SS moisture/is_leaf.0 .. moisture/is_leaf.3 moisture/is_leaf.ALL .I read-write yes_no .br Set or get the type of sensor attached to each channel. Note that .I OWFS addresses the sensors as 0 through 3 while the datasheet uses 1-4. Two types of external sensors are supported: .TP Watermark Soil Moisture Sensor .TP Leaf Wetness Sensor .P Note that .I is_leaf and .I is_moisture are complementary and clearing one sets the other. .SS moisture/calibrate/min .SS moisture/calibrate/max .I read-write unsigned integer .br Set or get the upper and lower range for the raw data for leaf wetness scaling. See the datasheet for details. .SS moisture/calibrate/raw.0 .. moisture/calibrate/raw.3 moisture/calibrate/raw.ALL .I read-only unsigned integer .br Read the raw leaf wetness values for setting scaling. See the datasheet for details. Note that .I OWFS addresses the sensors as 0 through 3 while the datasheet uses 1-4. .SH Hub 4-channel hub. Individual branches can be switched on and off. .SS hub/branch.0 .. hub/branch.3 hub/branch.ALL hub/branch.BYTE .I read-write, yes-no .br The HobbyBoards hub has four 1-wire bus lines. Each branch is electricaly isolated from reflections and shorts, and can be optionally excluded from the 1-wire network. .PP You can turn each .I branch on or off by writing 0 (off) or 1 (on) to the corresponding property. Note that .I OWFS indexes the branches 0 to 3 while the datasheet uses 1 to 4. .PP The easiest way to turn all the branches on is to write 15 (0x0F) to .I hub/branch.BYTE .SS hub/short.0 .. hub/short.3 hub/short.ALL hub/short.BYTE .I read-only, yes-no .br Is the corresponding branch in "short" condition? (Electrically shorted out). .SH IDENTIFICATION PROPERTIES .SS version .I read-only, ascii .br Firmware version for the EE/EF device. Reported in nn.nn format where nn is major/minor decimal value. .P Note: This format was changed as of version owfs-2.9p6 at the request of the HobbyBoards. Formerly reported in HH.HH format where HH is a hex digit (0-9A-F). .SS type_number .I read-only, integer .br Index of the type of sensor built into this device. Current known assignments: .TP 1 UVI (Ultraviolet index) .TP 2 Moisture meter .TP 3 Moisture meter with datalogger .TP 4 Sniffer .TP 5 Hub .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None .SH DESCRIPTION .so man3/description.3so .SS EE / EF The .B EEEF (3) are a reference platform of microprocessor based 1-wire slaves. In general they require external power, and have an on-board index for the specific capabilities. They are designed by Eric Vickery at HobbyBoards.com .PP The .I EE class device uses family code EE and has an included temperature sensor. The .I EF devices have no temperature sensor, .SS UVI The .I UVI sensor is an implementation of the .I EE class device with Ultra Violet Index sensing. All it's specific properties are in the .I UVI/ directory. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .TP .B UVI http://www.hobby-boards.com/catalog/links/uvi2-r1/UVI%20Meter%20User%20Manual.pdf .TP .B Moisture and Leaf Sensor http://www.hobby-boards.com/download/manuals/Moisture%20Meter.pdf .TP .B 4 Channel Hub http://www.hobby-boards.com/download/manuals/4%20Channel%20Hub.pdf .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/LCD.man0000644000175000001440000000705412654730021013022 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH LCD 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B LCD \- LCD controller .SH SYNOPSIS 1-wire LCD controller by Louis Swart .PP .B FF [.]XXXXXXXXXXXX[XX][/[ .B backlight | .B counters.[0-3|ALL] | .B cumulative.[0-3|ALL] | .B branch.[0-1|ALL] | .B data | .B gpio.[0-3|ALL] | .B LCDon | .B line16.[0-3|ALL] | .B line20.[0-3|ALL] | .B line40.[0|1|ALL] | .B memory | .B register | .B screen16 | .B screen20 | .B screen40 | .B version | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I FF .SH SPECIAL PROPERTIES .SS backlight .I write-only,yes-no .br Write a non-zero value to turn on the LCD backlight. Write zero to turn off. .SS counters[0-3,ALL] .I read-only,unsigned integer .br Read the number of times the gpio has been externally changed. If wired to a push switch, will count twice per button press. The LCD firmware resets all the counter when any one is read. Use the .I ALL extension to read them all, simultaneously, or use the .I cumulative property instead. .br .I ALL is an aggregate of the properties, comma separated. Read atomically. .SS cumulative[0-3,ALL] .I read-write,unsigned integer .br Cumulative sum of the .I counters property. To reset, write a zero. The cumulative counter can have any value written, which allows preservation of counts accross program restarts if the value at program termination is stored. .br Reading .I cumulative will reset the .I counters property. All the cumulative counters will be updated so that no counts will be lost. Reads of .I counters can be interspersed without losing .I cumulative accuracy. .br Note: .I cumulative requires the .I caching system be compiled into libow. .br .I ALL is an aggregate of the properties, comma separated. .SS data .I read-write,unsigned int .br Contents of the LCD data byte (see datasheet). Not usually needed. .SS LCDon .I write-only,yes-no .br Write a non-zero value to turn on the LCD screen (also clears). Write a zero to turn off. .SS line16[0-3,ALL] line20[0-3,ALL] line40[0-1,ALL] .I write-only,ascii .br Write text to the LCD screen. Assumes 16/20/40 char width. (Cannot be determined from controller). .br .I ALL is an aggregate of the properties, comma separated. Each is set in turn. .SS memory .I read-write,binary .br 112 bytes of on-board memory. .SS register .I read-write,unsigned int .br Contents of the LCD register (see datasheet). Not usually needed. .SS screen16 screen20 screen40 .I write-only,ascii .br Write text to the LCD screen. Assumes 16/20/40 char width. (Cannot be determined from controller). .br .SS version .I read-only,ascii .br Self-reported LCD controller version. 16 bytes. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None implemented. .SH DESCRIPTION .so man3/description.3so .SS LCD The .B LCD (3) controller is a microprocessor driven device that simulates the operation of 1-wire devices. It's creator has arbitrarily chosen the .I family code FF. The controller requires external power. Full details are available from the designer. .br The main draw of the .B LCD controller is as any easy way to provide output to users. .SH ADDRESSING .so man3/addressing.3so .SH DATASHEET .br Available from http://www.louisswart.co.za/1-Wire_index.html .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/mAM001.man0000644000175000001440000000312712654730021013310 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH mAM001 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B mAM001 \- Analog Input Module .SH SYNOPSIS .SS Voltage or current meter. .PP .B B2 [.]XXXXXXXXXXXX[XX][/[ .B current | .B volts | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I B2 .SH SPECIAL PROPERTIES Note that the .I volts and .I current are mutually exclusive and set by switches on the sensor case. .PP Although both .I volts and .I current will give a value, only one of the two is correct. (Based on the electrical connections and switch settings). .SS current .I read-write, floating point .br Reads the current. .TP Range 0-20mA .TP Resolution 12 bit (5 uA) .TP Units A (amperes) .TP Frequency DC .SS volts .I read-write, floating point .br Reads the voltage. .TP Range 0-10V .TP Resolution 12 bit (2.5 mV) .TP Units V (volts) .TP Frequency DC .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS mAM001 The .B mAM001 (3) is a voltage or current meter from CMC Industrial Electronics. It is packaged for industrial use. .SH ADDRESSING .so man3/addressing.3so .SH WEBSITE .br http://www.cmciel.com/products-solutions/individual-products/analog-input-mam001/ .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/mCM001.man0000644000175000001440000000227012654730021013310 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH mCM001 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B mCM001 \- AC Current Monitor .SH SYNOPSIS .SS AC Amp meter. .PP .B A2 [.]XXXXXXXXXXXX[XX][/[ .B current | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I A2 .SH SPECIAL PROPERTIES .SS current .I read-write, floating point .br Reads the current. .TP Range 0-5A .TP Resolution 0.01A .TP Units A (amperes) .TP Frequency AC (alternating current 50-60Hz) .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS mCM001 The .B mCM001 (3) is a Current meter from CMC Industrial Electronics. It is packaged for industrial use. .SH ADDRESSING .so man3/addressing.3so .SH WEBSITE .br http://www.cmciel.com/products-solutions/individual-products/ac-current-sensor-mcm001/ .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/mDI001.man0000644000175000001440000000321512654730021013305 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH mDI001 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B mDI001 \- Digital Input Module .SH SYNOPSIS .SS Monitor 4 digital lines .PP .B A5 [.]XXXXXXXXXXXX[XX][/[ .B switch_closed.[0-3|ALL|BYTE] | .B loop_open.[0-3|ALL|BYTE] | .B loop_shorted.[0-3|ALL|BYTE] | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I A5 .SH SPECIAL PROPERTIES .SS switch_closed.[0-3|ALL|BYTE] .I read-only, yes-no .br Is the relay closed? (1=yes, 0=no). .P Note that .I OWFS uses 0 through 3 as the index and the datasheet uses 1 through 4. .SS loop_shorted.[0-3|ALL|BYTE] .I read-only, yes-no .br Is the loop shorted? (1=yes, 0=no). Failsafe mode. .P Note that .I OWFS uses 0 through 3 as the index and the datasheet uses 1 through 4. .SS loop_open.[0-3|ALL|BYTE] .I read-only, yes-no .br Is the loop open? (1=yes, 0=no). Failsafe mode. .P Note that .I OWFS uses 0 through 3 as the index and the datasheet uses 1 through 4. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS mDI001 The .B mDI001 (3) is used to monitor digital lines for simple switching. .SH ADDRESSING .so man3/addressing.3so .SH WEBSITE .br http://www.cmciel.com/products-solutions/individual-products/4-channel-fail-safe-digital-module-mdi001/ .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/mRS001.man0000644000175000001440000000234012654730021013333 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH mRS001 3 2003 "OWFS Manpage" "One-Wire File System" .SH NAME .B mRS001 \- Rotation Sensor .SH SYNOPSIS .SS Rotation (in RPM) .PP .B A0 [.]XXXXXXXXXXXX[XX][/[ .B RPM | .so man3/standard_mini.3so ]] .SH FAMILY CODE .PP .I A0 .SH SPECIAL PROPERTIES .SS RPM .I read-write, integer .br Rotation rate in RPM (rotations per minute). Range is 1-1000 RPM and negative values show reverse rotation. .SH STANDARD PROPERTIES .so man3/standard.3so .SH ALARMS None. .SH DESCRIPTION .so man3/description.3so .SS mRS001 The .B mRS001 (3) is a rotation sensor. It is packaged for industrial use, requiring drilling the drive shaft or using special magnetic couplings. .SH ADDRESSING .so man3/addressing.3so .SH WEBSITE .br http://www.cmciel.com/products-solutions/individual-products/rotation-sensor-withpickup-intrinsically-safe-mrs001/ .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man3/owperl.man0000644000175000001440000000366012654730021013727 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Device manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWPERL 3 2004 "OWFS Manpage" "One-Wire File System" .SH NAME .B owperl \- perl interface for the 1-wire filesystem .SH SYNOPSIS .B OW.pm .br .B use OW ; .br .B OW::init( .I interface .B ); .br .B OW::init( .I initialization string .B ); .PP The full set of initialization options is extensive. They correspond roughly to the command line options of ,B owfs (1) .B owhttpd (1) and .B owftpd (1) .br .B OW::get( .I path .B ); .br .B OW::put( .I path .B , .I value .B ); .br .B OW::finish(); .SH "DESCRIPTION" .so man3/description.3so .SS owperl .B owperl (3) is a perl module that provides an interface to OWFS. The path to each 1-wire device is the same as .B owfs (1) \&. Only the top layer has been modified to return native perl strings. .PP .B owperl (3) is created by .B swig (1) (http://www.swig.org) which can be easily modified to support other programming languages. .SH FUNCTIONS .SS OW::init( interface ) .I interface .br Location of the 1-wire bus: .TP "u" Direct connection to the 1-wire interface on the USB port -- .I DS9490 .TP /dev/ttySx Direct connection to a 1-wire interface on the serial port -- .I DS9097U or .I DS9097 .TP port | :port | IPaddress:port Location of an .I owserver daemon that connects to the 1-wire bus. Multiple .I owperl as well as .I owfs and .I owhttpd programs can access the .I owserver process simultaneously. In fact, this will probably be the preferred mode of access to OWFS for .I owperl except in trivial applications. .SH EXAMPLE perl \-MOW \-e "OW::init('/dev/ttyS1'); printf OW::get('\');" .SH SEE ALSO .so man3/seealso.3so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/man5/0000755000175000001440000000000013022537100011770 500000000000000owfs-3.1p5/src/man/man5/Makefile.am0000644000175000001440000000101312654730021013746 00000000000000## man sources MANFILES = \ owfs.man ## .so includes SOFILES = \ description.5so seealso.5so ## man files that need no preprocessing dist_man5_MANS = \ owfs.conf.5 ## file to include in distribution EXTRA_DIST = $(SOFILES) $(MANFILES) if SOELIM man5_MANS = $(addsuffix .5,$(basename $(MANFILES))) CLEANFILES = $(man5_MANS) # preproc man pages via soelim $(man5_MANS): $(MANFILES) $(SOFILES) %.5 :: %.man $(SOELIM) -r -I $(srcdir)/.. $< > $@ else !SOELIM man5_MANS = $(MANFILES) $(SOFILES) endif !SOELIM owfs-3.1p5/src/man/man5/owfs.conf.50000644000175000001440000000002012654730021013677 00000000000000.so man5/owfs.5 owfs-3.1p5/src/man/man5/Makefile.in0000644000175000001440000004747113022537053014001 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/man/man5 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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; }; \ } man5dir = $(mandir)/man5 am__installdirs = "$(DESTDIR)$(man5dir)" NROFF = nroff MANS = $(dist_man5_MANS) $(man5_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(dist_man5_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MANFILES = \ owfs.man SOFILES = \ description.5so seealso.5so dist_man5_MANS = \ owfs.conf.5 EXTRA_DIST = $(SOFILES) $(MANFILES) @SOELIM_FALSE@man5_MANS = $(MANFILES) $(SOFILES) @SOELIM_TRUE@man5_MANS = $(addsuffix .5,$(basename $(MANFILES))) @SOELIM_TRUE@CLEANFILES = $(man5_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) --foreign src/man/man5/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/man/man5/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man5: $(dist_man5_MANS) $(man5_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man5_MANS) $(man5_MANS)'; \ list2=''; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || 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 '/\.5[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,^[^5][0-9a-z]*$$,5,;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)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$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)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(dist_man5_MANS) $(man5_MANS)'; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man5dir)"; 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 clean-libtool 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-man5 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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man5 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-man5 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man5 .PRECIOUS: Makefile # preproc man pages via soelim @SOELIM_TRUE@$(man5_MANS): $(MANFILES) $(SOFILES) @SOELIM_TRUE@%.5 :: %.man @SOELIM_TRUE@ $(SOELIM) -r -I $(srcdir)/.. $< > $@ # 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: owfs-3.1p5/src/man/man5/description.5so0000644000175000001440000000373712665167763014727 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SS 1-Wire .I 1-wire is a wiring protocol and series of devices designed and manufactured by Dallas Semiconductor, Inc. The bus is a low-power low-speed low-connector scheme where the data line can also provide power. .PP Each device is uniquely and unalterably numbered during manufacture. There are a wide variety of devices, including memory, sensors (humidity, temperature, voltage, contact, current), switches, timers and data loggers. More complex devices (like thermocouple sensors) can be built with these basic devices. There are also 1-wire devices that have encryption included. .PP The 1-wire scheme uses a single .I bus master and multiple .I slaves on the same wire. The bus master initiates all communication. The slaves can be individually discovered and addressed using their unique ID. .PP Bus masters come in a variety of configurations including serial, parallel, i2c, network or USB adapters. .SS OWFS design .I OWFS is a suite of programs that designed to make the 1-wire bus and its devices easily accessible. The underlying principle is to create a virtual filesystem, with the unique ID being the directory, and the individual properties of the device are represented as simple files that can be read and written. .PP Details of the individual slave or master design are hidden behind a consistent interface. The goal is to provide an easy set of tools for a software designer to create monitoring or control applications. There are some performance enhancements in the implementation, including data caching, parallel access to bus masters, and aggregation of device communication. Still the fundemental goal has been ease of use, flexibility and correctness rather than speed. owfs-3.1p5/src/man/man5/seealso.5so0000644000175000001440000000222412654730021014002 00000000000000.SS Programs .B owfs (1) owhttpd (1) owftpd (1) owserver (1) .B owdir (1) owread (1) owwrite (1) owpresent (1) .B owtap (1) .SS Configuration and testing .B owfs (5) owtap (1) owmon (1) .SS Language bindings .B owtcl (3) owperl (3) owcapi (3) .SS Clocks .B DS1427 (3) DS1904(3) DS1994 (3) DS2404 (3) DS2404S (3) DS2415 (3) DS2417 (3) .SS ID .B DS2401 (3) DS2411 (3) DS1990A (3) .SS Memory .B DS1982 (3) DS1985 (3) DS1986 (3) DS1991 (3) DS1992 (3) DS1993 (3) DS1995 (3) DS1996 (3) DS2430A (3) DS2431 (3) DS2433 (3) DS2502 (3) DS2506 (3) DS28E04 (3) DS28EC20 (3) .SS Switches .B DS2405 (3) DS2406 (3) DS2408 (3) DS2409 (3) DS2413 (3) DS28EA00 (3) .SS Temperature .B DS1822 (3) DS1825 (3) DS1820 (3) DS18B20 (3) DS18S20 (3) DS1920 (3) DS1921 (3) DS1821 (3) DS28EA00 (3) DS28E04 (3) .SS Humidity .B DS1922 (3) .SS Voltage .B DS2450 (3) .SS Resistance .B DS2890 (3) .SS Multifunction (current, voltage, temperature) .B DS2436 (3) DS2437 (3) DS2438 (3) DS2751 (3) DS2755 (3) DS2756 (3) DS2760 (3) DS2770 (3) DS2780 (3) DS2781 (3) DS2788 (3) DS2784 (3) .SS Counter .B DS2423 (3) .SS LCD Screen .B LCD (3) DS2408 (3) .SS Crypto .B DS1977 (3) .SS Pressure .B DS2406 (3) -- TAI8570 owfs-3.1p5/src/man/man5/owfs.man0000644000175000001440000001372112654730021013376 00000000000000'\" '\" Copyright (c) 2003-2008 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .TH OWFS 5 2006 "OWFS Configuration File Manpage" "One-Wire File System" .SH NAME .B owfs.conf \- owfs programs configuration file .SH SYNOPSIS An OWFS configuration file is specified on the command line: .TP .B owfs -c config_file [other options] The file name is arbitrary, there is no default configuration file used. .SH USAGE A configuration file can be invoked for any of the OWFS programs ( .B owfs (1) owhttpd (1) owserver (1) owftpd (1) ) or any of the language bindings ( .B owperl (1) owcapi (1) owtcl (1) owphp owpython ) to set command line parameters. .SH SYNTAX .P Similar to Unix shell script or perl syntax .TP Comments # Any .I # marks the start of a comment .br # blank lines are ignored .TP Options .B option # some options (like 'foreground') take no values .br .B option = value # other options need a value .br .B option value # '=' can be omitted if whitespace separates .br .B Option # Case is ignored (for options, not values) .br .B opt # non-ambiguous abbreviation allowed .br .B -opt --opt # hyphens ignored .TP .I owserver .B server: opt = value # only .I owserver effected by this line .br .B ! server: opt = value # .I owserver NOT effected by this line .TP .I owhttpd .B http: opt = value # only .I owhttpd effected by this line .br .B ! http: opt = value # .I owhttpd NOT effected by this line .TP .I owftpd .B ftp: opt = value # only .I owftpd effected by this line .br .B ! ftp: opt = value # .I owftpd NOT effected by this line .TP .I owfs .B owfs: opt = value # only .I owfs effected by this line .br .B ! owfs: opt = value # .I owfs NOT effected by this line .TP Limits # maximum line length of 250 characters .br # no limit on number of lines .SH "DESCRIPTION" .so man5/description.5so .SS Configuration .B owfs.conf (5) allows a uniform set of command line parameters to be set. .P Not all OWFS programs use the same command line options, but the non-relevant ones will be ignored. .P Command line and configuration options can mixed. They will be invoked in the order presented. Left to right for the command line. Top to bottom for the configuration file. .P Configuration files can call other configuration files. There is an arbitrary depth of 5 levels to prevent infinite loops. More than one configuration file can be specified. .SH SAMPLE .TP Here is a sample configuration file with all the possible parameters included. # .B Sources .br .I device = /dev/ttyS0 # serial port: DS9097U DS9097 ECLO or LINK .br .I device = /dev/i2c-0 # i2c port: DS2482-100 or DS2482-800 .br .I usb # USB device: DS9490 PuceBaboon .br .I usb = 2 # Second DS9490 .br .I usb = all # All DS9490s .br .I altUSB # Willy Robison's tweaks .br .I LINK = /dev/ttyS0 # serial LINK in ascii mode .br .I LINK = [address:]port # LINK-HUB-E (tcp access) .br .I HA7 # HA7Net autodiscovery mode .br .I HA7 = address[:port] # HA7Net at tcp address (port 80) .br .I etherweather = address[:port] # Etherweather device .br .I server = [address:]port # .B owserver tcp address .br .I FAKE = 10,1B # Random simulated device with family codes (hex) .br .I TESTER = 28,3E # Predictable simulated device with family codes .br # .br # .B Sinks .br # # .B owfs specific .br .I mountpoint = filelocation # .I FUSE mount point .br .I allow_other # Short hand for .I FUSE mount option "\"\-o allow_other\"" .br # # .B owhttpd owserver owftpd specific .br .I port = [address:]port # tcp out port .br # .br # .B Temperature scales .br .I Celsius # default .br .I Fahrenheit .br .I Kelvin .br .I Rankine .br # .br # .B Timeouts (all in seconds) .br # cache for values that change on their own .br .I timeout_volatile = value # seconds "volatile" values remain in cache .br # cache for values that change on command .br .I timeout_stable = value # seconds "stable" values remain in cache .br # cache for directory lists (non-alarm) .br .I timeout_directory = value # seconds "directory" values remain in cache .br # cache for 1-wire device location .br .I timeout_presence = value # seconds "device presence" (which bus) .br .I timeout_serial = value # seconds to wait for serial response .br .I timeout_usb = value # seconds to wait for USB response .br .I timeout_network = value # seconds to wait for tcp/ip response .br .I timeout_ftp = value # seconds inactivity before closing ftp session .br # .br # .B Process control .br .I configuration = filename # file (like this) of program options .br .I pid_file = filename # file to store PID number .br .I foreground .br .I background # default .br .I readonly # prevent changing 1-wire device contents .br .I write # default .br .I error_print = 0-3 # 0-mixed 1-syslog 2-stderr 3-suppressed .br .I error_level = 0-9 # increasing noise .br # .br # .B zeroconf / Bonjour .br .I zero # turn on zeroconf announcement (default) .br .I nozero # turn off zeroconf announcement .br . I annouce = name # name of announced service (optional) .br .I autoserver # Add owservers descovered by zeroconf/Bonjour .br .I noautoserver # Don't use zeroconf/Bonjour owservers (default) .br # .br # .B tcp persistence .br .I timeout_persistent_low = 600 # minimum time a persistent socket will stay open .br .I timeout_persistent_high = 3600 # max time an idle client socket will stay around .br .I .br # .br # .B Display .br .I format = f[.]i[[.]c] # 1-wire address .I f amily .I i d code .I c rc .br # .br # .B Cache .br .I cache_size = 1000000 # maximum cache size (in bytes) or 0 for no limit (default 0) # .br # .B Information .br # (silly in a configuration file) .br .I version .br .I help .br .I morehelp .SH SEE ALSO .so man5/seealso.5so .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Paul Alfille (paul.alfille@gmail.com) owfs-3.1p5/src/man/mann/0000755000175000001440000000000013022537100012061 500000000000000owfs-3.1p5/src/man/mann/Makefile.am0000644000175000001440000000100512654730021014040 00000000000000## man sources MANFILES = \ owtcl.man ## .so includes SOFILES = \ description.nso seealso.nso ## man files that need no preprocessing dist_mann_MANS = \ ow.n ## file to include in distribution EXTRA_DIST = $(SOFILES) $(MANFILES) if SOELIM mann_MANS = $(addsuffix .n,$(basename $(MANFILES))) CLEANFILES = $(mann_MANS) # preproc man pages via soelim $(mann_MANS): $(MANFILES) $(SOFILES) %.n :: %.man $(SOELIM) -r -I $(srcdir)/.. $< > $@ else !SOELIM mann_MANS = $(MANFILES) $(SOFILES) endif !SOELIM owfs-3.1p5/src/man/mann/ow.n0000644000175000001440000000002112654730021012605 00000000000000.so mann/owtcl.n owfs-3.1p5/src/man/mann/Makefile.in0000644000175000001440000004746313022537054014074 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/man/mann ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/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; }; \ } manndir = $(mandir)/mann am__installdirs = "$(DESTDIR)$(manndir)" NROFF = nroff MANS = $(dist_mann_MANS) $(mann_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(dist_mann_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MANFILES = \ owtcl.man SOFILES = \ description.nso seealso.nso dist_mann_MANS = \ ow.n EXTRA_DIST = $(SOFILES) $(MANFILES) @SOELIM_FALSE@mann_MANS = $(MANFILES) $(SOFILES) @SOELIM_TRUE@mann_MANS = $(addsuffix .n,$(basename $(MANFILES))) @SOELIM_TRUE@CLEANFILES = $(mann_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) --foreign src/man/mann/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/man/mann/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-mann: $(dist_mann_MANS) $(mann_MANS) @$(NORMAL_INSTALL) @list1='$(dist_mann_MANS) $(mann_MANS)'; \ list2=''; \ test -n "$(manndir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(manndir)'"; \ $(MKDIR_P) "$(DESTDIR)$(manndir)" || 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 '/\.n[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,^[^n][0-9a-z]*$$,n,;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)$(manndir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(manndir)/$$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)$(manndir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(manndir)" || exit $$?; }; \ done; } uninstall-mann: @$(NORMAL_UNINSTALL) @list='$(dist_mann_MANS) $(mann_MANS)'; test -n "$(manndir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^n][0-9a-z]*$$,n,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(manndir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(manndir)"; 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 clean-libtool 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-mann 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 mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-mann .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-mann install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-mann .PRECIOUS: Makefile # preproc man pages via soelim @SOELIM_TRUE@$(mann_MANS): $(MANFILES) $(SOFILES) @SOELIM_TRUE@%.n :: %.man @SOELIM_TRUE@ $(SOELIM) -r -I $(srcdir)/.. $< > $@ # 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: owfs-3.1p5/src/man/mann/description.nso0000644000175000001440000000373712665167763015111 00000000000000'\" '\" Copyright (c) 2003-2004 Paul H Alfille, MD '\" (paul.alfille@gmail.com) '\" '\" Program manual page for the OWFS -- 1-wire filesystem package '\" Based on Dallas Semiconductor, Inc's datasheets, and trial and error. '\" '\" Free for all use. No waranty. None. Use at your own risk. '\" $Id$ '\" .SS 1-Wire .I 1-wire is a wiring protocol and series of devices designed and manufactured by Dallas Semiconductor, Inc. The bus is a low-power low-speed low-connector scheme where the data line can also provide power. .PP Each device is uniquely and unalterably numbered during manufacture. There are a wide variety of devices, including memory, sensors (humidity, temperature, voltage, contact, current), switches, timers and data loggers. More complex devices (like thermocouple sensors) can be built with these basic devices. There are also 1-wire devices that have encryption included. .PP The 1-wire scheme uses a single .I bus master and multiple .I slaves on the same wire. The bus master initiates all communication. The slaves can be individually discovered and addressed using their unique ID. .PP Bus masters come in a variety of configurations including serial, parallel, i2c, network or USB adapters. .SS OWFS design .I OWFS is a suite of programs that designed to make the 1-wire bus and its devices easily accessible. The underlying principle is to create a virtual filesystem, with the unique ID being the directory, and the individual properties of the device are represented as simple files that can be read and written. .PP Details of the individual slave or master design are hidden behind a consistent interface. The goal is to provide an easy set of tools for a software designer to create monitoring or control applications. There are some performance enhancements in the implementation, including data caching, parallel access to bus masters, and aggregation of device communication. Still the fundemental goal has been ease of use, flexibility and correctness rather than speed. owfs-3.1p5/src/man/mann/seealso.nso0000644000175000001440000000222412654730021014164 00000000000000.SS Programs .B owfs (1) owhttpd (1) owftpd (1) owserver (1) .B owdir (1) owread (1) owwrite (1) owpresent (1) .B owtap (1) .SS Configuration and testing .B owfs (5) owtap (1) owmon (1) .SS Language bindings .B owtcl (3) owperl (3) owcapi (3) .SS Clocks .B DS1427 (3) DS1904(3) DS1994 (3) DS2404 (3) DS2404S (3) DS2415 (3) DS2417 (3) .SS ID .B DS2401 (3) DS2411 (3) DS1990A (3) .SS Memory .B DS1982 (3) DS1985 (3) DS1986 (3) DS1991 (3) DS1992 (3) DS1993 (3) DS1995 (3) DS1996 (3) DS2430A (3) DS2431 (3) DS2433 (3) DS2502 (3) DS2506 (3) DS28E04 (3) DS28EC20 (3) .SS Switches .B DS2405 (3) DS2406 (3) DS2408 (3) DS2409 (3) DS2413 (3) DS28EA00 (3) .SS Temperature .B DS1822 (3) DS1825 (3) DS1820 (3) DS18B20 (3) DS18S20 (3) DS1920 (3) DS1921 (3) DS1821 (3) DS28EA00 (3) DS28E04 (3) .SS Humidity .B DS1922 (3) .SS Voltage .B DS2450 (3) .SS Resistance .B DS2890 (3) .SS Multifunction (current, voltage, temperature) .B DS2436 (3) DS2437 (3) DS2438 (3) DS2751 (3) DS2755 (3) DS2756 (3) DS2760 (3) DS2770 (3) DS2780 (3) DS2781 (3) DS2788 (3) DS2784 (3) .SS Counter .B DS2423 (3) .SS LCD Screen .B LCD (3) DS2408 (3) .SS Crypto .B DS1977 (3) .SS Pressure .B DS2406 (3) -- TAI8570 owfs-3.1p5/src/man/mann/owtcl.man0000644000175000001440000002110112654730021013630 00000000000000'\" '\" The definitions below are for supplemental macros used in Tcl/Tk '\" manual entries. '\" '\" .AP type name in/out ?indent? '\" Start paragraph describing an argument to a library procedure. '\" type is type of argument (int, etc.), in/out is either "in", "out", '\" or "in/out" to describe whether procedure reads or modifies arg, '\" and indent is equivalent to second arg of .IP (shouldn't ever be '\" needed; use .AS below instead) '\" '\" .AS ?type? ?name? '\" Give maximum sizes of arguments for setting tab stops. Type and '\" name are examples of largest possible arguments that will be passed '\" to .AP later. If args are omitted, default tab stops are used. '\" '\" .BS '\" Start box enclosure. From here until next .BE, everything will be '\" enclosed in one large box. '\" '\" .BE '\" End of box enclosure. '\" '\" .CS '\" Begin code excerpt. '\" '\" .CE '\" End code excerpt. '\" '\" .VS ?br? '\" Begin vertical sidebar, for use in marking newly-changed parts '\" of man pages. If an argument is present, then a line break is '\" forced before starting the sidebar. '\" '\" .VE '\" End of vertical sidebar. '\" '\" .DS '\" Begin an indented unfilled display. '\" '\" .DE '\" End of indented unfilled display. '\" '\" .SO '\" Start of list of standard options for a Tk widget. The '\" options follow on successive lines, in four columns separated '\" by tabs. '\" '\" .SE '\" End of list of standard options for a Tk widget. '\" '\" .OP cmdName dbName dbClass '\" Start of description of a specific option. cmdName gives the '\" option's name as specified in the class command, dbName gives '\" the option's name in the option database, and dbClass gives '\" the option's class in the option database. '\" '\" .UL arg1 arg2 '\" Print arg1 underlined, then print arg2 normally. '\" '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. .if t .wh -1.3i ^B .nr ^l \n(.l .ad b '\" # Start an argument description .de AP .ie !'\\$4'' .TP \\$4 .el \{\ . ie !'\\$2'' .TP \\n()Cu . el .TP 15 .\} .ie !'\\$3'' \{\ .ta \\n()Au \\n()Bu \&\\$1 \\fI\\$2\\fP (\\$3) .\".b .\} .el \{\ .br .ie !'\\$2'' \{\ \&\\$1 \\fI\\$2\\fP .\} .el \{\ \&\\fI\\$1\\fP .\} .\} .. '\" # define tabbing values for .AP .de AS .nr )A 10n .if !'\\$1'' .nr )A \\w'\\$1'u+3n .nr )B \\n()Au+15n .\" .if !'\\$2'' .nr )B \\w'\\$2'u+\\n()Au+3n .nr )C \\n()Bu+\\w'(in/out)'u+2n .. .AS Tcl_Interp Tcl_CreateInterp in/out '\" # BS - start boxed text '\" # ^y = starting y location '\" # ^b = 1 .de BS .br .mk ^y .nr ^b 1u .if n .nf .if n .ti 0 .if n \l'\\n(.lu\(ul' .if n .fi .. '\" # BE - end boxed text (draw box now) .de BE .nf .ti 0 .mk ^t .ie n \l'\\n(^lu\(ul' .el \{\ .\" Draw four-sided box normally, but don't draw top of .\" box if the box started on an earlier page. .ie !\\n(^b-1 \{\ \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .el \}\ \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' .\} .\} .fi .br .nr ^b 0 .. '\" # VS - start vertical sidebar '\" # ^Y = starting y location '\" # ^v = 1 (for troff; for nroff this doesn't matter) .de VS .if !'\\$1'' .br .mk ^Y .ie n 'mc \s12\(br\s0 .el .nr ^v 1u .. '\" # VE - end of vertical sidebar .de VE .ie n 'mc .el \{\ .ev 2 .nf .ti 0 .mk ^t \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' .sp -1 .fi .ev .\} .nr ^v 0 .. '\" # Special macro to handle page bottom: finish off current '\" # box/sidebar if in box/sidebar mode, then invoked standard '\" # page bottom macro. .de ^B .ev 2 'ti 0 'nf .mk ^t .if \\n(^b \{\ .\" Draw three-sided box if this is the box's first page, .\" draw two sides but no top otherwise. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c .\} .if \\n(^v \{\ .nr ^x \\n(^tu+1v-\\n(^Yu \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c .\} .bp 'fi .ev .if \\n(^b \{\ .mk ^y .nr ^b 2 .\} .if \\n(^v \{\ .mk ^Y .\} .. '\" # DS - begin display .de DS .RS .nf .sp .. '\" # DE - end display .de DE .fi .RE .sp .. '\" # SO - start of list of standard options .de SO .SH "STANDARD OPTIONS" .LP .nf .ta 4c 8c 12c .ft B .. '\" # SE - end of list of standard options .de SE .fi .ft R .LP See the \\fBoptions\\fR manual entry for details on the standard options. .. '\" # OP - start of full description for a single option .de OP .LP .nf .ta 4c Command-Line Name: \\fB\\$1\\fR Database Name: \\fB\\$2\\fR Database Class: \\fB\\$3\\fR .fi .IP .. '\" # CS - begin code excerpt .de CS .RS .nf .ta .25i .5i .75i 1i .. '\" # CE - end code excerpt .de CE .fi .RE .. .de UL \\$1\l'|0\(ul'\\$2 .. .TH "Owtcl" TCL "20/January/2005" "Tcl" .HS table tk .BS .SH NAME Owtcl \- OWFS library access commands for Tcl .SH SYNOPSIS \fBpackage \fBrequire \fBow .sp \fBow\fI \fIoption \fR?\fIarg ...\fR? .sp \fB::OW::init\fI \fIinterface \fR?\fIinterface ...\fR? \fR?\fIarg ...\fR? .br \fB::OW::finish .br \fB::OW::isconnect .br \fB::OW::get\fI \fR?\fIpath\fR? \fR?\fIarg ...\fR? .br \fB::OW::put\fI \fIpath \fR?\fIvalue\fR? .br \fB::OW::isdirectory\fI \fIpath .br \fB::OW::isdir\fI \fIpath .br \fB::OW::exists\fI \fIpath \fR .SH DESCRIPTION .so mann/description.nso .SS owtcl .B owtcl (3) is a Tcl extension that provides an interface to OWFS. The underlying interface to the 1-wire bus is identical to .B owfs (1) (filesystem view) and .B owhttpd (1) web server interface. Only the top layer has been modified to return native Tcl data. .SH COMMANDS Performs one of several operations, depending on \fIoption\fR. The legal \fIoption\fRs (which may be abbreviated) are: .TP \fBow open \fIarg ...\fR Connect to 1-wire adapter or \fIowserver\fR. \fIarg ...\fR defines a way of connection to the 1-wire bus. .br The full set of initialization args is extensive. They correspond roughly to the command line args of .B owfs (1) .B owhttpd (1) and .B owftpd (1) .TP \fBow close Close connection to 1-wire bus or owserver. .TP \fBow version\fR ?\fI-list\fR? Return version of the owtcl and owlib/ .TP \fBow opened Return 1 if connected to 1-wire adapter or \fIowserver\fR, otherwise 0. .TP \fBow error\fR \fIlevel\fR \fIvalue\fR Set debug options. See .B owfs (5) .TP \fBow error\fR \fIprint\fR \fIvalue\fR Set debug options. See .B owfs (5) .TP \fBow get\fR \fIpath\fR \fR?\fI-list\fR? Returns contents of OWFS directory as the list if path contains name OWFS directory. If path is name of OWFS file, returns of contents of this file. For files *.ALL returns a values list. .TP \fBow put \fIpath \fR\fIvalue\fR Puts \fIvalue\fR in OWFS file indicated in \fIpath\fR. For files *.ALL use a value list. .TP \fBow isdirectory \fIpath If \fIpath\fR is the directory return 1. Otherwise return 0. .TP \fBow isdir \fIpath Synonym of \fBow isdirectory .TP \fBow set \fIpath Creates a new \fBow\fR-like command with root in the \fIpath\fR. A new command allows options \fIget\fR, \fIput\fR, \fIisdirectory\fR, \fIisdir\fR and \fIset\fR. .SH LOW-LEVEL COMMANDS The following low-level commands are possible: .TP \fB::OW::init \fIinterface \fR?\fIinterface ...\fR? \fR?\fIarg ...\fR? Connect to 1-wire adapter or \fIowserver\fR. \fIinterface\fR and \fIarg ...\fR defines a way of connection to the 1-wire bus. .br The full set of initialization options is extensive. They correspond roughly to the command line options of ,B owfs (1) .B owhttpd (1) and .B owftpd (1) .TP \fB::OW::finish Close connection to 1-wire bus or owserver. .TP \fB::OW::isconnect Return 1 if connected to 1-wire adapter or \fIowserver\fR, otherwise 0. .TP \fB::OW::get \fR?\fIpath\fR? \fR?\fI-list\fR? Returns contents of OWFS directory as the list if path contains name OWFS directory. If path is name of OWFS file, returns of contents of this file. For files *.ALL returns a values list. If path is not defined, contents of root OWFS directory come back. .TP \fB::OW::put \fIpath \fR?\fIvalue\fR? Puts \fIvalue\fR in OWFS file indicated in \fIpath\fR. For files *.ALL use a value list. If /fIvalue\fR is not defined, puts a empty string. .TP \fB::OW::isdirectory \fIpath If \fIpath\fR is the directory - return 1. Otherwise return 0. .TP \fB::OW::isdir \fIpath Synonym of \fB::OW::isdirectory .TP \fB::OW::exists \fIpath If \fIpath\fR is exists - return 1. Otherwise return 0. .SH EXAMPLE .CS package require ow ow open \-d /dev/ttyS0 \-t 60 set save_templow [ow get /28.86BF80000000/templow] ow put /28.86BF80000000/templow 10 set room_sensor [ow set /28.86BF80000000] $room_sensor put temphigh 50 set room_temp [$room_sensor set temperature] set current_temp [$room_temp get] .CE .SH SEE ALSO .so mann/seealso.nso .SH AVAILABILITY http://www.owfs.org .SH AUTHOR Serg Oskin (serg@oskin.ru) .sp owfs-3.1p5/src/rpm/0000755000175000001440000000000013022537100011153 500000000000000owfs-3.1p5/src/rpm/Makefile.am0000644000175000001440000000020112654730021013127 00000000000000# $Id$ EXTRA_DIST = owfs.conf owfs.init \ owserver.conf owserver.init \ owhttpd.conf owhttpd.init \ owftpd.conf owftpd.init owfs-3.1p5/src/rpm/Makefile.in0000644000175000001440000004102613022537054013153 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ # $Id$ 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/rpm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = owfs.spec 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 $(srcdir)/owfs.spec.in \ $(top_srcdir)/src/scripts/install/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = owfs.conf owfs.init \ owserver.conf owserver.init \ owhttpd.conf owhttpd.init \ owftpd.conf owftpd.init 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) --foreign src/rpm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/rpm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): owfs.spec: $(top_builddir)/config.status $(srcdir)/owfs.spec.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am 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 clean-libtool 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 mostlyclean-libtool 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 clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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 mostlyclean-libtool 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: owfs-3.1p5/src/rpm/owfs.spec.in0000644000175000001440000004143512654730021013350 00000000000000# Use --define 'cvs 1' on the command line to enable CVS version %{!?cvs:%define CVSVERSION %{nil}} %{?cvs:%define CVSVERSION %(echo "_cvs_`date +"%Y%m%d"`")} %{!?cvs:%define CVS 0} %{?cvs:%define CVS 1} %define build_fs 1 %define build_httpd 1 %define build_capi 1 %define build_ownet 1 %define build_ftpd 1 %define build_server 1 %define build_perl 1 %define build_python 1 %define build_php 1 %define build_side 0 %define build_tap 1 %define build_mon 1 %define build_tcl 1 %define build_shell 1 %define build_man 1 %define debug_package %{nil} # include some mandriva defines # Look at http://wiki.mandriva.com/en/Policies/Release_Tag %define rel 3 # define the mkrel macro if it is not already defined # %{?!mkrel:%define mkrel(c:) %{-c:0.%{-c''}.}%{!?''with''unstable:%(perl -e '$''="%{1}";m/(.\'''\\D\+)?(\\d+)$/;$rel=${2}-1;re;print "$1$rel";').%{?subrel:%subrel}%{!?subrel:1}.%{?distversion:%distversion}}%{?''with_unstable:%{1}}%{?distsuffix:%distsuffix}%{?!distsuffix:mdk}} # For mandriva mkrel could be used. It doesn't work on older distributions though. # the define above fails with different syntax errors on FC1 atleast. #%define release %mkrel %rel %define release 1 %if %{build_tcl} %define tcl_pkgpath %(echo 'puts [lindex $tcl_pkgPath 0]' | %{_bindir}/tclsh) %endif Name: owfs Version: @VERSION@%{?cvs:%{CVSVERSION}} Release: %release Summary: 1-Wire Virtual File System Source: %{name}-%{version}.tar.gz #Copyright: GPL License: GPL Group: System Environment/Libraries URL: http://sourceforge.net/projects/owfs Buildroot: %{_tmppath}/%{name}-root Prefix: /usr Requires: %{name}-libs = %{version}-%{release} Packager: Serg Oskin Summary: Virtual filesystem on top of %{name}-libs providing access to 1-Wire networks. %description OWFS is a userspace virtual filesystem providing access to 1-Wire networks. %package libs Summary: Core library providing base functions to other OWFS modules. Group: System Environment/Libraries Requires: libusb >= 0.1.6 BuildRequires: automake autoconf libtool BuildRequires: libusb-devel %description libs %{name}-libs is a core library providing base functions to other OWFS modules. %if %{build_capi} %package capi Summary: C-API to develop third-part applications which access 1-Wire networks. Group: System Environment/Libraries Requires: %{name}-libs = %{version}-%{release} %description capi %{name}-capi library on top of libow providing an easy API to develop third-part applications to access to 1-Wire networks. %endif %if %{build_ownet} %package ownet Summary: C-API to develop third-part applications which access 1-Wire networks. Group: System Environment/Libraries Requires: %{name}-libs = %{version}-%{release} %description ownet %{name}-ownet library provids an easy API to develop third-part applications to access to 1-Wire networks. It doesn't depend on owlib, and only supports remote-server connections. This library doesn't include any 1-wire adapter support, except server connections. %endif %if %{build_fs} %package fs Summary: Virtual filesystem on top of %{name}-libs providing access to 1-Wire networks. Group: System Environment/Daemon Requires: %{name}-libs = %{version}-%{release}, fuse >= 1.0 #BuildRequires: fuse-devel >= 1.0 %description fs %{name}-fs is a virtual filesystem on top of %{name}-libs providing access to 1-Wire networks. %endif %if %{build_httpd} %package httpd Summary: HTTP daemon providing access to 1-Wire networks. Group: System Environment/Daemon Requires: %{name}-libs = %{version}-%{release} %description httpd %{name}-httpd is a HTTP daemon on top of %{name} providing access to 1-Wire networks. %endif %if %{build_ftpd} %package ftpd Summary: FTP daemon providing access to 1-Wire networks. Group: System Environment/Daemon Requires: %{name}-libs = %{version}-%{release} %description ftpd %{name}-ftpd is a FTP daemon on top of %{name} providing access to 1-Wire networks. %endif %if %{build_server} %package server Summary: Backend server (daemon) for 1-wire control Group: System Environment/Daemon Requires: %{name}-libs = %{version}-%{release} %description server %{name}-server is the backend component of the OWFS 1-wire bus control system. owserver arbitrates access to the bus from multiple client processes. The physical bus is usually connected to a serial or USB port, and other processes connect to owserver over network sockets (tcp port). Communication can be local or over a network. %endif %if %{build_side} %package side Summary: Packet sniffer for the owserver protocol Group: System Environment/Daemon Requires: tcl >= 8.1 %description side %{name}-side is a packet sniffer for the owserver protocol %endif %if %{build_tap} %package tap Summary: Packet sniffer for the owserver protocol Group: System Environment/Daemon Requires: tcl >= 8.1 %description tap %{name}-tap is a packet sniffer for the owserver protocol %endif %if %{build_mon} %package mon Summary: Statistics and settings monitor for owserver Group: System Environment/Daemon Requires: tcl >= 8.1 %description mon %{name}-mon is a graphical monitor of owserver\'s status %endif %if %{build_perl} %package perl Summary: %{name}-perl is a Perl interface for the 1-wire filesystem Group: System Environment/Libraries Requires: %{name}-libs = %{version}-%{release}, perl BuildRequires: swig # FC1 doesn't have perl-devel, but should be added %description perl %{name}-perl is a Perl interface for the 1-wire filesystem %endif %if %{build_python} %package python Summary: %{name}-python is a python interface for the 1-wire filesystem Group: System Environment/Libraries Requires: %{name}-libs = %{version}-%{release}, python >= 2.0 BuildRequires: python-devel >= 2.0, swig %description python %{name}-python is a Python interface for the 1-wire filesystem %endif %if %{build_php} %package php Summary: %{name}-php is a php interface for the 1-wire filesystem Group: System Environment/Libraries Requires: %{name}-libs = %{version}-%{release}, php >= 4.3.0 BuildRequires: php-devel >= 4.3.0, swig # FC1 doesn't have php-cli >= 4.3.0, but should be added %description php %{name}-php is a php interface for the 1-wire filesystem %endif %if %{build_tcl} %package tcl Summary: %{name}-tcl is a Tcl interface for the 1-wire filesystem Group: System Environment/Libraries Requires: %{name}-libs = %{version}-%{release}, tcl >= 8.1 BuildRequires: tcl-devel >= 8.1 %description tcl %{name}-tcl is a Tcl interface for the 1-wire filesystem %endif %if %{build_shell} %package shell Summary: %{name}-shell gives light weight shell access to owserver and the 1-wire filesystem Group: Applications/System %description shell %{name}-shell is 5 small programs to easily access owserver (and thus the 1-wire system) from shell scripts. owdir, owread, owwrite, owget and owpresent. %endif %if %{build_man} %package man Summary: %{name}-man installs man pages for all the OWFS programs 1-wire devices. Group: Documentation %description man %{name}-man installs man pages for all the OWFS progams (owfs, owhtttpd, owserver, owftpd, owshell, owperl, owtcl) and also all the supported 1-wire devices. %endif %clean rm -rf $RPM_BUILD_ROOT %prep %if %{CVS} == 0 %setup %else %setup -n owfs-@VERSION@ %endif %build aclocal libtoolize -f -c autoheader autoconf automake -a -c ./configure \ --prefix=%{prefix} \ --libdir=%{_libdir} \ --disable-static \ --enable-usb \ --enable-cache \ --enable-mt \ %if %{build_fs} --enable-owfs \ %else --disable-owfs \ %endif %if %{build_httpd} --enable-owhttpd \ %else --disable-owhttpd \ %endif %if %{build_capi} --enable-owcapi \ %else --disable-owcapi \ %endif %if %{build_ownet} --enable-ownetlib \ %else --disable-ownetlib \ %endif %if %{build_ftpd} --enable-owftpd \ %else --disable-owftpd \ %endif %if %{build_server} --enable-owserver \ %else --disable-owserver \ %endif %if %{build_side} --enable-owside \ %else --disable-owside \ %endif %if %{build_tap} --enable-owtap \ %else --disable-owtap \ %endif %if %{build_mon} --enable-owmon \ %else --disable-owmon \ %endif %if %{build_perl} --enable-owperl \ %else --disable-owperl \ %endif %if %{build_python} --enable-owpython \ %else --disable-owpython \ %endif %if %{build_php} --enable-owphp \ %else --disable-owphp \ %endif %if %{build_tcl} --enable-owtcl \ %else --disable-owtcl \ %endif make #make check %install case "$RPM_BUILD_ROOT" in *-root) rm -rf $RPM_BUILD_ROOT ;; esac make install \ DESTDIR=$RPM_BUILD_ROOT #pushd src/man #make install-so-man #popd install -d -m 755 $RPM_BUILD_ROOT%{prefix}/include/owfs mv -f $RPM_BUILD_ROOT%{prefix}/include/*.h $RPM_BUILD_ROOT%{prefix}/include/owfs # man-files already installed at correct place on FC7 if [ -d $RPM_BUILD_ROOT%{prefix}/man ]; then install -d -m 755 $RPM_BUILD_ROOT%{_mandir} install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1 mv -f $RPM_BUILD_ROOT%{prefix}/man/man1/* $RPM_BUILD_ROOT%{_mandir}/man1/ install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man3 mv -f $RPM_BUILD_ROOT%{prefix}/man/man3/* $RPM_BUILD_ROOT%{_mandir}/man3/ install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man5 mv -f $RPM_BUILD_ROOT%{prefix}/man/man5/* $RPM_BUILD_ROOT%{_mandir}/man5/ install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/mann mv -f $RPM_BUILD_ROOT%{prefix}/man/mann/* $RPM_BUILD_ROOT%{_mandir}/mann/ rm -rf $RPM_BUILD_ROOT%{prefix}/man fi rm -f $RPM_BUILD_ROOT%{_mandir}/man1/*.1so $RPM_BUILD_ROOT%{_mandir}/man1/*.1so.gz rm -f $RPM_BUILD_ROOT%{_mandir}/man3/*.3so $RPM_BUILD_ROOT%{_mandir}/man3/*.3so.gz rm -f $RPM_BUILD_ROOT%{_mandir}/man5/*.5so $RPM_BUILD_ROOT%{_mandir}/man5/*.5so.gz rm -f $RPM_BUILD_ROOT%{_mandir}/mann/*.nso $RPM_BUILD_ROOT%{_mandir}/mann/*.nso.gz %if %{build_fs} install -D -m 644 src/rpm/owfs.conf $RPM_BUILD_ROOT/etc/sysconfig/owfs install -D -m 755 src/rpm/owfs.init $RPM_BUILD_ROOT/etc/rc.d/init.d/owfs install -d -m 755 $RPM_BUILD_ROOT%{prefix}/sbin mv -f $RPM_BUILD_ROOT%{prefix}/bin/owfs $RPM_BUILD_ROOT%{prefix}/sbin %endif %if %{build_httpd} install -D -m 755 src/rpm/owhttpd.conf $RPM_BUILD_ROOT/etc/sysconfig/owhttpd install -D -m 644 src/rpm/owhttpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/owhttpd install -d -m 755 $RPM_BUILD_ROOT%{prefix}/sbin mv -f $RPM_BUILD_ROOT%{prefix}/bin/owhttpd $RPM_BUILD_ROOT%{prefix}/sbin %endif %if %{build_ftpd} install -D -m 644 src/rpm/owftpd.conf $RPM_BUILD_ROOT/etc/sysconfig/owftpd install -D -m 755 src/rpm/owftpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/owftpd install -d -m 755 $RPM_BUILD_ROOT%{prefix}/sbin mv -f $RPM_BUILD_ROOT%{prefix}/bin/owftpd $RPM_BUILD_ROOT%{prefix}/sbin %endif %if %{build_server} install -D -m 644 src/rpm/owserver.conf $RPM_BUILD_ROOT/etc/sysconfig/owserver install -D -m 755 src/rpm/owserver.init $RPM_BUILD_ROOT/etc/rc.d/init.d/owserver install -d -m 755 $RPM_BUILD_ROOT%{prefix}/sbin mv -f $RPM_BUILD_ROOT%{prefix}/bin/owserver $RPM_BUILD_ROOT%{prefix}/sbin %endif %if %{build_side} %endif %if %{build_tap} %endif %if %{build_mon} %endif %if %{build_perl} %define perl_archlib %(eval "`@PERL@ -V:installarchlib`"; echo $installarchlib) %define perl_sitearch %(eval "`@PERL@ -V:installsitearch`"; echo $installsitearch) %define perl_sitelib %(eval "`@PERL@ -V:installsitelib`"; echo $installsitelib) %define perl_siteman3dir %(eval "`@PERL@ -V:siteman3dir`"; echo $siteman3dir) rm -f $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod rm -f $RPM_BUILD_ROOT%{perl_sitearch}/auto/OW/.packlist rm -f $RPM_BUILD_ROOT%{perl_sitearch}/auto/OWNet/.packlist %endif %if %{build_python} %define python_sitedir %(@PYTHON@ -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=1)" 2>/dev/null|| echo @PYSITEDIR@) # Remove OpenSUSE info files rm -f $RPM_BUILD_ROOT%{python_sitedir}/ow-*-info rm -f $RPM_BUILD_ROOT%{python_sitedir}/ownet-*-info %endif %if %{build_php} #don't use the PHPLIBDIR here... assume php-config works instead. %define php_extdir %(php-config --extension-dir 2>/dev/null || php5-config --extension-dir 2>/dev/null || php4-config --extension-dir 2>/dev/null || echo @PHPLIBDIR@) #don't use the PHPLIBDIR here... assume php-config works instead. rm -f $RPM_BUILD_ROOT%{php_extdir}/libowphp.la $RPM_BUILD_ROOT%{php_extdir}/libowphp.a %endif %if %{build_tcl} rm -f $RPM_BUILD_ROOT%{_libdir}/owtcl-*/ow.la $RPM_BUILD_ROOT%{_libdir}/owtcl-*/ow.a %endif %post libs /sbin/ldconfig %postun libs /sbin/ldconfig %if %{build_capi} %post capi /sbin/ldconfig %postun capi /sbin/ldconfig %endif %if %{build_ownet} %post ownet /sbin/ldconfig %postun ownet /sbin/ldconfig %endif %if %{build_fs} %post fs /sbin/chkconfig --add owfs %preun fs if [ $1 = 0 ]; then /sbin/chkconfig --del owfs fi %endif %if %{build_httpd} %post httpd /sbin/chkconfig --add owhttpd %preun httpd if [ $1 = 0 ]; then /sbin/chkconfig --del owhttpd fi %endif %if %{build_ftpd} %post ftpd /sbin/chkconfig --add owftpd %preun ftpd if [ $1 = 0 ]; then /sbin/chkconfig --del owftpd fi %endif %if %{build_server} %post server /sbin/chkconfig --add owserver %preun server if [ $1 = 0 ]; then /sbin/chkconfig --del owserver fi %endif %files libs %defattr(-,root,root) %doc README NEWS INSTALL ChangeLog AUTHORS COPYING %{prefix}/include/owfs/owfs_config.h %{_libdir}/libow-*.so* %{_libdir}/libow.so %{_libdir}/libow.la %{_mandir}/man3/*.3.* %if %{build_capi} %files capi %defattr(-,root,root) %{prefix}/include/owfs/owcapi.h %{_libdir}/libowcapi-*.so* %{_libdir}/libowcapi.so %{_libdir}/libowcapi.la %{_mandir}/man1/*owcapi.1.* %endif %if %{build_ownet} %files ownet %defattr(-,root,root) %{prefix}/include/owfs/ownetapi.h %{_libdir}/libownet-*.so* %{_libdir}/libownet.so %{_libdir}/libownet.la %{_mandir}/man1/*ownet*.1.* %endif %if %{build_fs} %files fs %defattr(-,root,root) %attr(0755,root,root) /etc/rc.d/init.d/owfs %config /etc/sysconfig/owfs %{prefix}/sbin/owfs %{_mandir}/man1/owfs.1.* %endif %if %{build_httpd} %files httpd %defattr(-,root,root) %attr(0755,root,root) /etc/rc.d/init.d/owhttpd %config /etc/sysconfig/owhttpd %{prefix}/sbin/owhttpd %{_mandir}/man1/owhttpd.1.* %endif %if %{build_shell} %files shell %defattr(-,root,root) %{prefix}/bin/owdir %{prefix}/bin/owread %{prefix}/bin/owwrite %{prefix}/bin/owget %{prefix}/bin/owpresent %{_mandir}/man1/owshell.1.* %{_mandir}/man1/owdir.1.* %{_mandir}/man1/owread.1.* %{_mandir}/man1/owget.1.* %{_mandir}/man1/owpresent.1.* %if %{build_php} # include ownet-php (it's a duplicate since it's in owfs-php too) %{prefix}/bin/ownet.php %endif %if %{build_python} #%dir %{python_sitedir}/ow #%{python_sitedir}/ow/__init__.py* #%{python_sitedir}/ow/_OW.so # include ownet-python (it's a duplicate since it's in owfs-python too) %dir %{python_sitedir}/ownet %{python_sitedir}/ownet/__init__.py*/ %{python_sitedir}/ownet/connection.py* %endif %endif %if %{build_man} %files man %defattr(-,root,root) %{_mandir}/man1/*.1.* #%{_mandir}/man1/*.1so %{_mandir}/man3/*.3.* #%{_mandir}/man3/*.3so %{_mandir}/man5/*.5.* #%{_mandir}/man5/*.5so %{_mandir}/mann/*.n.* #%{_mandir}/mann/*.nso %endif %if %{build_ftpd} %files ftpd %defattr(-,root,root) %attr(0755,root,root) /etc/rc.d/init.d/owftpd %config /etc/sysconfig/owftpd %{prefix}/sbin/owftpd %{_mandir}/man1/owftpd.1.* %endif %if %{build_server} %files server %defattr(-,root,root) %attr(0755,root,root) /etc/rc.d/init.d/owserver %config /etc/sysconfig/owserver %{prefix}/sbin/owserver %{_mandir}/man1/owserver.1.* %endif %if %{build_side} %files side %defattr(-,root,root) %{prefix}/bin/owside #%{_mandir}/man1/owside.1.* %endif %if %{build_tap} %files tap %defattr(-,root,root) %{prefix}/bin/owtap %{_mandir}/man1/owtap.1.* %endif %if %{build_mon} %files mon %defattr(-,root,root) %{prefix}/bin/owmon #%{_mandir}/man1/owmon.1.* %endif %if %{build_perl} %files perl %defattr(-,root,root) %dir %{perl_sitearch}/auto/OW %{perl_sitearch}/auto/OW/OW.* %{perl_sitearch}/OW.pm %{perl_sitelib}/OWNet.pm %{perl_siteman3dir}/OWNet.3* %endif %if %{build_python} %files python %defattr(-,root,root) %dir %{python_sitedir}/ow %{python_sitedir}/ow/__init__.py* %{python_sitedir}/ow/_OW.so #OpenSUSE info file #%{python_sitedir}/ow-*info %dir %{python_sitedir}/ownet %{python_sitedir}/ownet/__init__.py* %{python_sitedir}/ownet/connection.py* #OpenSUSE info file #%{python_sitedir}/ownet-*info %endif %if %{build_php} %files php %defattr(-,root,root) %dir %{php_extdir} %{php_extdir}/libowphp.so* %{prefix}/bin/ownet.php %endif %if %{build_tcl} %files tcl %defattr(-,root,root) %dir %{tcl_pkgpath}/owtcl-* %{tcl_pkgpath}/owtcl-*/* # ow-*.so ow.so ow.tcl pkgIndex.tcl %{_mandir}/mann/owtcl.n.* %endif %changelog * Sat Nov 15 2008 Serg Oskin - Build pkgs from released and CVS sources. - Correct TCL install path * Tue Jan 19 2008 Christian Magnusson - x86_64 support, tested on i386 and x86_64 * Tue Jan 15 2008 Serg Oskin - no scripts for owshell - x86_64 support (Not fully tested) * Sat Sep 30 2006 Paul Alfille - added shell programs, removed nfsd * Thu Jan 13 2005 Serg Oskin - reorganized * Sun Oct 24 2004 Serg Oskin - recreated * Wed Sep 24 2003 Vadim Tkachenko - Initial take at RPM build owfs-3.1p5/src/rpm/owfs.conf0000644000175000001440000000006612654730021012731 00000000000000MOUNTPOINT[0]=/mnt/1wire OPTIONS[0]="-d /dev/ttyS100" owfs-3.1p5/src/rpm/owfs.init0000755000175000001440000000342512654730021012754 00000000000000#!/bin/bash # # owfs Startup script for the 1-Wire networks # # chkconfig: - 95 05 # description: OWFS is a userspace virtual filesystem providing access to 1-Wire networks. # # config: /etc/sysconfig/owfs # Source function library. . /etc/rc.d/init.d/functions if [ -f /etc/sysconfig/owfs ]; then . /etc/sysconfig/owfs fi numfs=${#MOUNTPOINT[*]} if [ $numfs -eq 0 ]; then exit 0 fi lockfile=/var/lock/subsys/owfs owfs=/usr/sbin/owfs RETVAL=0 start() { echo -n $"Mounting One Wire file system: " /sbin/modprobe -q fuse i=0; n=0 while [ $n -lt $numfs ]; do mountpoint=${MOUNTPOINT[$i]} options=${OPTIONS[$i]} if [ "$mountpoint" != "" ]; then [ -d $mountpoint ] || mkdir -p $mountpoint $owfs $options $mountpoint >/dev/null RETVAL=$? [ $RETVAL = 0 ] || { echo_failure echo return $RETVAL } n=`expr $n + 1` fi i=`expr $i + 1` done echo_success echo touch ${lockfile} return 0 } stop() { echo -n $"Umounting One Wire file system: " # i=0; n=0 # while [ $n -lt $numfs ]; do # mountpoint=${MOUNTPOINT[$i]} # interface=${INTERFACE[$i]} # options=${OPTIONS[$i]} # if [ "$mountpoint" != "" ]; then # /bin/umount $mountpoint # RETVAL=$? # [ $RETVAL = 0 ] || { # echo_failure # echo # return $RETVAL # } # n=`expr $n + 1` # fi # i=`expr $i + 1` # done killproc $owfs RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f ${lockfile} return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) for mountpoint in ${MOUNTPOINT[@]}; do /bin/mount | /bin/grep $mountpoint done status $owfs ;; restart) stop start ;; condrestart) if [ -f ${lockfile} ]; then stop start fi ;; *) echo $"Usage: $prog {start|stop|restart|condrestart|status}" exit 1 esac exit $RETVAL owfs-3.1p5/src/rpm/owserver.conf0000644000175000001440000000005212654730021013622 00000000000000PORT[0]=3000 OPTIONS[0]="-d /dev/ttyS103" owfs-3.1p5/src/rpm/owserver.init0000755000175000001440000000242712654730021013653 00000000000000#!/bin/bash # # owserver Startup script for the 1-Wire networks # # chkconfig: - 94 06 # description: OWSERVER is a backend server (daemon) for 1-wire control # # config: /etc/sysconfig/owserver # Source function library. . /etc/rc.d/init.d/functions if [ -f /etc/sysconfig/owserver ]; then . /etc/sysconfig/owserver fi numfs=${#PORT[*]} if [ $numfs -eq 0 ]; then exit 0 fi lockfile=/var/lock/subsys/owserver owserver=/usr/sbin/owserver RETVAL=0 start() { echo -n $"Starting owserver: " i=0; n=0 while [ $n -lt $numfs ]; do port=${PORT[$i]} interface=${INTERFACE[$i]} options=${OPTIONS[$i]} if [ "$port" != "" ]; then $owserver -p $port $options >/dev/null RETVAL=$? [ $RETVAL = 0 ] || { echo_failure echo return $RETVAL } n=`expr $n + 1` fi i=`expr $i + 1` done echo_success echo touch ${lockfile} return 0 } stop() { echo -n $"Shutdown owserver: " killproc $owserver RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status $owserver ;; restart) stop start ;; condrestart) if [ -f ${lockfile} ]; then stop start fi ;; *) echo $"Usage: $prog {start|stop|restart|condrestart|status}" exit 1 esac exit $RETVAL owfs-3.1p5/src/rpm/owhttpd.conf0000644000175000001440000000005212654730021013437 00000000000000PORT[0]=3001 OPTIONS[0]="-d /dev/ttyS101" owfs-3.1p5/src/rpm/owhttpd.init0000755000175000001440000000236312654730021013467 00000000000000#!/bin/bash # # owhttpd Startup script for the 1-Wire networks # # chkconfig: - 95 05 # description: OWHTTPD is a HTTP daemon providing access to 1-Wire networks. # # config: /etc/sysconfig/owhttpd # Source function library. . /etc/rc.d/init.d/functions if [ -f /etc/sysconfig/owhttpd ]; then . /etc/sysconfig/owhttpd fi numfs=${#PORT[*]} if [ $numfs -eq 0 ]; then exit 0 fi lockfile=/var/lock/subsys/owhttpd owhttpd=/usr/sbin/owhttpd RETVAL=0 start() { echo -n $"Starting owhttpd: " i=0; n=0 while [ $n -lt $numfs ]; do port=${PORT[$i]} options=${OPTIONS[$i]} if [ "$port" != "" ]; then $owhttpd -p $port $options >/dev/null RETVAL=$? [ $RETVAL = 0 ] || { echo_failure echo return $RETVAL } n=`expr $n + 1` fi i=`expr $i + 1` done echo_success echo touch ${lockfile} return 0 } stop() { echo -n $"Shutdown owhttpd: " killproc $owhttpd RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status $owhttpd ;; restart) stop start ;; condrestart) if [ -f ${lockfile} ]; then stop start fi ;; *) echo $"Usage: $prog {start|stop|restart|condrestart|status}" exit 1 esac exit $RETVAL owfs-3.1p5/src/rpm/owftpd.conf0000644000175000001440000000006012654730021013250 00000000000000PORT[0]=0.0.0.0:21 OPTIONS[0]="-d /dev/ttyS102" owfs-3.1p5/src/rpm/owftpd.init0000755000175000001440000000234512654730021013301 00000000000000#!/bin/bash # # owftpd Startup script for the 1-Wire networks # # chkconfig: - 95 05 # description: OWFTPD is a FTP daemon providing access to 1-Wire networks. # # config: /etc/sysconfig/owftpd # Source function library. . /etc/rc.d/init.d/functions if [ -f /etc/sysconfig/owftpd ]; then . /etc/sysconfig/owftpd fi numfs=${#PORT[*]} if [ $numfs -eq 0 ]; then exit 0 fi lockfile=/var/lock/subsys/owftpd owftpd=/usr/sbin/owftpd RETVAL=0 start() { echo -n $"Starting owftpd: " i=0; n=0 while [ $n -lt $numfs ]; do port=${PORT[$i]} options=${OPTIONS[$i]} if [ "$port" != "" ]; then $owftpd -p $port $options >/dev/null RETVAL=$? [ $RETVAL = 0 ] || { echo_failure echo return $RETVAL } n=`expr $n + 1` fi i=`expr $i + 1` done echo_success echo touch ${lockfile} return 0 } stop() { echo -n $"Shutdown owftpd: " killproc $owftpd RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status $owftpd ;; restart) stop start ;; condrestart) if [ -f ${lockfile} ]; then stop start fi ;; *) echo $"Usage: $prog {start|stop|restart|condrestart|status}" exit 1 esac exit $RETVAL owfs-3.1p5/Makefile.am0000644000175000001440000000202212654730021011545 00000000000000ACLOCAL_AMFLAGS = -I src/scripts/m4 SUBDIRS = src module RPMMACROS = ${HOME}/.rpmmacros RPMDIR = ${HOME}/.rpm EXTRA_DIST = bootstrap clean-generic: @RM@ -f *~ .*~ preparerpm: dist @ if @TEST@ -z "@RPMBUILD@" ; then \ @ECHO@ "RPMBUILD binary not found, can't build RPM package"; \ exit 1; \ fi if @TEST@ ! -f ${RPMMACROS} ; then \ @ECHO@ "%_topdir ${RPMDIR}" > ${RPMMACROS}; \ mkdir -p ${RPMDIR}/SOURCES \ ${RPMDIR}/SPECS \ ${RPMDIR}/BUILD \ ${RPMDIR}/RPMS/i386 \ ${RPMDIR}/SRPMS ; \ fi cd src/rpm && ${MAKE} @PACKAGE@.spec @LN_S@ -f `pwd`/src/rpm/@PACKAGE@.spec ${RPMDIR}/SPECS/@PACKAGE@.spec rpm: preparerpm @LN_S@ -f `pwd`/@PACKAGE@-@VERSION@.tar.gz ${RPMDIR}/SOURCES/@PACKAGE@-@VERSION@.tar.gz cd ${RPMDIR}/SPECS && @RPMBUILD@ -ba @PACKAGE@.spec rpmcvs: preparerpm @LN_S@ -f `pwd`/@PACKAGE@-@VERSION@.tar.gz ${RPMDIR}/SOURCES/@PACKAGE@-@VERSION@_cvs_`date +"%Y%m%d"`.tar.gz cd ${RPMDIR}/SPECS && @RPMBUILD@ -ba @PACKAGE@.spec --define 'cvs 1' owfs-3.1p5/configure0000755000175000001440000237212313022537050011433 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # 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 -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || 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 about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do 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'" SHELL=${CONFIG_SHELL-/bin/sh} 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= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_default_prefix=/opt/owfs # 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_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS CHECK_LIBS CHECK_CFLAGS HAVE_CHECK_FALSE HAVE_CHECK_TRUE libcheck_LIBS libcheck_CFLAGS MQ_LIBS HAVE_SYSTEMD_FALSE HAVE_SYSTEMD_TRUE systemdsystemunitdir M_LIBS DL_LIBS LIBOBJS POW_LIB OW_ALLOC_DEBUG OW_MUTEX_DEBUG OW_DEBUG OW_FTDI OW_PARPORT OW_ZERO OW_AVAHI OW_USB OW_W1 OW_I2C OW_DARWIN OW_CYGWIN ENABLE_FTDI_FALSE ENABLE_FTDI_TRUE ENABLE_FTDI LIBFTDI_LIBS LIBFTDI_CFLAGS LIBFTDI_CONFIG ENABLE_PARPORT_FALSE ENABLE_PARPORT_TRUE ENABLE_PARPORT ENABLE_AVAHI_FALSE ENABLE_AVAHI_TRUE ENABLE_AVAHI LIBAVAHI_LIBS LIBAVAHI_CFLAGS ENABLE_USB_FALSE ENABLE_USB_TRUE ENABLE_USB LIBUSB_LIBS LIBUSB_CFLAGS ENABLE_ZERO_FALSE ENABLE_ZERO_TRUE ENABLE_ZERO ENABLE_OWFS_FALSE ENABLE_OWFS_TRUE ENABLE_OWFS FUSE_INCLUDES FUSE_FLAGS FUSE_LIBS fuse_lib_path fuse_include_path OSLIBS LD_EXTRALIBS ENABLE_PROFILING_FALSE ENABLE_PROFILING_TRUE ENABLE_PROFILING EXTRACFLAGS DATADIR BINDIR LIBDIR ENABLE_OWTCL_FALSE ENABLE_OWTCL_TRUE ENABLE_OWTCL OWTCL_INSTALL_PATH TCL_PACKAGE_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_LIB_SPEC TCL_LD_SEARCH_FLAGS TCL_COMPAT_OBJS TCL_LD_FLAGS TCL_LIBS TCL_DEFS TCL_CFLAGS TCL_EXEC_PREFIX TCL_PREFIX TCL_SHLIB_SUFFIX TCL_SHLIB_LD_LIBS TCL_SHLIB_LD TCL_SHLIB_CFLAGS TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIB_FLAG TCL_LIB_FILE TCL_SRC_DIR TCL_BIN_DIR TCL_VERSION ENABLE_PYTHON_FALSE ENABLE_PYTHON_TRUE ENABLE_PYTHON ENABLE_OWPYTHON_FALSE ENABLE_OWPYTHON_TRUE ENABLE_OWPYTHON PYTHONDYNAMICLINKING PYSITEDIR PYVERSION PYTHON PYTHONCONFIG ENABLE_PHP_FALSE ENABLE_PHP_TRUE ENABLE_PHP ENABLE_OWPHP_FALSE ENABLE_OWPHP_TRUE ENABLE_OWPHP PHPLIBDIR PHPEXT PHPINC PHPCONFIG PHP ENABLE_PERL_FALSE ENABLE_PERL_TRUE ENABLE_PERL ENABLE_OWPERL_FALSE ENABLE_OWPERL_TRUE ENABLE_OWPERL PERL5CCFLAGS PERL5NAME PERL5DIR PERL5LIB PERL5DYNAMICLINKING PERL5EXT PERL ENABLE_SWIG_FALSE ENABLE_SWIG_TRUE ENABLE_SWIG ENABLE_OWCAPI_FALSE ENABLE_OWCAPI_TRUE ENABLE_OWCAPI ENABLE_OWMON_FALSE ENABLE_OWMON_TRUE ENABLE_OWMON ENABLE_OWMALLOC_FALSE ENABLE_OWMALLOC_TRUE ENABLE_OWMALLOC ENABLE_OWTAP_FALSE ENABLE_OWTAP_TRUE ENABLE_OWTAP ENABLE_OWNET_FALSE ENABLE_OWNET_TRUE ENABLE_OWNET ENABLE_OWEXTERNAL_FALSE ENABLE_OWEXTERNAL_TRUE ENABLE_OWEXTERNAL ENABLE_OWSERVER_FALSE ENABLE_OWSERVER_TRUE ENABLE_OWSERVER ENABLE_OWFTPD_FALSE ENABLE_OWFTPD_TRUE ENABLE_OWFTPD ENABLE_OWHTTPD_FALSE ENABLE_OWHTTPD_TRUE ENABLE_OWHTTPD ENABLE_W1_FALSE ENABLE_W1_TRUE ENABLE_W1 ENABLE_I2C_FALSE ENABLE_I2C_TRUE ENABLE_I2C PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC acx_pthread_config ENABLE_OWNETLIB_FALSE ENABLE_OWNETLIB_TRUE ENABLE_OWNETLIB ENABLE_OWLIB_FALSE ENABLE_OWLIB_TRUE ENABLE_OWLIB ENABLE_OWSHELL_FALSE ENABLE_OWSHELL_TRUE ENABLE_OWSHELL ENABLE_MUTEX_DEBUG_FALSE ENABLE_MUTEX_DEBUG_TRUE ENABLE_MUTEX_DEBUG ENABLE_DEBUG_FALSE ENABLE_DEBUG_TRUE ENABLE_DEBUG OWFSROOT LIBPOSTFIX PIC_FLAGS AM_CPPFLAGS HAVE_FREEBSD_FALSE HAVE_FREEBSD_TRUE HAVE_FREEBSD HAVE_CYGWIN_FALSE HAVE_CYGWIN_TRUE HAVE_CYGWIN HAVE_DARWIN_FALSE HAVE_DARWIN_TRUE HAVE_DARWIN HAVE_DEBIAN_FALSE HAVE_DEBIAN_TRUE HAVE_DEBIAN LIBTOOL_DEPS LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL LN_S OBJDUMP DLLTOOL AS CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG SOELIM_FALSE SOELIM_TRUE SOELIM SWIG RPMBUILD RPM RM TEST ECHO 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 CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build PACKAGE VERSION LT_RELEASE LT_AGE LT_REVISION LT_CURRENT OWFS_BINARY_AGE OWFS_INTERFACE_AGE VERSION_PATCHLEVEL VERSION_MINOR VERSION_MAJOR AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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 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' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_debian enable_debug enable_mutexdebug enable_owshell enable_owlib enable_ownetlib enable_i2c enable_w1 enable_owhttpd enable_owftpd enable_owserver enable_owexternal enable_ownet enable_owtap enable_owmalloc enable_owmon enable_owcapi enable_swig enable_owperl with_perl5 enable_owphp with_php with_phpconfig enable_owpython with_python with_pythonconfig enable_owtcl with_tcl enable_profiling with_fuseinclude with_fuselib enable_owfs enable_zero enable_usb enable_avahi enable_parport with_libftdi_config enable_ftdi with_systemdsystemunitdir ' ac_precious_vars='build_alias host_alias target_alias PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP LT_SYS_LIBRARY_PATH LIBUSB_CFLAGS LIBUSB_LIBS LIBAVAHI_CFLAGS LIBAVAHI_LIBS libcheck_CFLAGS libcheck_LIBS' # 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' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' 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 ;; -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 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 this package 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] --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/PACKAGE] --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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then 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 --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debian Enable debian-system (default false) --enable-debug Enable debug-output (default true) --enable-mutexdebug Enable mutexdebug-output (default true) --enable-owshell Enable owshell support (default true) --enable-owlib Enable owlib support (default true) --enable-ownetlib Enable ownetlib support (default true) --enable-i2c Enable i2c (DS2482-x00) support (default true) --enable-w1 Enable w1 support (default true) --enable-owhttpd Enable owhttpd module (default true) --enable-owftpd Enable owftpd module (default true) --enable-owserver Enable owserver module (default true) --enable-owexternal Enable owexternal module (default true) --enable-ownet Enable ownet module (default true) --enable-owtap Enable owtap module (default true) --enable-owmalloc Enable owmalloc checking (default false) --enable-owmon Enable owmon module (default true) --enable-owcapi Enable owcapi module (default true) --enable-swig Enable swig (default auto) --enable-owperl Enable owperl module (default true) --enable-owphp Enable owphp module (default true) --enable-owpython Enable owpython module (default true) --enable-owtcl Enable owtcl module (default true) --enable-profiling Enable profiling (default false) --enable-owfs Enable owfs module (default auto) --enable-zero Enable zeroconf/bonjour (default true) --enable-usb Enable 1-Wire usb DS2490 support (default auto) --enable-avahi Enable zero-config autodiscovery (default auto) --enable-parport Enable 1-Wire parallel port DS1410E support (default auto) --enable-ftdi Enable LinkUSB support via libftdi (default auto) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-perl5 Set location of Perl executable --with-php Set location of Php executable --with-phpconfig Set location of php-config executable --with-python Set location of Python executable --with-pythonconfig Set location of python-config executable --with-tcl directory containing tcl configuration (tclConfig.sh) --with-fuseinclude=DIR FUSE-include from [/usr/local/include] --with-fuselib=DIR FUSE-lib from [/usr/local/lib] --with-libftdi-config=PATH Specify full path to libftdi-config or libftdi1-config --with-systemdsystemunitdir=DIR Directory for systemd service files Some influential environment variables: PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path 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 CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. LIBUSB_CFLAGS C compiler flags for LIBUSB, overriding pkg-config LIBUSB_LIBS linker flags for LIBUSB, overriding pkg-config LIBAVAHI_CFLAGS C compiler flags for LIBAVAHI, overriding pkg-config LIBAVAHI_LIBS linker flags for LIBAVAHI, overriding pkg-config libcheck_CFLAGS C compiler flags for libcheck, overriding pkg-config libcheck_LIBS linker flags for libcheck, overriding pkg-config 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 the package provider. _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 configure 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_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_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_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_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 # 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;} ;; 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_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_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" 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=\$$4 { $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_member 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 $as_me, 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 # 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 # 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=0;; 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='\' # Making releases: # VERSION_PATCHLEVEL += 1; # OWFS_INTERFACE_AGE += 1; # OWFS_BINARY_AGE += 1; # if any functions have been added, set OWFS_INTERFACE_AGE to 0. # if backwards compatibility has been broken, # set OWFS_BINARY_AGE _and_ OWFS_INTERFACE_AGE to 0. # (In our case it's better to always keep AGE to 0, since nobody else will use our library) VERSION_MAJOR=3 VERSION_MINOR=1 VERSION_PATCHLEVEL=5 OWFS_INTERFACE_AGE=0 OWFS_BINARY_AGE=0 LT_CURRENT=`expr $VERSION_PATCHLEVEL - $OWFS_INTERFACE_AGE` LT_REVISION=$OWFS_INTERFACE_AGE LT_AGE=`expr $OWFS_BINARY_AGE - $OWFS_INTERFACE_AGE` LT_RELEASE=$VERSION_MAJOR.$VERSION_MINOR VERSION="${VERSION_MAJOR}.${VERSION_MINOR}p${VERSION_PATCHLEVEL}" PACKAGE="owfs" { $as_echo "$as_me:${as_lineno-$LINENO}: result: Configuring ${PACKAGE}-${VERSION}" >&5 $as_echo "Configuring ${PACKAGE}-${VERSION}" >&6; } ac_aux_dir= for ac_dir in src/scripts/install "$srcdir"/src/scripts/install; 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 src/scripts/install \"$srcdir\"/src/scripts/install" "$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. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version='1.15' # 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 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=${PACKAGE} VERSION=${VERSION} 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 # Process config.h.in ac_config_headers="$ac_config_headers src/include/config.h" # Extract the first word of "echo", so it can be a program name with args. set dummy echo; 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_path_ECHO+:} false; then : $as_echo_n "(cached) " >&6 else case $ECHO in [\\/]* | ?:[\\/]*) ac_cv_path_ECHO="$ECHO" # Let the user override the test with a path. ;; *) 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_path_ECHO="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ECHO=$ac_cv_path_ECHO if test -n "$ECHO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECHO" >&5 $as_echo "$ECHO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "test", so it can be a program name with args. set dummy test; 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_path_TEST+:} false; then : $as_echo_n "(cached) " >&6 else case $TEST in [\\/]* | ?:[\\/]*) ac_cv_path_TEST="$TEST" # Let the user override the test with a path. ;; *) 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_path_TEST="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi TEST=$ac_cv_path_TEST if test -n "$TEST"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST" >&5 $as_echo "$TEST" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; 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_path_RM+:} false; then : $as_echo_n "(cached) " >&6 else case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # Let the user override the test with a path. ;; *) 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_path_RM="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 $as_echo "$RM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "rpm", so it can be a program name with args. set dummy rpm; 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_path_RPM+:} false; then : $as_echo_n "(cached) " >&6 else case $RPM in [\\/]* | ?:[\\/]*) ac_cv_path_RPM="$RPM" # Let the user override the test with a path. ;; *) 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_path_RPM="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi RPM=$ac_cv_path_RPM if test -n "$RPM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPM" >&5 $as_echo "$RPM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "rpmbuild", so it can be a program name with args. set dummy rpmbuild; 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_path_RPMBUILD+:} false; then : $as_echo_n "(cached) " >&6 else case $RPMBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_RPMBUILD="$RPMBUILD" # Let the user override the test with a path. ;; *) 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_path_RPMBUILD="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi RPMBUILD=$ac_cv_path_RPMBUILD if test -n "$RPMBUILD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPMBUILD" >&5 $as_echo "$RPMBUILD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "swig", so it can be a program name with args. set dummy swig; 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_path_SWIG+:} false; then : $as_echo_n "(cached) " >&6 else case $SWIG in [\\/]* | ?:[\\/]*) ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path. ;; *) 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_path_SWIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi SWIG=$ac_cv_path_SWIG if test -n "$SWIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5 $as_echo "$SWIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "soelim", so it can be a program name with args. set dummy soelim; 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_path_SOELIM+:} false; then : $as_echo_n "(cached) " >&6 else case $SOELIM in [\\/]* | ?:[\\/]*) ac_cv_path_SOELIM="$SOELIM" # Let the user override the test with a path. ;; *) 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_path_SOELIM="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi SOELIM=$ac_cv_path_SOELIM if test -n "$SOELIM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOELIM" >&5 $as_echo "$SOELIM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -n "${SOELIM}"; then SOELIM_TRUE= SOELIM_FALSE='#' else SOELIM_TRUE='#' SOELIM_FALSE= fi # This macro should appair before any other PKG_* macro if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; 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_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) 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_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; 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_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) 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_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" 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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; 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" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Check for additional programs # We don't need c++ right now. #AC_PROG_CXX 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # 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 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 enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # 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_AS="${ac_tool_prefix}as" $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 AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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_AS="as" $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_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="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 AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump { $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 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 enable_dlopen=yes case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_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 '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "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_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_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_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $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 fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_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 fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "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_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$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 DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$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_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" 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 DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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 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} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi 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 test -z "$STRIP" && STRIP=: 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 test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext 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: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt" $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 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt" $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil" $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 DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil" $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_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" 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 DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit" $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 NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit" $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_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" 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 NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo" $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 LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo" $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_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" 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 LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool" $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 OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool" $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_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" 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 OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64" $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 OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64" $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_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" 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 OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } { $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 dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=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_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } 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 CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: # Supposedly this helps OS X compiling $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h HAVE_DEBIAN="false" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if debian-system is used" >&5 $as_echo_n "checking if debian-system is used... " >&6; } # Check whether --enable-debian was given. if test "${enable_debian+set}" = set; then : enableval=$enable_debian; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test "$enableval" = "yes" ; then HAVE_DEBIAN="true" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 $as_echo "no (default)" >&6; } fi if test "${HAVE_DEBIAN}" = "true"; then HAVE_DEBIAN_TRUE= HAVE_DEBIAN_FALSE='#' else HAVE_DEBIAN_TRUE='#' HAVE_DEBIAN_FALSE= fi HAVE_DARWIN="false" HAVE_FREEBSD="false" HAVE_CYGWIN="false" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special host" >&5 $as_echo_n "checking for special host... " >&6; } case "$host" in *-*-cygwin*) HAVE_CYGWIN="true" CFLAGS="$CFLAGS -mwin32 -g" { $as_echo "$as_me:${as_lineno-$LINENO}: result: Cygwin" >&5 $as_echo "Cygwin" >&6; } ;; *-darwin*) HAVE_DARWIN="true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin" >&5 $as_echo "Darwin" >&6; } ;; *-freebsd*) HAVE_FREEBSD="true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD" >&5 $as_echo "FreeBSD" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Other host" >&5 $as_echo "Other host" >&6; } ;; esac if test "${HAVE_DARWIN}" = "true"; then HAVE_DARWIN_TRUE= HAVE_DARWIN_FALSE='#' else HAVE_DARWIN_TRUE='#' HAVE_DARWIN_FALSE= fi if test "${HAVE_CYGWIN}" = "true"; then HAVE_CYGWIN_TRUE= HAVE_CYGWIN_FALSE='#' else HAVE_CYGWIN_TRUE='#' HAVE_CYGWIN_FALSE= fi if test "${HAVE_FREEBSD}" = "true"; then HAVE_FREEBSD_TRUE= HAVE_FREEBSD_FALSE='#' else HAVE_FREEBSD_TRUE='#' HAVE_FREEBSD_FALSE= fi # launchd using the new launch_activate_socket for ac_func in launch_activate_socket do : ac_fn_c_check_func "$LINENO" "launch_activate_socket" "ac_cv_func_launch_activate_socket" if test "x$ac_cv_func_launch_activate_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LAUNCH_ACTIVATE_SOCKET 1 _ACEOF fi done # AC_CHECK_HEADERS(launch.h) AM_CPPFLAGS="" PIC_FLAGS="" if test "$lt_prog_compiler_pic_works" = yes; then PIC_FLAGS="$lt_prog_compiler_pic" fi # Make sure tclConfig.sh is found under /usr/lib64/ # Should perhaps support cross-compiling to other cpu-type too? LIBPOSTFIX= case "${host_os}" in *linux* ) case "${host_cpu}" in powerpc64 | s390x | x86_64 ) LIBPOSTFIX="64" CFLAGS="$CFLAGS -m64" ;; esac ;; esac if test "$cross_compiling" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports nested functions" >&5 $as_echo_n "checking if compiler supports nested functions... " >&6; } if test "$cross_compiling" = yes; 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 $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ f(void (*nested)()) { (*nested)(); } main() { int a = 0; void nested() { a = 1; } f(nested); if(a != 1) exit(1); exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; 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" >&5 $as_echo "no" >&6; } CFLAGS="$CFLAGS -DNO_NESTED_FUNCTIONS" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi OWFSROOT="`pwd`" # Checks for header files. ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $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 for ac_header in asm/types.h arpa/inet.h sys/ioctl.h sys/mkdev.h sys/socket.h sys/time.h sys/times.h sys/types.h sys/param.h sys/uio.h feature_tests.h fcntl.h netinet/in.h stdlib.h string.h strings.h sys/file.h syslog.h termios.h unistd.h limits.h stdint.h features.h getopt.h resolv.h semaphore.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 for ac_header in linux/limits.h linux/types.h netdb.h dlfcn.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 for ac_header in sys/event.h sys/inotify.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 # Test if debugging out enabled ENABLE_DEBUG="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if debug-output is enabled" >&5 $as_echo_n "checking if debug-output is enabled... " >&6; } # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_DEBUG="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_DEBUG}" = "true"; then ENABLE_DEBUG_TRUE= ENABLE_DEBUG_FALSE='#' else ENABLE_DEBUG_TRUE='#' ENABLE_DEBUG_FALSE= fi # Test if mutex-debugging is enabled. Should not be enabled for smaller embedded systems ENABLE_MUTEX_DEBUG="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if mutexdebug is enabled" >&5 $as_echo_n "checking if mutexdebug is enabled... " >&6; } # Check whether --enable-mutexdebug was given. if test "${enable_mutexdebug+set}" = set; then : enableval=$enable_mutexdebug; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_MUTEX_DEBUG="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_MUTEX_DEBUG}" = "true"; then ENABLE_MUTEX_DEBUG_TRUE= ENABLE_MUTEX_DEBUG_FALSE='#' else ENABLE_MUTEX_DEBUG_TRUE='#' ENABLE_MUTEX_DEBUG_FALSE= fi # Test if OWSHELL should be supported ENABLE_OWSHELL="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if OWSHELL support is enabled" >&5 $as_echo_n "checking if OWSHELL support is enabled... " >&6; } # Check whether --enable-owshell was given. if test "${enable_owshell+set}" = set; then : enableval=$enable_owshell; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_OWSHELL="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWSHELL}" = "true"; then ENABLE_OWSHELL_TRUE= ENABLE_OWSHELL_FALSE='#' else ENABLE_OWSHELL_TRUE='#' ENABLE_OWSHELL_FALSE= fi # Test if OWLIB should be supported ENABLE_OWLIB="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if OWLIB support is enabled" >&5 $as_echo_n "checking if OWLIB support is enabled... " >&6; } # Check whether --enable-owlib was given. if test "${enable_owlib+set}" = set; then : enableval=$enable_owlib; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_OWLIB="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWLIB}" = "true"; then ENABLE_OWLIB_TRUE= ENABLE_OWLIB_FALSE='#' else ENABLE_OWLIB_TRUE='#' ENABLE_OWLIB_FALSE= fi # Test if OWNETLIB should be supported ENABLE_OWNETLIB="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if OWNETLIB support is enabled" >&5 $as_echo_n "checking if OWNETLIB support is enabled... " >&6; } # Check whether --enable-ownetlib was given. if test "${enable_ownetlib+set}" = set; then : enableval=$enable_ownetlib; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_OWNETLIB="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWNETLIB}" = "true"; then ENABLE_OWNETLIB_TRUE= ENABLE_OWNETLIB_FALSE='#' else ENABLE_OWNETLIB_TRUE='#' ENABLE_OWNETLIB_FALSE= fi # Check for threading 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 acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } 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 pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; 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_acx_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$acx_pthread_config"; then ac_cv_prog_acx_pthread_config="$acx_pthread_config" # 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_acx_pthread_config="yes" $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 test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" fi fi acx_pthread_config=$ac_cv_prog_acx_pthread_config if test -n "$acx_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5 $as_echo "$acx_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr=$attr; return attr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then for ac_prog in xlc_r cc_r 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_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_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_PTHREAD_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 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else acx_pthread_ok=no 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 "$acx_pthread_ok" = "yes"; then #CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # can't set pthread flags for all compilations, since owshell doesn't need it. if test "$cross_compiling" = yes; then # We need to link libow.so with -lpthread on some cross-platforms # since owtcl.so doesn't work otherwise. -pthread is not enough if test x"$PTHREAD_LIBS" = x -a "x$PTHREAD_CFLAGS" = "x-pthread"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: add -lpthread to PTHREAD_LIBS" >&5 $as_echo "add -lpthread to PTHREAD_LIBS" >&6; } PTHREAD_LIBS="-lpthread" fi fi ENABLE_MT="true" else ENABLE_MT="false" PTHREAD_CFLAGS="" PTHREAD_LIBS="" PTHREAD_CC="" fi # Check for i2c support ENABLE_I2C="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if i2c(DS2482-x00) is enabled" >&5 $as_echo_n "checking if i2c(DS2482-x00) is enabled... " >&6; } # Check whether --enable-i2c was given. if test "${enable_i2c+set}" = set; then : enableval=$enable_i2c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_I2C="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_I2C}" = "true"; then ENABLE_I2C_TRUE= ENABLE_I2C_FALSE='#' else ENABLE_I2C_TRUE='#' ENABLE_I2C_FALSE= fi # Check for W1 (linux kernel module) ENABLE_W1="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if W1 is enabled" >&5 $as_echo_n "checking if W1 is enabled... " >&6; } # Check whether --enable-w1 was given. if test "${enable_w1+set}" = set; then : enableval=$enable_w1; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_W1="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_W1}" = "true"; then ENABLE_W1_TRUE= ENABLE_W1_FALSE='#' else ENABLE_W1_TRUE='#' ENABLE_W1_FALSE= fi # Check if the modules are enabled #Check owhttpd ENABLE_OWHTTPD="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owhttpd is enabled" >&5 $as_echo_n "checking if owhttpd is enabled... " >&6; } # Check whether --enable-owhttpd was given. if test "${enable_owhttpd+set}" = set; then : enableval=$enable_owhttpd; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_OWHTTPD="false" else ENABLE_OWLIB="true" fi else ENABLE_OWLIB="true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWHTTPD}" = "true"; then ENABLE_OWHTTPD_TRUE= ENABLE_OWHTTPD_FALSE='#' else ENABLE_OWHTTPD_TRUE='#' ENABLE_OWHTTPD_FALSE= fi #Check owftpd ENABLE_OWFTPD="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owftpd is enabled" >&5 $as_echo_n "checking if owftpd is enabled... " >&6; } # Check whether --enable-owftpd was given. if test "${enable_owftpd+set}" = set; then : enableval=$enable_owftpd; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_OWFTPD="false" else # if test ! "${ENABLE_MT}" = "true" ; then # AC_MSG_ERROR([owftpd needs multithreading]) # fi ENABLE_OWLIB="true" fi else if test "${ENABLE_MT}" = "true" ; then ENABLE_OWLIB="true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } else ENABLE_OWFTPD="false" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (multithreading needed)" >&5 $as_echo "no (multithreading needed)" >&6; } fi fi if test "${ENABLE_OWFTPD}" = "true"; then ENABLE_OWFTPD_TRUE= ENABLE_OWFTPD_FALSE='#' else ENABLE_OWFTPD_TRUE='#' ENABLE_OWFTPD_FALSE= fi #Check owserver { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owserver is enabled" >&5 $as_echo_n "checking if owserver is enabled... " >&6; } ENABLE_OWSERVER="true" # Check whether --enable-owserver was given. if test "${enable_owserver+set}" = set; then : enableval=$enable_owserver; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_OWSERVER="false" else ENABLE_OWLIB="true" fi else ENABLE_OWLIB="true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWSERVER}" = "true"; then ENABLE_OWSERVER_TRUE= ENABLE_OWSERVER_FALSE='#' else ENABLE_OWSERVER_TRUE='#' ENABLE_OWSERVER_FALSE= fi #Check owexternal { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owexternal is enabled" >&5 $as_echo_n "checking if owexternal is enabled... " >&6; } ENABLE_OWEXTERNAL="true" # Check whether --enable-owexternal was given. if test "${enable_owexternal+set}" = set; then : enableval=$enable_owexternal; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_OWEXTERNAL="false" else ENABLE_OWLIB="true" fi else ENABLE_OWLIB="true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWEXTERNAL}" = "true"; then ENABLE_OWEXTERNAL_TRUE= ENABLE_OWEXTERNAL_FALSE='#' else ENABLE_OWEXTERNAL_TRUE='#' ENABLE_OWEXTERNAL_FALSE= fi #Check ownet ENABLE_OWNET="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ownet is enabled" >&5 $as_echo_n "checking if ownet is enabled... " >&6; } # Check whether --enable-ownet was given. if test "${enable_ownet+set}" = set; then : enableval=$enable_ownet; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_OWNET="false" else ENABLE_OWLIB="true" fi else ENABLE_OWLIB="true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWNET}" = "true"; then ENABLE_OWNET_TRUE= ENABLE_OWNET_FALSE='#' else ENABLE_OWNET_TRUE='#' ENABLE_OWNET_FALSE= fi #Check owtap ENABLE_OWTAP="true" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owtap is enabled" >&5 $as_echo_n "checking if owtap is enabled... " >&6; } # Check whether --enable-owtap was given. if test "${enable_owtap+set}" = set; then : enableval=$enable_owtap; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_OWTAP="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWTAP}" = "true"; then ENABLE_OWTAP_TRUE= ENABLE_OWTAP_FALSE='#' else ENABLE_OWTAP_TRUE='#' ENABLE_OWTAP_FALSE= fi #Check owmalloc (special memory allocation routines) ENABLE_OWMALLOC="false" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owmalloc is enabled" >&5 $as_echo_n "checking if owmalloc is enabled... " >&6; } # Check whether --enable-owmalloc was given. if test "${enable_owmalloc+set}" = set; then : enableval=$enable_owmalloc; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test "$enableval" = "yes" ; then ENABLE_OWMALLOC="true" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 $as_echo "no (default)" >&6; } fi if test "${ENABLE_OWMALLOC}" = "true"; then ENABLE_OWMALLOC_TRUE= ENABLE_OWMALLOC_FALSE='#' else ENABLE_OWMALLOC_TRUE='#' ENABLE_OWMALLOC_FALSE= fi #Check owmon { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owmon is enabled" >&5 $as_echo_n "checking if owmon is enabled... " >&6; } ENABLE_OWMON="true" # Check whether --enable-owmon was given. if test "${enable_owmon+set}" = set; then : enableval=$enable_owmon; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_OWMON="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWMON}" = "true"; then ENABLE_OWMON_TRUE= ENABLE_OWMON_FALSE='#' else ENABLE_OWMON_TRUE='#' ENABLE_OWMON_FALSE= fi #Check owcapi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owcapi is enabled" >&5 $as_echo_n "checking if owcapi is enabled... " >&6; } ENABLE_OWCAPI="true" # Check whether --enable-owcapi was given. if test "${enable_owcapi+set}" = set; then : enableval=$enable_owcapi; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_OWCAPI="false" else ENABLE_OWLIB="true" fi else ENABLE_OWLIB="true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWCAPI}" = "true"; then ENABLE_OWCAPI_TRUE= ENABLE_OWCAPI_FALSE='#' else ENABLE_OWCAPI_TRUE='#' ENABLE_OWCAPI_FALSE= fi #Check swig { $as_echo "$as_me:${as_lineno-$LINENO}: checking if swig is enabled" >&5 $as_echo_n "checking if swig is enabled... " >&6; } if test -z "$SWIG" ; then ENABLE_SWIG="false" else ENABLE_SWIG="auto" fi # Check whether --enable-swig was given. if test "${enable_swig+set}" = set; then : enableval=$enable_swig; if test "$enableval" = "no"; then ENABLE_SWIG="false" SWIG="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else if test -z "$SWIG"; then as_fn_error $? "Swig is not found and could not be enabled" "$LINENO" 5 fi ENABLE_OWLIB="true" ENABLE_SWIG="true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto (default)" >&5 $as_echo "auto (default)" >&6; } fi if test "${HAVE_CYGWIN}" = "true"; then if test ! "$ENABLE_SWIG" = "true"; then ENABLE_SWIG="false" SWIG="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: (Disable swig by default in Cygwin)" >&5 $as_echo "(Disable swig by default in Cygwin)" >&6; } fi else if test "$ENABLE_SWIG" = "auto"; then ENABLE_SWIG="true" fi fi if test "${ENABLE_SWIG}" = "true"; then ENABLE_SWIG_TRUE= ENABLE_SWIG_FALSE='#' else ENABLE_SWIG_TRUE='#' ENABLE_SWIG_FALSE= fi #Check owperl { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owperl is enabled" >&5 $as_echo_n "checking if owperl is enabled... " >&6; } ENABLE_OWPERL="true" # Check whether --enable-owperl was given. if test "${enable_owperl+set}" = set; then : enableval=$enable_owperl; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_OWPERL="false" else if test -z "$SWIG" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find swig program. Look for it at http://www.swig.org or use CPAN" >&5 $as_echo "$as_me: WARNING: Cannot find swig program. Look for it at http://www.swig.org or use CPAN" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPERL is disabled because swig is not found" >&5 $as_echo "$as_me: WARNING: OWPERL is disabled because swig is not found" >&2;} ENABLE_OWPERL="false" fi fi else if test -z "$SWIG" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (swig disabled)" >&5 $as_echo "no (swig disabled)" >&6; } ENABLE_OWPERL="false" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi fi PERL="" if test "${ENABLE_OWPERL}" = "true"; then #---------------------------------------------------------------- # Look for Perl5 # $Id$ #---------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Looking for location of Perl executable" >&5 $as_echo "Looking for location of Perl executable" >&6; } PERLBIN= # Check whether --with-perl5 was given. if test "${with_perl5+set}" = set; then : withval=$with_perl5; PERLBIN="$withval" else PERLBIN=yes fi # First, check for "--without-perl5" or "--with-perl5=no". if test x"${PERLBIN}" = xno -o x"${with_alllang}" = xno ; then { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Perl5" >&5 $as_echo "$as_me: Disabling Perl5" >&6;} else # First figure out what the name of Perl5 is if test "x$PERLBIN" = xyes; then for ac_prog in perl perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl 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_PERL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # 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_PERL="$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 PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PERL" && break done else PERL="$PERLBIN" fi # This could probably be simplified as for all platforms and all versions of Perl the following apparently should be run to get the compilation options: # perl -MExtUtils::Embed -e ccopts { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl5 header files" >&5 $as_echo_n "checking for Perl5 header files... " >&6; } if test -n "$PERL"; then PERL=`(which $PERL) 2>/dev/null` # Make it possible to force a directory during cross-compilation if test -z "$PERL5DIR"; then PERL5DIR=`($PERL -e 'use Config; print $Config{archlib}, "\n";') 2>/dev/null` fi if test -n "$PERL5DIR"; then dirs="$PERL5DIR $PERL5DIR/CORE" PERL5EXT=none for i in $dirs; do if test -r $i/perl.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 $as_echo "$i" >&6; } PERL5EXT="$i" break; fi done if test "$PERL5EXT" = none; then PERL5EXT="$PERL5DIR/CORE" { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not locate perl.h...using $PERL5EXT" >&5 $as_echo "could not locate perl.h...using $PERL5EXT" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl5 library" >&5 $as_echo_n "checking for Perl5 library... " >&6; } PERL5NAME=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; print $_, "\n"') 2>/dev/null` if test "$PERL5NAME" = "" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL5NAME" >&5 $as_echo "$PERL5NAME" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl5 compiler options" >&5 $as_echo_n "checking for Perl5 compiler options... " >&6; } PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}, "\n"' | sed "s/-I/$ISYSTEM/") 2>/dev/null` if test "$PERL5CCFLAGS" = "" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL5CCFLAGS" >&5 $as_echo "$PERL5CCFLAGS" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: unable to determine perl5 configuration" >&5 $as_echo "unable to determine perl5 configuration" >&6; } PERL5EXT=$PERL5DIR fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not figure out how to run perl5" >&5 $as_echo "could not figure out how to run perl5" >&6; } fi # Cygwin (Windows) needs the library for dynamic linking case $host in *-*-cygwin* | *-*-mingw*) PERL5DYNAMICLINKING="-L$PERL5EXT -l$PERL5NAME";; *)PERL5DYNAMICLINKING="";; esac fi if test -z "${PERL}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find perl binary." >&5 $as_echo "$as_me: WARNING: Cannot find perl binary." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPERL is disabled because perl binary is not found" >&5 $as_echo "$as_me: WARNING: OWPERL is disabled because perl binary is not found" >&2;} ENABLE_OWPERL="false" else if test -z "${PERL5NAME}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find perl library. Install perl-devel package." >&5 $as_echo "$as_me: WARNING: Cannot find perl library. Install perl-devel package." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPERL is disabled because perl library is not found" >&5 $as_echo "$as_me: WARNING: OWPERL is disabled because perl library is not found" >&2;} ENABLE_OWPERL="false" fi fi fi if test "${ENABLE_OWPERL}" = "true"; then ENABLE_OWPERL_TRUE= ENABLE_OWPERL_FALSE='#' else ENABLE_OWPERL_TRUE='#' ENABLE_OWPERL_FALSE= fi if test -z "$PERL" ; then ENABLE_PERL="false" else ENABLE_PERL="true" fi if test "${ENABLE_PERL}" = "true"; then ENABLE_PERL_TRUE= ENABLE_PERL_FALSE='#' else ENABLE_PERL_TRUE='#' ENABLE_PERL_FALSE= fi #Check owphp { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owphp is enabled" >&5 $as_echo_n "checking if owphp is enabled... " >&6; } ENABLE_OWPHP="true" # Check whether --enable-owphp was given. if test "${enable_owphp+set}" = set; then : enableval=$enable_owphp; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test "$enableval" = "no" ; then ENABLE_OWPHP="false" fi if test "$enableval" = "yes" ; then ENABLE_OWPHP="true" fi if test -z "$SWIG" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find swig program. Look for it at http://www.swig.org or use CPAN" >&5 $as_echo "$as_me: WARNING: Cannot find swig program. Look for it at http://www.swig.org or use CPAN" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPHP is disabled because swig is not found" >&5 $as_echo "$as_me: WARNING: OWPHP is disabled because swig is not found" >&2;} ENABLE_OWPHP="false" fi else if test -z "$SWIG" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (swig disabled)" >&5 $as_echo "no (swig disabled)" >&6; } ENABLE_OWPHP="false" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi fi PHP="" if test "${ENABLE_OWPHP}" = "true" ; then #------------------------------------------------------------------------- # Look for Php5 or Php4 #------------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Looking for location of Php executable" >&5 $as_echo "Looking for location of Php executable" >&6; } PHP4BIN= #AC_ARG_WITH(php4, AS_HELP_STRING([--without-php4], [Disable PHP4]) #AS_HELP_STRING([--with-php4=path], [Set location of PHP4 executable]),[ PHP4BIN="$withval"], [PHP4BIN=yes]) # Check whether --with-php was given. if test "${with_php+set}" = set; then : withval=$with_php; PHPBIN="$withval" else PHPBIN=yes fi # Check whether --with-phpconfig was given. if test "${with_phpconfig+set}" = set; then : withval=$with_phpconfig; PHPCONFIGBIN="$withval" else PHPCONFIGBIN=yes fi # First, check for "--without-php" or "--with-php=no". if test x"${PHPBIN}" = xno -o x"${with_alllang}" = xno ; then { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling PHP" >&5 $as_echo "$as_me: Disabling PHP" >&6;} else if test "x$PHPBIN" = xyes; then for ac_prog in php php5 php4 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_PHP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PHP"; then ac_cv_prog_PHP="$PHP" # 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_PHP="$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 PHP=$ac_cv_prog_PHP if test -n "$PHP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP" >&5 $as_echo "$PHP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PHP" && break done else PHP="$PHPBIN" fi if test "x$PHPCONFIGBIN" = xyes; then for ac_prog in php-config php5-config php-config5 php4-config php-config4 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_PHPCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PHPCONFIG"; then ac_cv_prog_PHPCONFIG="$PHPCONFIG" # 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_PHPCONFIG="$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 PHPCONFIG=$ac_cv_prog_PHPCONFIG if test -n "$PHPCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHPCONFIG" >&5 $as_echo "$PHPCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PHPCONFIG" && break done else PHPCONFIG="$PHPCONFIGBIN" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PHP header files" >&5 $as_echo_n "checking for PHP header files... " >&6; } PHPINC="`$PHPCONFIG --includes 2>/dev/null`" if test "$PHPINC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHPINC" >&5 $as_echo "$PHPINC" >&6; } else dirs="/usr/include/php /usr/local/include/php /usr/include/php5 /usr/local/include/php5 /usr/include/php4 /usr/local/include/php4 /usr/local/apache/php" for i in $dirs; do echo $i if test -r $i/main/php_config.h -o -r $i/main/php_version.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i is found" >&5 $as_echo "$i is found" >&6; } PHPEXT="$i" PHPINC="-I$PHPEXT -I$PHPEXT/main -I$PHPEXT/TSRM -I$PHPEXT/Zend" break; fi done fi if test -z "$PHPINC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PHP extension-dir" >&5 $as_echo_n "checking for PHP extension-dir... " >&6; } PHPLIBDIR="`$PHPCONFIG --extension-dir 2>/dev/null`" if test ! -z "$PHPLIBDIR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHPLIBDIR" >&5 $as_echo "$PHPLIBDIR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } fi fi if test -z "${PHP}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find php binary. Install php or php5 package" >&5 $as_echo "$as_me: WARNING: Cannot find php binary. Install php or php5 package" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPHP is disabled because php binary is not found" >&5 $as_echo "$as_me: WARNING: OWPHP is disabled because php binary is not found" >&2;} ENABLE_OWPHP="false" else if test -z "${PHPCONFIG}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find php-config binary. Install php-devel or php5-dev package" >&5 $as_echo "$as_me: WARNING: Cannot find php-config binary. Install php-devel or php5-dev package" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: include and library paths will be guessed" >&5 $as_echo "$as_me: WARNING: include and library paths will be guessed" >&2;} fi if test -z "${PHPINC}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find php include-file. Install php-devel or php5-dev package" >&5 $as_echo "$as_me: WARNING: Cannot find php include-file. Install php-devel or php5-dev package" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPHP is disabled because php include-file is not found" >&5 $as_echo "$as_me: WARNING: OWPHP is disabled because php include-file is not found" >&2;} ENABLE_OWPHP="false" else if test -z "${PHPLIBDIR}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find php extension-dir. Install php-devel or php5-dev package" >&5 $as_echo "$as_me: WARNING: Cannot find php extension-dir. Install php-devel or php5-dev package" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPHP is disabled because php extension-dir is not found" >&5 $as_echo "$as_me: WARNING: OWPHP is disabled because php extension-dir is not found" >&2;} ENABLE_OWPHP="false" fi fi fi fi if test "${ENABLE_OWPHP}" = "true"; then ENABLE_OWPHP_TRUE= ENABLE_OWPHP_FALSE='#' else ENABLE_OWPHP_TRUE='#' ENABLE_OWPHP_FALSE= fi if test -z "$PHP" ; then ENABLE_PHP="false" else ENABLE_PHP="true" fi if test "${ENABLE_PHP}" = "true"; then ENABLE_PHP_TRUE= ENABLE_PHP_FALSE='#' else ENABLE_PHP_TRUE='#' ENABLE_PHP_FALSE= fi #Check owpython { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owpython is enabled" >&5 $as_echo_n "checking if owpython is enabled... " >&6; } ENABLE_OWPYTHON="true" # Check whether --enable-owpython was given. if test "${enable_owpython+set}" = set; then : enableval=$enable_owpython; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test "$enableval" = "no" ; then ENABLE_OWPYTHON="false" fi if test "$enableval" = "yes" ; then ENABLE_OWPYTHON="true" if test -z "$SWIG" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find swig program. Look for it at http://www.swig.org or use CPAN" >&5 $as_echo "$as_me: WARNING: Cannot find swig program. Look for it at http://www.swig.org or use CPAN" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPYTHON is disabled because swig is not found" >&5 $as_echo "$as_me: WARNING: OWPYTHON is disabled because swig is not found" >&2;} ENABLE_OWPYTHON="false" fi fi else if test -z "$SWIG" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (swig disabled)" >&5 $as_echo "no (swig disabled)" >&6; } ENABLE_OWPYTHON="false" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi fi PYTHON="" if test "${ENABLE_OWPYTHON}" = "true" ; then #------------------------------------------------------------------------ # SC_PATH_PYTHONCONFIG -- # # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-pythonconfig=... # --with-python=... # # Defines the following vars: # #------------------------------------------------------------------------ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Looking for location of Python executable" >&5 $as_echo "Looking for location of Python executable" >&6; } #---------------------------------------------------------------- # Look for Python #---------------------------------------------------------------- PYCFLAGS= PYLDFLAGS= PYLIB= PYVERSION= PYSITEDIR= # Check whether --with-python was given. if test "${with_python+set}" = set; then : withval=$with_python; PYBIN="$withval" else PYBIN=yes fi # Check whether --with-pythonconfig was given. if test "${with_pythonconfig+set}" = set; then : withval=$with_pythonconfig; PYTHONCONFIGBIN="$withval" else PYTHONCONFIGBIN=yes fi if test "x$PYTHONCONFIGBIN" = xyes; then for ac_prog in python-config python2.7-config python2.5-config python2.4-config python2.3-config 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_PYTHONCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHONCONFIG"; then ac_cv_prog_PYTHONCONFIG="$PYTHONCONFIG" # 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_PYTHONCONFIG="$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 PYTHONCONFIG=$ac_cv_prog_PYTHONCONFIG if test -n "$PYTHONCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONCONFIG" >&5 $as_echo "$PYTHONCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHONCONFIG" && break done else PYTHONCONFIG="$PYTHONCONFIGBIN" fi # First, check for "--without-python" or "--with-python=no". if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Python" >&5 $as_echo "$as_me: Disabling Python" >&6;} else # First figure out the name of the Python executable if test "x$PYBIN" = xyes; then for ac_prog in python python2.7 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4 python 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_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON"; then ac_cv_prog_PYTHON="$PYTHON" # 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_PYTHON="$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 PYTHON=$ac_cv_prog_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYTHON" && break done else PYTHON="$PYBIN" fi if test ! -z "$PYTHONCONFIG"; then # python-config available. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python cflags" >&5 $as_echo_n "checking for Python cflags... " >&6; } PYTHONCFLAGS="`$PYTHONCONFIG --cflags 2>/dev/null`" if test -z "$PYTHONCFLAGS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONCFLAGS" >&5 $as_echo "$PYTHONCFLAGS" >&6; } fi PYCFLAGS=$PYTHONCFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python ldflags" >&5 $as_echo_n "checking for Python ldflags... " >&6; } PYTHONLDFLAGS="`$PYTHONCONFIG --ldflags 2>/dev/null`" if test -z "$PYTHONLDFLAGS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONLDFLAGS" >&5 $as_echo "$PYTHONLDFLAGS" >&6; } fi PYLDFLAGS=$PYTHONLDFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python libs" >&5 $as_echo_n "checking for Python libs... " >&6; } PYTHONLIBS="`$PYTHONCONFIG --libs 2>/dev/null`" if test -z "$PYTHONLIBS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONLIBS" >&5 $as_echo "$PYTHONLIBS" >&6; } fi PYLIB="$PYTHONLIBS" # Need to do this hack since autoconf replaces __file__ with the name of the configure file filehack="file__" PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYVERSION" >&5 $as_echo "$PYVERSION" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python exec-prefix" >&5 $as_echo_n "checking for Python exec-prefix... " >&6; } PYTHONEPREFIX="`$PYTHONCONFIG --exec-prefix 2>/dev/null`" if test -z "$PYTHONEPREFIX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONEPREFIX" >&5 $as_echo "$PYTHONEPREFIX" >&6; } fi PYEPREFIX="$PYTHONEPREFIX" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python site-dir" >&5 $as_echo_n "checking for Python site-dir... " >&6; } #This seem to be the site-packages dir where files are installed. PYSITEDIR=`($PYTHON -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=1)") 2>/dev/null` if test -z "$PYSITEDIR"; then # I'm not really sure if it should be installed at /usr/lib64... if test -d "$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/site-packages"; then PYSITEDIR="$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/site-packages" else if test -d "$PYEPREFIX/lib/$PYVERSION/site-packages"; then PYSITEDIR="$PYEPREFIX/lib/$PYVERSION/site-packages" fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYSITEDIR" >&5 $as_echo "$PYSITEDIR" >&6; } else # python-config not available. if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python prefix" >&5 $as_echo_n "checking for Python prefix... " >&6; } PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYPREFIX" >&5 $as_echo "$PYPREFIX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python exec-prefix" >&5 $as_echo_n "checking for Python exec-prefix... " >&6; } PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYEPREFIX" >&5 $as_echo "$PYEPREFIX" >&6; } # Note: I could not think of a standard way to get the version string from different versions. # This trick pulls it out of the file location for a standard library file. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python version" >&5 $as_echo_n "checking for Python version... " >&6; } # Need to do this hack since autoconf replaces __file__ with the name of the configure file filehack="file__" PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYVERSION" >&5 $as_echo "$PYVERSION" >&6; } # Find the directory for libraries this is necessary to deal with # platforms that can have apps built for multiple archs: e.g. x86_64 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python lib dir" >&5 $as_echo_n "checking for Python lib dir... " >&6; } PYLIBDIR=`($PYTHON -c "import sys; print sys.lib") 2>/dev/null` if test -z "$PYLIBDIR"; then # older versions don't have sys.lib so the best we can do is assume lib #PYLIBDIR="lib$LIBPOSTFIX" if test -r $PYPREFIX/include/$PYVERSION/Python.h; then if test -d "$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/config"; then PYLIBDIR="lib$LIBPOSTFIX" else if test -d "$PYEPREFIX/lib/$PYVERSION/config"; then # for some reason a 64bit system could have libs installed at lib PYLIBDIR="lib" else # I doubt this will work PYLIBDIR="lib$LIBPOSTFIX" fi fi else # probably very old installation... PYLIBDIR="lib" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYLIBDIR" >&5 $as_echo "$PYLIBDIR" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python site-dir" >&5 $as_echo_n "checking for Python site-dir... " >&6; } PYSITEDIR=`($PYTHON -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=1)") 2>/dev/null` if test -z "$PYSITEDIR"; then # I'm not really sure if it should be installed at /usr/lib64... if test -d "$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/site-packages"; then PYSITEDIR="$PYEPREFIX/lib$LIBPOSTFIX/$PYVERSION/site-packages" else if test -d "$PYEPREFIX/lib/$PYVERSION/site-packages"; then PYSITEDIR="$PYEPREFIX/lib/$PYVERSION/site-packages" fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYSITEDIR" >&5 $as_echo "$PYSITEDIR" >&6; } # Set the include directory { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python header files" >&5 $as_echo_n "checking for Python header files... " >&6; } if test -r $PYPREFIX/include/$PYVERSION/Python.h; then PYCFLAGS="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config" fi if test -z "$PYCFLAGS"; then if test -r $PYPREFIX/include/Py/Python.h; then PYCFLAGS="-I$PYPREFIX/include/Py -I$PYEPREFIX/$PYLIBDIR/python/lib" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYCFLAGS" >&5 $as_echo "$PYCFLAGS" >&6; } # Set the library directory blindly. This probably won't work with older versions { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library" >&5 $as_echo_n "checking for Python library... " >&6; } dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR" for i in $dirs; do if test -d $PYEPREFIX/$PYLIBDIR/$i; then PYLIB="$PYEPREFIX/$PYLIBDIR/$i" break fi done if test -z "$PYLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5 $as_echo "Not found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYLIB" >&5 $as_echo "$PYLIB" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python LDFLAGS" >&5 $as_echo_n "checking for Python LDFLAGS... " >&6; } # Check for really old versions if test -r $PYLIB/libPython.a; then PYLINK="-lModules -lPython -lObjects -lParser" else if test ! -r $PYLIB/lib$PYVERSION.so -a -r $PYLIB/lib$PYVERSION.a ; then # python2.2 on FC1 need this PYLINK="$PYLIB/lib$PYVERSION.a" else PYLINK="-l$PYVERSION" fi fi PYLDFLAGS="$PYLINK" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYLDFLAGS" >&5 $as_echo "$PYLDFLAGS" >&6; } fi fi # Cygwin (Windows) needs the library for dynamic linking case $host in *-*-cygwin* | *-*-mingw*) PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK" DEFS="-DUSE_DL_IMPORT $DEFS" PYCFLAGS="$PYCFLAGS" ;; *)PYTHONDYNAMICLINKING="";; esac fi if test -z "${PYTHON}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find python binary. Install python package." >&5 $as_echo "$as_me: WARNING: Cannot find python binary. Install python package." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPYTHON is disabled because python binary is not found" >&5 $as_echo "$as_me: WARNING: OWPYTHON is disabled because python binary is not found" >&2;} ENABLE_OWPYTHON="false" else if test -z "${PYLDFLAGS}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find python library. Install python-devel package." >&5 $as_echo "$as_me: WARNING: Cannot find python library. Install python-devel package." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPYTHON is disabled because python library is not found" >&5 $as_echo "$as_me: WARNING: OWPYTHON is disabled because python library is not found" >&2;} ENABLE_OWPYTHON="false" else if test -z "${PYCFLAGS}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find python include-file. Install python-devel package." >&5 $as_echo "$as_me: WARNING: Cannot find python include-file. Install python-devel package." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWPYTHON is disabled because python include-file is not found" >&5 $as_echo "$as_me: WARNING: OWPYTHON is disabled because python include-file is not found" >&2;} ENABLE_OWPYTHON="false" fi fi fi fi if test "${ENABLE_OWPYTHON}" = "true"; then ENABLE_OWPYTHON_TRUE= ENABLE_OWPYTHON_FALSE='#' else ENABLE_OWPYTHON_TRUE='#' ENABLE_OWPYTHON_FALSE= fi if test -z "$PYTHON" ; then ENABLE_PYTHON="false" else ENABLE_PYTHON="true" fi if test "${ENABLE_PYTHON}" = "true"; then ENABLE_PYTHON_TRUE= ENABLE_PYTHON_FALSE='#' else ENABLE_PYTHON_TRUE='#' ENABLE_PYTHON_FALSE= fi #Check owtcl { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owtcl is enabled" >&5 $as_echo_n "checking if owtcl is enabled... " >&6; } ENABLE_OWTCL="true" # Check whether --enable-owtcl was given. if test "${enable_owtcl+set}" = set; then : enableval=$enable_owtcl; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test "$enableval" = "no" ; then ENABLE_OWTCL="false" fi if test "$enableval" = "yes" ; then ENABLE_OWTCL="true" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_OWTCL}" = "true" ; then #------------------------------------------------------------------------ # SC_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ #------------------------------------------------------------------------ # SC_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ #------------------------------------------------------------------------ # SC_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ #------------------------------------------------------------------------ # SC_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ #------------------------------------------------------------------------ # SC_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 #------------------------------------------------------------------------ #------------------------------------------------------------------------ # SC_ENABLE_FRAMEWORK -- # # Allows the building of shared libraries into frameworks # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-framework=yes|no # # Sets the following vars: # FRAMEWORK_BUILD Value of 1 or 0 #------------------------------------------------------------------------ #------------------------------------------------------------------------ # SC_ENABLE_THREADS -- # # Specify if thread support should be enabled. TCL_THREADS is # checked so that if you are compiling an extension against a # threaded core, your extension must be compiled threaded as well. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-threads # # Sets the following vars: # THREADS_LIBS Thread library(s) # # Defines the following vars: # TCL_THREADS # _REENTRANT # _THREAD_SAFE # #------------------------------------------------------------------------ #------------------------------------------------------------------------ # SC_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used. # Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging # can also be enabled. # # Arguments: # none # # Requires the following vars to be set in the Makefile: # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # LDFLAGS_DEBUG # LDFLAGS_OPTIMIZE # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true # Sets to $(CFLAGS_OPTIMIZE) if false # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true # Sets to $(LDFLAGS_OPTIMIZE) if false # DBGX Debug library extension # #------------------------------------------------------------------------ #------------------------------------------------------------------------ # SC_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. # This is only relevant for Unix. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-langinfo=yes|no (default is yes) # # Defines the following vars: # HAVE_LANGINFO Triggers use of nl_langinfo if defined. # #------------------------------------------------------------------------ #-------------------------------------------------------------------- # SC_CONFIG_MANPAGES # # Decide whether to use symlinks for linking the manpages, # whether to compress the manpages after installation, and # whether to add a package name suffix to the installed # manpages to avoidfile name clashes. # If compression is enabled also find out what file name suffix # the given compression program is using. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-man-symlinks # --enable-man-compression=PROG # --enable-man-suffix[=STRING] # # Defines the following variable: # # MAN_FLAGS - The apropriate flags for installManPage # according to the user's selection. # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # Arguments: # none # # Results: # # Defines and substitutes the following vars: # # DL_OBJS - Name of the object file that implements dynamic # loading for Tcl on this system. # DL_LIBS - Library file(s) to include in tclsh and other base # applications in order for the "load" command to work. # LDFLAGS - Flags to pass to the compiler when linking object # files into an executable application binary such # as tclsh. # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. Could # be the same as CC_SEARCH_FLAGS if ${CC} is used to link. # CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. # MAKE_LIB - Command to execute to build the a library; # differs when building shared or static. # MAKE_STUB_LIB - # Command to execute to build a stub library. # INSTALL_LIB - Command to execute to install a library; # differs when building shared or static. # INSTALL_STUB_LIB - # Command to execute to install a stub library. # STLIB_LD - Base command to use for combining object files # into a static library. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components # of a shared library (may request position-independent # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. # SHLIB_LD_FLAGS -Flags to pass when building a shared library. This # differes from the SHLIB_CFLAGS as it is not used # when building object files or executables. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when # creating shared libraries. This symbol typically # goes at the end of the "ld" commands that build # shared libraries. The value of the symbol is # "${LIBS}" if all of the dependent libraries should # be specified when creating a shared library. If # dependent libraries should not be specified (as on # SunOS 4.x, where they cause the link to fail, or in # general if Tcl and Tk aren't themselves shared # libraries), then this symbol has an empty string # as its value. # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable # extensions. An empty string means we don't know how # to use shared libraries on this platform. # TCL_SHLIB_LD_EXTRAS - Additional element which are added to SHLIB_LD_LIBS # TK_SHLIB_LD_EXTRAS for the build of Tcl and Tk, but not recorded in the # tclConfig.sh, since they are only used for the build # of Tcl and Tk. # Examples: MacOS X records the library version and # compatibility version in the shared library. But # of course the Tcl version of this is only used for Tcl. # LIB_SUFFIX - Specifies everything that comes after the "libfoo" # in a static or shared library name, using the $VERSION variable # to put the version in the right place. This is used # by platforms that need non-standard library names. # Examples: ${VERSION}.so.1.1 on NetBSD, since it needs # to have a version after the .so, and ${VERSION}.a # on AIX, since a shared library needs to have # a .a extension whereas shared objects for loadable # extensions have a .so extension. Defaults to # ${VERSION}${SHLIB_SUFFIX}. # TCL_NEEDS_EXP_FILE - # 1 means that an export file is needed to link to a # shared library. # TCL_EXP_FILE - The name of the installed export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # TCL_BUILD_EXP_FILE - # The name of the built export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # CFLAGS_DEBUG - # Flags used when running the compiler in debug mode # CFLAGS_OPTIMIZE - # Flags used when running the compiler in optimize mode # CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_SERIAL_PORT # # Determine which interface to use to talk to the serial port. # Note that #include lines must begin in leftmost column for # some compilers to recognize them as preprocessor directives, # and some build environments have stdin not pointing at a # pseudo-terminal (usually /dev/null instead.) # # Arguments: # none # # Results: # # Defines only one of the following vars: # HAVE_SYS_MODEM_H # USE_TERMIOS # USE_TERMIO # USE_SGTTY # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_MISSING_POSIX_HEADERS # # Supply substitutes for missing POSIX header files. Special # notes: # - stdlib.h doesn't define strtol, strtoul, or # strtod insome versions of SunOS # - some versions of string.h don't declare procedures such # as strstr # # Arguments: # none # # Results: # # Defines some of the following vars: # NO_DIRENT_H # NO_ERRNO_H # NO_VALUES_H # HAVE_LIMITS_H or NO_LIMITS_H # NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_UNISTD_H # HAVE_SYS_PARAM_H # # HAVE_STRING_H ? # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_PATH_X # # Locate the X11 header files and the X11 library archive. Try # the ac_path_x macro first, but if it doesn't find the X stuff # (e.g. because there's no xmkmf program) then check through # a list of possible directories. Under some conditions the # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. # # Arguments: # none # # Results: # # Sets the the following vars: # XINCLUDES # XLIBSW # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_BLOCKING_STYLE # # The statements below check for systems where POSIX-style # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. # On these systems (mostly older ones), use the old BSD-style # FIONBIO approach instead. # # Arguments: # none # # Results: # # Defines some of the following vars: # HAVE_SYS_IOCTL_H # HAVE_SYS_FILIO_H # USE_FIONBIO # O_NONBLOCK # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_TIME_HANLDER # # Checks how the system deals with time.h, what time structures # are used on the system, and what fields the structures have. # # Arguments: # none # # Results: # # Defines some of the following vars: # USE_DELTA_FOR_TZ # HAVE_TM_GMTOFF # HAVE_TM_TZADJ # HAVE_TIMEZONE_VAR # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_BUGGY_STRTOD # # Under Solaris 2.4, strtod returns the wrong value for the # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. # Also, on Compaq's Tru64 Unix 5.0, # strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none # # Results: # # Might defines some of the following vars: # strtod (=fixstrtod) # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm) and socket stuff (-lsocket vs. # -lnsl) are dealt with here. # # Arguments: # Requires the following vars to be set in the Makefile: # DL_LIBS # LIBS # MATH_LIBS # # Results: # # Subst's the following var: # TCL_LIBS # MATH_LIBS # # Might append to the following vars: # LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _LARGEFILE64_SOURCE # #-------------------------------------------------------------------- #-------------------------------------------------------------------- # SC_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # TCL_WIDE_INT_TYPE # HAVE_STRUCT_DIRENT64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Looking for tclConfig.sh" >&5 $as_echo "Looking for tclConfig.sh" >&6; } # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl was given. if test "${with_tcl+set}" = set; then : withval=$with_tcl; with_tclconfig=${withval} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 $as_echo_n "checking for Tcl configuration... " >&6; } if ${ac_cv_c_tclconfig+:} false; then : $as_echo_n "(cached) " >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d ${libdir} 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib${LIBPOSTFIX} 2>/dev/null` \ ../../tcl \ `ls -dr /usr/lib${LIBPOSTFIX}/tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr /usr/lib${LIBPOSTFIX}/tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr /usr/lib${LIBPOSTFIX}/tcl[8-9].[0-9]* 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -dr /usr/lib/tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr /usr/lib/tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr /usr/lib/tcl[8-9].[0-9]* 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then # TCL_BIN_DIR="# no Tcl configs found" TCL_BIN_DIR="" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find Tcl configuration definitions" >&5 $as_echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} # exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 $as_echo "found $TCL_BIN_DIR/tclConfig.sh" >&6; } fi fi if test -z "$TCL_BIN_DIR" -o ! -f "$TCL_BIN_DIR/tclConfig.sh" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWTCL is disabled because tclConfig.sh is not found" >&5 $as_echo "$as_me: WARNING: OWTCL is disabled because tclConfig.sh is not found" >&2;} ENABLE_OWTCL="false" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 $as_echo_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh... " >&6; } if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 $as_echo "loading" >&6; } . $TCL_BIN_DIR/tclConfig.sh else { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 $as_echo "file not found" >&6; } fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" # guess that tcl will install the files under the first path in # TCL_PACKAGE_PATH. TCL_BIN_DIR is usually correct, but this # might contain staging_dir prefix when cross-compiling. OWTCL_INSTALL_PATH="`echo ${TCL_PACKAGE_PATH} | cut -d' ' -f1`" case "${host_cpu}-${host_os}" in *-darwin*) OWTCL_INSTALL_PATH="`echo ${TCL_BIN_DIR} | cut -d' ' -f1`" ;; *) OWTCL_INSTALL_PATH="`echo ${TCL_PACKAGE_PATH} | cut -d' ' -f1`" ;; esac # Debian Hack: do not install in /usr/local/lib/tcltk # OWTCL_INSTALL_PATH="/usr/lib/tcltk" fi fi if test "${ENABLE_OWTCL}" = "true"; then ENABLE_OWTCL_TRUE= ENABLE_OWTCL_FALSE='#' else ENABLE_OWTCL_TRUE='#' ENABLE_OWTCL_FALSE= fi EXP_VAR=LIBDIR FROM_VAR=$libdir prefix_save=$prefix exec_prefix_save=$exec_prefix if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi if test "x$exec_prefix" = "xNONE"; then exec_prefix=$prefix fi full_var="$FROM_VAR" while true; do new_full_var="`eval echo $full_var`" if test "x$new_full_var"="x$full_var"; then break; fi full_var=$new_full_var done full_var=$new_full_var LIBDIR="$full_var" prefix=$prefix_save exec_prefix=$exec_prefix_save EXP_VAR=BINDIR FROM_VAR=$bindir prefix_save=$prefix exec_prefix_save=$exec_prefix if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi if test "x$exec_prefix" = "xNONE"; then exec_prefix=$prefix fi full_var="$FROM_VAR" while true; do new_full_var="`eval echo $full_var`" if test "x$new_full_var"="x$full_var"; then break; fi full_var=$new_full_var done full_var=$new_full_var BINDIR="$full_var" prefix=$prefix_save exec_prefix=$exec_prefix_save EXP_VAR=DATADIR FROM_VAR=$datadir prefix_save=$prefix exec_prefix_save=$exec_prefix if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi if test "x$exec_prefix" = "xNONE"; then exec_prefix=$prefix fi full_var="$FROM_VAR" while true; do new_full_var="`eval echo $full_var`" if test "x$new_full_var"="x$full_var"; then break; fi full_var=$new_full_var done full_var=$new_full_var DATADIR="$full_var" prefix=$prefix_save exec_prefix=$exec_prefix_save EXTRACFLAGS="-D_FILE_OFFSET_BITS=64" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if cflag _XOPEN_SOURCE is required" >&5 $as_echo_n "checking if cflag _XOPEN_SOURCE is required... " >&6; } case "${host_cpu}-${host_os}" in *-aix* | *solaris* | *-osf* | *-hpux*) CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500" EXTRACFLAGS="$EXTRACFLAGS -D_XOPEN_SOURCE=500" { $as_echo "$as_me:${as_lineno-$LINENO}: result: -D_XOPEN_SOURCE=500" >&5 $as_echo "-D_XOPEN_SOURCE=500" >&6; } ;; *-darwin* | *-netbsd*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; *-freebsd* | *) # have to add this to support pthread_rwlock_t CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600" EXTRACFLAGS="$EXTRACFLAGS -D_XOPEN_SOURCE=600" { $as_echo "$as_me:${as_lineno-$LINENO}: result: -D_XOPEN_SOURCE=600" >&5 $as_echo "-D_XOPEN_SOURCE=600" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if cflag _BSD_SOURCE is required" >&5 $as_echo_n "checking if cflag _BSD_SOURCE is required... " >&6; } case "${host_cpu}-${host_os}" in *-netbsd*) CFLAGS="$CFLAGS -D_NETBSD_SOURCE=1" EXTRACFLAGS="$EXTRACFLAGS -D_NETBSD_SOURCE=1" { $as_echo "$as_me:${as_lineno-$LINENO}: result: -D_NETBSD_SOURCE=1" >&5 $as_echo "-D_NETBSD_SOURCE=1" >&6; } ;; *) # have to add -D_BSD_SOURCE=1 to support major() in sys/sysmacros.h # have to add -D_ISOC99_SOURCE=1 to support lrint() in bits/mathcalls.h # have to add -D_POSIX_C_SOURCE=200112L for sem_timedwait # have to add -D_POSIX_C_SOURCE=199309L for clock_gettime() CFLAGS="$CFLAGS -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE" EXTRACFLAGS="$EXTRACFLAGS -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE" { $as_echo "$as_me:${as_lineno-$LINENO}: result: -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE" >&5 $as_echo "-D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE" >&6; } ;; esac # should perhaps add _GNU_SOURCE=1 instead of the two defines above... # That would define _BSD_SOURCE, _SVID_SOURCE, _LARGEFILE64_SOURCE, # _XOPEN_SOURCE=600, _POSIX_C_SOURCE, _POSIX_SOURCE, _ISOC99_SOURCE # Check if extra libs are needed. Should perhaps test if they are available too # instead of hardcoding the libraries. EXTRALIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if extra libs are required" >&5 $as_echo_n "checking if extra libs are required... " >&6; } case "${host_cpu}-${host_os}" in *-darwin*) # This will actually be duplicates if libusb is used. OSLIBS="-Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation" EXTRALIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${OSLIBS}" >&5 $as_echo "${OSLIBS}" >&6; } ;; *-solaris*) OSLIBS="" EXTRALIBS=" -lsocket -lnsl " LIBS="$LIBS -lsocket -lnsl" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${EXTRALIBS}" >&5 $as_echo "${EXTRALIBS}" >&6; } ;; *) OSLIBS="" EXTRALIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${EXTRALIBS}" >&5 $as_echo "${EXTRALIBS}" >&6; } ;; esac #Check for profiling { $as_echo "$as_me:${as_lineno-$LINENO}: checking if profiling is enabled" >&5 $as_echo_n "checking if profiling is enabled... " >&6; } ENABLE_PROFILING="false" # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then : enableval=$enable_profiling; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test "$enableval" = "yes" ; then ENABLE_PROFILING=true EXTRALIBS="$EXTRALIBS -pg" EXTRACFLAGS="$EXTRACFLAGS -pg" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 $as_echo "no (default)" >&6; } fi if test "${ENABLE_PROFILING}" = "true"; then ENABLE_PROFILING_TRUE= ENABLE_PROFILING_FALSE='#' else ENABLE_PROFILING_TRUE='#' ENABLE_PROFILING_FALSE= fi EXP_VAR=LD_EXTRALIBS FROM_VAR=$EXTRALIBS prefix_save=$prefix exec_prefix_save=$exec_prefix if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi if test "x$exec_prefix" = "xNONE"; then exec_prefix=$prefix fi full_var="$FROM_VAR" while true; do new_full_var="`eval echo $full_var`" if test "x$new_full_var"="x$full_var"; then break; fi full_var=$new_full_var done full_var=$new_full_var LD_EXTRALIBS="$full_var" prefix=$prefix_save exec_prefix=$exec_prefix_save { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: LD_EXTRALIBS=${LD_EXTRALIBS} OSLIBS=${OSLIBS}" >&5 $as_echo "$as_me: WARNING: LD_EXTRALIBS=${LD_EXTRALIBS} OSLIBS=${OSLIBS}" >&2;} # Check whether --with-fuseinclude was given. if test "${with_fuseinclude+set}" = set; then : withval=$with_fuseinclude; fuse_include_path=$withval else fuse_include_path='/usr/local/include' fi # Check whether --with-fuselib was given. if test "${with_fuselib+set}" = set; then : withval=$with_fuselib; fuse_lib_path=$withval else fuse_lib_path='/usr/local/lib' fi #Check owfs { $as_echo "$as_me:${as_lineno-$LINENO}: checking if owfs is enabled" >&5 $as_echo_n "checking if owfs is enabled... " >&6; } ENABLE_OWFS="auto" # Check whether --enable-owfs was given. if test "${enable_owfs+set}" = set; then : enableval=$enable_owfs; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test "$enableval" = "yes" ; then ENABLE_OWFS="true" fi if test "$enableval" = "no" ; then ENABLE_OWFS="false" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto (default)" >&5 $as_echo "auto (default)" >&6; } fi # We need fuse only if OWFS is enabled if test "${ENABLE_OWFS}" != "false" ; then save_LD_EXTRALIBS="$LD_EXTRALIBS" save_CPPFLAGS="$CPPFLAGS" save_LDFLAGS="$LDFLAGS" FUSE_FLAGS="-DFUSE_USE_VERSION=26" FUSE_INCLUDES="-I${fuse_include_path}" FUSE_LIBS="-L${fuse_lib_path}" LD_EXTRALIBS="$save_LD_EXTRALIBS " CPPFLAGS="$save_CPPFLAGS -D_FILE_OFFSET_BITS=64 $FUSE_FLAGS $FUSE_INCLUDES" LDFLAGS="$save_LDFLAGS $FUSE_LIBS" ac_fn_c_check_header_mongrel "$LINENO" "fuse.h" "ac_cv_header_fuse_h" "$ac_includes_default" if test "x$ac_cv_header_fuse_h" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find fuse.h - Add the search path with --with-fuseinclude" >&5 $as_echo "$as_me: WARNING: Cannot find fuse.h - Add the search path with --with-fuseinclude" >&2;} FUSE_FLAGS="" FUSE_INCLUDES="" FUSE_LIBS="" LD_EXTRALIBS="$save_LD_EXTRALIBS" CPPFLAGS="$save_CPPFLAGS -D_FILE_OFFSET_BITS=64" LDFLAGS="$save_LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Install FUSE-2.2 or later to enable owfs - download it from http://fuse.sourceforge.net/" >&5 $as_echo "$as_me: WARNING: Install FUSE-2.2 or later to enable owfs - download it from http://fuse.sourceforge.net/" >&2;} if test "${ENABLE_OWFS}" = "auto"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWFS is disabled because fuse.h is not found." >&5 $as_echo "$as_me: WARNING: OWFS is disabled because fuse.h is not found." >&2;} ENABLE_OWFS="false" else as_fn_error $? "Configure without --enable-owfs to detect fuse automatically." "$LINENO" 5 fi fi if test "${ENABLE_OWFS}" != "false"; then save_CFLAGS="$CFLAGS" save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$LIBS $PTHREAD_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_main in -lfuse" >&5 $as_echo_n "checking for fuse_main in -lfuse... " >&6; } if ${ac_cv_lib_fuse_fuse_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $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 fuse_main (); int main () { return fuse_main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fuse_fuse_main=yes else ac_cv_lib_fuse_fuse_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_fuse_fuse_main" >&5 $as_echo "$ac_cv_lib_fuse_fuse_main" >&6; } if test "x$ac_cv_lib_fuse_fuse_main" = xyes; then : FUSE_LIBS="$FUSE_LIBS -lfuse" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libfuse.a - add the search path with --with-fuselib" >&5 $as_echo "$as_me: WARNING: Cannot find libfuse.a - add the search path with --with-fuselib" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Running ldconfig or adding \"/usr/local/lib\" to /etc/ld.so.conf might also solve the problem, otherwise re-install fuse." >&5 $as_echo "$as_me: WARNING: Running ldconfig or adding \"/usr/local/lib\" to /etc/ld.so.conf might also solve the problem, otherwise re-install fuse." >&2;} if test "${ENABLE_OWFS}" = "auto"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWFS is disabled because libfuse.a is not found." >&5 $as_echo "$as_me: WARNING: OWFS is disabled because libfuse.a is not found." >&2;} ENABLE_OWFS="false" else as_fn_error $? "Cannot enable OWFS" "$LINENO" 5 fi fi CFLAGS="$save_CFLAGS" LIBS="$save_LIBS" fi if test "${ENABLE_OWFS}" != "false"; then # check for a supported FUSE_MAJOR_VERSION. { $as_echo "$as_me:${as_lineno-$LINENO}: checking For supported FUSE API version" >&5 $as_echo_n "checking For supported FUSE API version... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef FUSE_MAJOR_VERSION #error "FUSE_MAJOR_VERSION not defined" #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; 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" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OWFS is disabled since fuse.h is too old" >&5 $as_echo "$as_me: WARNING: OWFS is disabled since fuse.h is too old" >&2;} if test "${ENABLE_OWFS}" = "true"; then as_fn_error $? "You have to install fuse first (fuse-2.2 or later recommended) - download it from http://fuse.sourceforge.net/" "$LINENO" 5 else ENABLE_OWFS="false" fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # Use newest FUSE API if version is newer than 2.2 if test "${ENABLE_OWFS}" != "false"; then # check for a supported FUSE_MAJOR_VERSION. { $as_echo "$as_me:${as_lineno-$LINENO}: checking For FUSE version " >&5 $as_echo_n "checking For FUSE version ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef FUSE_VERSION #ifndef FUSE_MAJOR_VERSION #define FUSE_VERSION 11 #else /* FUSE_MAJOR_VERSION */ #undef FUSE_MAKE_VERSION #define FUSE_MAKE_VERSION(maj,min) ((maj) * 10 + (min)) #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION,FUSE_MINOR_VERSION) #endif /* FUSE_MAJOR_VERSION */ #endif /* FUSE_VERSION */ #if (FUSE_VERSION >= 22) /* Fuse > 2.2 is ok */ #else #error "Fuse < 2.2" #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.2 or later" >&5 $as_echo "2.2 or later" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: <2.2" >&5 $as_echo "<2.2" >&6; } FUSE_FLAGS="" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LD_EXTRALIBS="$save_LD_EXTRALIBS" if test "${ENABLE_OWFS}" != "false"; then ENABLE_OWLIB="true" ENABLE_OWFS="true" fi else ENABLE_OWFS="false" fi if test "${ENABLE_OWFS}" = "true"; then ENABLE_OWFS_TRUE= ENABLE_OWFS_FALSE='#' else ENABLE_OWFS_TRUE='#' ENABLE_OWFS_FALSE= fi # Check if the zeroconf/bonjour is enabled. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if zeroconf/bonjour is enabled" >&5 $as_echo_n "checking if zeroconf/bonjour is enabled... " >&6; } ENABLE_ZERO="true" # Check whether --enable-zero was given. if test "${enable_zero+set}" = set; then : enableval=$enable_zero; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if test ! "$enableval" = "yes" ; then ENABLE_ZERO=false fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi if test "${ENABLE_ZERO}" = "true"; then ENABLE_ZERO_TRUE= ENABLE_ZERO_FALSE='#' else ENABLE_ZERO_TRUE='#' ENABLE_ZERO_FALSE= fi LIBUSB_CFLAGS="" LIBUSB_LIBS="" # Check for USB enabled ENABLE_USB=auto { $as_echo "$as_me:${as_lineno-$LINENO}: checking if usb support is enabled" >&5 $as_echo_n "checking if usb support is enabled... " >&6; } # Check whether --enable-usb was given. if test "${enable_usb+set}" = set; then : enableval=$enable_usb; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_USB=false fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto (default)" >&5 $as_echo "auto (default)" >&6; } fi if test "${ENABLE_USB}" != "false"; then #LIBUSB_CONFIG pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUSB" >&5 $as_echo_n "checking for LIBUSB... " >&6; } if test -n "$LIBUSB_CFLAGS"; then pkg_cv_LIBUSB_CFLAGS="$LIBUSB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb-1.0 >= 0.9.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "libusb-1.0 >= 0.9.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUSB_CFLAGS=`$PKG_CONFIG --cflags "libusb-1.0 >= 0.9.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBUSB_LIBS"; then pkg_cv_LIBUSB_LIBS="$LIBUSB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb-1.0 >= 0.9.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "libusb-1.0 >= 0.9.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUSB_LIBS=`$PKG_CONFIG --libs "libusb-1.0 >= 0.9.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBUSB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libusb-1.0 >= 0.9.1" 2>&1` else LIBUSB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libusb-1.0 >= 0.9.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBUSB_PKG_ERRORS" >&5 ENABLE_USB=false elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ENABLE_USB=false else LIBUSB_CFLAGS=$pkg_cv_LIBUSB_CFLAGS LIBUSB_LIBS=$pkg_cv_LIBUSB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ENABLE_USB=true fi fi if test "${ENABLE_USB}" = "true"; then ENABLE_USB_TRUE= ENABLE_USB_FALSE='#' else ENABLE_USB_TRUE='#' ENABLE_USB_FALSE= fi AM_CPPFLAGS="$AM_CPPFLAGS $LIBUSB_CFLAGS" # Check for Avahi enabled ENABLE_AVAHI=auto { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Avahi support is enabled" >&5 $as_echo_n "checking if Avahi support is enabled... " >&6; } # Check whether --enable-avahi was given. if test "${enable_avahi+set}" = set; then : enableval=$enable_avahi; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_AVAHI=false fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto (default)" >&5 $as_echo "auto (default)" >&6; } fi if test "${ENABLE_AVAHI}" != "false"; then # Include libavahi if the avahi is enabled if test "X${LIBAVAHI_CONFIG}" != "X" ; then LIBAVAHI_CFLAGS=`$LIBAVAHI_CONFIG --cflags` LIBAVAHI_LIBS=`$LIBAVAHI_CONFIG --libs` save_CPPFLAGS="$CPPFLAGS" save_LDFLAGS="$LDFLAGS" CPPFLAGS="$save_CPPFLAGS $LIBAVAHI_CFLAGS" LDFLAGS="$save_LDFLAGS $LIBAVAHI_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libavahi compiles with includes+lib " >&5 $as_echo_n "checking if libavahi compiles with includes+lib ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { avahi_client_new(NULL,0,NULL); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: compilation error" >&5 $as_echo "compilation error" >&6; } LIBAVAHI_CFLAGS="" LIBAVAHI_LDFLAGS="" LIBAVAHI_CONFIG="" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" #LIBAVAHI_CONFIG fi # ultimate test to see if libavahi is found after AC_CHECK_LIB if test "X${LIBAVAHI_CONFIG}" == "X"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBAVAHI" >&5 $as_echo_n "checking for LIBAVAHI... " >&6; } if test -n "$LIBAVAHI_CFLAGS"; then pkg_cv_LIBAVAHI_CFLAGS="$LIBAVAHI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"avahi-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "avahi-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBAVAHI_CFLAGS=`$PKG_CONFIG --cflags "avahi-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBAVAHI_LIBS"; then pkg_cv_LIBAVAHI_LIBS="$LIBAVAHI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"avahi-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "avahi-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBAVAHI_LIBS=`$PKG_CONFIG --libs "avahi-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBAVAHI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "avahi-client" 2>&1` else LIBAVAHI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "avahi-client" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBAVAHI_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avahi_threaded_poll_new in -lavahi-common" >&5 $as_echo_n "checking for avahi_threaded_poll_new in -lavahi-common... " >&6; } if ${ac_cv_lib_avahi_common_avahi_threaded_poll_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavahi-common $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 avahi_threaded_poll_new (); int main () { return avahi_threaded_poll_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_avahi_common_avahi_threaded_poll_new=yes else ac_cv_lib_avahi_common_avahi_threaded_poll_new=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_avahi_common_avahi_threaded_poll_new" >&5 $as_echo "$ac_cv_lib_avahi_common_avahi_threaded_poll_new" >&6; } if test "x$ac_cv_lib_avahi_common_avahi_threaded_poll_new" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avahi_client_new in -lavahi-client" >&5 $as_echo_n "checking for avahi_client_new in -lavahi-client... " >&6; } if ${ac_cv_lib_avahi_client_avahi_client_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavahi-client $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 avahi_client_new (); int main () { return avahi_client_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_avahi_client_avahi_client_new=yes else ac_cv_lib_avahi_client_avahi_client_new=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_avahi_client_avahi_client_new" >&5 $as_echo "$ac_cv_lib_avahi_client_avahi_client_new" >&6; } if test "x$ac_cv_lib_avahi_client_avahi_client_new" = xyes; then : LIBAVAHI_LIBS="-lavahi-client -lavahi-common" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libavahi-client" >&5 $as_echo "$as_me: WARNING: Cannot find libavahi-client" >&2;} if test "${ENABLE_AVAHI}" = "true" ; then as_fn_error $? "libavahi must be installed to use a Avahi zero-configuration" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libavahi not found, avahi will be disabled" >&5 $as_echo "$as_me: WARNING: libavahi not found, avahi will be disabled" >&2;} ENABLE_AVAHI=false fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libavahi-common" >&5 $as_echo "$as_me: WARNING: Cannot find libavahi-common" >&2;} if test "${ENABLE_AVAHI}" = "true" ; then as_fn_error $? "libavahi must be installed to use a Avahi zero-configuration" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libavahi not found, avahi will be disabled" >&5 $as_echo "$as_me: WARNING: libavahi not found, avahi will be disabled" >&2;} ENABLE_AVAHI=false fi fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avahi_threaded_poll_new in -lavahi-common" >&5 $as_echo_n "checking for avahi_threaded_poll_new in -lavahi-common... " >&6; } if ${ac_cv_lib_avahi_common_avahi_threaded_poll_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavahi-common $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 avahi_threaded_poll_new (); int main () { return avahi_threaded_poll_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_avahi_common_avahi_threaded_poll_new=yes else ac_cv_lib_avahi_common_avahi_threaded_poll_new=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_avahi_common_avahi_threaded_poll_new" >&5 $as_echo "$ac_cv_lib_avahi_common_avahi_threaded_poll_new" >&6; } if test "x$ac_cv_lib_avahi_common_avahi_threaded_poll_new" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avahi_client_new in -lavahi-client" >&5 $as_echo_n "checking for avahi_client_new in -lavahi-client... " >&6; } if ${ac_cv_lib_avahi_client_avahi_client_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lavahi-client $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 avahi_client_new (); int main () { return avahi_client_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_avahi_client_avahi_client_new=yes else ac_cv_lib_avahi_client_avahi_client_new=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_avahi_client_avahi_client_new" >&5 $as_echo "$ac_cv_lib_avahi_client_avahi_client_new" >&6; } if test "x$ac_cv_lib_avahi_client_avahi_client_new" = xyes; then : LIBAVAHI_LIBS="-lavahi-client -lavahi-common" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libavahi-client" >&5 $as_echo "$as_me: WARNING: Cannot find libavahi-client" >&2;} if test "${ENABLE_AVAHI}" = "true" ; then as_fn_error $? "libavahi must be installed to use a Avahi zero-configuration" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libavahi not found, avahi will be disabled" >&5 $as_echo "$as_me: WARNING: libavahi not found, avahi will be disabled" >&2;} ENABLE_AVAHI=false fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libavahi-common" >&5 $as_echo "$as_me: WARNING: Cannot find libavahi-common" >&2;} if test "${ENABLE_AVAHI}" = "true" ; then as_fn_error $? "libavahi must be installed to use a Avahi zero-configuration" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libavahi not found, avahi will be disabled" >&5 $as_echo "$as_me: WARNING: libavahi not found, avahi will be disabled" >&2;} ENABLE_AVAHI=false fi fi else LIBAVAHI_CFLAGS=$pkg_cv_LIBAVAHI_CFLAGS LIBAVAHI_LIBS=$pkg_cv_LIBAVAHI_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "${ENABLE_AVAHI}" != "false" ; then ENABLE_AVAHI=true fi # ENABLE_AVAHI fi if test "${ENABLE_AVAHI}" = "true"; then ENABLE_AVAHI_TRUE= ENABLE_AVAHI_FALSE='#' else ENABLE_AVAHI_TRUE='#' ENABLE_AVAHI_FALSE= fi # Check for Parallel port enabled ENABLE_PARPORT=auto { $as_echo "$as_me:${as_lineno-$LINENO}: checking if parallel port support is enabled" >&5 $as_echo_n "checking if parallel port support is enabled... " >&6; } # Check whether --enable-parport was given. if test "${enable_parport+set}" = set; then : enableval=$enable_parport; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_PARPORT=false fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 $as_echo "yes (default)" >&6; } fi # Include linux/ppdev.h if the parallel port is enabled if test "${ENABLE_PARPORT}" != "false" ; then ac_fn_c_check_header_mongrel "$LINENO" "linux/ppdev.h" "ac_cv_header_linux_ppdev_h" "$ac_includes_default" if test "x$ac_cv_header_linux_ppdev_h" = xyes; then : else if test "${ENABLE_PARPORT}" = "true" ; then as_fn_error $? "ppdev.h must be installed to use parallel port adapter" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ppdev.h not found, parallel port will be disabled" >&5 $as_echo "$as_me: WARNING: ppdev.h not found, parallel port will be disabled" >&2;} ENABLE_PARPORT=false fi fi if test "${ENABLE_PARPORT}" != "false" ; then ENABLE_PARPORT=true fi fi if test "${ENABLE_PARPORT}" = "true"; then ENABLE_PARPORT_TRUE= ENABLE_PARPORT_FALSE='#' else ENABLE_PARPORT_TRUE='#' ENABLE_PARPORT_FALSE= fi if test "$cross_compiling" != yes; then for ac_prog in libftdi1-config libftdi-config 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_LIBFTDI_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIBFTDI_CONFIG"; then ac_cv_prog_LIBFTDI_CONFIG="$LIBFTDI_CONFIG" # 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_LIBFTDI_CONFIG="$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 LIBFTDI_CONFIG=$ac_cv_prog_LIBFTDI_CONFIG if test -n "$LIBFTDI_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBFTDI_CONFIG" >&5 $as_echo "$LIBFTDI_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LIBFTDI_CONFIG" && break done else LIBFTDI_CONFIG="" fi # Check whether --with-libftdi-config was given. if test "${with_libftdi_config+set}" = set; then : withval=$with_libftdi_config; fi if test "X$with_libftdi_config" != "X" ; then LIBFTDI_CONFIG=$with_libftdi_config fi if test "$cross_compiling" != yes; then if test "X$LIBFTDI_CONFIG" == "X" ; then dirs="/usr/bin /usr/local/bin /opt/local/bin" for i in $dirs; do for prog in libftdi1-config libftdi-config; do echo "Testing $i/$prog" if test -x $i/$prog; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i/$prog is found" >&5 $as_echo "$i/$prog is found" >&6; } LIBFTDI_CONFIG="$i/$prog" break 2; fi done done fi fi # Check if FTDI should be enabled ENABLE_FTDI=auto { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libftdi is available" >&5 $as_echo_n "checking if libftdi is available... " >&6; } # Check whether --enable-ftdi was given. if test "${enable_ftdi+set}" = set; then : enableval=$enable_ftdi; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 $as_echo "$enableval" >&6; } if ! test "$enableval" = "yes" ; then ENABLE_FTDI=false fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto (default)" >&5 $as_echo "auto (default)" >&6; } fi # Include ftdi.h if enabled if test "${ENABLE_FTDI}" != "false" ; then LIBFTDI_FOUND=false if test "X${LIBFTDI_CONFIG}" != "X" ; then LIBFTDI_CFLAGS=`$LIBFTDI_CONFIG --cflags` LIBFTDI_LIBS=`$LIBFTDI_CONFIG --libs` save_CPPFLAGS="$CPPFLAGS" save_LDFLAGS="$LDFLAGS" CPPFLAGS="$save_CPPFLAGS $LIBFTDI_CFLAGS" LDFLAGS="$save_LDFLAGS $LIBFTDI_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libftdi compiles with includes+lib " >&5 $as_echo_n "checking if libftdi compiles with includes+lib ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct ftdi_context ftdic; ftdi_init(&ftdic); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } FTDI_FOUND=true else { $as_echo "$as_me:${as_lineno-$LINENO}: result: compilation error" >&5 $as_echo "compilation error" >&6; } LIBFTDI_CFLAGS="" LIBFTDI_LDFLAGS="" LIBFTDI_CONFIG="" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" fi if test "${FTDI_FOUND}" = "true"; then ENABLE_FTDI=true else if test "${ENABLE_FTDI}" = "true" ; then as_fn_error $? "libftdi must be installed to use LinkUSB natively" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libftdi not found, LinkUSB native will be disabled" >&5 $as_echo "$as_me: WARNING: libftdi not found, LinkUSB native will be disabled" >&2;} ENABLE_FTDI=false fi fi fi if test "${ENABLE_FTDI}" = "true"; then ENABLE_FTDI_TRUE= ENABLE_FTDI_FALSE='#' else ENABLE_FTDI_TRUE='#' ENABLE_FTDI_FALSE= fi if test "${HAVE_CYGWIN}" = "true" ; then OW_CYGWIN=1 else OW_CYGWIN=0 fi if test "${HAVE_DARWIN}" = "true" ; then OW_DARWIN=1 else OW_DARWIN=0 fi ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif " if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_STORAGE 1 _ACEOF fi if test "$ac_cv_type_struct_sockaddr_storage" = no; then ac_fn_c_check_member "$LINENO" "struct sockaddr_in" "sin_len" "ac_cv_member_struct_sockaddr_in_sin_len" "$ac_includes_default" if test "x$ac_cv_member_struct_sockaddr_in_sin_len" = xyes; then : $as_echo "#define SOCKADDR_IN_HAS_LEN 1" >>confdefs.h fi fi ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include " if test "x$ac_cv_type_struct_addrinfo" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_ADDRINFO 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif " if test "x$ac_cv_type_socklen_t" = xyes; then : else $as_echo "#define socklen_t unsigned int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AF_NETLINK" >&5 $as_echo_n "checking for AF_NETLINK... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif int main () { int ss_family = AF_NETLINK; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_af_netlink="yes" $as_echo "#define HAVE_AF_NETLINK 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_af_netlink="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "${have_af_netlink}" != "yes" ; then if test "${ENABLE_W1}" != "false" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disable w1 since AF_NETLINK not found" >&5 $as_echo "$as_me: WARNING: Disable w1 since AF_NETLINK not found" >&2;} ENABLE_W1="false" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken glibc with __ss_family" >&5 $as_echo_n "checking for broken glibc with __ss_family... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif int main () { struct sockaddr_storage s; s.__ss_family = AF_INET; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_BROKEN_SS_FAMILY 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for core ipv6 support" >&5 $as_echo_n "checking for core ipv6 support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define IN_AUTOCONF #include "include/stdinc.h" int main () { struct sockaddr_in6 s; struct sockaddr_storage t; s.sin6_family = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if test "${HAVE_CYGWIN}" = "true" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, Cygwins ipv6 is incomplete" >&5 $as_echo "no, Cygwins ipv6 is incomplete" >&6; } $as_echo "#define __HAS_IPV6__ 0" >>confdefs.h have_v6=no else have_v6=yes $as_echo "#define IPV6 1" >>confdefs.h $as_echo "#define __HAS_IPV6__ 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct in6addr_any" >&5 $as_echo_n "checking for struct in6addr_any... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define IN_AUTOCONF #include "include/stdinc.h" int main () { struct in6_addr a = in6addr_any; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; 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" >&5 $as_echo "no" >&6; } $as_echo "#define NO_IN6ADDR_ANY 1" >>confdefs.h inet_misc=1 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_v6=no $as_echo "#define __HAS_IPV6__ 0" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sem_timedwait exists" >&5 $as_echo_n "checking if sem_timedwait exists... " >&6; } if ${ac_cv_sem_timedwait+:} false; then : $as_echo_n "(cached) " >&6 else save_LIBS="$LIBS"; LIBS="$LIBS $PTHREAD_LIBS" ; save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS $PTHREAD_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_STDLIB_H #include #endif #if HAVE_SEMAPHORE_H #include #endif int main () { sem_timedwait(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sem_timedwait="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find sem_timedwait" >&5 $as_echo "$as_me: WARNING: Cannot find sem_timedwait" >&2;} ac_cv_sem_timedwait="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sem_timedwait" >&5 $as_echo "$ac_cv_sem_timedwait" >&6; } if test "$ac_cv_sem_timedwait" = "yes"; then $as_echo "#define HAVE_SEM_TIMEDWAIT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether string.h and strings.h may both be included" >&5 $as_echo_n "checking whether string.h and strings.h may both be included... " >&6; } if ${gcc_cv_header_string+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gcc_cv_header_string=yes else gcc_cv_header_string=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_header_string" >&5 $as_echo "$gcc_cv_header_string" >&6; } if test "$gcc_cv_header_string" = "yes"; then $as_echo "#define STRING_WITH_STRINGS 1" >>confdefs.h fi if test "${ENABLE_I2C}" = "true" ; then OW_I2C=1 else OW_I2C=0 fi if test "${ENABLE_W1}" = "true" ; then OW_W1=1 else OW_W1=0 fi if test "${ENABLE_USB}" = "true" ; then OW_USB=1 else OW_USB=0 fi if test "${ENABLE_AVAHI}" = "true" ; then OW_AVAHI=1 else OW_AVAHI=0 fi if test "${ENABLE_ZERO}" = "true" ; then OW_ZERO=1 else OW_ZERO=0 fi if test "${ENABLE_PARPORT}" = "true" ; then OW_PARPORT=1 else OW_PARPORT=0 fi if test "${ENABLE_FTDI}" = "true" ; then OW_FTDI=1 else OW_FTDI=0 fi if test "${ENABLE_DEBUG}" = "true" ; then OW_DEBUG=1 else OW_DEBUG=0 fi if test "${ENABLE_MUTEX_DEBUG}" = "true" ; then OW_MUTEX_DEBUG=1 else OW_MUTEX_DEBUG=0 fi if test "${ENABLE_OWMALLOC}" = "true" ; then OW_ALLOC_DEBUG=1 else OW_ALLOC_DEBUG=0 fi # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF 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 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 { $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 { $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 whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi # Checks for library functions. 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 #AC_FUNC_MALLOC #AC_FUNC_MKTIME #AC_FUNC_REALLOC for ac_header in sys/select.h sys/socket.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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 $as_echo_n "checking types of arguments for select... " >&6; } if ${ac_cv_func_select_args+:} false; then : $as_echo_n "(cached) " >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : "${ac_cv_func_select_args=int,int *,struct timeval *}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 $as_echo "$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 strftime (); int main () { return strftime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_strftime=yes else ac_cv_lib_intl_strftime=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_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } if ${ac_cv_func_strtod+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_strtod=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifndef strtod double strtod (); #endif int main() { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) return 1; } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) return 1; } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strtod=yes else ac_cv_func_strtod=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_strtod" >&5 $as_echo "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" if test "x$ac_cv_func_pow" = xyes; then : fi if test $ac_cv_func_pow = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if ${ac_cv_lib_m_pow+:} 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 pow (); int main () { return pow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else ac_cv_lib_m_pow=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_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = xyes; then : POW_LIB=-lm else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 $as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in accept daemon getaddrinfo freeaddrinfo gethostbyname2_r gethostbyaddr_r gethostbyname_r getservbyname_r getopt getopt_long gmtime_r gettimeofday localtime_r inet_ntop inet_pton memchr memset select socket strcasecmp strchr strdup strncasecmp strtol strtoul twalk tsearch tfind tdelete tdestroy vasprintf strsep vsprintf vsnprintf writev getline 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 save_LIBS="$LIBS" LIBS="" DL_LIBS="" if test "${ENABLE_ZERO}" = "true" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h fi DL_LIBS="$LIBS" fi LIBS="$save_LIBS" save_LIBS="$LIBS" M_LIBS="" LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing lrint" >&5 $as_echo_n "checking for library containing lrint... " >&6; } if ${ac_cv_search_lrint+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 lrint (); int main () { return lrint (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_lrint=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_lrint+:} false; then : break fi done if ${ac_cv_search_lrint+:} false; then : else ac_cv_search_lrint=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_lrint" >&5 $as_echo "$ac_cv_search_lrint" >&6; } ac_res=$ac_cv_search_lrint if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LRINT 1" >>confdefs.h fi M_LIBS="$LIBS" LIBS="$save_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 $as_echo_n "checking for library containing nanosleep... " >&6; } if ${ac_cv_search_nanosleep+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 nanosleep (); int main () { return nanosleep (); ; return 0; } _ACEOF for ac_lib in '' rt posix4; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_nanosleep=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_nanosleep+:} false; then : break fi done if ${ac_cv_search_nanosleep+:} false; then : else ac_cv_search_nanosleep=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 $as_echo "$ac_cv_search_nanosleep" >&6; } ac_res=$ac_cv_search_nanosleep if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_NANOSLEEP 1" >>confdefs.h fi # clock_gettime needed if real-time wait is needed for sem_timedwait. gettimeofday is enough. #AC_SEARCH_LIBS(clock_gettime, rt posix4, AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime])) # systemd support (see man 7 daemon) # Check whether --with-systemdsystemunitdir was given. if test "${with_systemdsystemunitdir+set}" = set; then : withval=$with_systemdsystemunitdir; else with_systemdsystemunitdir=auto fi if test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"; then : def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) if test "x$def_systemdsystemunitdir" = "x"; then : if test "x$with_systemdsystemunitdir" = "xyes"; then : as_fn_error $? "systemd support requested but pkg-config unable to query systemd package" "$LINENO" 5 fi with_systemdsystemunitdir=no else with_systemdsystemunitdir="$def_systemdsystemunitdir" fi fi if test "x$with_systemdsystemunitdir" != "xno"; then : systemdsystemunitdir=$with_systemdsystemunitdir fi if test "x$with_systemdsystemunitdir" != "xno"; then HAVE_SYSTEMD_TRUE= HAVE_SYSTEMD_FALSE='#' else HAVE_SYSTEMD_TRUE='#' HAVE_SYSTEMD_FALSE= fi save_LIBS="$LIBS" MQ_LIBS="" LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mq_getattr" >&5 $as_echo_n "checking for library containing mq_getattr... " >&6; } if ${ac_cv_search_mq_getattr+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 mq_getattr (); int main () { return mq_getattr (); ; return 0; } _ACEOF for ac_lib in '' rt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_mq_getattr=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_mq_getattr+:} false; then : break fi done if ${ac_cv_search_mq_getattr+:} false; then : else ac_cv_search_mq_getattr=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mq_getattr" >&5 $as_echo "$ac_cv_search_mq_getattr" >&6; } ac_res=$ac_cv_search_mq_getattr if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi MQ_LIBS="$LIBS" LIBS="$save_LIBS" HAVE_CHECK="false" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcheck" >&5 $as_echo_n "checking for libcheck... " >&6; } if test -n "$libcheck_CFLAGS"; then pkg_cv_libcheck_CFLAGS="$libcheck_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcheck_CFLAGS=`$PKG_CONFIG --cflags "check >= 0.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libcheck_LIBS"; then pkg_cv_libcheck_LIBS="$libcheck_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcheck_LIBS=`$PKG_CONFIG --libs "check >= 0.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libcheck_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "check >= 0.10.0" 2>&1` else libcheck_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "check >= 0.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libcheck_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Check unit testing framework not found. \"" >&5 $as_echo "$as_me: WARNING: \"Check unit testing framework not found. \"" >&2;} elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Check unit testing framework not found. \"" >&5 $as_echo "$as_me: WARNING: \"Check unit testing framework not found. \"" >&2;} else libcheck_CFLAGS=$pkg_cv_libcheck_CFLAGS libcheck_LIBS=$pkg_cv_libcheck_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_CHECK="true" fi if test "${HAVE_CHECK}" = "true"; then HAVE_CHECK_TRUE= HAVE_CHECK_FALSE='#' else HAVE_CHECK_TRUE='#' HAVE_CHECK_FALSE= fi CHECK_CFLAGS="$libcheck_CFLAGS" CHECK_LIBS="$libcheck_LIBS" ac_config_files="$ac_config_files Makefile module/Makefile module/owlib/Makefile module/owlib/src/Makefile module/owlib/src/include/Makefile module/owlib/src/c/Makefile module/owlib/tests/Makefile module/owfs/Makefile module/owfs/src/Makefile module/owfs/src/include/Makefile module/owfs/src/c/Makefile module/owhttpd/Makefile module/owhttpd/src/Makefile module/owhttpd/src/include/Makefile module/owhttpd/src/c/Makefile module/owserver/Makefile module/owserver/src/Makefile module/owserver/src/include/Makefile module/owserver/src/c/Makefile module/owftpd/Makefile module/owftpd/src/Makefile module/owftpd/src/include/Makefile module/owftpd/src/c/Makefile module/ownet/Makefile module/ownet/php/Makefile module/ownet/php/examples/ownet_example.php module/ownet/python/Makefile module/ownet/perl5/Makefile module/ownet/c/Makefile module/ownet/c/src/Makefile module/ownet/c/src/include/Makefile module/ownet/c/src/c/Makefile module/ownet/c/src/example/Makefile module/owshell/Makefile module/owshell/src/Makefile module/owshell/src/include/Makefile module/owshell/src/c/Makefile module/owcapi/Makefile module/owcapi/src/Makefile module/owcapi/src/include/Makefile module/owcapi/src/c/Makefile module/owcapi/src/example/Makefile module/owcapi/src/example++/Makefile module/owtap/Makefile module/owmon/Makefile module/swig/Makefile module/swig/perl5/Makefile module/swig/perl5/OW/Makefile.linux module/swig/perl5/OW/Makefile.osx module/swig/php/Makefile module/swig/php/example/load_php_OW.php module/swig/python/Makefile module/swig/python/ow/Makefile module/swig/python/setup.py module/owtcl/Makefile src/Makefile src/include/Makefile src/man/Makefile src/man/man1/Makefile src/man/man3/Makefile src/man/man5/Makefile src/man/mann/Makefile src/rpm/Makefile src/rpm/owfs.spec src/scripts/Makefile src/scripts/windows/Makefile src/scripts/windows/owfs.nsi src/scripts/usb/Makefile src/scripts/usb/cygwin/Makefile src/scripts/usb/windows/Makefile src/scripts/systemd/Makefile src/include/owfs_config.h" 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= 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 "${SOELIM_TRUE}" && test -z "${SOELIM_FALSE}"; then as_fn_error $? "conditional \"SOELIM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 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 "${HAVE_DEBIAN_TRUE}" && test -z "${HAVE_DEBIAN_FALSE}"; then as_fn_error $? "conditional \"HAVE_DEBIAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_DARWIN_TRUE}" && test -z "${HAVE_DARWIN_FALSE}"; then as_fn_error $? "conditional \"HAVE_DARWIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CYGWIN_TRUE}" && test -z "${HAVE_CYGWIN_FALSE}"; then as_fn_error $? "conditional \"HAVE_CYGWIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_FREEBSD_TRUE}" && test -z "${HAVE_FREEBSD_FALSE}"; then as_fn_error $? "conditional \"HAVE_FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DEBUG_TRUE}" && test -z "${ENABLE_DEBUG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_MUTEX_DEBUG_TRUE}" && test -z "${ENABLE_MUTEX_DEBUG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_MUTEX_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWSHELL_TRUE}" && test -z "${ENABLE_OWSHELL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWSHELL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWLIB_TRUE}" && test -z "${ENABLE_OWLIB_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWNETLIB_TRUE}" && test -z "${ENABLE_OWNETLIB_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWNETLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_I2C_TRUE}" && test -z "${ENABLE_I2C_FALSE}"; then as_fn_error $? "conditional \"ENABLE_I2C\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_W1_TRUE}" && test -z "${ENABLE_W1_FALSE}"; then as_fn_error $? "conditional \"ENABLE_W1\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWHTTPD_TRUE}" && test -z "${ENABLE_OWHTTPD_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWHTTPD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWFTPD_TRUE}" && test -z "${ENABLE_OWFTPD_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWFTPD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWSERVER_TRUE}" && test -z "${ENABLE_OWSERVER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWSERVER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWEXTERNAL_TRUE}" && test -z "${ENABLE_OWEXTERNAL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWEXTERNAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWNET_TRUE}" && test -z "${ENABLE_OWNET_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWNET\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWTAP_TRUE}" && test -z "${ENABLE_OWTAP_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWTAP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWMALLOC_TRUE}" && test -z "${ENABLE_OWMALLOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWMALLOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWMON_TRUE}" && test -z "${ENABLE_OWMON_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWMON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWCAPI_TRUE}" && test -z "${ENABLE_OWCAPI_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWCAPI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_SWIG_TRUE}" && test -z "${ENABLE_SWIG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SWIG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWPERL_TRUE}" && test -z "${ENABLE_OWPERL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWPERL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PERL_TRUE}" && test -z "${ENABLE_PERL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PERL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWPHP_TRUE}" && test -z "${ENABLE_OWPHP_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWPHP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PHP_TRUE}" && test -z "${ENABLE_PHP_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PHP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWPYTHON_TRUE}" && test -z "${ENABLE_OWPYTHON_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWPYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PYTHON_TRUE}" && test -z "${ENABLE_PYTHON_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWTCL_TRUE}" && test -z "${ENABLE_OWTCL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWTCL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PROFILING_TRUE}" && test -z "${ENABLE_PROFILING_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PROFILING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_OWFS_TRUE}" && test -z "${ENABLE_OWFS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_OWFS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ZERO_TRUE}" && test -z "${ENABLE_ZERO_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ZERO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_USB_TRUE}" && test -z "${ENABLE_USB_FALSE}"; then as_fn_error $? "conditional \"ENABLE_USB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_AVAHI_TRUE}" && test -z "${ENABLE_AVAHI_FALSE}"; then as_fn_error $? "conditional \"ENABLE_AVAHI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PARPORT_TRUE}" && test -z "${ENABLE_PARPORT_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PARPORT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FTDI_TRUE}" && test -z "${ENABLE_FTDI_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FTDI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SYSTEMD_TRUE}" && test -z "${HAVE_SYSTEMD_FALSE}"; then as_fn_error $? "conditional \"HAVE_SYSTEMD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CHECK_TRUE}" && test -z "${HAVE_CHECK_FALSE}"; then as_fn_error $? "conditional \"HAVE_CHECK\" 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 $as_me, 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status 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" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _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 "src/include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "module/Makefile") CONFIG_FILES="$CONFIG_FILES module/Makefile" ;; "module/owlib/Makefile") CONFIG_FILES="$CONFIG_FILES module/owlib/Makefile" ;; "module/owlib/src/Makefile") CONFIG_FILES="$CONFIG_FILES module/owlib/src/Makefile" ;; "module/owlib/src/include/Makefile") CONFIG_FILES="$CONFIG_FILES module/owlib/src/include/Makefile" ;; "module/owlib/src/c/Makefile") CONFIG_FILES="$CONFIG_FILES module/owlib/src/c/Makefile" ;; "module/owlib/tests/Makefile") CONFIG_FILES="$CONFIG_FILES module/owlib/tests/Makefile" ;; "module/owfs/Makefile") CONFIG_FILES="$CONFIG_FILES module/owfs/Makefile" ;; "module/owfs/src/Makefile") CONFIG_FILES="$CONFIG_FILES module/owfs/src/Makefile" ;; "module/owfs/src/include/Makefile") CONFIG_FILES="$CONFIG_FILES module/owfs/src/include/Makefile" ;; "module/owfs/src/c/Makefile") CONFIG_FILES="$CONFIG_FILES module/owfs/src/c/Makefile" ;; "module/owhttpd/Makefile") CONFIG_FILES="$CONFIG_FILES module/owhttpd/Makefile" ;; "module/owhttpd/src/Makefile") CONFIG_FILES="$CONFIG_FILES module/owhttpd/src/Makefile" ;; "module/owhttpd/src/include/Makefile") CONFIG_FILES="$CONFIG_FILES module/owhttpd/src/include/Makefile" ;; "module/owhttpd/src/c/Makefile") CONFIG_FILES="$CONFIG_FILES module/owhttpd/src/c/Makefile" ;; "module/owserver/Makefile") CONFIG_FILES="$CONFIG_FILES module/owserver/Makefile" ;; "module/owserver/src/Makefile") CONFIG_FILES="$CONFIG_FILES module/owserver/src/Makefile" ;; "module/owserver/src/include/Makefile") CONFIG_FILES="$CONFIG_FILES module/owserver/src/include/Makefile" ;; "module/owserver/src/c/Makefile") CONFIG_FILES="$CONFIG_FILES module/owserver/src/c/Makefile" ;; "module/owftpd/Makefile") CONFIG_FILES="$CONFIG_FILES module/owftpd/Makefile" ;; "module/owftpd/src/Makefile") CONFIG_FILES="$CONFIG_FILES module/owftpd/src/Makefile" ;; "module/owftpd/src/include/Makefile") CONFIG_FILES="$CONFIG_FILES module/owftpd/src/include/Makefile" ;; "module/owftpd/src/c/Makefile") CONFIG_FILES="$CONFIG_FILES module/owftpd/src/c/Makefile" ;; "module/ownet/Makefile") CONFIG_FILES="$CONFIG_FILES module/ownet/Makefile" ;; "module/ownet/php/Makefile") CONFIG_FILES="$CONFIG_FILES module/ownet/php/Makefile" ;; "module/ownet/php/examples/ownet_example.php") CONFIG_FILES="$CONFIG_FILES module/ownet/php/examples/ownet_example.php" ;; "module/ownet/python/Makefile") CONFIG_FILES="$CONFIG_FILES module/ownet/python/Makefile" ;; "module/ownet/perl5/Makefile") CONFIG_FILES="$CONFIG_FILES module/ownet/perl5/Makefile" ;; "module/ownet/c/Makefile") CONFIG_FILES="$CONFIG_FILES module/ownet/c/Makefile" ;; "module/ownet/c/src/Makefile") CONFIG_FILES="$CONFIG_FILES module/ownet/c/src/Makefile" ;; "module/ownet/c/src/include/Makefile") CONFIG_FILES="$CONFIG_FILES module/ownet/c/src/include/Makefile" ;; "module/ownet/c/src/c/Makefile") CONFIG_FILES="$CONFIG_FILES module/ownet/c/src/c/Makefile" ;; "module/ownet/c/src/example/Makefile") CONFIG_FILES="$CONFIG_FILES module/ownet/c/src/example/Makefile" ;; "module/owshell/Makefile") CONFIG_FILES="$CONFIG_FILES module/owshell/Makefile" ;; "module/owshell/src/Makefile") CONFIG_FILES="$CONFIG_FILES module/owshell/src/Makefile" ;; "module/owshell/src/include/Makefile") CONFIG_FILES="$CONFIG_FILES module/owshell/src/include/Makefile" ;; "module/owshell/src/c/Makefile") CONFIG_FILES="$CONFIG_FILES module/owshell/src/c/Makefile" ;; "module/owcapi/Makefile") CONFIG_FILES="$CONFIG_FILES module/owcapi/Makefile" ;; "module/owcapi/src/Makefile") CONFIG_FILES="$CONFIG_FILES module/owcapi/src/Makefile" ;; "module/owcapi/src/include/Makefile") CONFIG_FILES="$CONFIG_FILES module/owcapi/src/include/Makefile" ;; "module/owcapi/src/c/Makefile") CONFIG_FILES="$CONFIG_FILES module/owcapi/src/c/Makefile" ;; "module/owcapi/src/example/Makefile") CONFIG_FILES="$CONFIG_FILES module/owcapi/src/example/Makefile" ;; "module/owcapi/src/example++/Makefile") CONFIG_FILES="$CONFIG_FILES module/owcapi/src/example++/Makefile" ;; "module/owtap/Makefile") CONFIG_FILES="$CONFIG_FILES module/owtap/Makefile" ;; "module/owmon/Makefile") CONFIG_FILES="$CONFIG_FILES module/owmon/Makefile" ;; "module/swig/Makefile") CONFIG_FILES="$CONFIG_FILES module/swig/Makefile" ;; "module/swig/perl5/Makefile") CONFIG_FILES="$CONFIG_FILES module/swig/perl5/Makefile" ;; "module/swig/perl5/OW/Makefile.linux") CONFIG_FILES="$CONFIG_FILES module/swig/perl5/OW/Makefile.linux" ;; "module/swig/perl5/OW/Makefile.osx") CONFIG_FILES="$CONFIG_FILES module/swig/perl5/OW/Makefile.osx" ;; "module/swig/php/Makefile") CONFIG_FILES="$CONFIG_FILES module/swig/php/Makefile" ;; "module/swig/php/example/load_php_OW.php") CONFIG_FILES="$CONFIG_FILES module/swig/php/example/load_php_OW.php" ;; "module/swig/python/Makefile") CONFIG_FILES="$CONFIG_FILES module/swig/python/Makefile" ;; "module/swig/python/ow/Makefile") CONFIG_FILES="$CONFIG_FILES module/swig/python/ow/Makefile" ;; "module/swig/python/setup.py") CONFIG_FILES="$CONFIG_FILES module/swig/python/setup.py" ;; "module/owtcl/Makefile") CONFIG_FILES="$CONFIG_FILES module/owtcl/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;; "src/man/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/Makefile" ;; "src/man/man1/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/man1/Makefile" ;; "src/man/man3/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/man3/Makefile" ;; "src/man/man5/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/man5/Makefile" ;; "src/man/mann/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/mann/Makefile" ;; "src/rpm/Makefile") CONFIG_FILES="$CONFIG_FILES src/rpm/Makefile" ;; "src/rpm/owfs.spec") CONFIG_FILES="$CONFIG_FILES src/rpm/owfs.spec" ;; "src/scripts/Makefile") CONFIG_FILES="$CONFIG_FILES src/scripts/Makefile" ;; "src/scripts/windows/Makefile") CONFIG_FILES="$CONFIG_FILES src/scripts/windows/Makefile" ;; "src/scripts/windows/owfs.nsi") CONFIG_FILES="$CONFIG_FILES src/scripts/windows/owfs.nsi" ;; "src/scripts/usb/Makefile") CONFIG_FILES="$CONFIG_FILES src/scripts/usb/Makefile" ;; "src/scripts/usb/cygwin/Makefile") CONFIG_FILES="$CONFIG_FILES src/scripts/usb/cygwin/Makefile" ;; "src/scripts/usb/windows/Makefile") CONFIG_FILES="$CONFIG_FILES src/scripts/usb/windows/Makefile" ;; "src/scripts/systemd/Makefile") CONFIG_FILES="$CONFIG_FILES src/scripts/systemd/Makefile" ;; "src/include/owfs_config.h") CONFIG_FILES="$CONFIG_FILES src/include/owfs_config.h" ;; *) 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. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; 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 # Now, let's tell them what is the current configuration. Only the items # that are funny (like current default prefix) or configurable (like the # cache) should be included. { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: Current configuration:" >&5 $as_echo "Current configuration:" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: Deployment location: ${prefix}" >&5 $as_echo " Deployment location: ${prefix}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: Compile-time options:" >&5 $as_echo "Compile-time options:" >&6; } if test "${ENABLE_USB}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: USB is enabled" >&5 $as_echo " USB is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: USB is DISABLED" >&5 $as_echo " USB is DISABLED" >&6; } fi if test "${ENABLE_AVAHI}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: AVAHI is enabled" >&5 $as_echo " AVAHI is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: AVAHI is DISABLED" >&5 $as_echo " AVAHI is DISABLED" >&6; } fi if test "${ENABLE_I2C}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: I2C is enabled" >&5 $as_echo " I2C is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: I2C is DISABLED" >&5 $as_echo " I2C is DISABLED" >&6; } fi if test "${ENABLE_W1}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: W1 is enabled" >&5 $as_echo " W1 is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: W1 is DISABLED" >&5 $as_echo " W1 is DISABLED" >&6; } fi if test "${ENABLE_PARPORT}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Parallel port DS1410E is enabled" >&5 $as_echo " Parallel port DS1410E is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Parallel port DS1410E is DISABLED" >&5 $as_echo " Parallel port DS1410E is DISABLED" >&6; } fi if test "${ENABLE_FTDI}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: FTDI (LinkUSB) is enabled" >&5 $as_echo " FTDI (LinkUSB) is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: FTDI (LinkUSB) is DISABLED" >&5 $as_echo " FTDI (LinkUSB) is DISABLED" >&6; } fi if test "${ENABLE_ZERO}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Zeroconf/Bonjour is enabled" >&5 $as_echo " Zeroconf/Bonjour is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Zeroconf/Bonjour is DISABLED" >&5 $as_echo " Zeroconf/Bonjour is DISABLED" >&6; } fi if test "${ENABLE_DEBUG}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Debug-output is enabled" >&5 $as_echo " Debug-output is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Debug-output is DISABLED" >&5 $as_echo " Debug-output is DISABLED" >&6; } fi if test "${ENABLE_MUTEX_DEBUG}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Mutexdebug is enabled" >&5 $as_echo " Mutexdebug is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Mutexdebug is DISABLED" >&5 $as_echo " Mutexdebug is DISABLED" >&6; } fi if test "${ENABLE_PROFILING}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Profiling is enabled" >&5 $as_echo " Profiling is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Profiling is DISABLED" >&5 $as_echo " Profiling is DISABLED" >&6; } fi if test "${ENABLE_OWMALLOC}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Tracing memory allocation is enabled" >&5 $as_echo "Tracing memory allocation is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Tracing memory allocation is DISABLED" >&5 $as_echo "Tracing memory allocation is DISABLED" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: Module configuration:" >&5 $as_echo "Module configuration:" >&6; } if test "${ENABLE_OWLIB}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owlib is enabled" >&5 $as_echo " owlib is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owlib is DISABLED" >&5 $as_echo " owlib is DISABLED" >&6; } fi if test "${ENABLE_OWSHELL}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owshell is enabled" >&5 $as_echo " owshell is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owshell is DISABLED" >&5 $as_echo " owshell is DISABLED" >&6; } fi if test "${ENABLE_OWFS}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owfs is enabled" >&5 $as_echo " owfs is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owfs is DISABLED" >&5 $as_echo " owfs is DISABLED" >&6; } fi if test "${ENABLE_OWHTTPD}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owhttpd is enabled" >&5 $as_echo " owhttpd is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owhttpd is DISABLED" >&5 $as_echo " owhttpd is DISABLED" >&6; } fi if test "${ENABLE_OWFTPD}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owftpd is enabled" >&5 $as_echo " owftpd is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owftpd is DISABLED" >&5 $as_echo " owftpd is DISABLED" >&6; } fi if test "${ENABLE_OWSERVER}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owserver is enabled" >&5 $as_echo " owserver is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owserver is DISABLED" >&5 $as_echo " owserver is DISABLED" >&6; } fi if test "${ENABLE_OWEXTERNAL}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owexternal is enabled" >&5 $as_echo " owexternal is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owexternal is DISABLED" >&5 $as_echo " owexternal is DISABLED" >&6; } fi if test "${ENABLE_OWNET}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ownet is enabled" >&5 $as_echo " ownet is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ownet is DISABLED" >&5 $as_echo " ownet is DISABLED" >&6; } fi if test "${ENABLE_OWNETLIB}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ownetlib is enabled" >&5 $as_echo " ownetlib is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ownetlib is DISABLED" >&5 $as_echo " ownetlib is DISABLED" >&6; } fi if test "${ENABLE_OWTAP}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owtap is enabled" >&5 $as_echo " owtap is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owtap is DISABLED" >&5 $as_echo " owtap is DISABLED" >&6; } fi if test "${ENABLE_OWMON}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owmon is enabled" >&5 $as_echo " owmon is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owmon is DISABLED" >&5 $as_echo " owmon is DISABLED" >&6; } fi if test "${ENABLE_OWCAPI}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owcapi is enabled" >&5 $as_echo " owcapi is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owcapi is DISABLED" >&5 $as_echo " owcapi is DISABLED" >&6; } fi if test "${ENABLE_SWIG}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: swig is enabled" >&5 $as_echo " swig is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: swig is DISABLED" >&5 $as_echo " swig is DISABLED" >&6; } fi if test "${ENABLE_OWPERL}" = "true" -a "${ENABLE_SWIG}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owperl is enabled" >&5 $as_echo " owperl is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owperl is DISABLED" >&5 $as_echo " owperl is DISABLED" >&6; } fi if test "${ENABLE_OWPHP}" = "true" -a "${ENABLE_SWIG}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owphp is enabled" >&5 $as_echo " owphp is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owphp is DISABLED" >&5 $as_echo " owphp is DISABLED" >&6; } fi if test "${ENABLE_OWPYTHON}" = "true" -a "${ENABLE_SWIG}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owpython is enabled" >&5 $as_echo " owpython is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owpython is DISABLED" >&5 $as_echo " owpython is DISABLED" >&6; } fi if test "${ENABLE_OWTCL}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: owtcl is enabled" >&5 $as_echo " owtcl is enabled" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: owtcl is DISABLED" >&5 $as_echo " owtcl is DISABLED" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } if test "${HAVE_CHECK}" = "true"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: unit tests are enabled (run with 'make check')" >&5 $as_echo " unit tests are enabled (run with 'make check')" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: unit tests are DISABLED" >&5 $as_echo " unit tests are DISABLED" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } owfs-3.1p5/acinclude.m40000644000175000001440000000076212654730021011713 00000000000000# aclocal macros specific to OWFS dnl dnl Check to see if the c compiler supports nested functions dnl AC_DEFUN([OW_CHECK_NESTED_FUNCTIONS], [AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING(if compiler supports nested functions) AC_TRY_RUN([ f(void (*nested)()) { (*nested)(); } main() { int a = 0; void nested() { a = 1; } f(nested); if(a != 1) exit(1); exit(0); } ], [AC_MSG_RESULT(yes) ], AC_MSG_RESULT(no) CFLAGS="$CFLAGS -DNO_NESTED_FUNCTIONS" ) ]) owfs-3.1p5/configure.ac0000644000175000001440000014166013022536625012017 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT AM_SILENT_RULES([yes]) # Making releases: # VERSION_PATCHLEVEL += 1; # OWFS_INTERFACE_AGE += 1; # OWFS_BINARY_AGE += 1; # if any functions have been added, set OWFS_INTERFACE_AGE to 0. # if backwards compatibility has been broken, # set OWFS_BINARY_AGE _and_ OWFS_INTERFACE_AGE to 0. # (In our case it's better to always keep AGE to 0, since nobody else will use our library) VERSION_MAJOR=3 VERSION_MINOR=1 VERSION_PATCHLEVEL=5 OWFS_INTERFACE_AGE=0 OWFS_BINARY_AGE=0 AC_SUBST(VERSION_MAJOR) AC_SUBST(VERSION_MINOR) AC_SUBST(VERSION_PATCHLEVEL) AC_SUBST(OWFS_INTERFACE_AGE) AC_SUBST(OWFS_BINARY_AGE) LT_CURRENT=`expr $VERSION_PATCHLEVEL - $OWFS_INTERFACE_AGE` LT_REVISION=$OWFS_INTERFACE_AGE LT_AGE=`expr $OWFS_BINARY_AGE - $OWFS_INTERFACE_AGE` AC_SUBST(LT_CURRENT)dnl AC_SUBST(LT_REVISION)dnl AC_SUBST(LT_AGE)dnl LT_RELEASE=$VERSION_MAJOR.$VERSION_MINOR AC_SUBST(LT_RELEASE)dnl VERSION="${VERSION_MAJOR}.${VERSION_MINOR}p${VERSION_PATCHLEVEL}" AC_SUBST(VERSION)dnl PACKAGE="owfs" AC_SUBST(PACKAGE)dnl AC_MSG_RESULT(Configuring ${PACKAGE}-${VERSION}) AC_CONFIG_AUX_DIR(src/scripts/install)dnl AC_CONFIG_MACRO_DIR([src/scripts/m4]) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})dnl # Process config.h.in AH_TOP([ #ifndef OWCONFIG_H #define OWCONFIG_H ]) AH_BOTTOM([#endif]) AM_CONFIG_HEADER(src/include/config.h) AC_PREREQ(2.57)dnl AC_PREFIX_DEFAULT(/opt/owfs)dnl AC_PATH_PROG(ECHO,echo,,$PATH)dnl AC_PATH_PROG(TEST,test,,$PATH)dnl AC_PATH_PROG(RM,rm,,$PATH)dnl AC_PATH_PROG(RPM,rpm,,$PATH)dnl AC_PATH_PROG(RPMBUILD,rpmbuild,,$PATH)dnl AC_PATH_PROG([SWIG],[swig],,$PATH)dnl AC_PATH_PROG([SOELIM],[soelim]) AM_CONDITIONAL([SOELIM], [test -n "${SOELIM}"]) # This macro should appair before any other PKG_* macro PKG_PROG_PKG_CONFIG # Check for additional programs # We don't need c++ right now. #AC_PROG_CXX AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_LIBTOOL_WIN32_DLL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_AWK AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) # Supposedly this helps OS X compiling AC_DEFINE(_DARWIN_C_SOURCE, 1, [Define on Darwin to activate all library features]) HAVE_DEBIAN="false" AC_MSG_CHECKING([if debian-system is used]) AC_ARG_ENABLE(debian, [ --enable-debian Enable debian-system (default false)], [ AC_MSG_RESULT([$enableval]) if test "$enableval" = "yes" ; then HAVE_DEBIAN="true" fi ], [ AC_MSG_RESULT([no (default)]) ]) AC_SUBST(HAVE_DEBIAN) AM_CONDITIONAL(HAVE_DEBIAN, test "${HAVE_DEBIAN}" = "true") HAVE_DARWIN="false" HAVE_FREEBSD="false" HAVE_CYGWIN="false" AC_MSG_CHECKING([for special host]) case "$host" in *-*-cygwin*) HAVE_CYGWIN="true" CFLAGS="$CFLAGS -mwin32 -g" AC_MSG_RESULT([Cygwin]) ;; *-darwin*) HAVE_DARWIN="true" AC_MSG_RESULT([Darwin]) ;; *-freebsd*) HAVE_FREEBSD="true" AC_MSG_RESULT([FreeBSD]) ;; *) AC_MSG_RESULT([Other host]) ;; esac AC_SUBST(HAVE_DARWIN) AM_CONDITIONAL(HAVE_DARWIN, test "${HAVE_DARWIN}" = "true") AC_SUBST(HAVE_CYGWIN) AM_CONDITIONAL(HAVE_CYGWIN, test "${HAVE_CYGWIN}" = "true") AC_SUBST(HAVE_FREEBSD) AM_CONDITIONAL(HAVE_FREEBSD, test "${HAVE_FREEBSD}" = "true") # launchd using the new launch_activate_socket AC_CHECK_FUNCS(launch_activate_socket) # AC_CHECK_HEADERS(launch.h) AM_CPPFLAGS="" AC_SUBST([AM_CPPFLAGS]) PIC_FLAGS="" if test "$lt_prog_compiler_pic_works" = yes; then PIC_FLAGS="$lt_prog_compiler_pic" fi AC_SUBST(PIC_FLAGS) # Make sure tclConfig.sh is found under /usr/lib64/ # Should perhaps support cross-compiling to other cpu-type too? LIBPOSTFIX= case "${host_os}" in *linux* ) case "${host_cpu}" in powerpc64 | s390x | x86_64 ) LIBPOSTFIX="64" CFLAGS="$CFLAGS -m64" ;; esac ;; esac AC_SUBST(LIBPOSTFIX) if test "$cross_compiling" != yes; then OW_CHECK_NESTED_FUNCTIONS fi OWFSROOT="`pwd`" AC_SUBST(OWFSROOT) m4_include([src/scripts/m4/acx_pthread.m4]) # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([asm/types.h arpa/inet.h sys/ioctl.h sys/mkdev.h sys/socket.h sys/time.h sys/times.h sys/types.h sys/param.h sys/uio.h feature_tests.h fcntl.h netinet/in.h stdlib.h string.h strings.h sys/file.h syslog.h termios.h unistd.h limits.h stdint.h features.h getopt.h resolv.h semaphore.h]) AC_CHECK_HEADERS([linux/limits.h linux/types.h netdb.h dlfcn.h]) AC_CHECK_HEADERS(sys/event.h sys/inotify.h) # Test if debugging out enabled ENABLE_DEBUG="true" AC_MSG_CHECKING([if debug-output is enabled]) AC_ARG_ENABLE(debug, [ --enable-debug Enable debug-output (default true)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_DEBUG="false" fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_DEBUG) AM_CONDITIONAL(ENABLE_DEBUG, test "${ENABLE_DEBUG}" = "true") # Test if mutex-debugging is enabled. Should not be enabled for smaller embedded systems ENABLE_MUTEX_DEBUG="true" AC_MSG_CHECKING([if mutexdebug is enabled]) AC_ARG_ENABLE(mutexdebug, [ --enable-mutexdebug Enable mutexdebug-output (default true)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_MUTEX_DEBUG="false" fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_MUTEX_DEBUG) AM_CONDITIONAL(ENABLE_MUTEX_DEBUG, test "${ENABLE_MUTEX_DEBUG}" = "true") # Test if OWSHELL should be supported ENABLE_OWSHELL="true" AC_MSG_CHECKING([if OWSHELL support is enabled]) AC_ARG_ENABLE(owshell, [ --enable-owshell Enable owshell support (default true)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_OWSHELL="false" fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWSHELL) AM_CONDITIONAL(ENABLE_OWSHELL, test "${ENABLE_OWSHELL}" = "true") # Test if OWLIB should be supported ENABLE_OWLIB="true" AC_MSG_CHECKING([if OWLIB support is enabled]) AC_ARG_ENABLE(owlib, [ --enable-owlib Enable owlib support (default true)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_OWLIB="false" fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWLIB) AM_CONDITIONAL(ENABLE_OWLIB, test "${ENABLE_OWLIB}" = "true") # Test if OWNETLIB should be supported ENABLE_OWNETLIB="true" AC_MSG_CHECKING([if OWNETLIB support is enabled]) AC_ARG_ENABLE(ownetlib, [ --enable-ownetlib Enable ownetlib support (default true)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_OWNETLIB="false" fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWNETLIB) AM_CONDITIONAL(ENABLE_OWNETLIB, test "${ENABLE_OWNETLIB}" = "true") # Check for threading ACX_PTHREAD if test "$acx_pthread_ok" = "yes"; then #CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # can't set pthread flags for all compilations, since owshell doesn't need it. if test "$cross_compiling" = yes; then # We need to link libow.so with -lpthread on some cross-platforms # since owtcl.so doesn't work otherwise. -pthread is not enough if test x"$PTHREAD_LIBS" = x -a "x$PTHREAD_CFLAGS" = "x-pthread"; then AC_MSG_RESULT([add -lpthread to PTHREAD_LIBS]) PTHREAD_LIBS="-lpthread" fi fi ENABLE_MT="true" else ENABLE_MT="false" PTHREAD_CFLAGS="" PTHREAD_LIBS="" PTHREAD_CC="" fi # Check for i2c support ENABLE_I2C="true" AC_MSG_CHECKING([if i2c(DS2482-x00) is enabled]) AC_ARG_ENABLE(i2c, [ --enable-i2c Enable i2c (DS2482-x00) support (default true)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_I2C="false" fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_I2C) AM_CONDITIONAL(ENABLE_I2C, test "${ENABLE_I2C}" = "true") # Check for W1 (linux kernel module) ENABLE_W1="true" AC_MSG_CHECKING([if W1 is enabled]) AC_ARG_ENABLE(w1, [ --enable-w1 Enable w1 support (default true)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_W1="false" fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_W1) AM_CONDITIONAL(ENABLE_W1, test "${ENABLE_W1}" = "true") # Check if the modules are enabled #Check owhttpd ENABLE_OWHTTPD="true" AC_MSG_CHECKING(if owhttpd is enabled) AC_ARG_ENABLE(owhttpd, [ --enable-owhttpd Enable owhttpd module (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_OWHTTPD="false" else ENABLE_OWLIB="true" fi ], [ ENABLE_OWLIB="true" AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWHTTPD) AM_CONDITIONAL(ENABLE_OWHTTPD, test "${ENABLE_OWHTTPD}" = "true") #Check owftpd ENABLE_OWFTPD="true" AC_MSG_CHECKING(if owftpd is enabled) AC_ARG_ENABLE(owftpd, [ --enable-owftpd Enable owftpd module (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_OWFTPD="false" else # if test ! "${ENABLE_MT}" = "true" ; then # AC_MSG_ERROR([owftpd needs multithreading]) # fi ENABLE_OWLIB="true" fi ], [ if test "${ENABLE_MT}" = "true" ; then ENABLE_OWLIB="true" AC_MSG_RESULT([yes (default)]) else ENABLE_OWFTPD="false" AC_MSG_RESULT([no (multithreading needed)]) fi ]) AC_SUBST(ENABLE_OWFTPD) AM_CONDITIONAL(ENABLE_OWFTPD, test "${ENABLE_OWFTPD}" = "true") #Check owserver AC_MSG_CHECKING(if owserver is enabled) ENABLE_OWSERVER="true" AC_ARG_ENABLE(owserver, [ --enable-owserver Enable owserver module (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_OWSERVER="false" else ENABLE_OWLIB="true" fi ], [ ENABLE_OWLIB="true" AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWSERVER) AM_CONDITIONAL(ENABLE_OWSERVER, test "${ENABLE_OWSERVER}" = "true") #Check owexternal AC_MSG_CHECKING(if owexternal is enabled) ENABLE_OWEXTERNAL="true" AC_ARG_ENABLE(owexternal, [ --enable-owexternal Enable owexternal module (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_OWEXTERNAL="false" else ENABLE_OWLIB="true" fi ], [ ENABLE_OWLIB="true" AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWEXTERNAL) AM_CONDITIONAL(ENABLE_OWEXTERNAL, test "${ENABLE_OWEXTERNAL}" = "true") #Check ownet ENABLE_OWNET="true" AC_MSG_CHECKING(if ownet is enabled) AC_ARG_ENABLE(ownet, [ --enable-ownet Enable ownet module (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_OWNET="false" else ENABLE_OWLIB="true" fi ], [ ENABLE_OWLIB="true" AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWNET) AM_CONDITIONAL(ENABLE_OWNET, test "${ENABLE_OWNET}" = "true") #Check owtap ENABLE_OWTAP="true" AC_MSG_CHECKING(if owtap is enabled) AC_ARG_ENABLE(owtap, [ --enable-owtap Enable owtap module (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_OWTAP="false" fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWTAP) AM_CONDITIONAL(ENABLE_OWTAP, test "${ENABLE_OWTAP}" = "true") #Check owmalloc (special memory allocation routines) ENABLE_OWMALLOC="false" AC_MSG_CHECKING(if owmalloc is enabled) AC_ARG_ENABLE(owmalloc, [ --enable-owmalloc Enable owmalloc checking (default false)], [ AC_MSG_RESULT([$enableval]) if test "$enableval" = "yes" ; then ENABLE_OWMALLOC="true" fi ], [ AC_MSG_RESULT([no (default)]) ]) AC_SUBST(ENABLE_OWMALLOC) AM_CONDITIONAL(ENABLE_OWMALLOC, test "${ENABLE_OWMALLOC}" = "true") #Check owmon AC_MSG_CHECKING(if owmon is enabled) ENABLE_OWMON="true" AC_ARG_ENABLE(owmon, [ --enable-owmon Enable owmon module (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_OWMON="false" fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWMON) AM_CONDITIONAL(ENABLE_OWMON, test "${ENABLE_OWMON}" = "true") #Check owcapi AC_MSG_CHECKING(if owcapi is enabled) ENABLE_OWCAPI="true" AC_ARG_ENABLE(owcapi, [ --enable-owcapi Enable owcapi module (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_OWCAPI="false" else ENABLE_OWLIB="true" fi ], [ ENABLE_OWLIB="true" AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_OWCAPI) AM_CONDITIONAL(ENABLE_OWCAPI, test "${ENABLE_OWCAPI}" = "true") #Check swig AC_MSG_CHECKING(if swig is enabled) if test -z "$SWIG" ; then ENABLE_SWIG="false" else ENABLE_SWIG="auto" fi AC_ARG_ENABLE(swig, [ --enable-swig Enable swig (default auto)], [ if test "$enableval" = "no"; then ENABLE_SWIG="false" SWIG="" AC_MSG_RESULT([no]) else if test -z "$SWIG"; then AC_MSG_ERROR([Swig is not found and could not be enabled]) fi ENABLE_OWLIB="true" ENABLE_SWIG="true" AC_MSG_RESULT([yes]) fi ], [ AC_MSG_RESULT([auto (default)]) ]) if test "${HAVE_CYGWIN}" = "true"; then if test ! "$ENABLE_SWIG" = "true"; then ENABLE_SWIG="false" SWIG="" AC_MSG_RESULT([(Disable swig by default in Cygwin)]) fi else if test "$ENABLE_SWIG" = "auto"; then ENABLE_SWIG="true" fi fi AC_SUBST(ENABLE_SWIG) AM_CONDITIONAL(ENABLE_SWIG, test "${ENABLE_SWIG}" = "true") #Check owperl AC_MSG_CHECKING(if owperl is enabled) ENABLE_OWPERL="true" AC_ARG_ENABLE(owperl, [ --enable-owperl Enable owperl module (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_OWPERL="false" else if test -z "$SWIG" ; then AC_MSG_WARN([Cannot find swig program. Look for it at http://www.swig.org or use CPAN]) AC_MSG_WARN([OWPERL is disabled because swig is not found]) ENABLE_OWPERL="false" fi fi ], [ if test -z "$SWIG" ; then AC_MSG_RESULT([no (swig disabled)]) ENABLE_OWPERL="false" else AC_MSG_RESULT([yes (default)]) fi ]) PERL="" if test "${ENABLE_OWPERL}" = "true"; then m4_include(module/swig/perl5/perl5.m4) AC_MSG_RESULT(Looking for location of Perl executable) SC_PATH_PERL5 AC_SUBST(PERL5EXT) AC_SUBST(PERL5DYNAMICLINKING) AC_SUBST(PERL5LIB) AC_SUBST(PERL5DIR) AC_SUBST(PERL5NAME) AC_SUBST(PERL5CCFLAGS) if test -z "${PERL}" ; then AC_MSG_WARN([Cannot find perl binary.]) AC_MSG_WARN([OWPERL is disabled because perl binary is not found]) ENABLE_OWPERL="false" else if test -z "${PERL5NAME}" ; then AC_MSG_WARN([Cannot find perl library. Install perl-devel package.]) AC_MSG_WARN([OWPERL is disabled because perl library is not found]) ENABLE_OWPERL="false" fi fi fi AC_SUBST(PERL) AC_SUBST(ENABLE_OWPERL) AM_CONDITIONAL(ENABLE_OWPERL, test "${ENABLE_OWPERL}" = "true") if test -z "$PERL" ; then ENABLE_PERL="false" else ENABLE_PERL="true" fi AC_SUBST(ENABLE_PERL) AM_CONDITIONAL(ENABLE_PERL, test "${ENABLE_PERL}" = "true") #Check owphp AC_MSG_CHECKING(if owphp is enabled) ENABLE_OWPHP="true" AC_ARG_ENABLE(owphp, [ --enable-owphp Enable owphp module (default true)], [ AC_MSG_RESULT([$enableval]) if test "$enableval" = "no" ; then ENABLE_OWPHP="false" fi if test "$enableval" = "yes" ; then ENABLE_OWPHP="true" fi if test -z "$SWIG" ; then AC_MSG_WARN([Cannot find swig program. Look for it at http://www.swig.org or use CPAN]) AC_MSG_WARN([OWPHP is disabled because swig is not found]) ENABLE_OWPHP="false" fi ], [ if test -z "$SWIG" ; then AC_MSG_RESULT([no (swig disabled)]) ENABLE_OWPHP="false" else AC_MSG_RESULT([yes (default)]) fi ]) PHP="" if test "${ENABLE_OWPHP}" = "true" ; then m4_include(module/swig/php/php.m4) AC_MSG_RESULT(Looking for location of Php executable) SC_PATH_PHP AC_SUBST(PHPCONFIG) AC_SUBST(PHPINC) AC_SUBST(PHPEXT) AC_SUBST(PHPLIBDIR) if test -z "${PHP}" ; then AC_MSG_WARN([Cannot find php binary. Install php or php5 package]) AC_MSG_WARN([OWPHP is disabled because php binary is not found]) ENABLE_OWPHP="false" else if test -z "${PHPCONFIG}" ; then AC_MSG_WARN([Cannot find php-config binary. Install php-devel or php5-dev package]) AC_MSG_WARN([include and library paths will be guessed]) fi if test -z "${PHPINC}" ; then AC_MSG_WARN([Cannot find php include-file. Install php-devel or php5-dev package]) AC_MSG_WARN([OWPHP is disabled because php include-file is not found]) ENABLE_OWPHP="false" else if test -z "${PHPLIBDIR}" ; then AC_MSG_WARN([Cannot find php extension-dir. Install php-devel or php5-dev package]) AC_MSG_WARN([OWPHP is disabled because php extension-dir is not found]) ENABLE_OWPHP="false" fi fi fi fi AC_SUBST(PHP) AC_SUBST(ENABLE_OWPHP) AM_CONDITIONAL(ENABLE_OWPHP, test "${ENABLE_OWPHP}" = "true") if test -z "$PHP" ; then ENABLE_PHP="false" else ENABLE_PHP="true" fi AC_SUBST(ENABLE_PHP) AM_CONDITIONAL(ENABLE_PHP, test "${ENABLE_PHP}" = "true") #Check owpython AC_MSG_CHECKING(if owpython is enabled) ENABLE_OWPYTHON="true" AC_ARG_ENABLE(owpython, [ --enable-owpython Enable owpython module (default true)], [ AC_MSG_RESULT([$enableval]) if test "$enableval" = "no" ; then ENABLE_OWPYTHON="false" fi if test "$enableval" = "yes" ; then ENABLE_OWPYTHON="true" if test -z "$SWIG" ; then AC_MSG_WARN([Cannot find swig program. Look for it at http://www.swig.org or use CPAN]) AC_MSG_WARN([OWPYTHON is disabled because swig is not found]) ENABLE_OWPYTHON="false" fi fi ], [ if test -z "$SWIG" ; then AC_MSG_RESULT([no (swig disabled)]) ENABLE_OWPYTHON="false" else AC_MSG_RESULT([yes (default)]) fi ]) PYTHON="" if test "${ENABLE_OWPYTHON}" = "true" ; then m4_include(module/swig/python/python.m4) AC_MSG_RESULT(Looking for location of Python executable) SC_PATH_PYTHON AC_SUBST(PYVERSION) AC_SUBST(PYSITEDIR) AC_SUBST(PYTHONDYNAMICLINKING) if test -z "${PYTHON}" ; then AC_MSG_WARN([Cannot find python binary. Install python package.]) AC_MSG_WARN([OWPYTHON is disabled because python binary is not found]) ENABLE_OWPYTHON="false" else if test -z "${PYLDFLAGS}" ; then AC_MSG_WARN([Cannot find python library. Install python-devel package.]) AC_MSG_WARN([OWPYTHON is disabled because python library is not found]) ENABLE_OWPYTHON="false" else if test -z "${PYCFLAGS}" ; then AC_MSG_WARN([Cannot find python include-file. Install python-devel package.]) AC_MSG_WARN([OWPYTHON is disabled because python include-file is not found]) ENABLE_OWPYTHON="false" fi fi fi fi AC_SUBST(ENABLE_OWPYTHON) AM_CONDITIONAL(ENABLE_OWPYTHON, test "${ENABLE_OWPYTHON}" = "true") AC_SUBST(PYTHON) if test -z "$PYTHON" ; then ENABLE_PYTHON="false" else ENABLE_PYTHON="true" fi AC_SUBST(ENABLE_PYTHON) AM_CONDITIONAL(ENABLE_PYTHON, test "${ENABLE_PYTHON}" = "true") #Check owtcl AC_MSG_CHECKING(if owtcl is enabled) ENABLE_OWTCL="true" AC_ARG_ENABLE(owtcl, [ --enable-owtcl Enable owtcl module (default true)], [ AC_MSG_RESULT([$enableval]) if test "$enableval" = "no" ; then ENABLE_OWTCL="false" fi if test "$enableval" = "yes" ; then ENABLE_OWTCL="true" fi ], [ AC_MSG_RESULT([yes (default)]) ]) if test "${ENABLE_OWTCL}" = "true" ; then m4_include(module/owtcl/tcl.m4) AC_MSG_RESULT(Looking for tclConfig.sh) SC_PATH_TCLCONFIG if test -z "$TCL_BIN_DIR" -o ! -f "$TCL_BIN_DIR/tclConfig.sh" ; then AC_MSG_WARN([OWTCL is disabled because tclConfig.sh is not found]) ENABLE_OWTCL="false" else SC_LOAD_TCLCONFIG AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SHLIB_CFLAGS) AC_SUBST(TCL_SHLIB_LD) AC_SUBST(TCL_SHLIB_LD_LIBS) AC_SUBST(TCL_SHLIB_SUFFIX) AC_SUBST(TCL_VERSION) AC_SUBST(TCL_PREFIX) AC_SUBST(TCL_EXEC_PREFIX) AC_SUBST(TCL_CFLAGS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_LIBS) AC_SUBST(TCL_LD_FLAGS) AC_SUBST(TCL_COMPAT_OBJS) AC_SUBST(TCL_LD_SEARCH_FLAGS) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TCL_BUILD_LIB_SPEC) AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) AC_SUBST(TCL_INCLUDE_SPEC) AC_SUBST(TCL_PACKAGE_PATH) # guess that tcl will install the files under the first path in # TCL_PACKAGE_PATH. TCL_BIN_DIR is usually correct, but this # might contain staging_dir prefix when cross-compiling. OWTCL_INSTALL_PATH="`echo ${TCL_PACKAGE_PATH} | cut -d' ' -f1`" case "${host_cpu}-${host_os}" in *-darwin*) OWTCL_INSTALL_PATH="`echo ${TCL_BIN_DIR} | cut -d' ' -f1`" ;; *) OWTCL_INSTALL_PATH="`echo ${TCL_PACKAGE_PATH} | cut -d' ' -f1`" ;; esac # Debian Hack: do not install in /usr/local/lib/tcltk # OWTCL_INSTALL_PATH="/usr/lib/tcltk" AC_SUBST(OWTCL_INSTALL_PATH) fi fi AC_SUBST(ENABLE_OWTCL) AM_CONDITIONAL(ENABLE_OWTCL, test "${ENABLE_OWTCL}" = "true") AC_DEFUN([ACX_EXPAND], [ EXP_VAR=[$1] FROM_VAR=[$2] dnl first expand prefix and exec_prefix if necessary prefix_save=$prefix exec_prefix_save=$exec_prefix dnl if no prefix given, then use /usr/local, the default prefix if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix fi dnl if no exec_prefix given, then use prefix if test "x$exec_prefix" = "xNONE"; then exec_prefix=$prefix fi full_var="$FROM_VAR" dnl loop until it doesnt change anymore while true; do new_full_var="`eval echo $full_var`" if test "x$new_full_var"="x$full_var"; then break; fi full_var=$new_full_var done dnl clean up full_var=$new_full_var AC_SUBST([$1], "$full_var") dnl restore prefix and exec_prefix prefix=$prefix_save exec_prefix=$exec_prefix_save ]) dnl ACX_EXPAND ACX_EXPAND(LIBDIR, $libdir) ACX_EXPAND(BINDIR, $bindir) ACX_EXPAND(DATADIR, $datadir) EXTRACFLAGS="-D_FILE_OFFSET_BITS=64" AC_MSG_CHECKING([if cflag _XOPEN_SOURCE is required]) case "${host_cpu}-${host_os}" in *-aix* | *solaris* | *-osf* | *-hpux*) CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500" EXTRACFLAGS="$EXTRACFLAGS -D_XOPEN_SOURCE=500" AC_MSG_RESULT([-D_XOPEN_SOURCE=500]) ;; *-darwin* | *-netbsd*) AC_MSG_RESULT([no]) ;; *-freebsd* | *) # have to add this to support pthread_rwlock_t CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600" EXTRACFLAGS="$EXTRACFLAGS -D_XOPEN_SOURCE=600" AC_MSG_RESULT([-D_XOPEN_SOURCE=600]) ;; esac AC_MSG_CHECKING([if cflag _BSD_SOURCE is required]) case "${host_cpu}-${host_os}" in *-netbsd*) CFLAGS="$CFLAGS -D_NETBSD_SOURCE=1" EXTRACFLAGS="$EXTRACFLAGS -D_NETBSD_SOURCE=1" { $as_echo "$as_me:${as_lineno-$LINENO}: result: -D_NETBSD_SOURCE=1" >&5 $as_echo "-D_NETBSD_SOURCE=1" >&6; } ;; *) # have to add -D_BSD_SOURCE=1 to support major() in sys/sysmacros.h # have to add -D_ISOC99_SOURCE=1 to support lrint() in bits/mathcalls.h # have to add -D_POSIX_C_SOURCE=200112L for sem_timedwait # have to add -D_POSIX_C_SOURCE=199309L for clock_gettime() CFLAGS="$CFLAGS -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE" EXTRACFLAGS="$EXTRACFLAGS -D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE" AC_MSG_RESULT([-D_BSD_SOURCE=1 -D_ISOC99_SOURCE=1 -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE]) ;; esac # should perhaps add _GNU_SOURCE=1 instead of the two defines above... # That would define _BSD_SOURCE, _SVID_SOURCE, _LARGEFILE64_SOURCE, # _XOPEN_SOURCE=600, _POSIX_C_SOURCE, _POSIX_SOURCE, _ISOC99_SOURCE # Check if extra libs are needed. Should perhaps test if they are available too # instead of hardcoding the libraries. EXTRALIBS="" AC_MSG_CHECKING([if extra libs are required]) case "${host_cpu}-${host_os}" in *-darwin*) # This will actually be duplicates if libusb is used. OSLIBS="-Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation" EXTRALIBS="" AC_MSG_RESULT([${OSLIBS}]) ;; *-solaris*) OSLIBS="" EXTRALIBS=" -lsocket -lnsl " LIBS="$LIBS -lsocket -lnsl" AC_MSG_RESULT([${EXTRALIBS}]) ;; *) OSLIBS="" EXTRALIBS="" AC_MSG_RESULT([${EXTRALIBS}]) ;; esac #Check for profiling AC_MSG_CHECKING(if profiling is enabled) ENABLE_PROFILING="false" AC_ARG_ENABLE(profiling, [ --enable-profiling Enable profiling (default false)], [ AC_MSG_RESULT([$enableval]) if test "$enableval" = "yes" ; then ENABLE_PROFILING=true EXTRALIBS="$EXTRALIBS -pg" EXTRACFLAGS="$EXTRACFLAGS -pg" fi ], [ AC_MSG_RESULT([no (default)]) ]) AC_SUBST(EXTRACFLAGS) AC_SUBST(ENABLE_PROFILING) AM_CONDITIONAL(ENABLE_PROFILING, test "${ENABLE_PROFILING}" = "true") ACX_EXPAND(LD_EXTRALIBS, $EXTRALIBS) AC_SUBST(LD_EXTRALIBS) AC_SUBST(OSLIBS) AC_MSG_WARN([LD_EXTRALIBS=${LD_EXTRALIBS} OSLIBS=${OSLIBS}]) AC_ARG_WITH(fuseinclude, [ --with-fuseinclude=DIR FUSE-include from @<:@/usr/local/include@:>@], [fuse_include_path=$withval], [fuse_include_path='/usr/local/include']) AC_SUBST(fuse_include_path) AC_ARG_WITH(fuselib, [ --with-fuselib=DIR FUSE-lib from @<:@/usr/local/lib@:>@], [fuse_lib_path=$withval], [fuse_lib_path='/usr/local/lib']) AC_SUBST(fuse_lib_path) #Check owfs AC_MSG_CHECKING([if owfs is enabled]) ENABLE_OWFS="auto" AC_ARG_ENABLE(owfs, [ --enable-owfs Enable owfs module (default auto)], [ AC_MSG_RESULT([$enableval]) if test "$enableval" = "yes" ; then ENABLE_OWFS="true" fi if test "$enableval" = "no" ; then ENABLE_OWFS="false" fi ], [ AC_MSG_RESULT([auto (default)]) ]) # We need fuse only if OWFS is enabled if test "${ENABLE_OWFS}" != "false" ; then save_LD_EXTRALIBS="$LD_EXTRALIBS" save_CPPFLAGS="$CPPFLAGS" save_LDFLAGS="$LDFLAGS" FUSE_FLAGS="-DFUSE_USE_VERSION=26" FUSE_INCLUDES="-I${fuse_include_path}" FUSE_LIBS="-L${fuse_lib_path}" LD_EXTRALIBS="$save_LD_EXTRALIBS " CPPFLAGS="$save_CPPFLAGS -D_FILE_OFFSET_BITS=64 $FUSE_FLAGS $FUSE_INCLUDES" LDFLAGS="$save_LDFLAGS $FUSE_LIBS" AC_CHECK_HEADER(fuse.h,,[ AC_MSG_WARN([ Cannot find fuse.h - Add the search path with --with-fuseinclude]) FUSE_FLAGS="" FUSE_INCLUDES="" FUSE_LIBS="" LD_EXTRALIBS="$save_LD_EXTRALIBS" CPPFLAGS="$save_CPPFLAGS -D_FILE_OFFSET_BITS=64" LDFLAGS="$save_LDFLAGS" AC_MSG_WARN([Install FUSE-2.2 or later to enable owfs - download it from http://fuse.sourceforge.net/]) if test "${ENABLE_OWFS}" = "auto"; then AC_MSG_WARN([OWFS is disabled because fuse.h is not found.]) ENABLE_OWFS="false" else AC_MSG_ERROR([Configure without --enable-owfs to detect fuse automatically.]) fi ]) if test "${ENABLE_OWFS}" != "false"; then save_CFLAGS="$CFLAGS" save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$LIBS $PTHREAD_LIBS" AC_CHECK_LIB(fuse,fuse_main, [FUSE_LIBS="$FUSE_LIBS -lfuse"],[ AC_MSG_WARN([ Cannot find libfuse.a - add the search path with --with-fuselib]) AC_MSG_WARN([Running ldconfig or adding "/usr/local/lib" to /etc/ld.so.conf might also solve the problem, otherwise re-install fuse.]) if test "${ENABLE_OWFS}" = "auto"; then AC_MSG_WARN([OWFS is disabled because libfuse.a is not found.]) ENABLE_OWFS="false" else AC_MSG_ERROR([Cannot enable OWFS]) fi ],) CFLAGS="$save_CFLAGS" LIBS="$save_LIBS" fi if test "${ENABLE_OWFS}" != "false"; then # check for a supported FUSE_MAJOR_VERSION. AC_MSG_CHECKING([For supported FUSE API version]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[ #ifndef FUSE_MAJOR_VERSION #error "FUSE_MAJOR_VERSION not defined" #endif ]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_WARN([OWFS is disabled since fuse.h is too old]) if test "${ENABLE_OWFS}" = "true"; then AC_MSG_ERROR([You have to install fuse first (fuse-2.2 or later recommended) - download it from http://fuse.sourceforge.net/]) else ENABLE_OWFS="false" fi ]) fi # Use newest FUSE API if version is newer than 2.2 if test "${ENABLE_OWFS}" != "false"; then # check for a supported FUSE_MAJOR_VERSION. AC_MSG_CHECKING([For FUSE version ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[ #ifndef FUSE_VERSION #ifndef FUSE_MAJOR_VERSION #define FUSE_VERSION 11 #else /* FUSE_MAJOR_VERSION */ #undef FUSE_MAKE_VERSION #define FUSE_MAKE_VERSION(maj,min) ((maj) * 10 + (min)) #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION,FUSE_MINOR_VERSION) #endif /* FUSE_MAJOR_VERSION */ #endif /* FUSE_VERSION */ #if (FUSE_VERSION >= 22) /* Fuse > 2.2 is ok */ #else #error "Fuse < 2.2" #endif ]])], [AC_MSG_RESULT([2.2 or later]) ], [AC_MSG_RESULT([<2.2]) FUSE_FLAGS="" ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LD_EXTRALIBS="$save_LD_EXTRALIBS" if test "${ENABLE_OWFS}" != "false"; then ENABLE_OWLIB="true" ENABLE_OWFS="true" fi else ENABLE_OWFS="false" fi AC_SUBST(FUSE_LIBS) AC_SUBST(FUSE_FLAGS) AC_SUBST(FUSE_INCLUDES) AC_SUBST(ENABLE_OWFS) AM_CONDITIONAL(ENABLE_OWFS, test "${ENABLE_OWFS}" = "true") # Check if the zeroconf/bonjour is enabled. AC_MSG_CHECKING(if zeroconf/bonjour is enabled) ENABLE_ZERO="true" AC_ARG_ENABLE(zero, [ --enable-zero Enable zeroconf/bonjour (default true)], [ AC_MSG_RESULT([$enableval]) if test ! "$enableval" = "yes" ; then ENABLE_ZERO=false fi ], [ AC_MSG_RESULT([yes (default)]) ]) AC_SUBST(ENABLE_ZERO) AM_CONDITIONAL(ENABLE_ZERO, test "${ENABLE_ZERO}" = "true") LIBUSB_CFLAGS="" LIBUSB_LIBS="" # Check for USB enabled ENABLE_USB=auto AC_MSG_CHECKING([if usb support is enabled]) AC_ARG_ENABLE(usb, [ --enable-usb Enable 1-Wire usb DS2490 support (default auto)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_USB=false fi ], [ AC_MSG_RESULT([auto (default)]) ]) if test "${ENABLE_USB}" != "false"; then #LIBUSB_CONFIG PKG_CHECK_MODULES([LIBUSB], [libusb-1.0 >= 0.9.1], [ENABLE_USB=true],[ENABLE_USB=false]) fi AC_SUBST(LIBUSB_CFLAGS) AC_SUBST(LIBUSB_LIBS) AC_SUBST(ENABLE_USB) AM_CONDITIONAL(ENABLE_USB, test "${ENABLE_USB}" = "true") AM_CPPFLAGS="$AM_CPPFLAGS $LIBUSB_CFLAGS" # Check for Avahi enabled ENABLE_AVAHI=auto AC_MSG_CHECKING([if Avahi support is enabled]) AC_ARG_ENABLE(avahi, [ --enable-avahi Enable zero-config autodiscovery (default auto)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_AVAHI=false fi ], [ AC_MSG_RESULT([auto (default)]) ]) if test "${ENABLE_AVAHI}" != "false"; then # Include libavahi if the avahi is enabled if test "X${LIBAVAHI_CONFIG}" != "X" ; then LIBAVAHI_CFLAGS=`$LIBAVAHI_CONFIG --cflags` LIBAVAHI_LIBS=`$LIBAVAHI_CONFIG --libs` save_CPPFLAGS="$CPPFLAGS" save_LDFLAGS="$LDFLAGS" CPPFLAGS="$save_CPPFLAGS $LIBAVAHI_CFLAGS" LDFLAGS="$save_LDFLAGS $LIBAVAHI_LIBS" AC_MSG_CHECKING([if libavahi compiles with includes+lib ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[ avahi_client_new(NULL,0,NULL); ]])], [AC_MSG_RESULT([ok])], [AC_MSG_RESULT([compilation error]) LIBAVAHI_CFLAGS="" LIBAVAHI_LDFLAGS="" LIBAVAHI_CONFIG="" ]) CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" #LIBAVAHI_CONFIG fi # ultimate test to see if libavahi is found after AC_CHECK_LIB if test "X${LIBAVAHI_CONFIG}" == "X"; then PKG_CHECK_MODULES([LIBAVAHI], [avahi-client], [ dnl ok, avahi found with pkg-config ],[ dnl else trying basic detection AC_CHECK_LIB(avahi-common,avahi_threaded_poll_new,[ AC_CHECK_LIB(avahi-client,avahi_client_new,[ LIBAVAHI_LIBS="-lavahi-client -lavahi-common"],[ AC_MSG_WARN([Cannot find libavahi-client]) if test "${ENABLE_AVAHI}" = "true" ; then AC_MSG_ERROR([libavahi must be installed to use a Avahi zero-configuration]) else AC_MSG_WARN([libavahi not found, avahi will be disabled]) ENABLE_AVAHI=false fi ],)],[ AC_MSG_WARN([Cannot find libavahi-common]) if test "${ENABLE_AVAHI}" = "true" ; then AC_MSG_ERROR([libavahi must be installed to use a Avahi zero-configuration]) else AC_MSG_WARN([libavahi not found, avahi will be disabled]) ENABLE_AVAHI=false fi ],) ]) fi if test "${ENABLE_AVAHI}" != "false" ; then ENABLE_AVAHI=true fi # ENABLE_AVAHI fi AC_SUBST(LIBAVAHI_CFLAGS) AC_SUBST(LIBAVAHI_LIBS) AC_SUBST(ENABLE_AVAHI) AM_CONDITIONAL(ENABLE_AVAHI, test "${ENABLE_AVAHI}" = "true") # Check for Parallel port enabled ENABLE_PARPORT=auto AC_MSG_CHECKING([if parallel port support is enabled]) AC_ARG_ENABLE(parport, [ --enable-parport Enable 1-Wire parallel port DS1410E support (default auto)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_PARPORT=false fi ], [ AC_MSG_RESULT([yes (default)]) ]) # Include linux/ppdev.h if the parallel port is enabled if test "${ENABLE_PARPORT}" != "false" ; then AC_CHECK_HEADER(linux/ppdev.h,,[ if test "${ENABLE_PARPORT}" = "true" ; then AC_MSG_ERROR([ppdev.h must be installed to use parallel port adapter]) else AC_MSG_WARN([ppdev.h not found, parallel port will be disabled]) ENABLE_PARPORT=false fi ]) if test "${ENABLE_PARPORT}" != "false" ; then ENABLE_PARPORT=true fi fi AC_SUBST(ENABLE_PARPORT) AM_CONDITIONAL(ENABLE_PARPORT, test "${ENABLE_PARPORT}" = "true") dnl We support both libftdi 1.x and libftdi 0.x if test "$cross_compiling" != yes; then AC_CHECK_PROGS(LIBFTDI_CONFIG, libftdi1-config libftdi-config) else LIBFTDI_CONFIG="" fi AC_SUBST(LIBFTDI_CONFIG) AC_ARG_WITH(libftdi-config, [ --with-libftdi-config=PATH Specify full path to libftdi-config or libftdi1-config]) dnl Check if user passed a specific libftdi-config program. if test "X$with_libftdi_config" != "X" ; then LIBFTDI_CONFIG=$with_libftdi_config fi if test "$cross_compiling" != yes; then if test "X$LIBFTDI_CONFIG" == "X" ; then dirs="/usr/bin /usr/local/bin /opt/local/bin" for i in $dirs; do for prog in libftdi1-config libftdi-config; do echo "Testing $i/$prog" if test -x $i/$prog; then AC_MSG_RESULT($i/$prog is found) LIBFTDI_CONFIG="$i/$prog" break 2; fi done done fi fi # Check if FTDI should be enabled ENABLE_FTDI=auto AC_MSG_CHECKING([if libftdi is available]) AC_ARG_ENABLE(ftdi, [ --enable-ftdi Enable LinkUSB support via libftdi (default auto)], [ AC_MSG_RESULT([$enableval]) if ! test "$enableval" = "yes" ; then ENABLE_FTDI=false fi ], [ AC_MSG_RESULT([auto (default)]) ]) # Include ftdi.h if enabled if test "${ENABLE_FTDI}" != "false" ; then LIBFTDI_FOUND=false if test "X${LIBFTDI_CONFIG}" != "X" ; then LIBFTDI_CFLAGS=`$LIBFTDI_CONFIG --cflags` LIBFTDI_LIBS=`$LIBFTDI_CONFIG --libs` save_CPPFLAGS="$CPPFLAGS" save_LDFLAGS="$LDFLAGS" CPPFLAGS="$save_CPPFLAGS $LIBFTDI_CFLAGS" LDFLAGS="$save_LDFLAGS $LIBFTDI_LIBS" AC_MSG_CHECKING([if libftdi compiles with includes+lib ]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[ struct ftdi_context ftdic; ftdi_init(&ftdic); ]])], [AC_MSG_RESULT([ok]) FTDI_FOUND=true ], [AC_MSG_RESULT([compilation error]) LIBFTDI_CFLAGS="" LIBFTDI_LDFLAGS="" LIBFTDI_CONFIG="" ]) CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" fi if test "${FTDI_FOUND}" = "true"; then ENABLE_FTDI=true else if test "${ENABLE_FTDI}" = "true" ; then AC_MSG_ERROR([libftdi must be installed to use LinkUSB natively]) else AC_MSG_WARN([libftdi not found, LinkUSB native will be disabled]) ENABLE_FTDI=false fi fi fi AC_SUBST(LIBFTDI_CFLAGS) AC_SUBST(LIBFTDI_LIBS) AC_SUBST(ENABLE_FTDI) AM_CONDITIONAL(ENABLE_FTDI, test "${ENABLE_FTDI}" = "true") if test "${HAVE_CYGWIN}" = "true" ; then OW_CYGWIN=1 else OW_CYGWIN=0 fi AC_SUBST(OW_CYGWIN) if test "${HAVE_DARWIN}" = "true" ; then OW_DARWIN=1 else OW_DARWIN=0 fi AC_SUBST(OW_DARWIN) AC_CHECK_TYPES([struct sockaddr_storage], , , [[ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif ]] ) if test "$ac_cv_type_struct_sockaddr_storage" = no; then AC_CHECK_MEMBER([struct sockaddr_in.sin_len], [AC_DEFINE(SOCKADDR_IN_HAS_LEN, 1, [Define to 1 if sockaddr_in has a 'sin_len' member.])]) fi AC_CHECK_TYPES([struct addrinfo], , , [[#include ]]) AC_CHECK_TYPE(socklen_t, , [AC_DEFINE([socklen_t], [unsigned int], [If we do not have a real socklen_t, unsigned int is good enough.])], [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif ]) AC_MSG_CHECKING(for AF_NETLINK) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif ], [int ss_family = AF_NETLINK;])], [ AC_MSG_RESULT(yes) have_af_netlink="yes" AC_DEFINE(HAVE_AF_NETLINK, 1, [Have AF_NETLINK in socket.h]) ], [AC_MSG_RESULT(no) have_af_netlink="no"]) if test "${have_af_netlink}" != "yes" ; then if test "${ENABLE_W1}" != "false" ; then AC_MSG_WARN([Disable w1 since AF_NETLINK not found]) ENABLE_W1="false" fi fi AC_MSG_CHECKING(for broken glibc with __ss_family) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif ], [struct sockaddr_storage s; s.__ss_family = AF_INET;])], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BROKEN_SS_FAMILY, 1, [Broken glibc implementations use __ss_family instead of ss_family.]) ], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING([for core ipv6 support]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#define IN_AUTOCONF #include "include/stdinc.h"]], [[struct sockaddr_in6 s; struct sockaddr_storage t; s.sin6_family = 0;]] )], [ if test "${HAVE_CYGWIN}" = "true" ; then AC_MSG_RESULT([no, Cygwins ipv6 is incomplete]) AC_DEFINE(__HAS_IPV6__, 0, [No ipv6 support available.]) have_v6=no else have_v6=yes AC_DEFINE(IPV6, 1, [Define if ipv6 support is present and available.]) AC_DEFINE(__HAS_IPV6__, 1, [Define if ipv6 support is present and available.]) AC_MSG_RESULT(yes) AC_MSG_CHECKING([for struct in6addr_any]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#define IN_AUTOCONF #include "include/stdinc.h"]], [[struct in6_addr a = in6addr_any;]] )], [AC_MSG_RESULT(yes)], [ AC_MSG_RESULT(no) AC_DEFINE(NO_IN6ADDR_ANY, 1, [Define to 1 if your system has no in6addr_any.]) inet_misc=1 ] ) fi ], [ AC_MSG_RESULT(no) have_v6=no AC_DEFINE(__HAS_IPV6__, 0, [No ipv6 support available.]) ]) AC_CACHE_CHECK(if sem_timedwait exists,ac_cv_sem_timedwait, [ save_LIBS="$LIBS"; LIBS="$LIBS $PTHREAD_LIBS" ; save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS $PTHREAD_CFLAGS" AC_TRY_LINK([ #if HAVE_STDLIB_H #include #endif #if HAVE_SEMAPHORE_H #include #endif ], [sem_timedwait(NULL, NULL)],[ ac_cv_sem_timedwait="yes"],[ AC_MSG_WARN([Cannot find sem_timedwait]) ac_cv_sem_timedwait="no" ]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" ]) if test "$ac_cv_sem_timedwait" = "yes"; then AC_DEFINE(HAVE_SEM_TIMEDWAIT, 1, [Define to 1 if you have the sem_timedwait function.]) fi AC_CACHE_CHECK([whether string.h and strings.h may both be included], gcc_cv_header_string, [ AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#include #include ]] )], [gcc_cv_header_string=yes], [gcc_cv_header_string=no] ) ]) if test "$gcc_cv_header_string" = "yes"; then AC_DEFINE(STRING_WITH_STRINGS, 1, [Define to 1 if string.h may be included along with strings.h]) fi if test "${ENABLE_I2C}" = "true" ; then OW_I2C=1 else OW_I2C=0 fi AC_SUBST(OW_I2C) if test "${ENABLE_W1}" = "true" ; then OW_W1=1 else OW_W1=0 fi AC_SUBST(OW_W1) if test "${ENABLE_USB}" = "true" ; then OW_USB=1 else OW_USB=0 fi AC_SUBST(OW_USB) if test "${ENABLE_AVAHI}" = "true" ; then OW_AVAHI=1 else OW_AVAHI=0 fi AC_SUBST(OW_AVAHI) if test "${ENABLE_ZERO}" = "true" ; then OW_ZERO=1 else OW_ZERO=0 fi AC_SUBST(OW_ZERO) if test "${ENABLE_PARPORT}" = "true" ; then OW_PARPORT=1 else OW_PARPORT=0 fi AC_SUBST(OW_PARPORT) if test "${ENABLE_FTDI}" = "true" ; then OW_FTDI=1 else OW_FTDI=0 fi AC_SUBST(OW_FTDI) if test "${ENABLE_DEBUG}" = "true" ; then OW_DEBUG=1 else OW_DEBUG=0 fi AC_SUBST(OW_DEBUG) if test "${ENABLE_MUTEX_DEBUG}" = "true" ; then OW_MUTEX_DEBUG=1 else OW_MUTEX_DEBUG=0 fi AC_SUBST(OW_MUTEX_DEBUG) if test "${ENABLE_OWMALLOC}" = "true" ; then OW_ALLOC_DEBUG=1 else OW_ALLOC_DEBUG=0 fi AC_SUBST(OW_ALLOC_DEBUG) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_HEADER_STDBOOL AC_STRUCT_TM # Checks for library functions. AC_FUNC_FORK #AC_FUNC_MALLOC #AC_FUNC_MKTIME #AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_STRFTIME AC_FUNC_STRTOD AC_TYPE_SIGNAL AC_CHECK_FUNCS([accept daemon getaddrinfo freeaddrinfo gethostbyname2_r gethostbyaddr_r gethostbyname_r getservbyname_r getopt getopt_long gmtime_r gettimeofday localtime_r inet_ntop inet_pton memchr memset select socket strcasecmp strchr strdup strncasecmp strtol strtoul twalk tsearch tfind tdelete tdestroy vasprintf strsep vsprintf vsnprintf writev getline]) save_LIBS="$LIBS" LIBS="" DL_LIBS="" if test "${ENABLE_ZERO}" = "true" ; then AC_SEARCH_LIBS(dlopen, dl, AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have dlopen])) DL_LIBS="$LIBS" fi AC_SUBST([DL_LIBS]) LIBS="$save_LIBS" save_LIBS="$LIBS" M_LIBS="" LIBS="" AC_SEARCH_LIBS(lrint, m, AC_DEFINE(HAVE_LRINT, 1, [Define if you have lrint])) M_LIBS="$LIBS" AC_SUBST([M_LIBS]) LIBS="$save_LIBS" AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep])) # clock_gettime needed if real-time wait is needed for sem_timedwait. gettimeofday is enough. #AC_SEARCH_LIBS(clock_gettime, rt posix4, AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime])) # systemd support (see man 7 daemon) AC_ARG_WITH([systemdsystemunitdir], [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, [with_systemdsystemunitdir=auto]) AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) AS_IF([test "x$def_systemdsystemunitdir" = "x"], [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) with_systemdsystemunitdir=no], [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) save_LIBS="$LIBS" MQ_LIBS="" LIBS="" AC_SEARCH_LIBS([mq_getattr], [rt]) MQ_LIBS="$LIBS" AC_SUBST([MQ_LIBS]) LIBS="$save_LIBS" HAVE_CHECK="false" PKG_CHECK_MODULES([libcheck],[check >= 0.10.0],[HAVE_CHECK="true"], AC_MSG_WARN(["Check unit testing framework not found. "])) AM_CONDITIONAL(HAVE_CHECK, test "${HAVE_CHECK}" = "true") CHECK_CFLAGS="$libcheck_CFLAGS" CHECK_LIBS="$libcheck_LIBS" AC_SUBST([CHECK_CFLAGS]) AC_SUBST([CHECK_LIBS]) AC_CONFIG_FILES([ Makefile module/Makefile module/owlib/Makefile module/owlib/src/Makefile module/owlib/src/include/Makefile module/owlib/src/c/Makefile module/owlib/tests/Makefile module/owfs/Makefile module/owfs/src/Makefile module/owfs/src/include/Makefile module/owfs/src/c/Makefile module/owhttpd/Makefile module/owhttpd/src/Makefile module/owhttpd/src/include/Makefile module/owhttpd/src/c/Makefile module/owserver/Makefile module/owserver/src/Makefile module/owserver/src/include/Makefile module/owserver/src/c/Makefile module/owftpd/Makefile module/owftpd/src/Makefile module/owftpd/src/include/Makefile module/owftpd/src/c/Makefile module/ownet/Makefile module/ownet/php/Makefile module/ownet/php/examples/ownet_example.php module/ownet/python/Makefile module/ownet/perl5/Makefile module/ownet/c/Makefile module/ownet/c/src/Makefile module/ownet/c/src/include/Makefile module/ownet/c/src/c/Makefile module/ownet/c/src/example/Makefile module/owshell/Makefile module/owshell/src/Makefile module/owshell/src/include/Makefile module/owshell/src/c/Makefile module/owcapi/Makefile module/owcapi/src/Makefile module/owcapi/src/include/Makefile module/owcapi/src/c/Makefile module/owcapi/src/example/Makefile module/owcapi/src/example++/Makefile module/owtap/Makefile module/owmon/Makefile module/swig/Makefile module/swig/perl5/Makefile module/swig/perl5/OW/Makefile.linux module/swig/perl5/OW/Makefile.osx module/swig/php/Makefile module/swig/php/example/load_php_OW.php module/swig/python/Makefile module/swig/python/ow/Makefile module/swig/python/setup.py module/owtcl/Makefile src/Makefile src/include/Makefile src/man/Makefile src/man/man1/Makefile src/man/man3/Makefile src/man/man5/Makefile src/man/mann/Makefile src/rpm/Makefile src/rpm/owfs.spec src/scripts/Makefile src/scripts/windows/Makefile src/scripts/windows/owfs.nsi src/scripts/usb/Makefile src/scripts/usb/cygwin/Makefile src/scripts/usb/windows/Makefile src/scripts/systemd/Makefile src/include/owfs_config.h ]) AC_OUTPUT # Now, let's tell them what is the current configuration. Only the items # that are funny (like current default prefix) or configurable (like the # cache) should be included. AC_MSG_RESULT() AC_MSG_RESULT([Current configuration:]) AC_MSG_RESULT() AC_MSG_RESULT([ Deployment location: ${prefix}]) AC_MSG_RESULT() AC_MSG_RESULT([Compile-time options:]) if test "${ENABLE_USB}" = "true"; then AC_MSG_RESULT([ USB is enabled]) else AC_MSG_RESULT([ USB is DISABLED]) fi if test "${ENABLE_AVAHI}" = "true"; then AC_MSG_RESULT([ AVAHI is enabled]) else AC_MSG_RESULT([ AVAHI is DISABLED]) fi if test "${ENABLE_I2C}" = "true"; then AC_MSG_RESULT([ I2C is enabled]) else AC_MSG_RESULT([ I2C is DISABLED]) fi if test "${ENABLE_W1}" = "true"; then AC_MSG_RESULT([ W1 is enabled]) else AC_MSG_RESULT([ W1 is DISABLED]) fi if test "${ENABLE_PARPORT}" = "true"; then AC_MSG_RESULT([ Parallel port DS1410E is enabled]) else AC_MSG_RESULT([ Parallel port DS1410E is DISABLED]) fi if test "${ENABLE_FTDI}" = "true"; then AC_MSG_RESULT([ FTDI (LinkUSB) is enabled]) else AC_MSG_RESULT([ FTDI (LinkUSB) is DISABLED]) fi if test "${ENABLE_ZERO}" = "true"; then AC_MSG_RESULT([ Zeroconf/Bonjour is enabled]) else AC_MSG_RESULT([ Zeroconf/Bonjour is DISABLED]) fi if test "${ENABLE_DEBUG}" = "true"; then AC_MSG_RESULT([ Debug-output is enabled]) else AC_MSG_RESULT([ Debug-output is DISABLED]) fi if test "${ENABLE_MUTEX_DEBUG}" = "true"; then AC_MSG_RESULT([ Mutexdebug is enabled]) else AC_MSG_RESULT([ Mutexdebug is DISABLED]) fi if test "${ENABLE_PROFILING}" = "true"; then AC_MSG_RESULT([ Profiling is enabled]) else AC_MSG_RESULT([ Profiling is DISABLED]) fi if test "${ENABLE_OWMALLOC}" = "true"; then AC_MSG_RESULT([Tracing memory allocation is enabled]) else AC_MSG_RESULT([Tracing memory allocation is DISABLED]) fi AC_MSG_RESULT() AC_MSG_RESULT([Module configuration:]) if test "${ENABLE_OWLIB}" = "true"; then AC_MSG_RESULT([ owlib is enabled]) else AC_MSG_RESULT([ owlib is DISABLED]) fi if test "${ENABLE_OWSHELL}" = "true"; then AC_MSG_RESULT([ owshell is enabled]) else AC_MSG_RESULT([ owshell is DISABLED]) fi if test "${ENABLE_OWFS}" = "true"; then AC_MSG_RESULT([ owfs is enabled]) else AC_MSG_RESULT([ owfs is DISABLED]) fi if test "${ENABLE_OWHTTPD}" = "true"; then AC_MSG_RESULT([ owhttpd is enabled]) else AC_MSG_RESULT([ owhttpd is DISABLED]) fi if test "${ENABLE_OWFTPD}" = "true"; then AC_MSG_RESULT([ owftpd is enabled]) else AC_MSG_RESULT([ owftpd is DISABLED]) fi if test "${ENABLE_OWSERVER}" = "true"; then AC_MSG_RESULT([ owserver is enabled]) else AC_MSG_RESULT([ owserver is DISABLED]) fi if test "${ENABLE_OWEXTERNAL}" = "true"; then AC_MSG_RESULT([ owexternal is enabled]) else AC_MSG_RESULT([ owexternal is DISABLED]) fi if test "${ENABLE_OWNET}" = "true"; then AC_MSG_RESULT([ ownet is enabled]) else AC_MSG_RESULT([ ownet is DISABLED]) fi if test "${ENABLE_OWNETLIB}" = "true"; then AC_MSG_RESULT([ ownetlib is enabled]) else AC_MSG_RESULT([ ownetlib is DISABLED]) fi if test "${ENABLE_OWTAP}" = "true"; then AC_MSG_RESULT([ owtap is enabled]) else AC_MSG_RESULT([ owtap is DISABLED]) fi if test "${ENABLE_OWMON}" = "true"; then AC_MSG_RESULT([ owmon is enabled]) else AC_MSG_RESULT([ owmon is DISABLED]) fi if test "${ENABLE_OWCAPI}" = "true"; then AC_MSG_RESULT([ owcapi is enabled]) else AC_MSG_RESULT([ owcapi is DISABLED]) fi if test "${ENABLE_SWIG}" = "true"; then AC_MSG_RESULT([ swig is enabled]) else AC_MSG_RESULT([ swig is DISABLED]) fi if test "${ENABLE_OWPERL}" = "true" -a "${ENABLE_SWIG}" = "true"; then AC_MSG_RESULT([ owperl is enabled]) else AC_MSG_RESULT([ owperl is DISABLED]) fi if test "${ENABLE_OWPHP}" = "true" -a "${ENABLE_SWIG}" = "true"; then AC_MSG_RESULT([ owphp is enabled]) else AC_MSG_RESULT([ owphp is DISABLED]) fi if test "${ENABLE_OWPYTHON}" = "true" -a "${ENABLE_SWIG}" = "true"; then AC_MSG_RESULT([ owpython is enabled]) else AC_MSG_RESULT([ owpython is DISABLED]) fi if test "${ENABLE_OWTCL}" = "true"; then AC_MSG_RESULT([ owtcl is enabled]) else AC_MSG_RESULT([ owtcl is DISABLED]) fi AC_MSG_RESULT() if test "${HAVE_CHECK}" = "true"; then AC_MSG_RESULT([ unit tests are enabled (run with 'make check')]) else AC_MSG_RESULT([ unit tests are DISABLED]) fi AC_MSG_RESULT() owfs-3.1p5/aclocal.m40000644000175000001440000015060313022537046011364 00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 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'.])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2014 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.15' 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.15], [], [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.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 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-2014 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-2014 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-2014 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. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _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. FIXME. This creates each '.P' file that we will # 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" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 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-2014 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-2014 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-2014 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 to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 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 ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2014 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. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 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-2014 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-2014 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-2014 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-2014 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-2014 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-2014 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-2014 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 m4_include([src/scripts/m4/libtool.m4]) m4_include([src/scripts/m4/ltoptions.m4]) m4_include([src/scripts/m4/ltsugar.m4]) m4_include([src/scripts/m4/ltversion.m4]) m4_include([src/scripts/m4/lt~obsolete.m4]) m4_include([acinclude.m4]) owfs-3.1p5/Makefile.in0000644000175000001440000010020113022537051011552 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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 = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/scripts/m4/libtool.m4 \ $(top_srcdir)/src/scripts/m4/ltoptions.m4 \ $(top_srcdir)/src/scripts/m4/ltsugar.m4 \ $(top_srcdir)/src/scripts/m4/ltversion.m4 \ $(top_srcdir)/src/scripts/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/src/scripts/m4/acx_pthread.m4 \ $(top_srcdir)/module/swig/perl5/perl5.m4 \ $(top_srcdir)/module/swig/php/php.m4 \ $(top_srcdir)/module/swig/python/python.m4 \ $(top_srcdir)/module/owtcl/tcl.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 = $(SHELL) \ $(top_srcdir)/src/scripts/install/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = module/ownet/php/examples/ownet_example.php \ module/ownet/c/src/example/Makefile \ module/owcapi/src/example/Makefile \ module/owcapi/src/example++/Makefile \ module/swig/perl5/OW/Makefile.linux \ module/swig/perl5/OW/Makefile.osx \ module/swig/php/example/load_php_OW.php 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 dist dist-all distcheck 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 CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/module/owcapi/src/example++/Makefile.in \ $(top_srcdir)/module/owcapi/src/example/Makefile.in \ $(top_srcdir)/module/ownet/c/src/example/Makefile.in \ $(top_srcdir)/module/ownet/php/examples/ownet_example.php.in \ $(top_srcdir)/module/swig/perl5/OW/Makefile.linux.in \ $(top_srcdir)/module/swig/perl5/OW/Makefile.osx.in \ $(top_srcdir)/module/swig/php/example/load_php_OW.php.in \ $(top_srcdir)/src/scripts/install/compile \ $(top_srcdir)/src/scripts/install/config.guess \ $(top_srcdir)/src/scripts/install/config.sub \ $(top_srcdir)/src/scripts/install/install-sh \ $(top_srcdir)/src/scripts/install/ltmain.sh \ $(top_srcdir)/src/scripts/install/missing \ $(top_srcdir)/src/scripts/install/mkinstalldirs AUTHORS \ COPYING COPYING.LIB ChangeLog INSTALL NEWS README TODO \ src/scripts/install/compile src/scripts/install/config.guess \ src/scripts/install/config.sub src/scripts/install/install-sh \ src/scripts/install/ltmain.sh src/scripts/install/missing \ src/scripts/install/mkinstalldirs 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 GZIP_ENV = --best DIST_TARGETS = 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_CPPFLAGS = @AM_CPPFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_AVAHI = @ENABLE_AVAHI@ ENABLE_DEBUG = @ENABLE_DEBUG@ ENABLE_FTDI = @ENABLE_FTDI@ ENABLE_I2C = @ENABLE_I2C@ ENABLE_MUTEX_DEBUG = @ENABLE_MUTEX_DEBUG@ ENABLE_OWCAPI = @ENABLE_OWCAPI@ ENABLE_OWEXTERNAL = @ENABLE_OWEXTERNAL@ ENABLE_OWFS = @ENABLE_OWFS@ ENABLE_OWFTPD = @ENABLE_OWFTPD@ ENABLE_OWHTTPD = @ENABLE_OWHTTPD@ ENABLE_OWLIB = @ENABLE_OWLIB@ ENABLE_OWMALLOC = @ENABLE_OWMALLOC@ ENABLE_OWMON = @ENABLE_OWMON@ ENABLE_OWNET = @ENABLE_OWNET@ ENABLE_OWNETLIB = @ENABLE_OWNETLIB@ ENABLE_OWPERL = @ENABLE_OWPERL@ ENABLE_OWPHP = @ENABLE_OWPHP@ ENABLE_OWPYTHON = @ENABLE_OWPYTHON@ ENABLE_OWSERVER = @ENABLE_OWSERVER@ ENABLE_OWSHELL = @ENABLE_OWSHELL@ ENABLE_OWTAP = @ENABLE_OWTAP@ ENABLE_OWTCL = @ENABLE_OWTCL@ ENABLE_PARPORT = @ENABLE_PARPORT@ ENABLE_PERL = @ENABLE_PERL@ ENABLE_PHP = @ENABLE_PHP@ ENABLE_PROFILING = @ENABLE_PROFILING@ ENABLE_PYTHON = @ENABLE_PYTHON@ ENABLE_SWIG = @ENABLE_SWIG@ ENABLE_USB = @ENABLE_USB@ ENABLE_W1 = @ENABLE_W1@ ENABLE_ZERO = @ENABLE_ZERO@ EXEEXT = @EXEEXT@ EXTRACFLAGS = @EXTRACFLAGS@ FGREP = @FGREP@ FUSE_FLAGS = @FUSE_FLAGS@ FUSE_INCLUDES = @FUSE_INCLUDES@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ HAVE_CYGWIN = @HAVE_CYGWIN@ HAVE_DARWIN = @HAVE_DARWIN@ HAVE_DEBIAN = @HAVE_DEBIAN@ HAVE_FREEBSD = @HAVE_FREEBSD@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXTRALIBS = @LD_EXTRALIBS@ LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@ LIBAVAHI_LIBS = @LIBAVAHI_LIBS@ LIBDIR = @LIBDIR@ LIBFTDI_CFLAGS = @LIBFTDI_CFLAGS@ LIBFTDI_CONFIG = @LIBFTDI_CONFIG@ LIBFTDI_LIBS = @LIBFTDI_LIBS@ LIBOBJS = @LIBOBJS@ LIBPOSTFIX = @LIBPOSTFIX@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MQ_LIBS = @MQ_LIBS@ M_LIBS = @M_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSLIBS = @OSLIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ OWFSROOT = @OWFSROOT@ OWFS_BINARY_AGE = @OWFS_BINARY_AGE@ OWFS_INTERFACE_AGE = @OWFS_INTERFACE_AGE@ OWTCL_INSTALL_PATH = @OWTCL_INSTALL_PATH@ OW_ALLOC_DEBUG = @OW_ALLOC_DEBUG@ OW_AVAHI = @OW_AVAHI@ OW_CYGWIN = @OW_CYGWIN@ OW_DARWIN = @OW_DARWIN@ OW_DEBUG = @OW_DEBUG@ OW_FTDI = @OW_FTDI@ OW_I2C = @OW_I2C@ OW_MUTEX_DEBUG = @OW_MUTEX_DEBUG@ OW_PARPORT = @OW_PARPORT@ OW_USB = @OW_USB@ OW_W1 = @OW_W1@ OW_ZERO = @OW_ZERO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PERL5CCFLAGS = @PERL5CCFLAGS@ PERL5DIR = @PERL5DIR@ PERL5DYNAMICLINKING = @PERL5DYNAMICLINKING@ PERL5EXT = @PERL5EXT@ PERL5LIB = @PERL5LIB@ PERL5NAME = @PERL5NAME@ PHP = @PHP@ PHPCONFIG = @PHPCONFIG@ PHPEXT = @PHPEXT@ PHPINC = @PHPINC@ PHPLIBDIR = @PHPLIBDIR@ PIC_FLAGS = @PIC_FLAGS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYSITEDIR = @PYSITEDIR@ PYTHON = @PYTHON@ PYTHONCONFIG = @PYTHONCONFIG@ PYTHONDYNAMICLINKING = @PYTHONDYNAMICLINKING@ PYVERSION = @PYVERSION@ RANLIB = @RANLIB@ RM = @RM@ RPM = @RPM@ RPMBUILD = @RPMBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOELIM = @SOELIM@ STRIP = @STRIP@ SWIG = @SWIG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@ TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@ TCL_CFLAGS = @TCL_CFLAGS@ TCL_COMPAT_OBJS = @TCL_COMPAT_OBJS@ TCL_DEFS = @TCL_DEFS@ TCL_EXEC_PREFIX = @TCL_EXEC_PREFIX@ TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PREFIX = @TCL_PREFIX@ TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@ TCL_SHLIB_LD = @TCL_SHLIB_LD@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_VERSION = @TCL_VERSION@ TEST = @TEST@ VERSION = @VERSION@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCHLEVEL = @VERSION_PATCHLEVEL@ 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_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fuse_include_path = @fuse_include_path@ fuse_lib_path = @fuse_lib_path@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libcheck_CFLAGS = @libcheck_CFLAGS@ libcheck_LIBS = @libcheck_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I src/scripts/m4 SUBDIRS = src module RPMMACROS = ${HOME}/.rpmmacros RPMDIR = ${HOME}/.rpm EXTRA_DIST = bootstrap all: 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) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): module/ownet/php/examples/ownet_example.php: $(top_builddir)/config.status $(top_srcdir)/module/ownet/php/examples/ownet_example.php.in cd $(top_builddir) && $(SHELL) ./config.status $@ module/ownet/c/src/example/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/ownet/c/src/example/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ module/owcapi/src/example/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/owcapi/src/example/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ module/owcapi/src/example++/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/owcapi/src/example++/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ module/swig/perl5/OW/Makefile.linux: $(top_builddir)/config.status $(top_srcdir)/module/swig/perl5/OW/Makefile.linux.in cd $(top_builddir) && $(SHELL) ./config.status $@ module/swig/perl5/OW/Makefile.osx: $(top_builddir)/config.status $(top_srcdir)/module/swig/perl5/OW/Makefile.osx.in cd $(top_builddir) && $(SHELL) ./config.status $@ module/swig/php/example/load_php_OW.php: $(top_builddir)/config.status $(top_srcdir)/module/swig/php/example/load_php_OW.php.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # 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: $(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 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: 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool 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-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile clean-generic: @RM@ -f *~ .*~ preparerpm: dist @ if @TEST@ -z "@RPMBUILD@" ; then \ @ECHO@ "RPMBUILD binary not found, can't build RPM package"; \ exit 1; \ fi if @TEST@ ! -f ${RPMMACROS} ; then \ @ECHO@ "%_topdir ${RPMDIR}" > ${RPMMACROS}; \ mkdir -p ${RPMDIR}/SOURCES \ ${RPMDIR}/SPECS \ ${RPMDIR}/BUILD \ ${RPMDIR}/RPMS/i386 \ ${RPMDIR}/SRPMS ; \ fi cd src/rpm && ${MAKE} @PACKAGE@.spec @LN_S@ -f `pwd`/src/rpm/@PACKAGE@.spec ${RPMDIR}/SPECS/@PACKAGE@.spec rpm: preparerpm @LN_S@ -f `pwd`/@PACKAGE@-@VERSION@.tar.gz ${RPMDIR}/SOURCES/@PACKAGE@-@VERSION@.tar.gz cd ${RPMDIR}/SPECS && @RPMBUILD@ -ba @PACKAGE@.spec rpmcvs: preparerpm @LN_S@ -f `pwd`/@PACKAGE@-@VERSION@.tar.gz ${RPMDIR}/SOURCES/@PACKAGE@-@VERSION@_cvs_`date +"%Y%m%d"`.tar.gz cd ${RPMDIR}/SPECS && @RPMBUILD@ -ba @PACKAGE@.spec --define 'cvs 1' # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: owfs-3.1p5/AUTHORS0000644000175000001440000000240012654730021010561 00000000000000$Id$ Paul H Allfille: Concept and original work Vadim Tkachenko: Module split, build infrastructure, configuration Geo Carncross: Configuration work Christian Magnusson: Embedded work, and work on chips, and multiple busses Serg Oskin: TCL support as well as alarms and many patches Peter Kropf: Python support Sebastian Zuther: PHP support By Sections: Programs: owfs Paul Alfille owhttpd Paul Alfille owftpd Paul Alfille owserver Paul Alfille and Christian Magnusson Lanquages (light weight) C Christian Magnusson C# (.NET) George M. Zouganelis java jowfsclient Patrik Åkerfeldt java ownet.java George M. Zouganelis pascal ownet.pas George M. Zouganelis php ownet.php Christian Magnusson perl5 OWNet.pm Paul Alfille python ownet Peter Kropf ruby Pedro Côrte-Real shell owdir owread owwrite Paul Alfille VisualBasic OWNet.VB Roberto Spadim Languages (heavy weight) owtcl Serg Oskin owperl Paul Alfille owphp Sebastian Zuther owpython Peter Kropf Libraies: owlib Paul Alfille and Christian Magnusson owcapi Paul Alfille and Christian Magnusson ownet Paul Alfille and Christian Magnusson swig Paul Alfille Added Modules: temploggerd Christian Magnusson TempTrakker Jim Canfield Maison Nicholas Huilardowfs-3.1p5/COPYING0000644000175000001440000003513512654730021010557 00000000000000GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 Lesser 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. 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. /* $Id$ Confirmed text from FSF website: http://http://www.gnu.org/licenses/gpl-2.0.html */ owfs-3.1p5/COPYING.LIB0000644000175000001440000005464612654730021011174 00000000000000GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Library 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. /* $Id$ Replaced text with text directly from FSF website: http://http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html */ owfs-3.1p5/ChangeLog0000644000175000001440000000127112654730021011270 000000000000002010-06-06 15:42 alfille * module/owlib/src/c/ow_write.c: Added some debug messages to write code. 2010-06-06 13:23 alfille * module/owlib/src/c/: ow_1921.c, ow_1923.c, ow_1963.c, ow_1977.c, ow_1991.c, ow_1993.c, ow_2404.c, ow_2406.c, ow_2423.c, ow_2430.c, ow_2433.c, ow_2436.c, ow_2438.c, ow_2450.c, ow_2502.c, ow_2505.c, ow_2760.c, ow_2804.c, ow_bae.c, ow_eds.c, ow_lcd.c: Organize memory and pages a little better in code for consistency 2010-06-06 13:08 alfille include/ow_filetype.h: Add fc_subdir for clarity ( does nothing since the directory itself isn't cached ) 2010-06-05 17:03 alfille Clean up some of the paged memory logic -- use an offset and the owfs-3.1p5/INSTALL0000644000175000001440000002346012654730021010553 00000000000000$Id$ This package uses the standard UNIX installation methods, with scripts that tailor the code to your environment. Usually you'll use the QUICK INSTALL and can ignore all the rest. QUICK INSTALL: (From a source code release) -------------------------------------------------------------------- 1. Download and unpack owfs (you can find it on sourceforge: http://www.sf.net/projects/owfs ) 2. cd owfs # move into the directory 3. ./configure 4. sudo make install 5. Run. Several choices: A. Filesystem using FUSE /opt/owfs/bin/owfs -d /dev/ttyS1 -m /mnt/1wire where /dev/ttyS1 is the serial port of your interface and /mnt/1wire is the directory to mount B. Webserver /opt/owfs/bin/owhttpd -u -p 4444 Where -u is the USB bus master (DS9490) -p 4444 is an arbitrary post Fire up your web browser and look at URL localhost:4444 6. There might be an issue with access permissions to the hardware. Easiest test: /opt/owfs/bin/owhttpd --fake=10 -p 4444 and look at URL http://localhost:4444 to see a simulated 1-wire network. INSTALL from development code (CVS) --------------------------------------------------------------------- 1. Get the source code from the server: A. Type at the command line: cvs -d:pserver:anonymous@owfs.cvs.sourceforge.net:/cvsroot/owfs login cvs -z3 -d:pserver:anonymous@owfs.cvs.sourceforge.net:/cvsroot/owfs co owfs B. You can also follow the instructions here: http://sourceforge.net/scm/?type=cvs&group_id=85502 (which say the same thing) C. Later update to a newer versiion by entering the owfs directory and typing cvs update -dR 2. Run bootstrap (this is a nuisance). A. Try to see if you're lucky: in the owfs directory type ./bootstrap B. If you get errors, the problem is probably the libtool version, so cp /usr/bin/libtool owfs/src/scripts/install/install.sh (the second pathname is a relative path into the owfs directory). then follow A above. 3. Now you can go to step 3 of QUICKINSTALL above. More complete instructions: (Not owfs-specific) --------------------------------------------------------------------- Basic Installation ================== These are generic installation instructions. 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, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). 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 at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' 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. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. 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. 4. Type `make install' to install the programs and any data files and documentation. 5. 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. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure 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 must use a version of `make' that supports the `VPATH' variable, such as 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 `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have 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. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' 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. 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'. Optional Features ================= 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. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM 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 host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. 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. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--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. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. owfs-3.1p5/NEWS0000644000175000001440000000134712654730021010221 00000000000000$Id$ Most everything can be found on the website: http://www.owfs.org Basically we support several languages: perl, python, php, tcl We support most of the 1-wire chips: memmory, temperature, voltage, switches (Actually Thermacron support is unfinished, as is DS1922, DS1923, Java iButtons and SHA encryption is unsupported. All other 1-wire slaves are supported). We support serial, i2c, ethernet and USB adapters (as well as a separate backend: owserver). We support multiple adapters and clients. We have caching, simultaneous conversion, multithreading. We have clients for the owserver that are light weight, platform independent, for the shell, perl, python, Visual Basic, Java, ... We have monitoring programs: owmon and owtap owfs-3.1p5/README0000644000175000001440000000254012654730021010376 00000000000000$Id$ See OWFS (http://www.owfs.org). This is OWFS -- the one-wire filesystem. 1-Wire is a data protocol stat allows simple connections to clever chips. The chips are uniquely addressed, and have a variety of types, including temperature and voltage sensors, switches, memory and clocks. The base functionality is in the owlib library. It includes adapter interface, chip interface, caching, statistics, inumeration and command line processing. owfs is the filesystem portion of the package. It depends on fuse: Basically, fuse (http://fuse.sourceforge.net) exposes filesystem calls in the appropriate directory to this program. This program then calls owlib to query and modify the 1-wire bus. owhttpd is a simple webserver exposing owlib. It does not need a kernel module and will probably run on a greater platform variety. owtcl, owphp, owperl, owpython are language bindings using the same backend and naming scheme as owfs owserver is a generic backend. It can be remote, and shared by several front ends. Your contribution is welcome. --- If you pulled from the cvs: ./bootstrap ./configure make install /opt/owfs/bin/owfs -d /dev/ttyS0 /mnt/1wire (for example) If you downloaded the source package: ./configure make install /opt/owfs/bin/owfs -d /dev/ttyS0 /mnt/1wire (for example) --- For more information: http://www.owfs.org owfs-3.1p5/TODO0000644000175000001440000000000012654730021010173 00000000000000owfs-3.1p5/bootstrap0000755000175000001440000000045612654730021011465 00000000000000#! /bin/sh # OSX uses BSD libtool by default -- we want GNU case `uname` in Darwin*) LZ=glibtoolize ;; *) LZ=libtoolize ;; esac rm -rf *cache $LZ -f -c -i && aclocal -I src/scripts/m4 && autoheader && autoconf && automake -a -c --foreign && echo "Run './configure' and 'make' to build owfs"