lib: force user to include `<babeltrace2/babeltrace.h>`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Jul 2019 05:33:02 +0000 (01:33 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Jul 2019 15:25:15 +0000 (11:25 -0400)
commit4fa90f321f51af8f5bfc48eee1435e2f41d853b3
tree5363b3d1eab46cc73f8af76a26fa041150c12f0a
parent924dc299c8a893e92fcd985fa05c245b591ef314
lib: force user to include `<babeltrace2/babeltrace.h>`

This patch makes all the library headers except
`<babeltrace2/babeltrace.h>` refuse to be included directly. This will
allow us to change how those headers are organized, and even remove some
if needed (as long as we move the existing content to another existing
header), because we know the user does not include specific headers.

To do this, the main `<babeltrace2/babeltrace.h>` defines
`__BT_IN_BABELTRACE_H`, and each specific header does:

    #ifndef __BT_IN_BABELTRACE_H
    # error "Please include <babeltrace2/babeltrace.h> instead."
    #endif

at the beginning.

Because each specific header has the guarantee that it is included from
`<babeltrace2/babeltrace.h>`, they don't include
`<babeltrace2/func-status.h>`: `<babeltrace2/babeltrace.h>` includes it,
and clears the private status definitions itself at the end. Therefore
this patch removes `undef-func-status.h`.

Some parts of the project need to have access to the `__BT_FUNC_STATUS_*`
definitions. To do that, they do:

    #define __BT_IN_BABELTRACE_H
    #include <babeltrace2/func-status.h>

Because `<babeltrace2/babeltrace.h>` is now manually written and
maintained, this patch removes `extras/gen-babeltrace-h.py` which we
used to generate it from `include/Makefile.am`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Icc3bf0bec18a465024b316f02f84df7a75429b87
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1671
Tested-by: jenkins <jenkins@lttng.org>
109 files changed:
extras/gen-babeltrace-h.py [deleted file]
include/Makefile.am
include/babeltrace2/babeltrace.h
include/babeltrace2/current-thread.h
include/babeltrace2/error-cause-const.h
include/babeltrace2/error-const.h
include/babeltrace2/func-status.h
include/babeltrace2/graph/component-class-const.h
include/babeltrace2/graph/component-class-filter-const.h
include/babeltrace2/graph/component-class-filter.h
include/babeltrace2/graph/component-class-sink-const.h
include/babeltrace2/graph/component-class-sink.h
include/babeltrace2/graph/component-class-source-const.h
include/babeltrace2/graph/component-class-source.h
include/babeltrace2/graph/component-class.h
include/babeltrace2/graph/component-const.h
include/babeltrace2/graph/component-filter-const.h
include/babeltrace2/graph/component-sink-const.h
include/babeltrace2/graph/component-source-const.h
include/babeltrace2/graph/connection-const.h
include/babeltrace2/graph/graph-const.h
include/babeltrace2/graph/graph.h
include/babeltrace2/graph/message-const.h
include/babeltrace2/graph/message-discarded-events-const.h
include/babeltrace2/graph/message-discarded-events.h
include/babeltrace2/graph/message-discarded-packets-const.h
include/babeltrace2/graph/message-discarded-packets.h
include/babeltrace2/graph/message-event-const.h
include/babeltrace2/graph/message-event.h
include/babeltrace2/graph/message-iterator.h
include/babeltrace2/graph/message-message-iterator-inactivity-const.h
include/babeltrace2/graph/message-message-iterator-inactivity.h
include/babeltrace2/graph/message-packet-beginning-const.h
include/babeltrace2/graph/message-packet-beginning.h
include/babeltrace2/graph/message-packet-end-const.h
include/babeltrace2/graph/message-packet-end.h
include/babeltrace2/graph/message-stream-beginning-const.h
include/babeltrace2/graph/message-stream-beginning.h
include/babeltrace2/graph/message-stream-const.h
include/babeltrace2/graph/message-stream-end-const.h
include/babeltrace2/graph/message-stream-end.h
include/babeltrace2/graph/port-const.h
include/babeltrace2/graph/port-input-const.h
include/babeltrace2/graph/port-output-const.h
include/babeltrace2/graph/port-output-message-iterator.h
include/babeltrace2/graph/query-executor-const.h
include/babeltrace2/graph/query-executor.h
include/babeltrace2/graph/self-component-class-filter.h
include/babeltrace2/graph/self-component-class-sink.h
include/babeltrace2/graph/self-component-class-source.h
include/babeltrace2/graph/self-component-filter.h
include/babeltrace2/graph/self-component-port-input-message-iterator.h
include/babeltrace2/graph/self-component-port-input.h
include/babeltrace2/graph/self-component-port-output.h
include/babeltrace2/graph/self-component-port.h
include/babeltrace2/graph/self-component-sink.h
include/babeltrace2/graph/self-component-source.h
include/babeltrace2/graph/self-component.h
include/babeltrace2/graph/self-message-iterator.h
include/babeltrace2/logging.h
include/babeltrace2/plugin/plugin-const.h
include/babeltrace2/plugin/plugin-dev.h
include/babeltrace2/plugin/plugin-set-const.h
include/babeltrace2/property.h
include/babeltrace2/trace-ir/clock-class-const.h
include/babeltrace2/trace-ir/clock-class.h
include/babeltrace2/trace-ir/clock-snapshot-const.h
include/babeltrace2/trace-ir/event-class-const.h
include/babeltrace2/trace-ir/event-class.h
include/babeltrace2/trace-ir/event-const.h
include/babeltrace2/trace-ir/event.h
include/babeltrace2/trace-ir/field-class-const.h
include/babeltrace2/trace-ir/field-class.h
include/babeltrace2/trace-ir/field-const.h
include/babeltrace2/trace-ir/field-path-const.h
include/babeltrace2/trace-ir/field.h
include/babeltrace2/trace-ir/packet-const.h
include/babeltrace2/trace-ir/packet-context-field.h
include/babeltrace2/trace-ir/packet.h
include/babeltrace2/trace-ir/stream-class-const.h
include/babeltrace2/trace-ir/stream-class.h
include/babeltrace2/trace-ir/stream-const.h
include/babeltrace2/trace-ir/stream.h
include/babeltrace2/trace-ir/trace-class-const.h
include/babeltrace2/trace-ir/trace-class.h
include/babeltrace2/trace-ir/trace-const.h
include/babeltrace2/trace-ir/trace.h
include/babeltrace2/types.h
include/babeltrace2/undef-func-status.h [deleted file]
include/babeltrace2/util.h
include/babeltrace2/value-const.h
include/babeltrace2/value.h
include/babeltrace2/version.h
src/bindings/python/bt2/bt2/native_bt.i
src/common/common.h
src/lib/babeltrace2.c
src/lib/current-thread.c
src/lib/error.c
src/lib/error.h
src/lib/func-status.h
src/lib/lib-logging.c
src/lib/logging.c
src/lib/property.h
src/lib/util.c
src/lib/value.c
src/lib/value.h
src/logging/log.h
src/plugins/comp-logging.h
tests/ctf-writer/ctf_writer.c
This page took 0.036442 seconds and 4 git commands to generate.