libpldm: Explicit deprecated, stable and testing ABI classes

Experimenting with new APIs is important, but ABI stability of the
library is also important. We wish to have the freedom to add APIs
without being burdened by them being immediately set in stone.

We implement this wish by introducing three classes of ABI:

1. deprecated
2. stable
3. testing

These are enforced by corresponding function attributes:

1. LIBPLDM_ABI_DEPRECATED
2. LIBPLDM_ABI_STABLE
3. LIBPLDM_ABI_TESTING

Symbol visibility in the library is flipped to 'hidden' by default, so
one of these annotations must be used for the symbol to be exposed.

With these classes in place there are now clear points in time at which
we update the ABI dumps captured under the abi/ directory: When an API
is migrated from the 'testing' class to the 'stable' class, or when
removed from the 'deprecated' class.

Which classes of functions are exposed by the build is controlled by the
new 'abi' meson option. The option is of array type which contains the
list of ABI classes the build should consider. It defaults to enabling
all classes to provide test coverage in CI. The classes used should be
constrained to deprecated and stable (and not test) in any dependent
projects.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I25402e20c7be9c9f264f9ccd7ac36b384823734c
diff --git a/src/requester/instance-id.c b/src/requester/instance-id.c
index 82e3ed1..10d5988 100644
--- a/src/requester/instance-id.c
+++ b/src/requester/instance-id.c
@@ -1,5 +1,6 @@
 // NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
 #define _GNU_SOURCE
+#include "config.h"
 #include "libpldm/instance-id.h"
 #include "libpldm/pldm.h"
 #include <errno.h>
@@ -30,6 +31,7 @@
 	return (cur + 1) % PLDM_INST_ID_MAX;
 }
 
+LIBPLDM_ABI_STABLE
 int pldm_instance_db_init(struct pldm_instance_db **ctx, const char *dbpath)
 {
 	struct pldm_instance_db *l_ctx;
@@ -78,12 +80,14 @@
 	return 0;
 }
 
+LIBPLDM_ABI_STABLE
 int pldm_instance_db_init_default(struct pldm_instance_db **ctx)
 {
 	return pldm_instance_db_init(ctx,
 				     "/usr/share/libpldm/instance-db/default");
 }
 
+LIBPLDM_ABI_STABLE
 int pldm_instance_db_destroy(struct pldm_instance_db *ctx)
 {
 	if (!ctx) {
@@ -94,6 +98,7 @@
 	return 0;
 }
 
+LIBPLDM_ABI_STABLE
 int pldm_instance_id_alloc(struct pldm_instance_db *ctx, pldm_tid_t tid,
 			   pldm_instance_id_t *iid)
 {
@@ -182,6 +187,7 @@
 	return -EAGAIN;
 }
 
+LIBPLDM_ABI_STABLE
 int pldm_instance_id_free(struct pldm_instance_db *ctx, pldm_tid_t tid,
 			  pldm_instance_id_t iid)
 {