#include #define SOCKTYPE int #define FDTYPE int #include #include static struct GNUNET_OS_ProjectData test_pd = { .libname = "test", .project_dirname = "test", .binary_name = "test-config", .env_varname = "TEST_PREFIX", .base_config_varname = "TEST_CONFIG", .bug_email = "", .homepage = "", .config_file = "test.conf", .user_config_file = "/tmp/test.conf", .version = "1.0", .is_gnu = 0, .gettext_domain = "test", .gettext_path = NULL, }; static const struct GNUNET_CONFIGURATION_Handle *cfg = NULL; static void ego_lookup(void *cls, const struct GNUNET_IDENTITY_Ego *ego) { if (ego == NULL) { GNUNET_log(GNUNET_ERROR_TYPE_INFO, "test-ego does not exist\n"); } else { GNUNET_log(GNUNET_ERROR_TYPE_INFO, "test-ego exists\n"); } GNUNET_SCHEDULER_shutdown(); } static void run(void *cls, char *const *args, const char *cfgname, const struct GNUNET_CONFIGURATION_Handle *c) { GNUNET_log_setup("test-config", "INFO", NULL); cfg = c; if (GNUNET_IDENTITY_ego_lookup(cfg, "test-ego", &ego_lookup, NULL) == NULL) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Error with ego lookup\n"); GNUNET_SCHEDULER_shutdown(); } } int main(int argc, char *argv[]) { const struct GNUNET_GETOPT_CommandLineOption opts[] = { GNUNET_GETOPT_OPTION_END, }; GNUNET_OS_init(&test_pd); return (GNUNET_PROGRAM_run(argc, argv, "test-config", "test", opts, &run, NULL) != GNUNET_OK); }