add a void* to resource tracker records which are useable as dynamic identifier ...
[nobug.git] / test_nobug_resources.c
blob95b4c351a6706585c1f61c7629e01d679b6441ad
1 #define EBUG_ALPHA
2 #include "nobug.h"
8 int main()
10 nobug_init();
12 RESOURCE_HANDLE(t1);
14 // TODO NOBUG_RESOURCE_MOVE_HANDLE(to, from )
16 RESOURCE_ANNOUNCE("type1", "test1", main, t1);
18 RESOURCE_HANDLE(e1);
19 RESOURCE_HANDLE(e2);
21 RESOURCE_ENTER(t1, "user1", main, e1);
22 RESOURCE_ENTER(t1, "user2", main, e2);
25 nobug_resource_dump_all (stderr);
27 RESOURCE_ACQUIRED(e1);
29 nobug_resource_dump_all (stderr);
31 NOBUG_RESOURCE_LEAVE_LOOKUP(t1, nobug_resource_acquired, "user1", main);
33 nobug_resource_dump_all (stderr);
35 RESOURCE_LEAVE(e2);
37 nobug_resource_dump_all (stderr);
39 RESOURCE_FORGET(t1);
41 nobug_resource_dump_all (stderr);
43 return 0;