CoreFW  Check-in [106a4491c3]

Overview
Comment:Add cfw_class.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 106a4491c357ab11bad5f967472632934d31f5ce387998d1ddd95211f839de1a
User & Date: js on 2012-04-22 14:10:01
Other Links: manifest | tags
Context
2012-04-22
14:17
Add int boxing. check-in: 8eceaeb4a4 user: js tags: trunk
14:10
Add cfw_class. check-in: 106a4491c3 user: js tags: trunk
14:03
Add cfw_is. check-in: ffa5357d1b user: js tags: trunk
Changes

Modified src/object.c from [55e68373f9] to [f1b2c26b73].

114
115
116
117
118
119
120








121
122
123
124
125
126
127
	CFWObject *obj = ptr;

	if (obj->cls->dtor != NULL)
		obj->cls->dtor(obj);

	free(obj);
}









bool
cfw_is(void *ptr, CFWClass *cls)
{
	CFWObject *obj = ptr;

	return (obj->cls == cls);







>
>
>
>
>
>
>
>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
	CFWObject *obj = ptr;

	if (obj->cls->dtor != NULL)
		obj->cls->dtor(obj);

	free(obj);
}

CFWClass*
cfw_class(void *ptr)
{
	CFWObject *obj;

	return obj->cls;
}

bool
cfw_is(void *ptr, CFWClass *cls)
{
	CFWObject *obj = ptr;

	return (obj->cls == cls);

Modified src/object.h from [b6d17265f1] to [44faac2ce6].

36
37
38
39
40
41
42

43
44
45
46
47
48

extern CFWClass *cfw_object;
extern void* cfw_new(CFWClass*, ...);
extern void* cfw_new_p(CFWClass*, ...);
extern void* cfw_ref(void*);
extern void cfw_unref(void*);
extern void cfw_free(void*);

extern bool cfw_is(void*, CFWClass*);
extern bool cfw_equal(void*, void*);
extern uint32_t cfw_hash(void*);
extern void* cfw_copy(void*);

#endif







>






36
37
38
39
40
41
42
43
44
45
46
47
48
49

extern CFWClass *cfw_object;
extern void* cfw_new(CFWClass*, ...);
extern void* cfw_new_p(CFWClass*, ...);
extern void* cfw_ref(void*);
extern void cfw_unref(void*);
extern void cfw_free(void*);
extern CFWClass* cfw_class(void*);
extern bool cfw_is(void*, CFWClass*);
extern bool cfw_equal(void*, void*);
extern uint32_t cfw_hash(void*);
extern void* cfw_copy(void*);

#endif