Mercurial > cpython-lru_cache-weakref
annotate Modules/sunaudiodev.c @ 79675:c0a2294de787 2.7
Issue #16199: Backport 2to3 typo fix from 3.2.
| author | Chris Jerdonek <chris.jerdonek@gmail.com> |
|---|---|
| date | Thu, 11 Oct 2012 16:15:46 -0700 |
| parents | fd25030223b0 |
| children |
| rev | line source |
|---|---|
| 885 | 1 |
| 2 /* Sad objects */ | |
| 3 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
4 #include "Python.h" |
| 885 | 5 #include "structmember.h" |
| 6 | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1418
diff
changeset
|
7 #ifdef HAVE_SYS_AUDIOIO_H |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1418
diff
changeset
|
8 #define SOLARIS |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1418
diff
changeset
|
9 #endif |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1418
diff
changeset
|
10 |
|
4652
3d87cb1b3d17
Make gcc -Wall happy; remove dummy variable (can't see where it's needed).
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
11 #ifdef HAVE_FCNTL_H |
|
3d87cb1b3d17
Make gcc -Wall happy; remove dummy variable (can't see where it's needed).
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
12 #include <fcntl.h> |
|
3d87cb1b3d17
Make gcc -Wall happy; remove dummy variable (can't see where it's needed).
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
13 #endif |
|
3d87cb1b3d17
Make gcc -Wall happy; remove dummy variable (can't see where it's needed).
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
14 |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
15 #include <stropts.h> |
| 885 | 16 #include <sys/ioctl.h> |
| 1418 | 17 #ifdef SOLARIS |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1418
diff
changeset
|
18 #include <sys/audioio.h> |
| 1418 | 19 #else |
| 885 | 20 #include <sun/audioio.h> |
| 1418 | 21 #endif |
| 885 | 22 |
| 23 /* #define offsetof(str,mem) ((int)(((str *)0)->mem)) */ | |
| 24 | |
| 25 typedef struct { | |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
26 PyObject_HEAD |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
27 int x_fd; /* The open file */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
28 int x_icount; /* # samples read */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
29 int x_ocount; /* # samples written */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
30 int x_isctl; /* True if control device */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
31 |
| 885 | 32 } sadobject; |
| 33 | |
| 34 typedef struct { | |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
35 PyObject_HEAD |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
36 audio_info_t ai; |
| 885 | 37 } sadstatusobject; |
| 38 | |
|
24280
1598a1e473e2
staticforward bites the dust.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
22709
diff
changeset
|
39 static PyTypeObject Sadtype; |
|
1598a1e473e2
staticforward bites the dust.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
22709
diff
changeset
|
40 static PyTypeObject Sadstatustype; |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
41 static sadstatusobject *sads_alloc(void); /* Forward */ |
| 885 | 42 |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
43 static PyObject *SunAudioError; |
| 885 | 44 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
45 #define is_sadobject(v) (Py_TYPE(v) == &Sadtype) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
46 #define is_sadstatusobject(v) (Py_TYPE(v) == &Sadstatustype) |
| 885 | 47 |
|
9466
6a244e64b3e6
audio(7I) suggests that applications do the following to get the
Barry Warsaw <barry@python.org>
parents:
6367
diff
changeset
|
48 |
| 885 | 49 static sadobject * |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
50 newsadobject(PyObject *args) |
| 885 | 51 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
52 sadobject *xp; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
53 int fd; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
54 char *mode; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
55 int imode; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
56 char* basedev; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
57 char* ctldev; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
58 char* opendev; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
59 |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
60 /* Check arg for r/w/rw */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
61 if (!PyArg_ParseTuple(args, "s", &mode)) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
62 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
63 if (strcmp(mode, "r") == 0) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
64 imode = 0; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
65 else if (strcmp(mode, "w") == 0) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
66 imode = 1; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
67 else if (strcmp(mode, "rw") == 0) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
68 imode = 2; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
69 else if (strcmp(mode, "control") == 0) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
70 imode = -1; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
71 else { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
72 PyErr_SetString(SunAudioError, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
73 "Mode should be one of 'r', 'w', 'rw' or 'control'"); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
74 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
75 } |
| 885 | 76 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
77 /* Open the correct device. The base device name comes from the |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
78 * AUDIODEV environment variable first, then /dev/audio. The |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
79 * control device tacks "ctl" onto the base device name. |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
80 */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
81 basedev = getenv("AUDIODEV"); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
82 if (!basedev) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
83 basedev = "/dev/audio"; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
84 ctldev = PyMem_NEW(char, strlen(basedev) + 4); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
85 if (!ctldev) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
86 PyErr_NoMemory(); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
87 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
88 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
89 strcpy(ctldev, basedev); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
90 strcat(ctldev, "ctl"); |
|
9466
6a244e64b3e6
audio(7I) suggests that applications do the following to get the
Barry Warsaw <barry@python.org>
parents:
6367
diff
changeset
|
91 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
92 if (imode < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
93 opendev = ctldev; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
94 fd = open(ctldev, 2); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
95 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
96 else { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
97 opendev = basedev; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
98 fd = open(basedev, imode); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
99 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
100 if (fd < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
101 PyErr_SetFromErrnoWithFilename(SunAudioError, opendev); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
102 PyMem_DEL(ctldev); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
103 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
104 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
105 PyMem_DEL(ctldev); |
| 885 | 106 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
107 /* Create and initialize the object */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
108 xp = PyObject_New(sadobject, &Sadtype); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
109 if (xp == NULL) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
110 close(fd); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
111 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
112 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
113 xp->x_fd = fd; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
114 xp->x_icount = xp->x_ocount = 0; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
115 xp->x_isctl = (imode < 0); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
116 |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
117 return xp; |
| 885 | 118 } |
| 119 | |
| 120 /* Sad methods */ | |
| 121 | |
| 122 static void | |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
123 sad_dealloc(sadobject *xp) |
| 885 | 124 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
125 close(xp->x_fd); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
126 PyObject_Del(xp); |
| 885 | 127 } |
| 128 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
129 static PyObject * |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
130 sad_read(sadobject *self, PyObject *args) |
| 885 | 131 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
132 int size, count; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
133 char *cp; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
134 PyObject *rv; |
| 885 | 135 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
136 if (!PyArg_ParseTuple(args, "i:read", &size)) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
137 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
138 rv = PyString_FromStringAndSize(NULL, size); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
139 if (rv == NULL) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
140 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
141 |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
142 if (!(cp = PyString_AsString(rv))) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
143 goto finally; |
| 885 | 144 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
145 count = read(self->x_fd, cp, size); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
146 if (count < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
147 PyErr_SetFromErrno(SunAudioError); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
148 goto finally; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
149 } |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
150 #if 0 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
151 /* TBD: why print this message if you can handle the condition? |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
152 * assume it's debugging info which we can just as well get rid |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
153 * of. in any case this message should *not* be using printf! |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
154 */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
155 if (count != size) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
156 printf("sunaudio: funny read rv %d wtd %d\n", count, size); |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
157 #endif |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
158 self->x_icount += count; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
159 return rv; |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
160 |
|
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
161 finally: |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
162 Py_DECREF(rv); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
163 return NULL; |
| 885 | 164 } |
| 165 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
166 static PyObject * |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
167 sad_write(sadobject *self, PyObject *args) |
| 885 | 168 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
169 char *cp; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
170 int count, size; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
171 |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
172 if (!PyArg_ParseTuple(args, "s#:write", &cp, &size)) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
173 return NULL; |
| 885 | 174 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
175 count = write(self->x_fd, cp, size); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
176 if (count < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
177 PyErr_SetFromErrno(SunAudioError); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
178 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
179 } |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
180 #if 0 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
181 if (count != size) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
182 printf("sunaudio: funny write rv %d wanted %d\n", count, size); |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
183 #endif |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
184 self->x_ocount += count; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
185 |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
186 Py_INCREF(Py_None); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
187 return Py_None; |
| 885 | 188 } |
| 189 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
190 static PyObject * |
| 22709 | 191 sad_getinfo(sadobject *self) |
| 885 | 192 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
193 sadstatusobject *rv; |
| 885 | 194 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
195 if (!(rv = sads_alloc())) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
196 return NULL; |
|
4919
f8e5bc5351a9
Plugged a couple of potential return value problems, memory leaks, and
Barry Warsaw <barry@python.org>
parents:
4708
diff
changeset
|
197 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
198 if (ioctl(self->x_fd, AUDIO_GETINFO, &rv->ai) < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
199 PyErr_SetFromErrno(SunAudioError); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
200 Py_DECREF(rv); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
201 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
202 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
203 return (PyObject *)rv; |
| 885 | 204 } |
| 205 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
206 static PyObject * |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
207 sad_setinfo(sadobject *self, sadstatusobject *arg) |
| 885 | 208 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
209 if (!is_sadstatusobject(arg)) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
210 PyErr_SetString(PyExc_TypeError, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
211 "Must be sun audio status object"); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
212 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
213 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
214 if (ioctl(self->x_fd, AUDIO_SETINFO, &arg->ai) < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
215 PyErr_SetFromErrno(SunAudioError); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
216 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
217 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
218 Py_INCREF(Py_None); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
219 return Py_None; |
| 885 | 220 } |
| 221 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
222 static PyObject * |
| 22709 | 223 sad_ibufcount(sadobject *self) |
| 885 | 224 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
225 audio_info_t ai; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
226 |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
227 if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
228 PyErr_SetFromErrno(SunAudioError); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
229 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
230 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
231 return PyInt_FromLong(ai.record.samples - self->x_icount); |
| 885 | 232 } |
| 233 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
234 static PyObject * |
| 22709 | 235 sad_obufcount(sadobject *self) |
| 885 | 236 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
237 audio_info_t ai; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
238 |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
239 if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
240 PyErr_SetFromErrno(SunAudioError); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
241 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
242 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
243 /* x_ocount is in bytes, whereas play.samples is in frames */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
244 /* we want frames */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
245 return PyInt_FromLong(self->x_ocount / (ai.play.channels * |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
246 ai.play.precision / 8) - |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
247 ai.play.samples); |
| 885 | 248 } |
| 249 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
250 static PyObject * |
| 22709 | 251 sad_drain(sadobject *self) |
| 885 | 252 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
253 if (ioctl(self->x_fd, AUDIO_DRAIN, 0) < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
254 PyErr_SetFromErrno(SunAudioError); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
255 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
256 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
257 Py_INCREF(Py_None); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
258 return Py_None; |
| 885 | 259 } |
| 260 | |
| 1418 | 261 #ifdef SOLARIS |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
262 static PyObject * |
| 22709 | 263 sad_getdev(sadobject *self) |
| 1418 | 264 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
265 struct audio_device ad; |
| 1418 | 266 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
267 if (ioctl(self->x_fd, AUDIO_GETDEV, &ad) < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
268 PyErr_SetFromErrno(SunAudioError); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
269 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
270 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
271 return Py_BuildValue("(sss)", ad.name, ad.version, ad.config); |
| 1418 | 272 } |
| 273 #endif | |
| 274 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
275 static PyObject * |
| 22709 | 276 sad_flush(sadobject *self) |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
277 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
278 if (ioctl(self->x_fd, I_FLUSH, FLUSHW) < 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
279 PyErr_SetFromErrno(SunAudioError); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
280 return NULL; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
281 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
282 Py_INCREF(Py_None); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
283 return Py_None; |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
284 } |
|
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
285 |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
286 static PyObject * |
| 22709 | 287 sad_close(sadobject *self) |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
288 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
289 |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
290 if (self->x_fd >= 0) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
291 close(self->x_fd); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
292 self->x_fd = -1; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
293 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
294 Py_INCREF(Py_None); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
295 return Py_None; |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
296 } |
|
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
297 |
|
9466
6a244e64b3e6
audio(7I) suggests that applications do the following to get the
Barry Warsaw <barry@python.org>
parents:
6367
diff
changeset
|
298 static PyObject * |
| 22709 | 299 sad_fileno(sadobject *self) |
|
9466
6a244e64b3e6
audio(7I) suggests that applications do the following to get the
Barry Warsaw <barry@python.org>
parents:
6367
diff
changeset
|
300 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
301 return PyInt_FromLong(self->x_fd); |
|
9466
6a244e64b3e6
audio(7I) suggests that applications do the following to get the
Barry Warsaw <barry@python.org>
parents:
6367
diff
changeset
|
302 } |
|
6a244e64b3e6
audio(7I) suggests that applications do the following to get the
Barry Warsaw <barry@python.org>
parents:
6367
diff
changeset
|
303 |
|
6a244e64b3e6
audio(7I) suggests that applications do the following to get the
Barry Warsaw <barry@python.org>
parents:
6367
diff
changeset
|
304 |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
305 static PyMethodDef sad_methods[] = { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
306 { "read", (PyCFunction)sad_read, METH_VARARGS }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
307 { "write", (PyCFunction)sad_write, METH_VARARGS }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
308 { "ibufcount", (PyCFunction)sad_ibufcount, METH_NOARGS }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
309 { "obufcount", (PyCFunction)sad_obufcount, METH_NOARGS }, |
| 885 | 310 #define CTL_METHODS 4 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
311 { "getinfo", (PyCFunction)sad_getinfo, METH_NOARGS }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
312 { "setinfo", (PyCFunction)sad_setinfo, METH_O}, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
313 { "drain", (PyCFunction)sad_drain, METH_NOARGS }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
314 { "flush", (PyCFunction)sad_flush, METH_NOARGS }, |
| 1418 | 315 #ifdef SOLARIS |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
316 { "getdev", (PyCFunction)sad_getdev, METH_NOARGS }, |
| 1418 | 317 #endif |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
318 { "close", (PyCFunction)sad_close, METH_NOARGS }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
319 { "fileno", (PyCFunction)sad_fileno, METH_NOARGS }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
320 {NULL, NULL} /* sentinel */ |
| 885 | 321 }; |
| 322 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
323 static PyObject * |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
324 sad_getattr(sadobject *xp, char *name) |
| 885 | 325 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
326 if (xp->x_isctl) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
327 return Py_FindMethod(sad_methods+CTL_METHODS, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
328 (PyObject *)xp, name); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
329 else |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
330 return Py_FindMethod(sad_methods, (PyObject *)xp, name); |
| 885 | 331 } |
| 332 | |
| 333 /* ----------------------------------------------------------------- */ | |
| 334 | |
| 335 static sadstatusobject * | |
|
13690
c09c0171474f
ANSIfy some more forward declarations.
Thomas Wouters <thomas@python.org>
parents:
13651
diff
changeset
|
336 sads_alloc(void) { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
337 return PyObject_New(sadstatusobject, &Sadstatustype); |
| 885 | 338 } |
| 339 | |
| 340 static void | |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
341 sads_dealloc(sadstatusobject *xp) |
| 885 | 342 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
343 PyMem_DEL(xp); |
| 885 | 344 } |
| 345 | |
| 346 #define OFF(x) offsetof(audio_info_t,x) | |
| 347 static struct memberlist sads_ml[] = { | |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
348 { "i_sample_rate", T_UINT, OFF(record.sample_rate) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
349 { "i_channels", T_UINT, OFF(record.channels) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
350 { "i_precision", T_UINT, OFF(record.precision) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
351 { "i_encoding", T_UINT, OFF(record.encoding) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
352 { "i_gain", T_UINT, OFF(record.gain) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
353 { "i_port", T_UINT, OFF(record.port) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
354 { "i_samples", T_UINT, OFF(record.samples) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
355 { "i_eof", T_UINT, OFF(record.eof) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
356 { "i_pause", T_UBYTE, OFF(record.pause) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
357 { "i_error", T_UBYTE, OFF(record.error) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
358 { "i_waiting", T_UBYTE, OFF(record.waiting) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
359 { "i_open", T_UBYTE, OFF(record.open) , RO}, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
360 { "i_active", T_UBYTE, OFF(record.active) , RO}, |
| 1418 | 361 #ifdef SOLARIS |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
362 { "i_buffer_size", T_UINT, OFF(record.buffer_size) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
363 { "i_balance", T_UBYTE, OFF(record.balance) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
364 { "i_avail_ports", T_UINT, OFF(record.avail_ports) }, |
| 1418 | 365 #endif |
| 885 | 366 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
367 { "o_sample_rate", T_UINT, OFF(play.sample_rate) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
368 { "o_channels", T_UINT, OFF(play.channels) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
369 { "o_precision", T_UINT, OFF(play.precision) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
370 { "o_encoding", T_UINT, OFF(play.encoding) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
371 { "o_gain", T_UINT, OFF(play.gain) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
372 { "o_port", T_UINT, OFF(play.port) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
373 { "o_samples", T_UINT, OFF(play.samples) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
374 { "o_eof", T_UINT, OFF(play.eof) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
375 { "o_pause", T_UBYTE, OFF(play.pause) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
376 { "o_error", T_UBYTE, OFF(play.error) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
377 { "o_waiting", T_UBYTE, OFF(play.waiting) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
378 { "o_open", T_UBYTE, OFF(play.open) , RO}, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
379 { "o_active", T_UBYTE, OFF(play.active) , RO}, |
| 1418 | 380 #ifdef SOLARIS |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
381 { "o_buffer_size", T_UINT, OFF(play.buffer_size) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
382 { "o_balance", T_UBYTE, OFF(play.balance) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
383 { "o_avail_ports", T_UINT, OFF(play.avail_ports) }, |
| 1418 | 384 #endif |
| 885 | 385 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
386 { "monitor_gain", T_UINT, OFF(monitor_gain) }, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
387 { NULL, 0, 0}, |
| 885 | 388 }; |
| 389 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
390 static PyObject * |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
391 sads_getattr(sadstatusobject *xp, char *name) |
| 885 | 392 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
393 return PyMember_Get((char *)&xp->ai, sads_ml, name); |
| 885 | 394 } |
| 395 | |
| 396 static int | |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
397 sads_setattr(sadstatusobject *xp, char *name, PyObject *v) |
| 885 | 398 { |
|
1031
7a11a70f7f44
classobject.c moduleobject.c stdwinmodule.c xxobject.c:
Guido van Rossum <guido@python.org>
parents:
885
diff
changeset
|
399 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
400 if (v == NULL) { |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
401 PyErr_SetString(PyExc_TypeError, |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
402 "can't delete sun audio status attributes"); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
403 return -1; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
404 } |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
405 return PyMember_Set((char *)&xp->ai, sads_ml, name, v); |
| 885 | 406 } |
| 407 | |
| 408 /* ------------------------------------------------------------------- */ | |
| 409 | |
| 410 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
411 static PyTypeObject Sadtype = { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
412 PyVarObject_HEAD_INIT(&PyType_Type, 0) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
413 "sunaudiodev.sun_audio_device", /*tp_name*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
414 sizeof(sadobject), /*tp_size*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
415 0, /*tp_itemsize*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
416 /* methods */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
417 (destructor)sad_dealloc, /*tp_dealloc*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
418 0, /*tp_print*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
419 (getattrfunc)sad_getattr, /*tp_getattr*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
420 0, /*tp_setattr*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
421 0, /*tp_compare*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
422 0, /*tp_repr*/ |
| 885 | 423 }; |
| 424 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
425 static PyTypeObject Sadstatustype = { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
426 PyVarObject_HEAD_INIT(&PyType_Type, 0) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
427 "sunaudiodev.sun_audio_device_status", /*tp_name*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
428 sizeof(sadstatusobject), /*tp_size*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
429 0, /*tp_itemsize*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
430 /* methods */ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
431 (destructor)sads_dealloc, /*tp_dealloc*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
432 0, /*tp_print*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
433 (getattrfunc)sads_getattr, /*tp_getattr*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
434 (setattrfunc)sads_setattr, /*tp_setattr*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
435 0, /*tp_compare*/ |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
436 0, /*tp_repr*/ |
| 885 | 437 }; |
| 438 /* ------------------------------------------------------------------- */ | |
| 439 | |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
440 static PyObject * |
|
13520
27d87e072bfb
ANSI-fication (fixed on parameter list I messed up in the patch)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
441 sadopen(PyObject *self, PyObject *args) |
| 885 | 442 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
443 return (PyObject *)newsadobject(args); |
| 885 | 444 } |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
445 |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
446 static PyMethodDef sunaudiodev_methods[] = { |
| 22709 | 447 { "open", sadopen, METH_VARARGS }, |
| 885 | 448 { 0, 0 }, |
| 449 }; | |
| 450 | |
| 451 void | |
|
13651
8a063423e0b7
Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',
Thomas Wouters <thomas@python.org>
parents:
13620
diff
changeset
|
452 initsunaudiodev(void) |
|
4708
775a7d0c2960
Renamed, however there is no test case. I did test some of the module
Barry Warsaw <barry@python.org>
parents:
4652
diff
changeset
|
453 { |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
454 PyObject *m, *d; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
455 |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
456 if (PyErr_WarnPy3k("the sunaudiodev module has been removed in " |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
457 "Python 3.0", 2) < 0) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
458 return; |
| 885 | 459 |
|
61463
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
460 m = Py_InitModule("sunaudiodev", sunaudiodev_methods); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
461 if (m == NULL) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
462 return; |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
463 d = PyModule_GetDict(m); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
464 SunAudioError = PyErr_NewException("sunaudiodev.error", NULL, NULL); |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
465 if (SunAudioError) |
|
fd25030223b0
Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents:
47527
diff
changeset
|
466 PyDict_SetItemString(d, "error", SunAudioError); |
| 885 | 467 } |
