Mercurial > cpython-lru_cache-weakref
annotate Modules/almodule.c @ 1590:ac2e5cc29949 legacy-trunk
Added tests for missing host to open_http and open_gopher
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 18 Apr 1994 09:39:56 +0000 |
| parents | 4749c957466b |
| children | 1940892d2fe3 |
| rev | line source |
|---|---|
| 367 | 1 /********************************************************** |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1214
diff
changeset
|
2 Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum, |
|
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1214
diff
changeset
|
3 Amsterdam, The Netherlands. |
| 367 | 4 |
| 5 All Rights Reserved | |
| 6 | |
| 7 Permission to use, copy, modify, and distribute this software and its | |
| 8 documentation for any purpose and without fee is hereby granted, | |
| 9 provided that the above copyright notice appear in all copies and that | |
| 10 both that copyright notice and this permission notice appear in | |
| 11 supporting documentation, and that the names of Stichting Mathematisch | |
| 12 Centrum or CWI not be used in advertising or publicity pertaining to | |
| 13 distribution of the software without specific, written prior permission. | |
| 14 | |
| 15 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO | |
| 16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
| 17 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE | |
| 18 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
| 19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
| 20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
| 21 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| 22 | |
| 23 ******************************************************************/ | |
| 24 | |
|
864
e58f40c2f285
Mark's name is Callow, not Callows
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
25 /* AL module -- interface to Mark Callow's Audio Library (AL). */ |
| 367 | 26 |
| 27 #include "audio.h" | |
| 28 | |
|
1214
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
29 /* Check which version audio library we have: */ |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
30 #ifdef AL_ERROR_NUMBER |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
31 #define AL_405 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
32 /* XXXX 4.0.5 libaudio also allows us to provide better error |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
33 ** handling (with ALseterrorhandler). We should implement that |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
34 ** sometime. |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
35 */ |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
36 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
37 #endif |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
38 |
| 367 | 39 #include "allobjects.h" |
| 40 #include "import.h" | |
| 41 #include "modsupport.h" | |
| 42 #include "structmember.h" | |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
864
diff
changeset
|
43 #include "ceval.h" |
| 367 | 44 |
| 45 | |
| 46 /* Config objects */ | |
| 47 | |
| 48 typedef struct { | |
| 49 OB_HEAD | |
| 50 ALconfig ob_config; | |
| 51 } configobject; | |
| 52 | |
| 53 extern typeobject Configtype; /* Forward */ | |
| 54 | |
| 55 #define is_configobject(v) ((v)->ob_type == &Configtype) | |
| 56 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
57 /* Forward */ |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
58 static int getconfigarg PROTO((object *, ALconfig *)); |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
59 static int getstrstrconfigarg PROTO((object *, char **, char **, ALconfig *)); |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
60 |
| 367 | 61 static object * |
| 62 setConfig (self, args, func) | |
| 63 configobject *self; | |
| 64 object *args; | |
| 65 void (*func)(ALconfig, long); | |
| 66 { | |
| 67 long par; | |
| 68 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
69 if (!getlongarg (args, &par)) return NULL; |
| 367 | 70 |
| 71 (*func) (self-> ob_config, par); | |
| 72 | |
| 73 INCREF (None); | |
| 74 return None; | |
| 75 } | |
| 76 | |
| 77 static object * | |
| 78 getConfig (self, args, func) | |
| 79 configobject *self; | |
| 80 object *args; | |
| 81 long (*func)(ALconfig); | |
| 82 { | |
| 83 long par; | |
| 84 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
85 if (!getnoarg (args)) return NULL; |
| 367 | 86 |
| 87 par = (*func) (self-> ob_config); | |
| 88 | |
| 89 return newintobject (par); | |
| 90 } | |
| 91 | |
| 92 static object * | |
| 93 al_setqueuesize (self, args) | |
| 94 configobject *self; | |
| 95 object *args; | |
| 96 { | |
| 97 return (setConfig (self, args, ALsetqueuesize)); | |
| 98 } | |
| 99 | |
| 100 static object * | |
| 101 al_getqueuesize (self, args) | |
| 102 configobject *self; | |
| 103 object *args; | |
| 104 { | |
| 105 return (getConfig (self, args, ALgetqueuesize)); | |
| 106 } | |
| 107 | |
| 108 static object * | |
| 109 al_setwidth (self, args) | |
| 110 configobject *self; | |
| 111 object *args; | |
| 112 { | |
| 113 return (setConfig (self, args, ALsetwidth)); | |
| 114 } | |
| 115 | |
| 116 static object * | |
| 117 al_getwidth (self, args) | |
| 118 configobject *self; | |
| 119 object *args; | |
| 120 { | |
| 121 return (getConfig (self, args, ALgetwidth)); | |
| 122 } | |
| 123 | |
| 124 static object * | |
| 125 al_getchannels (self, args) | |
| 126 configobject *self; | |
| 127 object *args; | |
| 128 { | |
| 129 return (getConfig (self, args, ALgetchannels)); | |
| 130 } | |
| 131 | |
| 132 static object * | |
| 133 al_setchannels (self, args) | |
| 134 configobject *self; | |
| 135 object *args; | |
| 136 { | |
| 137 return (setConfig (self, args, ALsetchannels)); | |
| 138 } | |
| 139 | |
|
1214
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
140 #ifdef AL_405 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
141 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
142 static object * |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
143 al_getsampfmt (self, args) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
144 configobject *self; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
145 object *args; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
146 { |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
147 return (getConfig (self, args, ALgetsampfmt)); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
148 } |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
149 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
150 static object * |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
151 al_setsampfmt (self, args) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
152 configobject *self; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
153 object *args; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
154 { |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
155 return (setConfig (self, args, ALsetsampfmt)); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
156 } |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
157 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
158 static object * |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
159 al_getfloatmax(self, args) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
160 configobject *self; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
161 object *args; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
162 { |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
163 double arg; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
164 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
165 if ( !getnoarg(args) ) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
166 return 0; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
167 arg = ALgetfloatmax(self->ob_config); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
168 return newfloatobject(arg); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
169 } |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
170 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
171 static object * |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
172 al_setfloatmax(self, args) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
173 configobject *self; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
174 object *args; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
175 { |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
176 double arg; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
177 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
178 if ( !getargs(args, "d", &arg) ) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
179 return 0; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
180 ALsetfloatmax(self->ob_config, arg); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
181 INCREF(None); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
182 return None; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
183 } |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
184 #endif /* AL_405 */ |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
185 |
| 367 | 186 static struct methodlist config_methods[] = { |
| 187 {"getqueuesize", al_getqueuesize}, | |
| 188 {"setqueuesize", al_setqueuesize}, | |
| 189 {"getwidth", al_getwidth}, | |
| 190 {"setwidth", al_setwidth}, | |
| 191 {"getchannels", al_getchannels}, | |
| 192 {"setchannels", al_setchannels}, | |
|
1214
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
193 #ifdef AL_405 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
194 {"getsampfmt", al_getsampfmt}, |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
195 {"setsampfmt", al_setsampfmt}, |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
196 {"getfloatmax", al_getfloatmax}, |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
197 {"setfloatmax", al_setfloatmax}, |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
198 #endif /* AL_405 */ |
| 367 | 199 {NULL, NULL} /* sentinel */ |
| 200 }; | |
| 201 | |
| 202 static void | |
| 203 config_dealloc(self) | |
| 204 configobject *self; | |
| 205 { | |
| 206 ALfreeconfig(self->ob_config); | |
| 207 DEL(self); | |
| 208 } | |
| 209 | |
| 210 static object * | |
| 211 config_getattr(self, name) | |
| 212 configobject *self; | |
| 213 char *name; | |
| 214 { | |
| 215 return findmethod(config_methods, (object *)self, name); | |
| 216 } | |
| 217 | |
| 218 typeobject Configtype = { | |
| 219 OB_HEAD_INIT(&Typetype) | |
| 220 0, /*ob_size*/ | |
| 221 "config", /*tp_name*/ | |
| 222 sizeof(configobject), /*tp_size*/ | |
| 223 0, /*tp_itemsize*/ | |
| 224 /* methods */ | |
| 225 config_dealloc, /*tp_dealloc*/ | |
| 226 0, /*tp_print*/ | |
| 227 config_getattr, /*tp_getattr*/ | |
| 228 0, /*tp_setattr*/ | |
| 229 0, /*tp_compare*/ | |
| 230 0, /*tp_repr*/ | |
| 231 }; | |
| 232 | |
| 233 static object * | |
| 234 newconfigobject(config) | |
| 235 ALconfig config; | |
| 236 { | |
| 237 configobject *p; | |
| 238 | |
| 239 p = NEWOBJ(configobject, &Configtype); | |
| 240 if (p == NULL) | |
| 241 return NULL; | |
| 242 p->ob_config = config; | |
| 243 return (object *)p; | |
| 244 } | |
| 245 | |
| 246 /* Port objects */ | |
| 247 | |
| 248 typedef struct { | |
| 249 OB_HEAD | |
| 250 ALport ob_port; | |
| 251 } portobject; | |
| 252 | |
| 253 extern typeobject Porttype; /* Forward */ | |
| 254 | |
| 255 #define is_portobject(v) ((v)->ob_type == &Porttype) | |
| 256 | |
| 257 static object * | |
| 258 al_closeport (self, args) | |
| 259 portobject *self; | |
| 260 object *args; | |
| 261 { | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
262 if (!getnoarg (args)) return NULL; |
| 367 | 263 |
| 264 if (self->ob_port != NULL) { | |
| 265 ALcloseport (self-> ob_port); | |
| 266 self->ob_port = NULL; | |
| 267 /* XXX Using a closed port may dump core! */ | |
| 268 } | |
| 269 | |
| 270 INCREF (None); | |
| 271 return None; | |
| 272 } | |
| 273 | |
| 274 static object * | |
| 275 al_getfd (self, args) | |
| 276 portobject *self; | |
| 277 object *args; | |
| 278 { | |
| 279 int fd; | |
| 280 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
281 if (!getnoarg (args)) return NULL; |
| 367 | 282 |
| 283 fd = ALgetfd (self-> ob_port); | |
| 284 | |
| 285 return newintobject (fd); | |
| 286 } | |
| 287 | |
| 288 static object * | |
| 289 al_getfilled (self, args) | |
| 290 portobject *self; | |
| 291 object *args; | |
| 292 { | |
| 293 long count; | |
| 294 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
295 if (!getnoarg (args)) return NULL; |
| 367 | 296 |
| 297 count = ALgetfilled (self-> ob_port); | |
| 298 | |
| 299 return newintobject (count); | |
| 300 } | |
| 301 | |
| 302 static object * | |
| 303 al_getfillable (self, args) | |
| 304 portobject *self; | |
| 305 object *args; | |
| 306 { | |
| 307 long count; | |
| 308 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
309 if (!getnoarg (args)) return NULL; |
| 367 | 310 |
| 311 count = ALgetfillable (self-> ob_port); | |
| 312 | |
| 313 return newintobject (count); | |
| 314 } | |
| 315 | |
| 316 static object * | |
| 317 al_readsamps (self, args) | |
| 318 portobject *self; | |
| 319 object *args; | |
| 320 { | |
| 321 long count; | |
| 322 object *v; | |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
323 ALconfig c; |
| 367 | 324 int width; |
| 325 | |
| 326 if (!getlongarg (args, &count)) return NULL; | |
| 327 | |
| 328 if (count <= 0) | |
| 329 { | |
| 330 err_setstr (RuntimeError, "al.readsamps : arg <= 0"); | |
| 331 return NULL; | |
| 332 } | |
| 333 | |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
334 c = ALgetconfig(self->ob_port); |
|
1214
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
335 #ifdef AL_405 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
336 width = ALgetsampfmt(c); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
337 if ( width == AL_SAMPFMT_FLOAT ) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
338 width = sizeof(float); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
339 else if ( width == AL_SAMPFMT_DOUBLE ) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
340 width = sizeof(double); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
341 else |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
342 width = ALgetwidth(c); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
343 #else |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
344 width = ALgetwidth(c); |
|
1214
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
345 #endif /* AL_405 */ |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
346 ALfreeconfig(c); |
| 367 | 347 v = newsizedstringobject ((char *)NULL, width * count); |
| 348 if (v == NULL) return NULL; | |
| 349 | |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
864
diff
changeset
|
350 BGN_SAVE |
| 367 | 351 ALreadsamps (self-> ob_port, (void *) getstringvalue(v), count); |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
864
diff
changeset
|
352 END_SAVE |
| 367 | 353 |
| 354 return (v); | |
| 355 } | |
| 356 | |
| 357 static object * | |
| 358 al_writesamps (self, args) | |
| 359 portobject *self; | |
| 360 object *args; | |
| 361 { | |
| 362 long count; | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
363 char *buf; |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
364 int size, width; |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
365 ALconfig c; |
| 367 | 366 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
367 if (!getargs (args, "s#", &buf, &size)) return NULL; |
| 367 | 368 |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
369 c = ALgetconfig(self->ob_port); |
|
1214
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
370 #ifdef AL_405 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
371 width = ALgetsampfmt(c); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
372 if ( width == AL_SAMPFMT_FLOAT ) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
373 width = sizeof(float); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
374 else if ( width == AL_SAMPFMT_DOUBLE ) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
375 width = sizeof(double); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
376 else |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
377 width = ALgetwidth(c); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
378 #else |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
379 width = ALgetwidth(c); |
|
1214
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
380 #endif /* AL_405 */ |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
381 ALfreeconfig(c); |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
864
diff
changeset
|
382 BGN_SAVE |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
383 ALwritesamps (self-> ob_port, (void *) buf, (long) size / width); |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
864
diff
changeset
|
384 END_SAVE |
| 367 | 385 |
| 386 INCREF (None); | |
| 387 return None; | |
| 388 } | |
| 389 | |
| 390 static object * | |
| 391 al_getfillpoint (self, args) | |
| 392 portobject *self; | |
| 393 object *args; | |
| 394 { | |
| 395 long count; | |
| 396 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
397 if (!getnoarg (args)) return NULL; |
| 367 | 398 |
| 399 count = ALgetfillpoint (self-> ob_port); | |
| 400 | |
| 401 return newintobject (count); | |
| 402 } | |
| 403 | |
| 404 static object * | |
| 405 al_setfillpoint (self, args) | |
| 406 portobject *self; | |
| 407 object *args; | |
| 408 { | |
| 409 long count; | |
| 410 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
411 if (!getlongarg (args, &count)) return NULL; |
| 367 | 412 |
| 413 ALsetfillpoint (self-> ob_port, count); | |
| 414 | |
| 415 INCREF (None); | |
| 416 return (None); | |
| 417 } | |
| 418 | |
| 419 static object * | |
| 420 al_setconfig (self, args) | |
| 421 portobject *self; | |
| 422 object *args; | |
| 423 { | |
| 424 ALconfig config; | |
| 425 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
426 if (!getconfigarg (args, &config)) return NULL; |
| 367 | 427 |
| 428 ALsetconfig (self-> ob_port, config); | |
| 429 | |
| 430 INCREF (None); | |
| 431 return (None); | |
| 432 } | |
| 433 | |
| 434 static object * | |
| 435 al_getconfig (self, args) | |
| 436 portobject *self; | |
| 437 object *args; | |
| 438 { | |
| 439 ALconfig config; | |
| 440 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
441 if (!getnoarg (args)) return NULL; |
| 367 | 442 |
| 443 config = ALgetconfig (self-> ob_port); | |
| 444 | |
| 445 return newconfigobject (config); | |
| 446 } | |
| 447 | |
|
1214
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
448 #ifdef AL_405 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
449 static object * |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
450 al_getstatus (self, args) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
451 portobject *self; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
452 object *args; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
453 { |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
454 object *list, *v; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
455 long *PVbuffer; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
456 long length; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
457 int i; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
458 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
459 if (!getargs(args, "O", &list)) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
460 return NULL; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
461 if (!is_listobject(list)) { |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
462 err_badarg(); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
463 return NULL; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
464 } |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
465 length = getlistsize(list); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
466 PVbuffer = NEW(long, length); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
467 if (PVbuffer == NULL) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
468 return err_nomem(); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
469 for (i = 0; i < length; i++) { |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
470 v = getlistitem(list, i); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
471 if (!is_intobject(v)) { |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
472 DEL(PVbuffer); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
473 err_badarg(); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
474 return NULL; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
475 } |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
476 PVbuffer[i] = getintvalue(v); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
477 } |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
478 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
479 ALgetstatus(self->ob_port, PVbuffer, length); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
480 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
481 for (i = 0; i < length; i++) |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
482 setlistitem(list, i, newintobject(PVbuffer[i])); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
483 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
484 DEL(PVbuffer); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
485 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
486 INCREF(None); |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
487 return None; |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
488 } |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
489 #endif /* AL_405 */ |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
490 |
| 367 | 491 static struct methodlist port_methods[] = { |
| 492 {"closeport", al_closeport}, | |
|
1442
4749c957466b
almodule.c: added close method, equivalent to closeport.
Sjoerd Mullender <sjoerd@acm.org>
parents:
1313
diff
changeset
|
493 {"close", al_closeport}, |
| 367 | 494 {"getfd", al_getfd}, |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
864
diff
changeset
|
495 {"fileno", al_getfd}, |
| 367 | 496 {"getfilled", al_getfilled}, |
| 497 {"getfillable", al_getfillable}, | |
| 498 {"readsamps", al_readsamps}, | |
| 499 {"writesamps", al_writesamps}, | |
| 500 {"setfillpoint", al_setfillpoint}, | |
| 501 {"getfillpoint", al_getfillpoint}, | |
| 502 {"setconfig", al_setconfig}, | |
| 503 {"getconfig", al_getconfig}, | |
|
1214
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
504 #ifdef AL_405 |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
505 {"getstatus", al_getstatus}, |
|
416a8a886a82
Added new audio library functionality (getstatus, float sample fmts)
Jack Jansen <jack.jansen@cwi.nl>
parents:
973
diff
changeset
|
506 #endif /* AL_405 */ |
| 367 | 507 {NULL, NULL} /* sentinel */ |
| 508 }; | |
| 509 | |
| 510 static void | |
| 511 port_dealloc(p) | |
| 512 portobject *p; | |
| 513 { | |
| 514 if (p->ob_port != NULL) | |
| 515 ALcloseport(p->ob_port); | |
| 516 DEL(p); | |
| 517 } | |
| 518 | |
| 519 static object * | |
| 520 port_getattr(p, name) | |
| 521 portobject *p; | |
| 522 char *name; | |
| 523 { | |
| 524 return findmethod(port_methods, (object *)p, name); | |
| 525 } | |
| 526 | |
| 527 typeobject Porttype = { | |
| 528 OB_HEAD_INIT(&Typetype) | |
| 529 0, /*ob_size*/ | |
| 530 "port", /*tp_name*/ | |
| 531 sizeof(portobject), /*tp_size*/ | |
| 532 0, /*tp_itemsize*/ | |
| 533 /* methods */ | |
| 534 port_dealloc, /*tp_dealloc*/ | |
| 535 0, /*tp_print*/ | |
| 536 port_getattr, /*tp_getattr*/ | |
| 537 0, /*tp_setattr*/ | |
| 538 0, /*tp_compare*/ | |
| 539 0, /*tp_repr*/ | |
| 540 }; | |
| 541 | |
| 542 static object * | |
| 543 newportobject(port) | |
| 544 ALport port; | |
| 545 { | |
| 546 portobject *p; | |
| 547 | |
| 548 p = NEWOBJ(portobject, &Porttype); | |
| 549 if (p == NULL) | |
| 550 return NULL; | |
| 551 p->ob_port = port; | |
| 552 return (object *)p; | |
| 553 } | |
| 554 | |
| 555 /* the module al */ | |
| 556 | |
| 557 static object * | |
| 558 al_openport (self, args) | |
| 559 object *self, *args; | |
| 560 { | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
561 char *name, *dir; |
| 367 | 562 ALport port; |
| 563 ALconfig config = NULL; | |
|
384
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
564 int size; |
| 367 | 565 |
|
384
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
566 if (args == NULL || !is_tupleobject(args)) { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
567 err_badarg (); |
|
384
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
568 return NULL; |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
569 } |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
570 size = gettuplesize(args); |
| 367 | 571 if (size == 2) { |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
572 if (!getargs (args, "(ss)", &name, &dir)) |
| 367 | 573 return NULL; |
| 574 } | |
| 575 else if (size == 3) { | |
| 576 if (!getstrstrconfigarg (args, &name, &dir, &config)) | |
| 577 return NULL; | |
| 578 } | |
| 579 else { | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
580 err_badarg (); |
| 367 | 581 return NULL; |
| 582 } | |
| 583 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
584 port = ALopenport(name, dir, config); |
| 367 | 585 |
|
384
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
586 if (port == NULL) { |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
587 err_errno(RuntimeError); |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
588 return NULL; |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
589 } |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
590 |
| 367 | 591 return newportobject (port); |
| 592 } | |
| 593 | |
| 594 static object * | |
| 595 al_newconfig (self, args) | |
| 596 object *self, *args; | |
| 597 { | |
| 598 ALconfig config; | |
| 599 | |
| 600 if (!getnoarg (args)) return NULL; | |
| 601 | |
| 602 config = ALnewconfig (); | |
|
384
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
603 if (config == NULL) { |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
604 err_errno(RuntimeError); |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
605 return NULL; |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
606 } |
| 367 | 607 |
| 608 return newconfigobject (config); | |
| 609 } | |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
610 |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
611 static object * |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
612 al_queryparams(self, args) |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
613 object *self, *args; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
614 { |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
615 long device; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
616 long length; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
617 long *PVbuffer; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
618 long PVdummy[2]; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
619 object *v; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
620 object *w; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
621 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
622 if (!getlongarg (args, &device)) |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
623 return NULL; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
624 length = ALqueryparams(device, PVdummy, 2L); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
625 PVbuffer = NEW(long, length); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
626 if (PVbuffer == NULL) |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
627 return err_nomem(); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
628 (void) ALqueryparams(device, PVbuffer, length); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
629 v = newlistobject((int)length); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
630 if (v != NULL) { |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
631 int i; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
632 for (i = 0; i < length; i++) |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
633 setlistitem(v, i, newintobject(PVbuffer[i])); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
634 } |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
635 DEL(PVbuffer); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
636 return v; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
637 } |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
638 |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
639 static object * |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
640 doParams(args, func, modified) |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
641 object *args; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
642 void (*func)(long, long *, long); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
643 int modified; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
644 { |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
645 long device; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
646 object *list, *v; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
647 long *PVbuffer; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
648 long length; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
649 int i; |
| 367 | 650 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
651 if (!getargs(args, "(lO)", &device, &list)) |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
652 return NULL; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
653 if (!is_listobject(list)) { |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
654 err_badarg(); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
655 return NULL; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
656 } |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
657 length = getlistsize(list); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
658 PVbuffer = NEW(long, length); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
659 if (PVbuffer == NULL) |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
660 return err_nomem(); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
661 for (i = 0; i < length; i++) { |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
662 v = getlistitem(list, i); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
663 if (!is_intobject(v)) { |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
664 DEL(PVbuffer); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
665 err_badarg(); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
666 return NULL; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
667 } |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
668 PVbuffer[i] = getintvalue(v); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
669 } |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
670 |
|
375
86828cc1c646
Call (*func), not ALgetparams!
Guido van Rossum <guido@python.org>
parents:
369
diff
changeset
|
671 (*func)(device, PVbuffer, length); |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
672 |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
673 if (modified) { |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
674 for (i = 0; i < length; i++) |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
675 setlistitem(list, i, newintobject(PVbuffer[i])); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
676 } |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
677 |
|
384
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
678 DEL(PVbuffer); |
|
a3d4d461d442
Added some error checks.
Guido van Rossum <guido@python.org>
parents:
375
diff
changeset
|
679 |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
680 INCREF(None); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
681 return None; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
682 } |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
683 |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
684 static object * |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
685 al_getparams(self, args) |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
686 object *self, *args; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
687 { |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
688 return doParams(args, ALgetparams, 1); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
689 } |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
690 |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
691 static object * |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
692 al_setparams(self, args) |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
693 object *self, *args; |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
694 { |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
695 return doParams(args, ALsetparams, 0); |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
696 } |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
697 |
|
973
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
698 static object * |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
699 al_getname(self, args) |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
700 object *self, *args; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
701 { |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
702 long device, descriptor; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
703 char *name; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
704 if (!getargs(args, "(ll)", &device, &descriptor)) |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
705 return NULL; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
706 name = ALgetname(device, descriptor); |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
707 if (name == NULL) { |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
708 err_setstr(ValueError, "al.getname: bad descriptor"); |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
709 return NULL; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
710 } |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
711 return newstringobject(name); |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
712 } |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
713 |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
714 static object * |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
715 al_getdefault(self, args) |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
716 object *self, *args; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
717 { |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
718 long device, descriptor, value; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
719 if (!getargs(args, "(ll)", &device, &descriptor)) |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
720 return NULL; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
721 value = ALgetdefault(device, descriptor); |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
722 return newlongobject(value); |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
723 } |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
724 |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
725 static object * |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
726 al_getminmax(self, args) |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
727 object *self, *args; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
728 { |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
729 long device, descriptor, min, max; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
730 if (!getargs(args, "(ll)", &device, &descriptor)) |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
731 return NULL; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
732 min = -1; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
733 max = -1; |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
734 ALgetminmax(device, descriptor, &min, &max); |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
735 return mkvalue("ll", min, max); |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
736 } |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
737 |
| 367 | 738 static struct methodlist al_methods[] = { |
| 739 {"openport", al_openport}, | |
| 740 {"newconfig", al_newconfig}, | |
|
369
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
741 {"queryparams", al_queryparams}, |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
742 {"getparams", al_getparams}, |
|
46a656123a69
Added queryparams, get/setparams.
Guido van Rossum <guido@python.org>
parents:
367
diff
changeset
|
743 {"setparams", al_setparams}, |
|
973
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
744 {"getname", al_getname}, |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
745 {"getdefault", al_getdefault}, |
|
30a290257c31
added getname, getdefault and getminmax functions
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
746 {"getminmax", al_getminmax}, |
| 367 | 747 {NULL, NULL} /* sentinel */ |
| 748 }; | |
| 749 | |
| 750 void | |
| 751 inital() | |
| 752 { | |
| 753 initmodule("al", al_methods); | |
| 754 } | |
| 755 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
756 static int |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
757 getconfigarg(o, conf) |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
758 object *o; |
| 367 | 759 ALconfig *conf; |
| 760 { | |
| 761 if (o == NULL || !is_configobject(o)) | |
| 762 return err_badarg (); | |
| 763 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
764 *conf = ((configobject *) o) -> ob_config; |
| 367 | 765 |
| 766 return 1; | |
| 767 } | |
| 768 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
769 static int |
| 367 | 770 getstrstrconfigarg(v, a, b, c) |
| 771 object *v; | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
772 char **a; |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
773 char **b; |
| 367 | 774 ALconfig *c; |
| 775 { | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
776 object *o; |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
384
diff
changeset
|
777 return getargs(v, "(ssO)", a, b, &o) && getconfigarg(o, c); |
| 367 | 778 } |
