mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-06 01:41:37 +08:00
Add delete callback to userdata objects.
This commit is contained in:
3
mujs.h
3
mujs.h
@@ -32,6 +32,7 @@ typedef void (*js_CFunction)(js_State *J);
|
||||
typedef void (*js_Finalize)(js_State *J, void *p);
|
||||
typedef int (*js_HasProperty)(js_State *J, void *p, const char *name);
|
||||
typedef int (*js_Put)(js_State *J, void *p, const char *name);
|
||||
typedef int (*js_Delete)(js_State *J, void *p, const char *name);
|
||||
|
||||
/* Basic functions */
|
||||
js_State *js_newstate(js_Alloc alloc, void *actx, int flags);
|
||||
@@ -143,7 +144,7 @@ void js_newstring(js_State *J, const char *v);
|
||||
void js_newcfunction(js_State *J, js_CFunction fun, const char *name, unsigned int length);
|
||||
void js_newcconstructor(js_State *J, js_CFunction fun, js_CFunction con, const char *name, unsigned int length);
|
||||
void js_newuserdata(js_State *J, const char *tag, void *data, js_Finalize finalize);
|
||||
void js_newuserdatax(js_State *J, const char *tag, void *data, js_HasProperty has, js_Put put, js_Finalize finalize);
|
||||
void js_newuserdatax(js_State *J, const char *tag, void *data, js_HasProperty has, js_Put put, js_Delete delete, js_Finalize finalize);
|
||||
void js_newregexp(js_State *J, const char *pattern, int flags);
|
||||
|
||||
void js_pushiterator(js_State *J, int idx, int own);
|
||||
|
||||
Reference in New Issue
Block a user