More documentation fixes, formatting, cosmetic, wording
[nobug.git] / doc / dumping.txt
blob10430a66b9e44f5628d740bc9db979999f8b4145
1 HEAD- Dumping Data Structures;dumping;
3 One can write functions to dump complex data structures using the NoBug
4 facilities. This is done by writing a custom function for each
5 data structure to be dumped, which may recursively call other dumping
6 functions. There are macros that can log within such a dumper function
7 and to initialise a dump of a given data structure.
9 A dump function has the prototype:
11 [source,c]
12 -------------------------------------------------------
13 void
14 nobug_NAME_dump (const struct NAME* POINTER,
15                  const int DEPTH,
16                  const struct nobug_context CONTEXT,
17                  void* EXTRA);
18 -------------------------------------------------------
20 where NAME is the identifier for what you want to dump, POINTER is a pointer
21 to the data to be dumped, DEPTH is an integer which will be decremented when
22 recursing into the data structure dumper (your dump function does that, see
23 below) to limit the recursion depth, CONTEXT is a source context generated by
24 nobug when you call DUMP() and EXTRA is a pointer transparently passed around
25 that you can use to store some additional state.