#ifndef APIPLANT_H
#define APIPLANT_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define APIPLANT_ABI_VERSION 1u
#define APIPLANT_OK 0
#define APIPLANT_ERR_REQUEST 1
#define APIPLANT_ERR_INTERNAL 2
#define APIPLANT_TRACE 0
#define APIPLANT_DEBUG 1
#define APIPLANT_INFO 2
#define APIPLANT_WARN 3
#define APIPLANT_ERROR 4
typedef struct ApiplantHost {
void *ctx;
char *(*query)(void *ctx, const char *request_json);
void (*log)(void *ctx, int32_t level, const char *message);
char *(*config)(void *ctx);
char *(*principal_id)(void *ctx);
char *(*hook)(void *ctx);
void (*free_string)(void *ctx, char *string);
char *(*send_email)(void *ctx, const char *request_json);
char *(*cache)(void *ctx, const char *request_json);
} ApiplantHost;
#ifndef APIPLANT_NO_PROTOTYPES
uint32_t apiplant_abi_version(void);
const char *apiplant_manifest(void);
int32_t apiplant_invoke(const char *name, const char *input_json,
const ApiplantHost *host, char **out);
void apiplant_free(char *string);
#endif
#ifdef __cplusplus
}
#endif
#endif