debian/0000775000000000000000000000000012263330175007172 5ustar debian/03_bison.patch0000664000000000000000000000261012201547101011615 0ustar Description: Fix build failure with bison 2.6 Origin: upstream, http://comedi.org/git?p=comedi/comedilib.git;a=commitdiff;h=90ce9a94bdb6b26a9cbffdf2e9922b0b1f668a65;hp=3dfae5a6ee6040d294493f3856a3949e1b602af0 Bug-Debian: http://bugs.debian.org/710622 Last-Update: 2013-08-11 --- comedilib-0.10.0.orig/lib/calib_yacc.y +++ comedilib-0.10.0/lib/calib_yacc.y @@ -28,13 +28,14 @@ #include #include #include -#include "calib_yacc.h" -#include "calib_lex.h" #define YYERROR_VERBOSE #define YYPARSE_PARAM parse_arg #define YYLEX_PARAM priv(YYPARSE_PARAM)->yyscanner +#include "calib_yacc.h" +#include "calib_lex.h" + enum polynomial_direction { POLYNOMIAL_TO_PHYS, @@ -347,6 +348,11 @@ extern comedi_calibration_t* _comedi_par return priv.parsed_file; } +static void yyerror(const char *s) +{ + fprintf(stderr, "%s\n", s); +} + %} %pure_parser @@ -504,10 +510,5 @@ extern comedi_calibration_t* _comedi_par %% -void calib_yyerror(char *s) -{ - fprintf(stderr, "%s\n", s); -} - --- comedilib-0.10.0.orig/lib/libinternal.h +++ comedilib-0.10.0/lib/libinternal.h @@ -146,8 +146,6 @@ int valid_chan(comedi_t *it,unsigned int int comedi_get_rangetype(comedi_t *it,unsigned int subdevice,unsigned int chan); #define YY_DECL int calib_yylex(YYSTYPE *calib_lvalp, yyscan_t yyscanner) -void calib_yyerror(char *s); -int calib_yyparse(void *parse_arg); #endif debian/copyright0000664000000000000000000000407212204103100011105 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: ftp://ftp.comedi.org/pub/comedi Files: * Copyright: 1997-2002 David A. Schleef 1999 Joseph E. Smith 2000-2005 Minero Aoki 2003-2004 James Steven Jenkins 2002-2008 Frank Mori Hess 2004 Caleb Tennis 2007 Anders Blomdell 2012 Bernd Porr 1994 X Consortium License: LGPL-2.1 Files: debian/* Copyright: 2007-2012 Gudjon I. Gudjonsson License: GPL-2 License: GPL-2 This program is free software; 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. . This program is distributed in the hope that it will be useful, but WITHOUT 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 package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. License: LGPL-2.1 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 . Copyright (C) 1991, 1999 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. . [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] . On Debian systems, the full text of the GNU Lesser General Public License version 2.1 can be found in the file `/usr/share/common-licenses/LGPL-2.1'. debian/README.Debian0000664000000000000000000000036711740007471011240 0ustar Comedilib for Debian ------------------- The group iocard has been created to access the comedilib devices. The group is assumed to be used for other iocards as well. -- Gudjon I. Gudjonsson , Tue, 04 Mar 2008 00:25:43 +0000 debian/90-comedi.rules0000664000000000000000000000006611740007471011735 0ustar KERNEL=="comedi[0-9]*", MODE="0660", GROUP="iocard" debian/libcomedi0.install0000664000000000000000000000033311762772312012576 0ustar usr/lib/libcomedi.so.* #usr/lib/ruby/* usr/sbin/* usr/bin/comedi_calibrate usr/bin/comedi_test usr/share/man/man7/* usr/share/man/man8/* usr/share/doc/comedilib/*.conf usr/share/doc/libcomedi0/ etc/pcmcia/* lib/udev/* debian/changelog0000664000000000000000000002102312263312463011042 0ustar comedilib (0.10.1-1ubuntu2) trusty; urgency=low * Use dh-autoreconf to resolve FTBFS on ppc64el. -- Daniel T Chen Wed, 08 Jan 2014 13:12:42 -0500 comedilib (0.10.1-1ubuntu1) trusty; urgency=low * FTBFS fixes: - Backport upstream changesets 90ce9a9, cc0c9e7, f4e228e, c689eff, and 2277e82; - Use explicit parameters. * Closes: #733322. LP: #1264686. -- Daniel T Chen Tue, 07 Jan 2014 17:22:30 -0500 comedilib (0.10.1-1) unstable; urgency=low * New upstream release * Bump compat to 9 * Add hardening * Upgraded copyright file -- Gudjon I. Gudjonsson Sun, 18 Aug 2013 10:31:45 +0200 comedilib (0.10.0-3.1) unstable; urgency=low * Non-maintainer upload. * debian/patches/03_bison.patch: Apply patch from upstream to fix build failure with bison 2.6. (Closes: #710622) * debian/python-comedilib.install: Don't install static libraries for the Python package. They are of no use and cause a lintian autoreject. -- Sebastian Ramacher Sun, 11 Aug 2013 01:42:56 +0200 comedilib (0.10.0-3) unstable; urgency=low * Change pdf backend from fop to no. Fixes compilation on mips. -- Gudjon I. Gudjonsson Thu, 05 Jul 2012 21:39:54 +0200 comedilib (0.10.0-2) unstable; urgency=low * Add dependency on adduser (Closes: #677573) -- Gudjon I. Gudjonsson Mon, 25 Jun 2012 18:03:10 +0200 comedilib (0.10.0-1) unstable; urgency=low [ Bernd Porr ] * Removed ruby from the build dependencies * Disabled install of firmware (via ./configure) [ Gudjon I. Gudjonsson ] * Upstream release (Closes: #669353) * Dropping ruby bindings support. Commented out all references to ruby (Closes: #676095) * Rename comedi.rules to 90-comedi.rules * Move 90-comedi.rules to /lib/udev/rules.d/ * Add comedi_calibrate (Closes: #544906) * Add LDFLAGS= -lm to configure (Closes: #558848) * Change bash to sh in postinst script * Fix a few errors in manpages. Add patch 02_fix_manpages.patch (Thanks to Yaroslav Halchenko) * Add upstream changelog * Update symbols file * Update copyright file to DEP5 -- Gudjon I. Gudjonsson Tue, 12 Jun 2012 22:09:08 +0200 comedilib (0.8.1-6) unstable; urgency=low * Bump standards version to 3.9.3 * Change to dh_python2 * Change XS-Python-Version to X-Python-Version * Add doc-base file * Add watch file * Add symbols file * Add get-orig-source target * Change dependency on udev to recommends (Closes: #570069) -- Gudjon I. Gudjonsson Sat, 07 Apr 2012 12:22:16 +0200 comedilib (0.8.1-5.1) unstable; urgency=low * Non-maintainer upload. * Don't ship .la files (Closes: #621195). -- Luk Claes Tue, 28 Jun 2011 07:39:19 +0200 comedilib (0.8.1-5) unstable; urgency=low * Fixed the replaces tags in control file. (Closes: #476562) * Changed the makefile for the demos. -- Gudjon I. Gudjonsson Fri, 09 May 2008 13:28:19 +0200 comedilib (0.8.1-4) unstable; urgency=low * Put the demo into wrong directory last time, fixed. * Added dependency on adduser and udev. (Closes: #470437) -- Gudjon I. Gudjonsson Tue, 11 Mar 2008 12:05:58 +0000 comedilib (0.8.1-3) unstable; urgency=low * Added conflicts and replaces tags to control file. (Closes: #465286) * Added a group called iocard for access to comedi cards. * Added a README.Debian file. * Added the demo directory to the libcomedi-dev package. -- Gudjon I. Gudjonsson Tue, 04 Mar 2008 01:35:26 +0000 comedilib (0.8.1-2) unstable; urgency=low * A new maintainer * Bumped the Debian policy version to 3.7.3 * Made a Homepage: field in the control file * libcomedi0.postinst removed and dependency on makedev (Closes: #434166) * Version 0.8.1 (Closes: #443922) * Pycentral is used in python-comedilib (Closes: #443922) -- Gudjon I. Gudjonsson Mon, 21 Jan 2008 23:30:30 +0100 comedilib (0.8.1-1) unstable; urgency=low * New upstream release -- Gudjon I. Gudjonsson Thu, 29 Nov 2007 01:26:20 +0100 comedilib (0.7.22-2.2) unstable; urgency=low * Non-maintainer upload. * Update package to new python policy (Closes: #373305). -- Pierre Habouzit Fri, 30 Jun 2006 01:06:30 +0200 comedilib (0.7.22-2.1) unstable; urgency=low * Non-maintainer upload. * Packaging changes : + Switch to debhelper compatibility level 5. + Bump Standards Version to 3.6.2. + switch to dh_install instead of dh_movefiles (--list-missing ...) * Add swig to build-depends. * Rename libcomedi0 into libcomedi-0.7.22 (Closes: #350550). + update libcomedi-dev links. + update documentation path. * Fix lintian warnings/errors: + fix man page comedi_calibrate(8). + Fix FSF Addresses. -- Pierre Habouzit Fri, 14 Apr 2006 18:54:50 +0200 comedilib (0.7.22-2) unstable; urgency=low * It helps if the shared library is actually in the package. -- David Schleef Thu, 04 Nov 2004 11:43:51 -0800 comedilib (0.7.22-1) unstable; urgency=low * New upstream version. -- David Schleef Mon, 25 Oct 2004 22:48:43 -0700 comedilib (0.7.21-3) unstable; urgency=low * Added dh_python to take care of python dependency (Closes: #207310) -- David Schleef Tue, 23 Sep 2003 18:11:12 -0700 comedilib (0.7.21-2) unstable; urgency=low * Fix accidental overlap of files between libcomedi-dev and libcomedi0 -- David Schleef Mon, 18 Aug 2003 19:35:06 -0700 comedilib (0.7.21-1) unstable; urgency=low * New upstream release -- David Schleef Sat, 16 Aug 2003 16:25:13 -0700 comedilib (0.7.20-2) unstable; urgency=low * Apparently debian/copyright got broken at some point in time. (probably forgot to merge code back into CVS). Fixed now, but not merged into CVS. :) * Bumped shlibs, since there were symbols added to the lib. * Updated to policy 3.5.10: - Handle DEB_BUILD_OPTIONS - Fix creation of device nodes * Long overdue rewrite of package descriptions -- David Schleef Wed, 25 Jun 2003 10:18:09 -0700 comedilib (0.7.20-1) unstable; urgency=low * New upstream release * Convert to using autoconf/automake, which takes care of problems with gcc-3.x (Closes: #194885) -- David Schleef Tue, 17 Jun 2003 16:18:25 -0700 comedilib (0.7.19-1) unstable; urgency=low * New upstream release -- David Schleef Wed, 3 Jul 2002 21:04:37 -0700 comedilib (0.7.18) unstable; urgency=low * New upstream version * Fix spelling error. (Closes: #124919) -- David Schleef Tue, 22 Jan 2002 02:00:04 -0800 comedilib (0.7.17-1) unstable; urgency=low * New upstream version. -- David Schleef Sat, 17 Nov 2001 18:58:16 -0800 comedilib (0.7.16-1.1) unstable; urgency=low * NMU * debian/control: bumped Standards-Version * debian/ex.doc-base.package: removed dh_make template file * debian/libcomedi0.postinst: - don't try to create device files if they already exist - don't use absolute path to ldconfig * debian/libcomedi0.postrm: new; run ldconfig on remove, per Policy * debian/libcomedi0.shlibs: refer to shared library package's real name and use a legal version number (Closes: #118057) -- Branden Robinson Fri, 2 Nov 2001 14:37:34 -0500 comedilib (0.7.16-1) unstable; urgency=low * Upstream version change -- David Schleef Sun, 15 Jul 2001 16:08:40 -0700 comedilib (0.7.15-1) unstable; urgency=low * Upstream version change -- David Schleef Fri, 3 Mar 2001 10:04:53 -0800 comedilib (0.7.14-1) unstable; urgency=low * Upstream version change -- David Schleef Thu, 30 Nov 2000 15:13:08 -0800 comedilib (0.7.12-1) unstable; urgency=low * Upstream version change -- David Schleef Wed, 11 Oct 2000 14:15:47 -0800 comedilib (0.7.11-2) unstable; urgency=low * Lintian fixes -- David Schleef Fri, 29 Sep 2000 13:07:55 -0800 comedilib (0.7.11-1) unstable; urgency=low * Upstream version change -- David Schleef Sat, 2 Sep 2000 20:00:49 -0800 comedilib (0.7.10) unstable; urgency=low * Merged into comedilib distro. -- David Schleef Wed, 29 Mar 2000 16:03:00 -0800 comedilib (0.7.9-1) unstable; urgency=low * Initial Release. -- David Schleef Tue, 28 Mar 2000 11:44:42 -0800 debian/series0000664000000000000000000000007612201547020010401 0ustar 01_calibrate_build.patch 02_fix_manpages.patch 03_bison.patch debian/patches/0000775000000000000000000000000012263330162010615 5ustar debian/patches/01_calibrate_build.patch0000664000000000000000000000465012077030455015255 0ustar Allows comedi_calibrate to be built without having libcomedi0 installed. This is a patch to configure, a machine generated file. A better solution without patching machine generated files would be preferable. --- a/comedi-calibrate/configure +++ b/comedi-calibrate/configure @@ -5616,81 +5616,6 @@ -{ echo "$as_me:$LINENO: checking for comedi_open in -lcomedi" >&5 -echo $ECHO_N "checking for comedi_open in -lcomedi... $ECHO_C" >&6; } -if test "${ac_cv_lib_comedi_comedi_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcomedi $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 comedi_open (); -int -main () -{ -return comedi_open (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_comedi_comedi_open=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_comedi_comedi_open=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_comedi_comedi_open" >&5 -echo "${ECHO_T}$ac_cv_lib_comedi_comedi_open" >&6; } -if test $ac_cv_lib_comedi_comedi_open = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCOMEDI 1 -_ACEOF - - LIBS="-lcomedi $LIBS" - -else - { { echo "$as_me:$LINENO: error: Failed to find libcomedi." >&5 -echo "$as_me: error: Failed to find libcomedi." >&2;} - { (exit 1); exit 1; }; } -fi - - #boost/program_options ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' debian/patches/03_fix_compile.patch0000664000000000000000000000050212102024352014424 0ustar Fixes compilation. The format string is needed. --- a/comedi-calibrate/libcomedi_calibrate/save_cal.c +++ b/comedi-calibrate/libcomedi_calibrate/save_cal.c @@ -40,7 +40,7 @@ for(i = 0; i < numTabs; ++i) string[i] = '\t'; string[i] = '\0'; - fprintf(file, string); + fprintf(file, "%s",string); free(string); } debian/patches/series0000664000000000000000000000016212263330040012024 0ustar 01_calibrate_build.patch 02_fix_manpages.patch 03_fix_compile.patch 04_new_bison.patch 05_automake_warning.patch debian/patches/02_fix_manpages.patch0000664000000000000000000000725212077030550014607 0ustar Fix manpage errors --- a/man/comedi_config.8 +++ b/man/comedi_config.8 @@ -1,8 +1,8 @@ -.TH comedi_config 8 "" +.TH comedi_config 8 "2012-06-04" .SH NAME -\fBcomedi_config\fR - COMEDI configuration utility +\fBcomedi_config\fR \- COMEDI configuration utility .SH SYNOPSIS -\fBcomedi_config\fR [-vVq] /dev/comediN +\fBcomedi_config\fR [\-vVq] /dev/comediN [[,...]] .br .SH DESCRIPTION @@ -19,14 +19,14 @@ \fBComedi_config\fR can be used with optional parameters which are driver dependent. Parameters are -specified by comma-delimited list of integers. The integers +specified by comma\-delimited list of integers. The integers may be expressed as decimal, hexidecimal (starting with 0x) or octal (stating with 0). In addition, a parameter may be -left blank, indicating 0. PCI-based devices typically +left blank, indicating 0. PCI\-based devices typically require no parameters, although some allow you to specify the bus and slot of the card to configure as the first two parameters. -ISA-based devices typically use +ISA\-based devices typically use the first and second parameters to indicate I/O base address and interrupt level. @@ -40,42 +40,42 @@ \fBcomedi_config\fR recognizes the following options: -\fB-q, --quiet\fR don't print output while running. +\fB\-q, \-\-quiet\fR don't print output while running. -\fB-v, --verbose\fR print verbose output while running. +\fB\-v, \-\-verbose\fR print verbose output while running. -\fB-V, --version\fR print version number and exit. +\fB\-V, \-\-version\fR print version number and exit. -\fB-r, --remove\fR remove previously configured driver. +\fB\-r, \-\-remove\fR remove previously configured driver. .TP -.BI "--read-buffer " "num" +.BI "\-\-read\-buffer " "num" set read buffer size to .I num kilobytes. The default size is 64k. .TP -.BI "--write-buffer " "num" +.BI "\-\-write\-buffer " "num" set write buffer size to .I num kilobytes. The default size is 64k. .TP -.BI "-i, --init-data, --init-data0 " "file" +.BI "\-i, \-\-init\-data, \-\-init\-data0 " "file" upload initialization data (typically firmware) from .I file to board. .TP -.BI "--init-data1 " "file" +.BI "\-\-init\-data1 " "file" .TP -.BI "--init-data2 " "file" +.BI "\-\-init\-data2 " "file" .TP -.BI "--init-data3 " "file" +.BI "\-\-init\-data3 " "file" Some drivers require more than one file for initialization data. Use these options to specify additional initialization data files. -See the driver-specific documentation for further details. +See the driver\-specific documentation for further details. .SH CONFIGURATION FILE @@ -88,17 +88,17 @@ ,,... These configurations will be read and performed when the -switch \fB-a\fR is used. This is potentially useful when +switch \fB\-a\fR is used. This is potentially useful when run from an initialization script. .SH EXAMPLES -A National Instruments PCI-MIO E series board can be +A National Instruments PCI\-MIO E series board can be configured to use /dev/comedi0 using the command: comedi_config /dev/comedi0 ni_pcimio -A National Instruments AT-MIO E series board can be +A National Instruments AT\-MIO E series board can be configured to use /dev/comedi3 using the command: comedi_config /dev/comedi3 ni_atmio 0x220,3 @@ -108,7 +108,7 @@ .SH ADDITIONAL INFORMATION -Additional text documentation can be found in /usr/doc/comedilib-0.7.11. +Additional text documentation can be found in /usr/share/doc/libcomedi\-dev. The current version of \fBComedi\fR and \fBComedilib\fR can be obtained from ftp://ftp.comedi.org/pub/comedi. The Comedi web site is located at http://www.comedi.org/comedi. debian/patches/05_automake_warning.patch0000664000000000000000000000110212263330162015467 0ustar Index: comedilib-0.10.1/configure.ac =================================================================== --- comedilib-0.10.1.orig/configure.ac 2012-08-22 07:48:48.000000000 -0400 +++ comedilib-0.10.1/configure.ac 2014-01-08 15:09:19.160460885 -0500 @@ -29,6 +29,8 @@ m4_define([scxi_lt_revision], [0]) m4_define([scxi_lt_age], [9]) +m4_pattern_allow([AM_PROG_AR]) + # comedilib library version: major.minor.micro # comedilib package version: major.minor.micro[letter] # @@ -105,6 +107,7 @@ AM_PROG_LEX AC_PROG_YACC AC_PROG_LIBTOOL +AM_PROG_AR AC_HEADER_STDC([]) debian/patches/04_new_bison.patch0000664000000000000000000005225112263077032014135 0ustar Index: comedilib-0.10.1/lib/calib_lex.l =================================================================== --- comedilib-0.10.1.orig/lib/calib_lex.l 2014-01-07 17:17:46.120064499 -0500 +++ comedilib-0.10.1/lib/calib_lex.l 2014-01-07 17:19:30.965518265 -0500 @@ -31,6 +31,8 @@ #include "libinternal.h" #include "calib_yacc.h" +#define YY_NO_INPUT + %} %x COMMENT Index: comedilib-0.10.1/lib/calib_yacc.y =================================================================== --- comedilib-0.10.1.orig/lib/calib_yacc.y 2014-01-07 17:17:46.108063299 -0500 +++ comedilib-0.10.1/lib/calib_yacc.y 2014-01-07 17:22:12.611832960 -0500 @@ -28,12 +28,12 @@ #include #include #include -#include "calib_yacc.h" -#include "calib_lex.h" #define YYERROR_VERBOSE -#define YYPARSE_PARAM parse_arg -#define YYLEX_PARAM priv(YYPARSE_PARAM)->yyscanner +#define LEX_PARAM parse_arg->yyscanner + +#include "calib_yacc.h" +#include "calib_lex.h" enum polynomial_direction { @@ -41,7 +41,7 @@ POLYNOMIAL_FROM_PHYS }; -typedef struct +struct calib_yyparse_private { yyscan_t yyscanner; comedi_calibration_t *parsed_file; @@ -49,15 +49,10 @@ int cal_index; unsigned num_coefficients; comedi_polynomial_t polynomial; -} calib_yyparse_private_t; +}; YY_DECL; -static inline calib_yyparse_private_t* priv( calib_yyparse_private_t *parse_arg) -{ - return parse_arg; -} - static void free_calibration_setting( comedi_calibration_setting_t *setting ) { if( setting->channels ); @@ -317,39 +312,18 @@ } } -EXPORT_ALIAS_DEFAULT(_comedi_parse_calibration_file,comedi_parse_calibration_file,0.7.20); -extern comedi_calibration_t* _comedi_parse_calibration_file( const char *cal_file_path ) +static void yyerror(calib_yyparse_private_t *parse_arg, const char *s) { - calib_yyparse_private_t priv; - FILE *file; - - if( cal_file_path == NULL ) return NULL; - memset(&priv, 0, sizeof(calib_yyparse_private_t)); - priv.parsed_file = alloc_calib_parse(); - if( priv.parsed_file == NULL ) return NULL; - - file = fopen( cal_file_path, "r" ); - if( file == NULL ) - { - COMEDILIB_DEBUG( 3, "failed to open file\n" ); - return NULL; - } - calib_yylex_init(&priv.yyscanner); - calib_yyrestart(file, priv.yyscanner); - if( calib_yyparse( &priv ) ) - { - comedi_cleanup_calibration( priv.parsed_file ); - priv.parsed_file = NULL; - } - calib_yylex_destroy(priv.yyscanner); - fclose( file ); - fill_inverse_linear_polynomials(priv.parsed_file); - return priv.parsed_file; + fprintf(stderr, "%s\n", s); } %} -%pure_parser +%pure-parser + +%parse-param {calib_yyparse_private_t *parse_arg} + +%lex-param {LEX_PARAM} %union { @@ -372,7 +346,7 @@ input: '{' hash '}' | error { - fprintf(stderr, "input error on line %i\n", calib_yyget_lineno(priv(parse_arg)->yyscanner)); + fprintf(stderr, "input error on line %i\n", calib_yyget_lineno(parse_arg->yyscanner)); // fprintf(stderr, "input error on line %i\n", @1.first_line ); YYABORT; } @@ -385,13 +359,13 @@ hash_element: T_DRIVER_NAME T_ASSIGN T_STRING { - if( priv(parse_arg)->parsed_file->driver_name != NULL ) YYABORT; - priv(parse_arg)->parsed_file->driver_name = strdup( $3 ); + if( parse_arg->parsed_file->driver_name != NULL ) YYABORT; + parse_arg->parsed_file->driver_name = strdup( $3 ); } | T_BOARD_NAME T_ASSIGN T_STRING { - if( priv(parse_arg)->parsed_file->board_name != NULL ) YYABORT; - priv(parse_arg)->parsed_file->board_name = strdup( $3 ); + if( parse_arg->parsed_file->board_name != NULL ) YYABORT; + parse_arg->parsed_file->board_name = strdup( $3 ); } | T_CALIBRATIONS T_ASSIGN '[' calibrations_array ']' ; @@ -401,8 +375,8 @@ | '{' calibration_setting '}' ',' calibrations_array ; - calibration_setting: /* empty */ { priv(parse_arg)->cal_index++; } - | calibration_setting_element { priv(parse_arg)->cal_index++; } + calibration_setting: /* empty */ { parse_arg->cal_index++; } + | calibration_setting_element { parse_arg->cal_index++; } | calibration_setting_element ',' calibration_setting ; @@ -420,12 +394,12 @@ | T_SOFTCAL_TO_PHYS T_ASSIGN '{' polynomial '}' { if(add_polynomial(parse_arg, POLYNOMIAL_TO_PHYS) < 0) YYERROR; - priv(parse_arg)->num_coefficients = 0; + parse_arg->num_coefficients = 0; } | T_SOFTCAL_FROM_PHYS T_ASSIGN '{' polynomial '}' { if(add_polynomial(parse_arg, POLYNOMIAL_FROM_PHYS) < 0) YYERROR; - priv(parse_arg)->num_coefficients = 0; + parse_arg->num_coefficients = 0; } ; @@ -458,14 +432,14 @@ | '{' caldac '}' ',' caldacs_array ; - caldac: /* empty */ { if(add_caldac( parse_arg, priv(parse_arg)->caldac ) < 0) YYERROR; } - | caldac_element { if(add_caldac( parse_arg, priv(parse_arg)->caldac ) < 0) YYERROR; } + caldac: /* empty */ { if(add_caldac( parse_arg, parse_arg->caldac ) < 0) YYERROR; } + | caldac_element { if(add_caldac( parse_arg, parse_arg->caldac ) < 0) YYERROR; } | caldac_element ',' caldac ; - caldac_element: T_SUBDEVICE T_ASSIGN T_NUMBER { priv(parse_arg)->caldac.subdevice = $3; } - | T_CHANNEL T_ASSIGN T_NUMBER { priv(parse_arg)->caldac.channel = $3; } - | T_VALUE T_ASSIGN T_NUMBER { priv(parse_arg)->caldac.value = $3; } + caldac_element: T_SUBDEVICE T_ASSIGN T_NUMBER { parse_arg->caldac.subdevice = $3; } + | T_CHANNEL T_ASSIGN T_NUMBER { parse_arg->caldac.channel = $3; } + | T_VALUE T_ASSIGN T_NUMBER { parse_arg->caldac.value = $3; } ; polynomial: /* empty */ @@ -494,20 +468,45 @@ expansion_origin: T_FLOAT { - priv(parse_arg)->polynomial.expansion_origin = $1; + parse_arg->polynomial.expansion_origin = $1; } | T_NUMBER { - priv(parse_arg)->polynomial.expansion_origin = $1; + parse_arg->polynomial.expansion_origin = $1; } ; %% -void calib_yyerror(char *s) + +EXPORT_ALIAS_DEFAULT(_comedi_parse_calibration_file,comedi_parse_calibration_file,0.7.20); +extern comedi_calibration_t* _comedi_parse_calibration_file( const char *cal_file_path ) { - fprintf(stderr, "%s\n", s); -} + calib_yyparse_private_t priv; + FILE *file; + + if( cal_file_path == NULL ) return NULL; + memset(&priv, 0, sizeof(calib_yyparse_private_t)); + priv.parsed_file = alloc_calib_parse(); + if( priv.parsed_file == NULL ) return NULL; + file = fopen( cal_file_path, "r" ); + if( file == NULL ) + { + COMEDILIB_DEBUG( 3, "failed to open file\n" ); + return NULL; + } + calib_yylex_init(&priv.yyscanner); + calib_yyrestart(file, priv.yyscanner); + if( calib_yyparse( &priv ) ) + { + comedi_cleanup_calibration( priv.parsed_file ); + priv.parsed_file = NULL; + } + calib_yylex_destroy(priv.yyscanner); + fclose( file ); + fill_inverse_linear_polynomials(priv.parsed_file); + return priv.parsed_file; +} Index: comedilib-0.10.1/lib/libinternal.h =================================================================== --- comedilib-0.10.1.orig/lib/libinternal.h 2014-01-07 17:17:46.132065695 -0500 +++ comedilib-0.10.1/lib/libinternal.h 2014-01-07 17:20:57.106739088 -0500 @@ -85,6 +85,8 @@ typedef struct subdevice_struct subdevice; typedef struct device_struct device; +typedef struct calib_yyparse_private calib_yyparse_private_t; + struct comedi_t_struct{ int magic; @@ -146,8 +148,6 @@ int comedi_get_rangetype(comedi_t *it,unsigned int subdevice,unsigned int chan); #define YY_DECL int calib_yylex(YYSTYPE *calib_lvalp, yyscan_t yyscanner) -void calib_yyerror(char *s); -int calib_yyparse(void *parse_arg); #endif Index: comedilib-0.10.1/lib/calib_yacc.y.orig =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ comedilib-0.10.1/lib/calib_yacc.y.orig 2014-01-07 17:20:57.106739088 -0500 @@ -0,0 +1,517 @@ +%{ +/* + lib/calib_yacc.y + code for parsing calibration file, generated by bison + + Copyright (C) 2003 Frank Mori Hess + + 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, version 2.1 + of the License. + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA. +*/ + +#define _GNU_SOURCE + +#include +#include "libinternal.h" +#include +#include +#include + +#define YYERROR_VERBOSE +#define LEX_PARAM parse_arg->yyscanner + +#include "calib_yacc.h" +#include "calib_lex.h" + +enum polynomial_direction +{ + POLYNOMIAL_TO_PHYS, + POLYNOMIAL_FROM_PHYS +}; + +struct calib_yyparse_private +{ + yyscan_t yyscanner; + comedi_calibration_t *parsed_file; + comedi_caldac_t caldac; + int cal_index; + unsigned num_coefficients; + comedi_polynomial_t polynomial; +}; + +YY_DECL; + +static inline calib_yyparse_private_t* priv( calib_yyparse_private_t *parse_arg) +{ + return parse_arg; +} + +static void free_calibration_setting( comedi_calibration_setting_t *setting ) +{ + if( setting->channels ); + { + free( setting->channels ); + setting->channels = NULL; + setting->num_channels = 0; + } + if( setting->ranges ); + { + free( setting->ranges ); + setting->ranges = NULL; + setting->num_ranges = 0; + } + setting->num_arefs = 0; + if( setting->caldacs ); + { + free( setting->caldacs ); + setting->caldacs = NULL; + setting->num_caldacs = 0; + } + if(setting->soft_calibration.to_phys) + { + free(setting->soft_calibration.to_phys); + setting->soft_calibration.to_phys = NULL; + } + if(setting->soft_calibration.from_phys) + { + free(setting->soft_calibration.from_phys); + setting->soft_calibration.from_phys = NULL; + } +} + +static void free_settings( comedi_calibration_t *file_contents ) +{ + int i; + + if( file_contents->settings == NULL ) return; + + for( i = 0; i < file_contents->num_settings; i++ ) + { + free_calibration_setting( &file_contents->settings[ i ] ); + } + free(file_contents->settings); + file_contents->settings = NULL; +} + +static int add_calibration_setting( comedi_calibration_t *file_contents ) +{ + comedi_calibration_setting_t *temp; + + temp = realloc( file_contents->settings, + ( file_contents->num_settings + 1 ) * sizeof( comedi_calibration_setting_t ) ); + if( temp == NULL ) + { + fprintf(stderr, "%s: realloc failed to allocate memory.\n", __FUNCTION__); + return -1; + } + file_contents->settings = temp; + memset( &file_contents->settings[ file_contents->num_settings ], + 0, sizeof( comedi_calibration_setting_t ) ); + + file_contents->num_settings++; + return 0; +} + +static comedi_calibration_setting_t* current_setting( calib_yyparse_private_t *priv ) +{ + int retval; + + while( priv->cal_index >= priv->parsed_file->num_settings ) + { + retval = add_calibration_setting( priv->parsed_file ); + if( retval < 0 ) return NULL; + } + return &priv->parsed_file->settings[ priv->cal_index ]; +} + +static int add_channel( calib_yyparse_private_t *priv, int channel ) +{ + unsigned *temp; + comedi_calibration_setting_t *setting; + + setting = current_setting( priv ); + if( setting == NULL ) return -1; + + temp = realloc( setting->channels, ( setting->num_channels + 1 ) * sizeof(unsigned) ); + if( temp == NULL ) + { + fprintf(stderr, "%s: realloc failed to allocate memory.\n", __FUNCTION__); + return -1; + } + setting->channels = temp; + setting->channels[ setting->num_channels++ ] = channel; + return 0; +} + +static int add_range( calib_yyparse_private_t *priv, int range ) +{ + unsigned *temp; + comedi_calibration_setting_t *setting; + + setting = current_setting( priv ); + if( setting == NULL ) return -1; + + temp = realloc( setting->ranges, ( setting->num_ranges + 1 ) * sizeof(unsigned) ); + if( temp == NULL ) + { + fprintf(stderr, "%s: realloc failed to allocate memory.\n", __FUNCTION__); + return -1; + } + setting->ranges = temp; + setting->ranges[ setting->num_ranges++ ] = range; + return 0; +} + +static int add_aref( calib_yyparse_private_t *priv, int aref ) +{ + comedi_calibration_setting_t *setting; + + setting = current_setting( priv ); + if( setting == NULL ) return -1; + + if( setting->num_arefs >= sizeof( setting->arefs ) / + sizeof( setting->arefs[ 0 ] ) ) + return -1; + setting->arefs[ setting->num_arefs++ ] = aref; + return 0; +} + +static int add_caldac( calib_yyparse_private_t *priv, + comedi_caldac_t caldac ) +{ + comedi_caldac_t *temp; + comedi_calibration_setting_t *setting; + + setting = current_setting( priv ); + if( setting == NULL ) return -1; + + temp = realloc( setting->caldacs, ( setting->num_caldacs + 1 ) * + sizeof( comedi_caldac_t ) ); + if( temp == NULL ) + { + fprintf(stderr, "%s: realloc failed to allocate memory.\n", __FUNCTION__); + return -1; + } + setting->caldacs = temp; + setting->caldacs[ setting->num_caldacs++ ] = caldac; + return 0; +} + +static int add_polynomial(calib_yyparse_private_t *priv, enum polynomial_direction polynomial_direction) +{ + comedi_calibration_setting_t *setting; + + setting = current_setting( priv ); + if( setting == NULL ) + { + fprintf(stderr, "%s: current_setting returned NULL\n", __FUNCTION__); + return -1; + } + if(priv->num_coefficients < 1) + { + fprintf(stderr, "%s: polynomial has no coefficients.\n", __FUNCTION__); + return -1; + } + if(polynomial_direction == POLYNOMIAL_TO_PHYS) + { + if(setting->soft_calibration.to_phys) return -1; + setting->soft_calibration.to_phys = malloc(sizeof(comedi_polynomial_t)); + *setting->soft_calibration.to_phys = priv->polynomial; + }else + { + if(setting->soft_calibration.from_phys) return -1; + setting->soft_calibration.from_phys = malloc(sizeof(comedi_polynomial_t)); + *setting->soft_calibration.from_phys = priv->polynomial; + } + return 0; +} + +static int add_polynomial_coefficient(calib_yyparse_private_t *priv, double coefficient) +{ + if(priv->num_coefficients >= COMEDI_MAX_NUM_POLYNOMIAL_COEFFICIENTS) + { + fprintf(stderr, "too many coefficients for polynomial,\n"); + fprintf(stderr, "num_coefficients=%i, max is %i .\n", priv->num_coefficients, COMEDI_MAX_NUM_POLYNOMIAL_COEFFICIENTS); + return -1; + } + priv->polynomial.order = priv->num_coefficients; + priv->polynomial.coefficients[priv->num_coefficients++] = coefficient; + return 0; +} + +static comedi_calibration_t* alloc_calib_parse( void ) +{ + comedi_calibration_t *file_contents; + + file_contents = malloc( sizeof( *file_contents ) ); + if( file_contents == NULL ) return file_contents; + memset( file_contents, 0, sizeof( *file_contents ) ); + return file_contents; +} + +EXPORT_ALIAS_DEFAULT(_comedi_cleanup_calibration,comedi_cleanup_calibration,0.7.20); +extern void _comedi_cleanup_calibration( comedi_calibration_t *file_contents ) +{ + if(file_contents == NULL) return; + if( file_contents->driver_name ) + { + free( file_contents->driver_name ); + file_contents->driver_name = NULL; + } + if( file_contents->board_name ) + { + free( file_contents->board_name ); + file_contents->board_name = NULL; + } + free_settings( file_contents ); + free( file_contents ); +} + +static comedi_polynomial_t* alloc_inverse_linear_polynomial(const comedi_polynomial_t *polynomial) +{ + comedi_polynomial_t *inverse; + if(polynomial->order != 1) return NULL; + inverse = malloc(sizeof(comedi_polynomial_t)); + memset(inverse, 0, sizeof(comedi_polynomial_t)); + inverse->order = 1; + inverse->expansion_origin = polynomial->coefficients[0]; + inverse->coefficients[0] = polynomial->expansion_origin; + inverse->coefficients[1] = 1. / polynomial->coefficients[1]; + if(isfinite(inverse->coefficients[1]) == 0) + { + free(inverse); + return NULL; + } + return inverse; +} + +static void fill_inverse_linear_polynomials(comedi_calibration_t *calibration) +{ + unsigned i; + for(i = 0; i < calibration->num_settings; ++i) + { + if(calibration->settings[i].soft_calibration.to_phys) + { + if(calibration->settings[i].soft_calibration.from_phys == NULL) + { + calibration->settings[i].soft_calibration.from_phys = + alloc_inverse_linear_polynomial(calibration->settings[i].soft_calibration.to_phys); + } + }else if(calibration->settings[i].soft_calibration.from_phys) + { + calibration->settings[i].soft_calibration.to_phys = + alloc_inverse_linear_polynomial(calibration->settings[i].soft_calibration.from_phys); + } + } +} + +static void yyerror(calib_yyparse_private_t *parse_arg, const char *s) +{ + fprintf(stderr, "%s\n", s); +} + +%} + +%pure-parser + +%parse-param {calib_yyparse_private_t *parse_arg} + +%lex-param {LEX_PARAM} + +%union +{ + int ival; + double dval; + char *sval; +} + +%token T_DRIVER_NAME T_BOARD_NAME T_CALIBRATIONS T_SUBDEVICE T_CHANNELS +%token T_RANGES T_AREFS T_CALDACS T_CHANNEL T_VALUE T_NUMBER T_STRING +%token T_COEFFICIENTS T_EXPANSION_ORIGIN T_SOFTCAL_TO_PHYS T_SOFTCAL_FROM_PHYS +%token T_ASSIGN T_FLOAT + +%type T_NUMBER +%type T_STRING +%type T_FLOAT + +%% + + input: '{' hash '}' + | error + { + fprintf(stderr, "input error on line %i\n", calib_yyget_lineno(priv(parse_arg)->yyscanner)); +// fprintf(stderr, "input error on line %i\n", @1.first_line ); + YYABORT; + } + ; + + hash: /* empty */ + | hash_element + | hash_element ',' hash + ; + + hash_element: T_DRIVER_NAME T_ASSIGN T_STRING + { + if( priv(parse_arg)->parsed_file->driver_name != NULL ) YYABORT; + priv(parse_arg)->parsed_file->driver_name = strdup( $3 ); + } + | T_BOARD_NAME T_ASSIGN T_STRING + { + if( priv(parse_arg)->parsed_file->board_name != NULL ) YYABORT; + priv(parse_arg)->parsed_file->board_name = strdup( $3 ); + } + | T_CALIBRATIONS T_ASSIGN '[' calibrations_array ']' + ; + + calibrations_array: /* empty */ + | '{' calibration_setting '}' + | '{' calibration_setting '}' ',' calibrations_array + ; + + calibration_setting: /* empty */ { priv(parse_arg)->cal_index++; } + | calibration_setting_element { priv(parse_arg)->cal_index++; } + | calibration_setting_element ',' calibration_setting + ; + + calibration_setting_element: T_SUBDEVICE T_ASSIGN T_NUMBER + { + comedi_calibration_setting_t *setting; + setting = current_setting( parse_arg ); + if( setting == NULL ) YYABORT; + setting->subdevice = $3; + } + | T_CHANNELS T_ASSIGN '[' channels_array ']' + | T_RANGES T_ASSIGN '[' ranges_array ']' + | T_AREFS T_ASSIGN '[' arefs_array ']' + | T_CALDACS T_ASSIGN '[' caldacs_array ']' + | T_SOFTCAL_TO_PHYS T_ASSIGN '{' polynomial '}' + { + if(add_polynomial(parse_arg, POLYNOMIAL_TO_PHYS) < 0) YYERROR; + priv(parse_arg)->num_coefficients = 0; + } + | T_SOFTCAL_FROM_PHYS T_ASSIGN '{' polynomial '}' + { + if(add_polynomial(parse_arg, POLYNOMIAL_FROM_PHYS) < 0) YYERROR; + priv(parse_arg)->num_coefficients = 0; + } + ; + + channels_array: /* empty */ + | channel + | channel ',' channels_array + ; + + channel: T_NUMBER { if(add_channel( parse_arg, $1 ) < 0) YYERROR; } + ; + + ranges_array: /* empty */ + | range + | range ',' ranges_array + ; + + range: T_NUMBER { if(add_range( parse_arg, $1 ) < 0) YYERROR; } + ; + + arefs_array: /* empty */ + | aref + | aref ',' arefs_array + ; + + aref: T_NUMBER { if(add_aref( parse_arg, $1 ) < 0) YYERROR; } + ; + + caldacs_array: /* empty */ + | '{' caldac '}' + | '{' caldac '}' ',' caldacs_array + ; + + caldac: /* empty */ { if(add_caldac( parse_arg, priv(parse_arg)->caldac ) < 0) YYERROR; } + | caldac_element { if(add_caldac( parse_arg, priv(parse_arg)->caldac ) < 0) YYERROR; } + | caldac_element ',' caldac + ; + + caldac_element: T_SUBDEVICE T_ASSIGN T_NUMBER { priv(parse_arg)->caldac.subdevice = $3; } + | T_CHANNEL T_ASSIGN T_NUMBER { priv(parse_arg)->caldac.channel = $3; } + | T_VALUE T_ASSIGN T_NUMBER { priv(parse_arg)->caldac.value = $3; } + ; + + polynomial: /* empty */ + | polynomial_element + | polynomial_element ',' polynomial + ; + + polynomial_element: T_COEFFICIENTS T_ASSIGN '[' coefficient_array ']' + | T_EXPANSION_ORIGIN T_ASSIGN expansion_origin + ; + + coefficient_array: /* empty */ + | coefficient + | coefficient ',' coefficient_array + ; + + coefficient: T_FLOAT + { + if(add_polynomial_coefficient(parse_arg, $1) < 0) YYERROR; + } + | T_NUMBER + { + if(add_polynomial_coefficient(parse_arg, $1) < 0) YYERROR; + } + ; + + expansion_origin: T_FLOAT + { + priv(parse_arg)->polynomial.expansion_origin = $1; + } + | T_NUMBER + { + priv(parse_arg)->polynomial.expansion_origin = $1; + } + ; + +%% + + +EXPORT_ALIAS_DEFAULT(_comedi_parse_calibration_file,comedi_parse_calibration_file,0.7.20); +extern comedi_calibration_t* _comedi_parse_calibration_file( const char *cal_file_path ) +{ + calib_yyparse_private_t priv; + FILE *file; + + if( cal_file_path == NULL ) return NULL; + memset(&priv, 0, sizeof(calib_yyparse_private_t)); + priv.parsed_file = alloc_calib_parse(); + if( priv.parsed_file == NULL ) return NULL; + + file = fopen( cal_file_path, "r" ); + if( file == NULL ) + { + COMEDILIB_DEBUG( 3, "failed to open file\n" ); + return NULL; + } + calib_yylex_init(&priv.yyscanner); + calib_yyrestart(file, priv.yyscanner); + if( calib_yyparse( &priv ) ) + { + comedi_cleanup_calibration( priv.parsed_file ); + priv.parsed_file = NULL; + } + calib_yylex_destroy(priv.yyscanner); + fclose( file ); + fill_inverse_linear_polynomials(priv.parsed_file); + return priv.parsed_file; +} + + debian/Makefile.debian_demo0000664000000000000000000000357011740007471013063 0ustar noinst_PROGRAMS = \ antialias ao_waveform ao_mmap apply_cal board_info choose_clock choose_filter \ choose_routing cmd do_waveform dio eeprom_dump gpct_buffered_counting \ gpct_encoder gpct_pulse_generator \ gpct_simple_counting inp inpn insn ledclock \ mmap outp poll receiver select \ sender sigio sv tut1 tut2 LIBS = -lcomedi -lm EXTRA = common.c CC = gcc all: $(noinst_PROGRAMS) antialias: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ ao_waveform: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ ao_mmap: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ apply_cal: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ board_info: $(CC) $(EXTRA) info.c $(LIBS) -o $@ choose_clock: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ choose_filter: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ choose_routing: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ cmd: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ do_waveform: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ dio: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ eeprom_dump: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ gpct_buffered_counting: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ gpct_encoder: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ gpct_pulse_generator: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ gpct_simple_counting: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ inp: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ inpn: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ insn: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ ledclock: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ mmap: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ outp: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ poll: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ receiver: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ select: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ sender: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ sigio: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ sv: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ tut1: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ tut2: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ printenv: $(CC) $(EXTRA) $@.c $(LIBS) -o $@ clean: rm -f *.o rm -rf .libs @list='$(noinst_PROGRAMS)'; for p in $$list; do \ rm -f $$p ; \ done debian/libcomedi-dev.doc-base0000664000000000000000000000122511740007665013300 0ustar Document: comedilib Title: Debian comedilib Manual Author: David Schleef, Frank Mori Hess, Herman Bruyninckx Abstract: Comedi is a free software project to interface digital acquisition (DAQ) cards. It is the combination of three complementary software items: (i) a generic, device-independent API, (ii) a collection of Linux kernel modules that implement this API for a wide range of cards, and (iii) a Linux user space library with a developer-oriented programming interface to configure and use the cards. Section: Programming/C++ Format: HTML Index: /usr/share/doc/libcomedi-dev/html/index.html Files: /usr/share/doc/libcomedi-dev/html/*.html debian/pycompat0000664000000000000000000000000211740007471010740 0ustar 2 debian/watch0000664000000000000000000000007511740012362010217 0ustar version=3 http://comedi.org/download/comedilib-(.*)\.tar\.gz debian/python-comedilib.install0000664000000000000000000000011312202766571014031 0ustar usr/lib/python*/dist-packages/*.so usr/lib/python*/dist-packages/comedi.py debian/control0000664000000000000000000000452612263312313010576 0ustar Source: comedilib Section: devel Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Gudjon I. Gudjonsson Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), python-all-dev, dh-autoreconf, swig, docbook-utils, dblatex, bison, flex, libtool, xmlto, imagemagick, fop, libboost-program-options-dev, libgsl0-dev, hardening-wrapper Standards-Version: 3.9.4 Homepage: http://www.comedi.org X-Python-Version: all Package: libcomedi-dev Section: libdevel Architecture: any Depends: libcomedi0 (= ${binary:Version}), ${misc:Depends} Description: Development library for Comedi Comedilib is a library for using Comedi, a driver interface for data acquisition hardware. . This package contains headers, static libraries, documentation, and examples for writing software that uses the Comedilib library. You only need to install it if you plan to develop or compile software that uses Comedilib. Package: libcomedi0 Section: libs Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, adduser Recommends: udev Conflicts: libcomedi-0.7.22 Replaces: libcomedi-0.7.22 Description: Library for Comedi Comedilib is a library for using Comedi, a driver interface for data acquisition hardware. Comedi supports a wide variety of ISA and PCI devices that contain analog-to-digital converters, digital-to-analog converters, digital input/output, counters and timers. The full list of support devices can be found in the libcomedi-dev documentation. . This package contains the shared library component of Comedilib. In general, this package will be automatically installed as a dependency of application or other library packages. . In order to effectively use this package, you need to have compiled and installed the Comedi kernel modules. The source for Comedi is available in the comedi-source package, which also contains instructions on how to compile and install the modules. Package: python-comedilib Section: python Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, ${python:Depends} Provides: ${python:Provides} Description: Python wrapper for Comedilib Comedilib is a library for using Comedi, a driver interface for data acquisition hardware. See the libcomedi0 package for more information. . This package provides Python bindings to the comedi library. debian/source/0000775000000000000000000000000011621767012010473 5ustar debian/source/format0000664000000000000000000000001411621767012011701 0ustar 3.0 (quilt) debian/libcomedi0.symbols0000664000000000000000000000663711763237001012625 0ustar libcomedi.so.0 libcomedi0 #MINVER# comedi_apply_calibration@v0.7.20 0.8.1 comedi_apply_parsed_calibration@v0.7.20 0.8.1 comedi_arm@v0.9.0 0.10.0 comedi_cancel@v0.7.18 0.8.1 comedi_cleanup_calibration@v0.7.20 0.8.1 comedi_close@v0.7.18 0.8.1 comedi_command@v0.7.18 0.8.1 comedi_command_test@v0.7.18 0.8.1 comedi_data_read@v0.7.18 0.8.1 comedi_data_read_delayed@v0.7.19 0.8.1 comedi_data_read_hint@v0.7.19 0.8.1 comedi_data_read_n@v0.7.18 0.8.1 comedi_data_write@v0.7.18 0.8.1 comedi_dio_bitfield2@v0.8.0 0.8.1 comedi_dio_bitfield@v0.7.18 0.8.1 comedi_dio_config@v0.7.18 0.8.1 comedi_dio_get_config@v0.8.0 0.8.1 comedi_dio_read@v0.7.18 0.8.1 comedi_dio_write@v0.7.18 0.8.1 comedi_do_insn@v0.7.18 0.8.1 comedi_do_insnlist@v0.7.18 0.8.1 comedi_errno@v0.7.18 0.8.1 comedi_fileno@v0.7.18 0.8.1 comedi_find_range@v0.7.18 0.8.1 comedi_find_subdevice_by_type@v0.7.18 0.8.1 comedi_from_phys@v0.7.18 0.8.1 comedi_from_physical@v0.8.0 0.8.1 comedi_get_board_name@v0.7.18 0.8.1 comedi_get_buffer_contents@v0.7.18 0.8.1 comedi_get_buffer_offset@v0.7.18 0.8.1 comedi_get_buffer_size@v0.7.18 0.8.1 comedi_get_clock_source@v0.10.0 0.10.0 comedi_get_clock_source@v0.9.0 0.10.0 comedi_get_cmd_generic_timed@v0.7.18 0.8.1 comedi_get_cmd_generic_timed@v0.9.0 0.8.1 comedi_get_cmd_src_mask@v0.7.18 0.8.1 comedi_get_default_calibration_path@v0.7.20 0.8.1 comedi_get_driver_name@v0.7.18 0.8.1 comedi_get_front_count@v0.7.18 0.8.1 comedi_get_gate_source@v0.9.0 0.10.0 comedi_get_hardcal_converter@v0.8.0 0.8.1 comedi_get_hardware_buffer_size@v0.9.0 0.10.0 comedi_get_max_buffer_size@v0.7.18 0.8.1 comedi_get_maxdata@v0.7.18 0.8.1 comedi_get_n_channels@v0.7.18 0.8.1 comedi_get_n_ranges@v0.7.18 0.8.1 comedi_get_n_subdevices@v0.7.18 0.8.1 comedi_get_range@v0.7.18 0.8.1 comedi_get_rangetype@v0.7.18 0.8.1 comedi_get_read_subdevice@v0.7.19 0.8.1 comedi_get_routing@v0.9.0 0.10.0 comedi_get_softcal_converter@v0.8.0 0.8.1 comedi_get_subdevice_flags@v0.7.18 0.8.1 comedi_get_subdevice_flags@v0.8.0 0.8.1 comedi_get_subdevice_type@v0.7.18 0.8.1 comedi_get_timer@v0.7.18 0.8.1 comedi_get_version_code@v0.7.18 0.8.1 comedi_get_write_subdevice@v0.7.19 0.8.1 comedi_internal_trigger@v0.9.0 0.10.0 comedi_lock@v0.7.18 0.8.1 comedi_loglevel@v0.7.18 0.8.1 comedi_mark_buffer_read@v0.7.18 0.8.1 comedi_mark_buffer_written@v0.8.0 0.8.1 comedi_maxdata_is_chan_specific@v0.7.18 0.8.1 comedi_open@v0.7.18 0.8.1 comedi_parse_calibration_file@v0.7.20 0.8.1 comedi_perror@v0.7.18 0.8.1 comedi_poll@v0.7.18 0.8.1 comedi_range_is_chan_specific@v0.7.18 0.8.1 comedi_reset@v0.9.0 0.10.0 comedi_sampl_from_phys@v0.7.18 0.8.1 comedi_sampl_to_phys@v0.7.18 0.8.1 comedi_set_buffer_size@v0.7.18 0.8.1 comedi_set_clock_source@v0.10.0 0.10.0 comedi_set_clock_source@v0.9.0 0.10.0 comedi_set_counter_mode@v0.9.0 0.10.0 comedi_set_filter@v0.9.0 0.10.0 comedi_set_gate_source@v0.9.0 0.10.0 comedi_set_global_oor_behavior@v0.7.18 0.8.1 comedi_set_max_buffer_size@v0.7.18 0.8.1 comedi_set_other_source@v0.9.0 0.10.0 comedi_set_routing@v0.9.0 0.10.0 comedi_strerror@v0.7.18 0.8.1 comedi_sv_init@v0.7.18 0.8.1 comedi_sv_measure@v0.7.18 0.8.1 comedi_sv_update@v0.7.18 0.8.1 comedi_timed_1chan@v0.7.18 0.8.1 comedi_to_phys@v0.7.18 0.8.1 comedi_to_physical@v0.8.0 0.8.1 comedi_trigger@v0.7.18 0.8.1 comedi_unlock@v0.7.18 0.8.1 v0.10.0@v0.10.0 0.10.0 v0.7.18@v0.7.18 0.8.1 v0.7.19@v0.7.19 0.8.1 v0.7.20@v0.7.20 0.8.1 v0.8.0@v0.8.0 0.8.1 v0.9.0@v0.9.0 0.8.1 debian/libcomedi-dev.install0000664000000000000000000000024211740007471013262 0ustar usr/lib/libcomedi.so usr/lib/libcomedi.a usr/include/* usr/share/man/man3/* usr/share/doc/comedilib/* usr/share/doc/libcomedi-dev/ usr/lib/pkgconfig/comedilib.pc debian/compat0000664000000000000000000000000212102041334010354 0ustar 9 debian/libcomedi0.postinst0000664000000000000000000000054311763071372013015 0ustar #!/bin/sh set -e test $DEBIAN_SCRIPT_DEBUG && set -v -x case "$1" in configure|upgrade) echo "creating iocard group..." getent group iocard >/dev/null || addgroup --system iocard ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/libcomedi-dev.dirs0000664000000000000000000000013711740007471012560 0ustar usr/lib/ usr/include/ usr/share/man/man3/ usr/share/doc/libcomedi-dev/html/ usr/lib/pkgconfig/ debian/libcomedi0.dirs0000664000000000000000000000023611762772276012104 0ustar usr/lib/ usr/sbin/ #usr/lib/ruby/1.8/local/lib/site_ruby/1.8/ usr/share/man/man7/ usr/share/man/man8/ usr/share/doc/libcomedi0/ etc/pcmcia/ lib/udev/rules.d/ debian/rules0000775000000000000000000001177712263312425010265 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_HARDENING=1 DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk PYTHONS := $(shell pyversions -vr) #ruby_ver = 1.8 arch_name = $(subst linux-gnu,linux-,$(patsubst %linux-gnu,%linux,$(DEB_BUILD_GNU_TYPE))) #ruby_libdir = $(CURDIR)/debian/tmp/usr/lib/ruby/$(ruby_ver) #ruby_archdir = $(CURDIR)/debian/tmp/usr/lib/ruby/$(ruby_ver)/$(arch_name) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif configure: configure-stamp configure-stamp: dh_testdir #ln -s comedi-calibrate-1 comedi-calibrate cp /usr/share/misc/config.sub . cp /usr/share/misc/config.guess . cp /usr/share/misc/config.sub comedi-calibrate/ cp /usr/share/misc/config.guess comedi-calibrate/ dh_autoreconf for pyvers in ${PYTHONS}; \ do\ mkdir -p pybuild/$$pyvers; \ cp -Rl `ls . |grep -v pybuild|grep -v debian` pybuild/$$pyvers; \ (cd pybuild/$$pyvers; \ PYTHON="/usr/bin/python$$pyvers" ./configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr);\ done ./configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ --mandir=\$${prefix}/share/man \ --datadir=\$${prefix}/share/doc/ \ --sysconfdir=/etc \ --disable-firmware \ --localstatedir=/var/lib/libcomedi0 \ --disable-dependency-tracking \ --disable-python-binding \ --disable-ruby-binding \ --with-pdf-backend=no\ --with-gnu-ld cd comedi-calibrate && CPPFLAGS="-I $(CURDIR)/c++/include/ -I $(CURDIR)/include/" LDFLAGS="-L $(CURDIR)/lib/.libs" ./configure --disable-comedilib-checking touch $@ build: build-arch build-indep build-arch: build-arch-stamp build-arch-stamp: configure-stamp dh_testdir $(MAKE) cd comedi-calibrate && $(MAKE) for pyvers in ${PYTHONS};\ do\ rm -rf pybuild/$$pyvers/lib;\ (cd pybuild/$$pyvers;\ ln -s ../../lib .);\ (cd pybuild/$$pyvers/swig/python;\ $(MAKE));\ done touch $@ build-indep: build-indep-stamp build-indep-stamp: configure-stamp touch $@ clean: dh_testdir dh_testroot rm -f config.sub rm -f config.guess rm -f config.log rm -f *-stamp rm -rf pybuild rm -rf doc/doc_html/ rm -rf doc/man/ rm -f lib/calib_lex.c rm -f lib/calib_lex.h rm -f lib/calib_yacc.c rm -f lib/calib_yacc.h #rm -f doc/*.xml rm -f doc/calibration_funcref.xml rm -f doc/command_funcref.xml rm -f doc/deprecated_funcref.xml rm -f rm -f doc/dio_funcref.xml rm -f doc/drivers.xml rm -f doc/error_funcref.xml rm -f doc/extensions_funcref.xml rm -f doc/funcref.xml [ ! -f Makefile ] || $(MAKE) distclean rm -f comedi-calibrate/config.sub rm -f comedi-calibrate/config.guess rm -f comedi-calibrate/config.log rm -f doc/pdf/comedilib.pdf [ ! -f comedi-calibrate/Makefile ]] || cd comedi-calibrate && [ ! -f Makefile ] || $(MAKE) distclean find . -name Makefile -exec rm -f {} \; #rm -f comedi-calibrate dh_autoreconf_clean dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr \ pkgdatadir=$(CURDIR)/debian/tmp/usr/share/doc/libcomedi0 \ sysconfdir=$(CURDIR)/debian/tmp/etc \ localstatedir=$(CURDIR)/debian/tmp/var cd comedi-calibrate && $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr for pyvers in ${PYTHONS};\ do\ (cd pybuild/$$pyvers/swig/python;\ $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install);\ done mkdir -p debian/tmp/lib/udev/rules.d cp debian/90-comedi.rules debian/tmp/lib/udev/rules.d/ chmod 644 debian/tmp/usr/lib/python*/dist-packages/comedi.py mkdir -p debian/tmp/usr/share/doc/libcomedi-dev/demo cp -a demo debian/libcomedi-dev/usr/share/doc/libcomedi-dev rm -f debian/libcomedi-dev/usr/share/doc/libcomedi-dev/demo/Makefile* cp debian/Makefile.debian_demo debian/libcomedi-dev/usr/share/doc/libcomedi-dev/demo/Makefile cd debian/libcomedi-dev/usr/share/doc/libcomedi-dev/demo && make clean rm -rf debian/tmp/usr/local binary-indep: build install binary-arch: build install dh_testdir dh_testroot # # build libcomedi${major} package by moving files from comedilib-dev # dh_install --sourcedir=debian/tmp --list-missing dh_installdocs dh_installexamples dh_installmenu dh_installcron dh_installinfo dh_installchangelogs ChangeLog dh_link dh_strip dh_compress --exclude=.c dh_python2 dh_fixperms dh_makeshlibs dh_installdeb dh_shlibdeps -l $(CURDIR)/debian/tmp/usr/lib/ dh_gencontrol dh_md5sums dh_builddeb get-orig-source: VERCAL=1;\ VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-+~]+).*,\1,p');\ set -e;\ wget -q http://comedi.org/download/comedilib-$$VER.tar.gz -O comedilib_$$VER.orig.tar.gz;\ wget -q http://comedi.org/download/comedi_calibrate-$$VERCAL.tar.gz -O comedilib_$$VER.orig-comedi-calibrate.tar.gz binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install