Commit e18865c5 authored by Philip Carns's avatar Philip Carns
Browse files

fill in simple bedrock module hooks

parent 7e261cd4
......@@ -6,36 +6,49 @@
#include <bedrock/module.h>
#include <string.h>
#include "bake-server.h"
static int bake_register_provider(bedrock_args_t args,
bedrock_module_provider_t* provider)
{
margo_instance_id mid = bedrock_args_get_margo_instance(args);
uint16_t provider_id = bedrock_args_get_provider_id(args);
ABT_pool pool = bedrock_args_get_pool(args);
const char* config = bedrock_args_get_config(args);
const char* name = bedrock_args_get_name(args);
*provider = strdup("bake:provider");
printf("Registered a provider from bake\n");
int ret;
struct bake_provider_init_info bpargs = {0};
margo_instance_id mid = bedrock_args_get_margo_instance(args);
uint16_t provider_id = bedrock_args_get_provider_id(args);
ABT_pool pool = bedrock_args_get_pool(args);
const char* config = bedrock_args_get_config(args);
const char* name = bedrock_args_get_name(args);
printf("Registering a Bake provider\n");
printf(" -> mid = %p\n", (void*)mid);
printf(" -> provider id = %d\n", provider_id);
printf(" -> pool = %p\n", (void*)pool);
printf(" -> config = %s\n", config);
printf(" -> name = %s\n", name);
bpargs.json_config = config;
ret = bake_provider_register(mid, provider_id, &bpargs,
(struct bake_provider**)&provider);
if (ret < 0) return (-1);
return BEDROCK_SUCCESS;
}
static int bake_deregister_provider(bedrock_module_provider_t provider)
{
free(provider);
printf("Deregistered a provider from bake\n");
int ret;
printf("Deregistering a Bake provider\n");
ret = bake_provider_destroy(provider);
if (ret < 0) return (-1);
return BEDROCK_SUCCESS;
}
static char* bake_get_provider_config(bedrock_module_provider_t provider)
{
(void)provider;
return strdup("{}");
return (bake_provider_get_config(provider));
}
static int bake_init_client(margo_instance_id mid,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment