Commit Graph

459 Commits

Author SHA1 Message Date
Angus Salkeld
e01b79883a map: enforce uniqueness of the notifiers based on (func,key,event,userdata)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-25 13:25:56 +11:00
Angus Salkeld
2d92af61c5 map: add qb_map_notify_del_2() which includes the userdata.
This allows you to match on the same fields that you provided
in the add. Now including the userdata.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-25 11:28:14 +11:00
Angus Salkeld
3c01f7bdb2 skiplist: add the inserted notification
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-25 11:28:01 +11:00
Angus Salkeld
fbdfd34f59 skiplist: implement skiplist_notify_del()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-25 11:19:11 +11:00
Angus Salkeld
52321a8185 Hashtable: fix the ordering of the new/old value in the notification
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-25 11:15:40 +11:00
Angus Salkeld
f644b5c1c6 Add tests for hash and skiplist notifications
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-25 11:14:31 +11:00
Angus Salkeld
b69ca79c7f By default don't build in the slow benchlog
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-25 11:12:27 +11:00
Angus Salkeld
6cea185166 check: add abi checking script
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-22 17:11:02 +11:00
The Quarterback Library Release Team
ce18956cc2 Bump the library version to 0.7.0
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2011-11-16 21:42:33 +11:00
Angus Salkeld
ee50e90fc2 LOOP: free up the signal list when qb_loop_destory() is called
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-10 21:30:37 +11:00
Angus Salkeld
177e54cb14 LOG: improve the removal of filters
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-10 21:29:04 +11:00
Angus Salkeld
fdf418abf5 LOG: clean up mem better when qb_log_fini is called
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-10 21:28:14 +11:00
Angus Salkeld
b2a0c06d50 ARRAY: make sure that num_bins stays below MAX_BINS
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-10 09:28:55 +11:00
Angus Salkeld
c30b3ae8d8 TEST: add a test that reproduces issue/20
https://github.com/asalkeld/libqb/issues/20

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-10 09:27:45 +11:00
Angus Salkeld
6e66cc1f9d Fix ./check -h output
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-08 11:06:41 +11:00
Angus Salkeld
ca4fe98136 Lindent formatting changes.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-08 10:49:14 +11:00
Angus Salkeld
99311d24fe LOOP: close opened pipe if function fails
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-08 10:43:21 +11:00
Angus Salkeld
b519f4f37d LOG: change assert into an early return
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-08 10:42:26 +11:00
Angus Salkeld
0171399274 Remove unnecessary checks before free()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-08 10:41:32 +11:00
Angus Salkeld
9959615598 MAP: Fix trie_new_node() and make skiplist_node_new() more consistent.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-08 10:39:13 +11:00
miz-take
fcd96fc8e0 Improve the error handling esp. after failed malloc's
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-08 09:50:38 +11:00
Angus Salkeld
a44df811a0 skiplist: destroy the list header last.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-24 09:35:13 +11:00
Angus Salkeld
dfe624f5a9 examples: add ipc client/server
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 22:40:26 +11:00
Angus Salkeld
b9dc96e40b examples: Add tcpclient.c/tcpserver.c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 22:40:26 +11:00
Angus Salkeld
e1e83aa746 Move simple-log.c to examples/
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 22:40:26 +11:00
Angus Salkeld
d48ed76dfd TEST: fix the map load test.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 13:36:07 +11:00
Angus Salkeld
ba95aafbf7 LOG: check for SCHED_IDLE
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 13:36:07 +11:00
Angus Salkeld
596bcf3dde LOG: fix filter input check
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 13:36:07 +11:00
Angus Salkeld
864e5c9c32 LOG: add stdarg to qblog.h
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 13:36:07 +11:00
Angus Salkeld
3001d56140 Add a ./check mock
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-23 13:35:45 +11:00
Angus Salkeld
ae86140250 LOG: only range check "t" when filtering else tags are not applied.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-21 14:51:22 +11:00
Angus Salkeld
bca6380eba Log: move the lock to below the sem_wait
(coverity ordering warning)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-18 14:02:29 +11:00
Angus Salkeld
0cf17148ef check: add a handy coverity check
./check coverity

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-18 14:00:59 +11:00
Angus Salkeld
7f09ba15d5 TEST: add a simple test for right-aligned text in format strings
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-18 10:13:00 +11:00
Andrew Beekhof
68b33d7243 Log: Support right-aligned text in format strings
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-18 09:51:19 +11:00
Yunkai Zhang
8a673559e7 Fixed segment fault bug when use logging API at i386 platform
This bug cause by qb_vsprintf_serialize function. It parse "%llx" format
as _long_ other than _long long_.

At x86_64 platform, both sizeof(long) and sizeof(long long) is 8, this
issue would not be triggered, so we could only catch it at i386.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-10-18 09:33:24 +11:00
Angus Salkeld
dc3a061e98 MAP: pass user_data to the callback correctly
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-16 13:31:31 +10:00
Angus Salkeld
d6e352fda5 MAP: add a more generic notification system
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-15 21:14:49 +10:00
Angus Salkeld
4780308fea MAP: add prefix iteration for the trie
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-13 20:54:39 +10:00
Angus Salkeld
6c260080ed hashtable: fix the iterator
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-13 17:09:20 +10:00
Angus Salkeld
34e5a469aa skiplist: fix order of deref
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-13 17:09:20 +10:00
Angus Salkeld
94df31cb44 skiplist: use ++ and -- operators
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-13 17:09:20 +10:00
Angus Salkeld
61268e3cb9 MAP: improve the storage in the trie
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-13 17:09:20 +10:00
Angus Salkeld
8ae2cf4430 TESTS: improve the map tests
- add a iterator to test_map_simple()
- improve the test output

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-13 17:08:19 +10:00
Angus Salkeld
57212c0e94 MAP: add a trie implementation
http://en.wikipedia.org/wiki/Trie

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-12 23:01:15 +10:00
Angus Salkeld
5944229b60 LOG: allow large priorities
They will be printed as trace, it's mainly to make
filtering more flexible

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-09 16:20:54 +10:00
Angus Salkeld
0a1c464514 LOG: add qb_log_filter_ctl2() so we can filter a range of priorities
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-09 14:09:02 +10:00
The Quarterback Library Release Team
c8309edf72 Bump the library version.
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2011-09-09 12:54:03 +10:00
Angus Salkeld
46a8903826 LOG: fix QB_LOG_INIT_DATA
this is weird, but now it actually works

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-09 12:07:57 +10:00
Angus Salkeld
f5fcf2a30b LOG: add a way of getting the target state
This is so we can do the following:

for (t = 0; t < QB_LOG_TARGET_MAX; t++) {
    if (qb_log_ctl(t, QB_LOG_CONF_STATE_GET, 0) == QB_LOG_STATE_ENABLED) {
        // bla bla
    }
}

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-09-08 16:40:02 +10:00