Changes between Initial Version and Version 1 of Ticket #1992

Show
Ignore:
Timestamp:
01/30/11 08:26:40 (11 years ago)
Author:
jimmy
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1992 – description

    initial v1  
    22   see https://github.com/parrot/parrot/blob/master/src/nci_test.c#-115 , there are two define here. 
    33 
     4 
     5{{{ 
    46typedef void (*cb_C1_func)(const char*, void*); 
    57PARROT_DYNEXT_EXPORT void nci_cb_C1(cb_C1_func, void*); 
     8}}} 
     9 
    610 
    711the callback is created by: 
     12 
     13{{{ 
    814     cb_wrapped = new_callback cb, user_data, "vtU" 
     15}}} 
     16 
    917 
    1018which means it's first parameter is external_data, and the two is user_data. that is, the callback function should be defined as this one: 
     19 
     20{{{ 
    1121.sub _call_back 
    1222  .param string external_data 
     
    1929  print "\n" 
    2030.end 
     31}}} 
     32 
    2133 
    2234but actually in t/pmc/nci.t, it's defined as: 
     35 
     36{{{ 
    2337.sub _call_back 
    2438  .param pmc user_data 
     
    3246.end 
    3347 
     48}}} 
     49 
    3450 
    3551according to t/pmc/nci.t it seems that no matter user_data is the first parameter or two, the callback sub must defined as: 
     52 
     53{{{ 
    3654.sub _call_back 
    3755  .param pmc user_data 
    3856  .param string external_data 
    3957.end 
     58}}} 
     59 
    4060 
    4161then I took a look at PDD16, and it's said user_data should be defined in the second parameter: 
    4262 
     63 
     64{{{ 
    4365.sub _call_back 
    4466  .param string external_data 
     
    4668.end 
    4769 
     70}}} 
     71 
    4872which is right.