scopecheck doced
[nobug.git] / doc / using.txt
blob02a106d67119772fec8831884d65bf6ebe11d2de
1 Using NoBug
2 -----------
4 You can make NoBug features available either by installing it as described
5 above or by shipping the nobug sources along with your project.
7 To use NoBug, some controlling preprocessor macros have to be defined. The
8 nobug.h header should then be included.
10 A project using NoBug should use autoconf to check for execinfo.h and valgrind/
11 valgrind.h
13 AC_CHECK_HEADERS([execinfo.h valgrind/valgrind.h])
15 For Multithreaded programs, you should also check for pthread.h.
17 When the resulting HAVE_PTHREAD_H, HAVE_EXECINFO_H and HAVE_VALGRIND_VALGRIND_H
18 are defined by the configure script, the corresponding features become
19 available.
21 NoBug then defines 'NOBUG_USE_PTHREAD', 'NOBUG_USE_VALGRIND' and
22 'NOBUG_USE_EXECINFO' to 1. If you do not want to use any of these features in
23 NoBug, you can define these macros to 0 before including nobug.h.
25 If NVALGRIND is defined, valgrind support will not be available.
27 There are many other macros which can be set and overridden by the user to
28 control behavior. Please edit the wiki documentation if you find them useful.
30 To use NoBug with single threaded programmes, link libnobug.a to your project;
31 multi-threaded programmes should link with libnobugmt.a. The Library must be
32 initialized with NOBUG_INIT before any features can be used or a thread is
33 created. This is discussed in more detail at NoBug/Documentation/Macros/
34 MultiThreading.
36 Header and Initialisation
37 ^^^^^^^^^^^^^^^^^^^^^^^^^
38 The project source file will have to include nobug.h, and Nobug will have to be
39 initialised using NOBUG_INIT before any NoBug features can be used.
41 -------------------------------------------------------
42 ...
43 #include "nobug.h"
44 ...
46 int main()
48     NOBUG_INIT();
49     ...
51 -------------------------------------------------------