mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +00:00
added cosmoO_setUserData and cosmoO_getUserData
This commit is contained in:
parent
9ca67c8408
commit
005e2acd1e
@ -250,6 +250,14 @@ void cosmoO_setObject(CState *state, CObjObject *object, CValue key, CValue val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cosmoO_setUserData(CState *state, CObjObject *object, void *p) {
|
||||||
|
object->user = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *cosmoO_getUserData(CState *state, CObjObject *object) {
|
||||||
|
return object->user;
|
||||||
|
}
|
||||||
|
|
||||||
bool cosmoO_getIString(CState *state, CObjObject *object, int flag, CValue *val) {
|
bool cosmoO_getIString(CState *state, CObjObject *object, int flag, CValue *val) {
|
||||||
if (readFlag(object->istringFlags, flag))
|
if (readFlag(object->istringFlags, flag))
|
||||||
return false; // it's been cached as bad
|
return false; // it's been cached as bad
|
||||||
|
@ -118,6 +118,9 @@ CObjUpval *cosmoO_newUpvalue(CState *state, CValue *val);
|
|||||||
bool cosmoO_getObject(CState *state, CObjObject *object, CValue key, CValue *val);
|
bool cosmoO_getObject(CState *state, CObjObject *object, CValue key, CValue *val);
|
||||||
void cosmoO_setObject(CState *state, CObjObject *object, CValue key, CValue val);
|
void cosmoO_setObject(CState *state, CObjObject *object, CValue key, CValue val);
|
||||||
|
|
||||||
|
void cosmoO_setUserData(CState *state, CObjObject *object, void *p);
|
||||||
|
void *cosmoO_getUserData(CState *state, CObjObject *object);
|
||||||
|
|
||||||
// internal string
|
// internal string
|
||||||
bool cosmoO_getIString(CState *state, CObjObject *object, int flag, CValue *val);
|
bool cosmoO_getIString(CState *state, CObjObject *object, int flag, CValue *val);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user