3 internal definitions for comedilib
5 COMEDILIB - Linux Control and Measurement Device Interface Library
6 Copyright (C) 1997-2001 David A. Schleef <ds@schleef.org>
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation, version 2.1
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 #ifndef _LIBINTERNAL_H
25 #define _LIBINTERNAL_H
27 #define _COMEDILIB_DEPRECATED
29 #include "comedilib.h"
31 #include "comedi_errno.h"
32 #include <sys/ioctl.h>
39 /* This indicates a symbol that should not be exported as part of
40 * the library. But I don't know how to make it useful yet. */
43 /* gettext()ization */
46 #define GETTEXT(a) gettext((a))
48 #define GETTEXT(a) (a)
53 #define debug_ptr(a) if(!(a))fprintf(stderr," ** NULL pointer: " __FILE__ ", line %d\n",__LINE__);
54 #define debug_int(a) if((a)<0)fprintf(stderr," ** error: " __FILE__ ", line %d\n",__LINE__);
56 #define COMEDILIB_DEBUG(level,format,args...) do{if(__comedi_loglevel>=(level))fprintf(stderr,"%s: " format, __FUNCTION__ , ##args);}while(0)
58 #define COMEDILIB_MAGIC 0xc001dafe
60 /* handle versioning */
62 #define EXPORT_SYMBOL(a,b) __asm__(".symver " #a "," #a "@v" #b )
63 #define EXPORT_ALIAS_VER(a,b,c) __asm__(".symver " #a "," #b "@v" #c )
64 #define EXPORT_ALIAS_DEFAULT(a,b,c) __asm__(".symver " #a "," #b "@@v" #c )
67 extern int __comedi_init;
68 extern int __comedi_loglevel;
69 extern int __comedi_errno;
73 #define libc_error() (__comedi_errno=errno)
74 #define internal_error(a) (__comedi_errno=(a))
78 void libc_error(void);
79 void internal_error(int error_number);
84 typedef struct subdevice_struct subdevice;
85 typedef struct device_struct device;
87 struct comedi_t_struct{
93 comedi_devinfo devinfo;
95 subdevice *subdevices;
97 unsigned int has_insnlist_ioctl;
98 unsigned int has_insn_ioctl;
101 struct subdevice_struct{
104 unsigned int subd_flags;
105 unsigned int timer_type;
106 unsigned int len_chanlist;
109 unsigned int range_type;
111 lsampl_t *maxdata_list;
112 unsigned int *range_type_list;
113 unsigned int *flags_list;
115 comedi_range *rangeinfo;
116 comedi_range **rangeinfo_list;
118 unsigned int has_cmd;
119 unsigned int has_insn_bits;
122 comedi_cmd *cmd_mask;
124 comedi_cmd *cmd_timed;
127 #define comedi_ioctl _comedi_ioctl
128 //#define comedi_ioctl _comedi_ioctl_debug
130 int _comedi_ioctl( int fd, int request, unsigned long arg );
131 int _comedi_ioctl_debug(int,int,unsigned long);
133 /* filler routines */
135 int get_subdevices(comedi_t *it);
136 comedi_range *get_rangeinfo(int fd,unsigned int range_type);
140 int valid_dev(comedi_t *it);
141 int valid_subd(comedi_t *it,unsigned int subdevice);
142 int valid_chan(comedi_t *it,unsigned int subdevice,unsigned int chan);
145 COMEDILIB_NOERROR = 0x1000,
152 /* used by range.c, was in comedilib.h but apparently deprecated so I put it here - fmhess */
153 int comedi_get_rangetype(comedi_t *it,unsigned int subdevice,unsigned int chan);
155 #define YY_DECL int calib_yylex( YYSTYPE *calib_lvalp, YYLTYPE *calib_llocp )
156 void calib_yyerror( char *s );
157 int calib_yyparse( void *parse_arg );
158 void calib_yyrestart( FILE *input );