Jump to content

Help with zend_is_callable() ? Trying to make a MIDI extension


SwiftlyTilting

Recommended Posts

Hi PHP freaks :)

 

I'm using WinBinder extension to create a windows program to accept MIDI input.  I had to write some custom code for the Winbinder extension to be able to receive MIDI callback functions.

 

basically zend_is_callable causes my program to crash in some cases, not in other cases.  I don't really understand what this function does or how it could cause a crash in any case.

 

...
zval *fname;
char *pszFName  =  "wb_midi_callback";

TSRMLS_FETCH();   

MAKE_STD_ZVAL(fname);
ZVAL_STRING(fname, pszFName, 1);

if(!zend_is_callable(fname, 0, &pszFName TSRMLS_CC)) {
...

 

also, how does one use zend_is_callable_ex work?  maybe I can use that instead?

 

here is a thread with a little more info http://winbinder.org/forum/viewtopic.php?f=10&t=1079&p=4701#p4701

 

thanks for any insight

I figured out how to call zend_is_callable_ex but it acts the same way

 

I can reliably get the callback for midiIn open and close, but midi data messages cause the callback to crash at zend_is_callable

 

I haven't written C code in 10 years and am not familiar with the zend API at all so i'm very much in the dark on this.  any and all insight or advice appreciated

  • 3 years later...

Hi SwiftlyTilting,

 

I just read your posting from 2010. I'm also trying to access MIDI ports via PHP, but there doesn't seem to be any PHP extension for this. I saw that it obviously is possible (with some tricks) via WinBinder. You wrote that you found a way to do that.

 

I would greatly apreciate if you wouldn't mind to share the essential part of your code (that performs MIDI receive).

 

Thanks a lot!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.