From 4b8dacac76a4a8df8d3fdf8b90f1bc9211669bb3 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Tue, 18 Mar 2014 10:56:34 +0100 Subject: [PATCH] Remove unused files Change-Id: Id5689811573c16dd58e945f318d0c32a48e79740 Reviewed-on: http://review.couchbase.org/34629 Reviewed-by: Trond Norbye Tested-by: Trond Norbye --- .gitmodules | 3 - README.markdown | 38 --------- examples/bot.c | 205 ---------------------------------------------- libconflate.pc.in | 12 --- libstrophe | 1 - 5 files changed, 259 deletions(-) delete mode 100644 .gitmodules delete mode 100644 README.markdown delete mode 100644 examples/bot.c delete mode 100644 libconflate.pc.in delete mode 160000 libstrophe diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 4e45e25..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "libstrophe"] - path = libstrophe - url = git://github.com/dustin/libstrophe.git diff --git a/README.markdown b/README.markdown deleted file mode 100644 index 1d03ce8..0000000 --- a/README.markdown +++ /dev/null @@ -1,38 +0,0 @@ -# Building - -First, you need to build and install libstrophe: - -## Libstrophe - - git clone git://github.com/dustin/libstrophe.git - cd libstrophe - git submodule init - git submodule update - ./config/autorun.sh - ./configure - make - -And then install it: - - mkdir ~/{lib,include} - cp *.h ~/include - cp *.a ~/lib - -## The Library and Example Bot - -Now you're ready to build the library and example application. - - git clone git://github.com/northscale/libconflate.git - cd libconflate - make - -# Trying the Example - -There's a bit of infrastructure required to see it all work, but the -example (bot.c) is ready to talk to your xmpp server and handle -messages. - - ./examples/bot myjid@example.com mypassword - -(optionally, you can specify a third argument to tell it exactly what -xmpp server to connect to if you'd like to avoid SRV lookups) diff --git a/examples/bot.c b/examples/bot.c deleted file mode 100644 index e3916da..0000000 --- a/examples/bot.c +++ /dev/null @@ -1,205 +0,0 @@ -#include "config.h" -#include -#include -#include - -#include "conflate.h" -#include "alarm.h" -#include "conflate_internal.h" - - -/* - * This program is both an example of most of the public API of - * libconflate as well as a sample program to interact with it. - */ - -/* ************************************************************ */ - -/* - * kvpair visitor callback to display a received config parameter. - */ -static bool config_visitor(void *opaque, const char *key, const char **values) -{ - (void)opaque; - printf("\t%s\n", key); - - for (int i = 0; values[i]; i++) { - printf("\t\t%s\n", values[i]); - } - - return true; -} - -/* - * Example callback to handle a newly receive configuration. - */ -static conflate_result display_config(void* userdata, kvpair_t* conf) -{ - printf("Hey. I received a new config (userdata: %s):\n", - (char*)userdata); - - walk_kvpair(conf, NULL, config_visitor); - - return CONFLATE_SUCCESS; -} - -/* - * Example callback with a simple form result. - */ -static enum conflate_mgmt_cb_result process_stats(void *opaque, - conflate_handle_t *handle, - const char *cmd, - bool direct, - kvpair_t *form, - conflate_form_result *r) -{ - (void)opaque; - (void)handle; - (void)cmd; - - /* Only direct stat requests are handled. */ - assert(direct); - - char *subtype = get_simple_kvpair_val(form, "-subtype-"); - - fprintf(stderr, "Handling stats request with subtype: %s\n", - subtype ? subtype : "(null)"); - - conflate_add_field(r, "stat1", "val1"); - conflate_add_field(r, "stat2", "val2"); - - return RV_OK; -} - -/* - * Example callback that has an empty result. - */ -static enum conflate_mgmt_cb_result process_reset_stats(void *opaque, - conflate_handle_t *handle, - const char *cmd, - bool direct, - kvpair_t *form, - conflate_form_result *r) -{ - (void)opaque; - (void)handle; - (void)cmd; - (void)direct; - (void)r; - char *subtype = get_simple_kvpair_val(form, "-subtype-"); - - fprintf(stderr, "Handling stats reset with subtype: %s\n", - subtype ? subtype : "(null)"); - - return RV_OK; -} - -/* - * Example callback that returns a list of forms. - */ -static enum conflate_mgmt_cb_result process_ping_test(void *opaque, - conflate_handle_t *handle, - const char *cmd, - bool direct, - kvpair_t *form, - conflate_form_result *r) -{ - (void)opaque; - (void)handle; - (void)cmd; - (void)direct; - - kvpair_t *servers_p = find_kvpair(form, "servers"); - if (!servers_p) { - return RV_BADARG; - } - char **servers = servers_p->values; - - for (int i = 0; servers[i]; i++) { - /* For each result we wish to send back, we begin a field set */ - conflate_next_fieldset(r); - - /* All fields added now fall within the current fieldset */ - conflate_add_field(r, "-set-", servers[i]); - - const char *vals[3] = { "val1", "val2", NULL }; - conflate_add_field_multi(r, "test1", vals); - - conflate_add_field(r, "test2", "some val"); - } - - return RV_OK; -} - -static enum conflate_mgmt_cb_result process_alarm_create(void *opaque, - conflate_handle_t *handle, - const char *cmd, - bool direct, - kvpair_t *form, - conflate_form_result *r) -{ - (void)opaque; - (void)handle; - (void)cmd; - (void)direct; - (void)form; - (void)r; - - if(add_alarm(handle->alarms, "test", "This is a test alarm!")) { - fprintf(stderr, "Created alarm!\n"); - } else { - fprintf(stderr, "Error queueing an alarm.\n"); - } - return RV_OK; -} - -int main(int argc, char **argv) { - - if (argc < 3) { - fprintf(stderr, "Usage: bot [host]\n"); - exit(EXIT_FAILURE); - } - - /* Initialize callbacks for provided functionality. - * - * These callbacks are global and thus initialized once for your - * entire application. - */ - conflate_register_mgmt_cb("client_stats", "Retrieves stats from the agent", - process_stats); - conflate_register_mgmt_cb("reset_stats", "Reset stats on the agent", - process_reset_stats); - - conflate_register_mgmt_cb("ping_test", "Perform a ping test", - process_ping_test); - - conflate_register_mgmt_cb("alarm", "Create an alarm", - process_alarm_create); - - /* Perform default configuration initialization. */ - conflate_config_t conf; - init_conflate(&conf); - - /* Specify application-specific configuration parameters. */ - conf.jid = argv[1]; - conf.pass = argv[2]; - conf.host = (argc == 4 ? argv[3] : NULL); - conf.software = "conflate sample bot"; - conf.version = "1.0"; - conf.save_path = "/tmp/conflate.db"; - conf.log = conflate_stderr_logger; - - conf.userdata = "something awesome"; - conf.new_config = display_config; - - /* Begin the connection. */ - if(!start_conflate(conf)) { - fprintf(stderr, "Couldn't initialize libconflate.\n"); - exit(EXIT_FAILURE); - } - - /* Typically, your application would go about its business here. - Since this is just a demo, the caller has nothing else to do, - so we wait forever. */ - pause(); -} diff --git a/libconflate.pc.in b/libconflate.pc.in deleted file mode 100644 index fff00cc..0000000 --- a/libconflate.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libconflate -Description: A library for managing configuration of clustered applications -- Bringing it all together. -Version: @VERSION@ -Requires.private: libstrophe -Libs: -L${libdir} -lconflate -Libs.private: @LIBS@ -Cflags: -I${includedir}/libconflate diff --git a/libstrophe b/libstrophe deleted file mode 160000 index ce1d79a..0000000 --- a/libstrophe +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ce1d79ae3322f565a900e4264a2defc469d484b2