Commit Graph

23 Commits

Author SHA1 Message Date
Jan Pokorný
137b3dea5b
API: introduce alternative, header-based versioning
Mainly as a light-weight alternative to full-blown autoconf/pkg-config
machineries, whereby one can:

* workaround functionality not present in libqb up to 1.0 (inclusive)
  - note that this versioning schema is being introduced *after*
    1.0.0 release so one cannot tell that version from any older,
    but will be able to safely identify any later one (1.0.1+)
    and act accordingly
  - example:
  #if !defined(QB_VER_MAJOR) || ((QB_VER_MAJOR == 1) && (QB_VER_MINOR < 1))
  #warning "Feature X not supported"
  int do_foo(int arg) { };
  #else
  int
  do_foo(int arg)
  {
      /* use feature X of libqb */
  }
  #endif

* make its program report libqb API version it was built with by
  emitting QB_VER_STR symbolic string (see tests/print_ver.c for example)

Also added is a print_ver test program to:

* emit how original unparsed version is parsed to particular components
  defined in qbconfig.h (QB_VER_{MAJOR,MINOR,PATCH} symbolic integer
  constants and QB_VER_REST symbolic string) when being compiled

* emit mentioned QB_VER_STR symbolic string joining the components
  back to a single string, plus the components themselves

Resolves: https://github.com/ClusterLabs/libqb/issues/186
2016-04-01 23:19:40 +02:00
Angus Salkeld
7667536626 Deal better with corrupt blackbox files.
fixes #59
Thanks to Jan Friesse for the reproducer.
https://github.com/jfriesse/csts/blob/master/tests/fplay-segfault.sh

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-04-02 13:52:57 +11:00
Angus Salkeld
fe0e9a61a9 TEST: add a progam to compare the speed of vsnprintf and qb_vsnprintf_serialize
On my system I get:

qb store] Duration:     8.289 OPs/sec: 1206381.250
snprintf] Duration:    16.712 OPs/sec: 598368.000

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-01-04 16:35:45 +11:00
Angus Salkeld
39d85a8d1b TEST: change the script to .sh and generated c file to auto_
Just to make cleanup easier

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-16 22:18:39 +11:00
Angus Salkeld
ef77398738 Fix errors found by api-sanity-autotest
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-11-25 17:16:19 +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
Jim Meyering
ab222595be adjust .gitignore so "git status" ignores all build artifacts
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-24 09:44:56 +10:00
Angus Salkeld
e990681826 Fix the test dependancies (and "make rpm")
My first attempt at this broke "make rpm" - oops.
It seems that we need a common extension for tests to get the
dependancies to work.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-18 11:11:14 +10:00
Angus Salkeld
a807d3b745 Add write_logs.c to .gitignore
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 22:24:38 +10:00
Angus Salkeld
c2f72d4068 LOG: add some basic tests & fixes
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 16:05:46 +10:00
Angus Salkeld
5ed2ca8592 LOG: add bench-log to .gitignore
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-31 21:24:40 +11:00
Angus Salkeld
f86c96bee1 LOG: add a blackbox
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-25 23:40:53 +11:00
Angus Salkeld
5bddb0fe68 LOG: add threaded logging (non-blocking)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-25 23:35:35 +11:00
Angus Salkeld
e910f8bc18 Add logging infrastructure.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-03-25 23:34:12 +11:00
Angus Salkeld
e211caab96 LOOP: fix job poll and simplify main loop
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-29 22:26:46 +11:00
Angus Salkeld
9745d4feb7 Add a resizable array that doesn't move memory.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-19 07:05:54 +11:00
Angus Salkeld
08e5a9004d Add a priority based main loop.
This is to try and get a better balance in the amount
of processing between IPC and totem in corosync.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-10-12 21:53:52 +11:00
Angus Salkeld
e7de13cd9d IPC: add a basic tx/rx test case.
- cleanup some printf's

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-09-07 08:56:38 +10:00
Angus Salkeld
7a90cdda1f Remove unneccessary extern's.
http://gcc.gnu.org/ml/gcc/2009-04/msg00812.html
http://publications.gbdirect.co.uk/c_book/chapter4/linkage.html
http://www.eskimo.com/~scs/cclass/notes/sx5b.html

note in ipcs.c qb_ipcs_ipc_init() is extern'ed, I don't
think that this is needed - we'll soon see :)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-11 08:29:31 +10:00
Angus Salkeld
bd2c07f739 Add a ringbuffer based off the one in logsys.
This ringbuffer is usable across processes.
the point is to use this for IPC to provide async
connections from client to server, but with inherient
flow control.

This still needs a bit of clean up, but committing now
for feedback and as it is quite functional.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-06-10 12:44:27 +10:00
Angus Salkeld
6ba7251165 Add tezt programs to .gitignore
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-04-29 21:19:03 +10:00
Angus Salkeld
40f235a889 libtool and code re-structure
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-04-15 23:25:29 +10:00
Angus Salkeld
c6134b367c add a unit test for hash & cleanup.
Fix make distcheck
    Add qbhash.h to the makefiles
    Fix make rpm.
    Make sure the makefiles are generatd for hash

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2010-04-15 12:19:08 +10:00