diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2019-08-18 18:48:01 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2020-02-17 18:57:46 +0100 |
commit | 1e4cd3dc83a68cd547e83ed0673367d4e6404e7e (patch) | |
tree | 5a6256ba3e2309558698d1d4e92b7fd3d9ab98b3 /src/libtracker-sparql/tracker-notifier.c | |
parent | 5b0a77537be1ffd7b6485b54767a6e5fd5f17267 (diff) | |
download | tracker-1e4cd3dc83a68cd547e83ed0673367d4e6404e7e.tar.gz |
libtracker-sparql: Reimplement public API in C
It is risky and clunky to have API/ABI in control of a transpiler
like Vala is. Examples are:
- Defining the abstract classes in vala necessarily exports these
*_construct() functions, which are 100% useless as public API
since no subclassing of Tracker objects is whatsoever allowed
outside of Tracker.
- While on the *_construct() functions topic, adding a constructor
like tracker_sparql_connetion_new() somehow made valac stop
exporting one for TrackerSparqlConnection. The warnings are
somehow eaten when compiling the resulting C code, but hell breaks
loose when the C compiler assumes an int return value (because
it can't know better) but the constructor has a pointer-sized
return value. Since those functions are exported, this change
sneakily involves an ABI break too.
- Even though we want some properties to be construct-only, vala
will automatically export setter functions for those. This adds
API like tracker_sparql_statement_set_connection() that can only
break things if ever called.
- The --abi-stability valac toggle was added too late for Tracker
to use it. We could use 3.0 as an excuse to turn it on, but that
doesn't magically fix the other points.
- Vala doesn't allow us to be explicit wrt the exported functions
(eg. through extern). We do resort to a .map file, but that's
prone to errors and hairy to maintain.
We still use vala at places for internal code, but I can't bring
myself to think it's a good idea to keep vala in charge of our
public API and ABI.
Diffstat (limited to 'src/libtracker-sparql/tracker-notifier.c')
-rw-r--r-- | src/libtracker-sparql/tracker-notifier.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libtracker-sparql/tracker-notifier.c b/src/libtracker-sparql/tracker-notifier.c index e7f5f8b01..c0c90db95 100644 --- a/src/libtracker-sparql/tracker-notifier.c +++ b/src/libtracker-sparql/tracker-notifier.c @@ -65,10 +65,10 @@ #include "config.h" +#include "tracker-connection.h" #include "tracker-notifier.h" #include "tracker-notifier-private.h" #include "tracker-sparql-enum-types.h" -#include "tracker-generated-no-checks.h" #include <libtracker-common/tracker-common.h> typedef struct _TrackerNotifierPrivate TrackerNotifierPrivate; @@ -509,6 +509,8 @@ tracker_notifier_class_init (TrackerNotifierClass *klass) /** * TrackerNotifier::events: * @self: The #TrackerNotifier + * @service: The SPARQL service that originated the events, %NULL for the local store + * @graph: The graph where the events happened on, %NULL for the default anonymous graph * @events: (element-type TrackerNotifierEvent): A #GPtrArray of #TrackerNotifierEvent * * Notifies of changes in the Tracker database. |