From: David Schleef <ds@schleef.org>
Date: Sat, 18 May 2002 22:48:19 +0000 (+0000)
Subject: Add comedi_get_read/write_subdevice()
X-Git-Tag: r0_7_19~26
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b4fd07f2cfd9d283feff101c3b629c2b2fa40c6e;p=comedilib.git

Add comedi_get_read/write_subdevice()
---

diff --git a/include/comedilib.h b/include/comedilib.h
index 3e0fe7b..b2eafdc 100644
--- a/include/comedilib.h
+++ b/include/comedilib.h
@@ -185,6 +185,8 @@ enum comedi_oor_behavior {
 
 enum comedi_oor_behavior comedi_set_global_oor_behavior(enum comedi_oor_behavior behavior);
 
+int comedi_get_read_subdevice(comedi_t *dev);
+int comedi_get_write_subdevice(comedi_t *dev);
 
 
 
diff --git a/lib/get.c b/lib/get.c
index 85f5d35..0063a70 100644
--- a/lib/get.c
+++ b/lib/get.c
@@ -96,6 +96,21 @@ int comedi_find_subdevice_by_type(comedi_t *it,int type,unsigned int subd)
 	return -1;
 }
 
+int comedi_get_read_subdevice(comedi_t *dev)
+{
+	if(!valid_dev(dev))
+		return -1;
+
+	return dev->devinfo.read_subdevice;
+}
+
+int comedi_get_write_subdevice(comedi_t *dev)
+{
+	if(!valid_dev(dev))
+		return -1;
+
+	return dev->devinfo.write_subdevice;
+}
 
 int comedi_get_n_channels(comedi_t *it,unsigned int subd)
 {