2021-10-02 19:20:18 +08:00
|
|
|
/*
|
|
|
|
Author: lyon
|
|
|
|
Tencent QQ: 645275593
|
|
|
|
*/
|
|
|
|
|
2021-10-01 00:21:50 +08:00
|
|
|
#include "PikaObj.h"
|
|
|
|
|
|
|
|
void _UpdateHandle(PikaObj* self) {
|
2021-10-02 19:20:18 +08:00
|
|
|
// override the handle function here
|
2021-10-01 00:21:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void _beforDinit(PikaObj* self) {
|
2021-10-02 19:20:18 +08:00
|
|
|
/* override in user code */
|
2021-10-01 00:21:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
PikaObj* New_TinyObj(Args* args) {
|
2021-10-02 19:20:18 +08:00
|
|
|
PikaObj* self = pikaMalloc(sizeof(PikaObj));
|
2021-10-01 00:21:50 +08:00
|
|
|
|
2021-10-02 19:20:18 +08:00
|
|
|
/* List */
|
|
|
|
self->attributeList = New_args(NULL);
|
2021-10-01 00:21:50 +08:00
|
|
|
|
2021-10-02 19:20:18 +08:00
|
|
|
/* attribute */
|
|
|
|
obj_setPtr(self, "_ctx", self);
|
|
|
|
obj_setStr(self, "_n", "root");
|
2021-10-01 00:21:50 +08:00
|
|
|
|
2021-10-02 19:20:18 +08:00
|
|
|
/* load */
|
|
|
|
if (NULL != args) {
|
|
|
|
obj_load(self, args, "_n");
|
|
|
|
obj_load(self, args, "_ctx");
|
|
|
|
}
|
2021-10-01 00:21:50 +08:00
|
|
|
|
2021-10-02 19:20:18 +08:00
|
|
|
/* hard attribute */
|
|
|
|
return self;
|
2021-10-01 00:21:50 +08:00
|
|
|
}
|