@@ -334,7 +334,7 @@ CD_readda(self, args)
334334 n = CDreadda (self -> ob_cdplayer , (CDFRAME * ) getstringvalue (result ), numframes );
335335 if (n == -1 ) {
336336 DECREF (result );
337- err_errno (IOError ); /* XXX - ??? (seems to work) */
337+ err_errno (IOError );
338338 return NULL ;
339339 }
340340 if (n < numframes )
@@ -685,6 +685,11 @@ CD_removecallback(self, args)
685685 if (!getargs (args , "i" , & type ))
686686 return NULL ;
687687
688+ if (type < 0 || type >= NCALLBACKS ) {
689+ err_setstr (RuntimeError , "bad type" );
690+ return NULL ;
691+ }
692+
688693 CDremovecallback (self -> ob_cdparser , (CDDATATYPES ) type );
689694
690695 XDECREF (self -> ob_cdcallbacks [type ].ob_cdcallback );
@@ -714,7 +719,7 @@ CD_resetparser(self, args)
714719}
715720
716721static object *
717- CD_setcallback (self , args )
722+ CD_addcallback (self , args )
718723 cdparserobject * self ;
719724 object * args ;
720725{
@@ -732,7 +737,11 @@ CD_setcallback(self, args)
732737 return NULL ;
733738 }
734739
740+ #ifdef IRIX_405
741+ CDaddcallback (self -> ob_cdparser , (CDDATATYPES ) type , CD_callback , (void * ) self );
742+ #else
735743 CDsetcallback (self -> ob_cdparser , (CDDATATYPES ) type , CD_callback , (void * ) self );
744+ #endif
736745 XDECREF (self -> ob_cdcallbacks [type ].ob_cdcallback );
737746 INCREF (funcobject );
738747 self -> ob_cdcallbacks [type ].ob_cdcallback = funcobject ;
@@ -745,11 +754,12 @@ CD_setcallback(self, args)
745754}
746755
747756static struct methodlist cdparser_methods [] = {
757+ {"addcallback" , CD_addcallback },
748758 {"deleteparser" , CD_deleteparser },
749759 {"parseframe" , CD_parseframe },
750760 {"removecallback" , CD_removecallback },
751761 {"resetparser" , CD_resetparser },
752- {"setcallback" , CD_setcallback },
762+ {"setcallback" , CD_addcallback }, /* backward compatibility */
753763 {NULL , NULL } /* sentinel */
754764};
755765
0 commit comments