summaryrefslogtreecommitdiffstats
path: root/Modules/sunaudiodev.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-06-17 12:35:49 (GMT)
committerGuido van Rossum <guido@python.org>1993-06-17 12:35:49 (GMT)
commit234f942aefb779efa6cfb7225e21d16a3f7e80f7 (patch)
tree9c85e1ae919ebb44c0a1ca48bdfd11d5f60c7d9c /Modules/sunaudiodev.c
parent6a0e2282c359801bd70742642d24f7b0b74f5b4e (diff)
downloadcpython-234f942aefb779efa6cfb7225e21d16a3f7e80f7.zip
cpython-234f942aefb779efa6cfb7225e21d16a3f7e80f7.tar.gz
cpython-234f942aefb779efa6cfb7225e21d16a3f7e80f7.tar.bz2
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Added $(SYSDEF) to its build rule in Makefile. * cgensupport.[ch], modsupport.[ch]: removed some old stuff. Also changed files that still used it... And made several things static that weren't but should have been... And other minor cleanups... * listobject.[ch]: add external interfaces {set,get}listslice * socketmodule.c: fix bugs in new send() argument parsing. * sunaudiodevmodule.c: added flush() and close().
Diffstat (limited to 'Modules/sunaudiodev.c')
-rw-r--r--Modules/sunaudiodev.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/Modules/sunaudiodev.c b/Modules/sunaudiodev.c
index b4470dd..4e63123 100644
--- a/Modules/sunaudiodev.c
+++ b/Modules/sunaudiodev.c
@@ -28,6 +28,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "modsupport.h"
#include "structmember.h"
+#include <stropts.h>
#include <sys/ioctl.h>
#include <sun/audioio.h>
@@ -255,6 +256,38 @@ sad_drain(self, args)
return None;
}
+static object *
+sad_flush(self, args)
+ sadobject *self;
+ object *args;
+{
+
+ if ( !getargs(args, "") )
+ return 0;
+ if ( ioctl(self->x_fd, I_FLUSH, FLUSHW) < 0 ) {
+ err_errno(SunAudioError);
+ return NULL;
+ }
+ INCREF(None);
+ return None;
+}
+
+static object *
+sad_close(self, args)
+ sadobject *self;
+ object *args;
+{
+
+ if ( !getargs(args, "") )
+ return 0;
+ if ( self->x_fd >= 0 ) {
+ close(self->x_fd);
+ self->x_fd = -1;
+ }
+ INCREF(None);
+ return None;
+}
+
static struct methodlist sad_methods[] = {
{ "read", sad_read },
{ "write", sad_write },
@@ -264,6 +297,8 @@ static struct methodlist sad_methods[] = {
{ "getinfo", sad_getinfo },
{ "setinfo", sad_setinfo },
{ "drain", sad_drain },
+ { "flush", sad_flush },
+ { "close", sad_close },
{NULL, NULL} /* sentinel */
};