@@ -501,6 +501,12 @@ pub type lua_Coverage = unsafe extern "C-unwind" fn(
501501 size : usize ,
502502) ;
503503
504+ pub type lua_CounterFunction =
505+ unsafe extern "C-unwind" fn ( context : * mut c_void , function : * const c_char , linedefined : c_int ) ;
506+
507+ pub type lua_CounterValue =
508+ unsafe extern "C-unwind" fn ( context : * mut c_void , kind : c_int , line : c_int , hits : u64 ) ;
509+
504510unsafe extern "C-unwind" {
505511 pub fn lua_stackdepth ( L : * mut lua_State ) -> c_int ;
506512 pub fn lua_getinfo ( L : * mut lua_State , level : c_int , what : * const c_char , ar : * mut lua_Debug ) -> c_int ;
@@ -515,6 +521,14 @@ unsafe extern "C-unwind" {
515521
516522 pub fn lua_getcoverage ( L : * mut lua_State , funcindex : c_int , context : * mut c_void , callback : lua_Coverage ) ;
517523
524+ pub fn lua_getcounters (
525+ L : * mut lua_State ,
526+ funcindex : c_int ,
527+ context : * mut c_void ,
528+ functionvisit : lua_CounterFunction ,
529+ countervisit : lua_CounterValue ,
530+ ) ;
531+
518532 pub fn lua_debugtrace ( L : * mut lua_State ) -> * const c_char ;
519533}
520534
@@ -552,7 +566,7 @@ pub struct lua_Callbacks {
552566 /// gets called when L is created (LP == parent) or destroyed (LP == NULL)
553567 pub userthread : Option < unsafe extern "C-unwind" fn ( LP : * mut lua_State , L : * mut lua_State ) > ,
554568 /// gets called when a string is created; returned atom can be retrieved via tostringatom
555- pub useratom : Option < unsafe extern "C-unwind" fn ( s : * const c_char , l : usize ) -> i16 > ,
569+ pub useratom : Option < unsafe extern "C-unwind" fn ( L : * mut lua_State , s : * const c_char , l : usize ) -> i16 > ,
556570
557571 /// gets called when BREAK instruction is encountered
558572 pub debugbreak : Option < unsafe extern "C-unwind" fn ( L : * mut lua_State , ar : * mut lua_Debug ) > ,
0 commit comments