repo-fixing: fixup #4.
authorKrisztian Litkey <krisztian.litkey@intel.com>
Fri, 26 Oct 2012 16:10:20 +0000 (19:10 +0300)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Fri, 26 Oct 2012 16:10:20 +0000 (19:10 +0300)
LICENSE-BSD [new file with mode: 0644]
build-aux/gen-linkedin-loader [deleted file]
build-aux/gen-linker-script
src/Makefile.am
src/common-func-info.c
src/common/hashtbl.h
src/common/msg.c
src/common/msg.h
src/core/plugin.h
src/plugins/plugin-test.c

diff --git a/LICENSE-BSD b/LICENSE-BSD
new file mode 100644 (file)
index 0000000..f70109e
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2012, Intel Corporation
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of Intel Corporation nor the names of its contributors
+      may be used to endorse or promote products derived from this software
+      without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/build-aux/gen-linkedin-loader b/build-aux/gen-linkedin-loader
deleted file mode 100755 (executable)
index 1719dd4..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-#!/bin/bash
-
-######################################################################
-# Generate helper code for making builtin DSO plugins available.
-#
-# Sometimes it is necessary to split a plugin to several source
-# files. Usually this is the case when the functionality provided
-# by the plugin is complex enough to require subdividing the plugin
-# into internal modules for the best maintainability.
-#
-# In these cases we cannot avoid making several functions and
-# variables globally available within the plugin so we cannot just
-# limit the scope of visibility by making them static. Still, we do
-# want to avoid conflicts between these symbols of different plugins.
-# To accomplish this we compile and link such plugins into shared
-# libraries (with our normal symbol visibility conventions) and then
-# link the murphy daemon against them.
-#
-# Since none of the code linked into murphy proper references
-# any of the symbols in any of these plugins without any further
-# special arrangements these plugins wouldn't be demand-loaded
-# and consequently would be unavailable when the daemon starts up.
-#
-# To overcome this every such plugin gets automatically augmented
-# by a plugin-specifig globally visible symbol and the murphy daemon
-# gets augmented by a symbol that references these plugin-specific
-# symbols. This forces the dynamic loader to load the plugins and
-# the normal builtin-plugin autoregistration mechanism takes care of
-# the rest.
-#
-# A bit too spaceship-ish, I admit... but nevertheless necessary
-# unless we want to give up the idea of builtin/linkedin plugins...
-#
-
-
-error () {
-    echo "error: $*" 1>&2
-}
-
-info () {
-    echo "$*" 1>&2
-}
-
-warning () {
-    echo "warning: $*" 1>&2
-}
-
-usage () {
-    info "usage: $0 [-p <plugin>] [-l <plugin-list>] -o <output-file>"
-    info "usage: $0 -p <plugin> -o <output-file>, or"
-    info "usage: $0 -o <output-file> <plugin-list>"
-    exit ${1:-1}
-}
-
-emit () {
-    echo "$*" >> $OUTPUT
-}
-
-emit_plugin_loader () {
-    case $OUTPUT in
-        *.c) emit "int mrp_linkedin_plugin_$1_symbol = 0;"
-             ;;
-        *.h) emit "extern int mrp_linkedin_plugin_$1_symbol;"
-             ;;
-    esac
-}
-
-emit_murphy_loader () {
-    local _p
-
-    for _p in $*; do
-        emit "#include \"linkedin-$_p-loader.h\""
-    done
-    emit ""
-    emit "void mrp_load_linkedin_plugins(void)"
-    emit "{"
-    emit "    return \\"
-    for _p in $*; do
-        emit "        mrp_linkedin_plugin_${_p}_symbol + \\"
-    done
-    emit "        0;"
-    emit "}"
-}
-
-
-OUTPUT=""
-PLUGIN=""
-PLUGIN_LIST=""
-
-#echo "*** $0 $* ***"
-
-# parse command line
-while [ -n "${1#-}" ]; do
-    case $1 in
-        -o)
-            if [ -z "$OUTPUT" ]; then
-                shift
-                OUTPUT="$1"
-            else
-                error "Multiple output files requested."
-                usage
-            fi
-            ;;
-        -p)
-            if [ -z "$PLUGIN" -a -z "$PLUGIN_LIST" ]; then
-                shift
-                PLUGIN="$1"
-            else
-                if [ -n "$PLUGIN" ]; then
-                    error "Multiple builtin plugins specified."
-                else
-                    error "Both builtin plugin and plugin list specified."
-                fi
-                usage
-            fi
-            ;;
-        -h)
-            usage 0
-            ;;
-       -q)
-           QUIET="yes"
-           ;;
-        -*)
-            error "Unknown option '$1'."
-            usage
-            ;;
-        *)
-            PLUGIN_LIST="$PLUGIN_LIST $1"
-            ;;
-    esac
-    shift
-done
-
-# check that we've got everything mandatory
-if [ -z "$OUTPUT" ]; then
-    error "No output file specified (use the -o option)."
-    usage
-fi
-
-if [ -z "$PLUGIN" -a -z "$PLUGIN_LIST" ]; then
-    error "Neither builtin plugin nor plugin list is specified."
-    usage
-fi
-
-if [ -n "$PLUGIN" -a -n "$PLUGIN_LIST" ]; then
-    error "Both builtin plugin and plugin list are specified."
-    usage
-fi
-
-# generate the output
-rm -f $OUTPUT
-touch $OUTPUT
-if [ -n "$PLUGIN" ]; then
-    emit_plugin_loader $PLUGIN
-else
-    emit_murphy_loader $PLUGIN_LIST
-fi
index bb322b4..c5dc567 100755 (executable)
@@ -16,10 +16,6 @@ info () {
     echo "$*" 1>&2
 }
 
-warning () {
-    echo "warning: $*" 1>&2
-}
-
 usage () {
     info "usage: $0 [-p <pattern>] [-I <ignore-list>] -o <output> <inputs>"
     exit ${1:-1}
@@ -31,7 +27,7 @@ emit () {
 
 
 # set up defaults
-PATTERN="^mrp_|^_mrp_"                # export everything prefixed with mrp_
+PATTERN="^mrp_"                       # export everything prefixed with mrp_
 IGNORE="MRP_PRINTF_LIKE,MRP_NULLTERM" # ignore these symbols/macros
 IT=","                                # ignore-list is comma-separated
 SOURCES=""                            # no default input, must be specified
@@ -82,12 +78,8 @@ if [ -z "$OUTPUT" ]; then
 fi
 
 if [ -z "$SOURCES" ]; then
-    warning "No input files, generating local-only linker script."
-    emit "{"
-    emit "    local:"
-    emit "        *;"
-    emit "};"
-    exit 0
+    error "No input files specified."
+    usage
 fi
 
 if [ -z "$PATTERN" ]; then
index c0e767d..c89a8b8 100644 (file)
@@ -62,8 +62,7 @@ libmurphy_common_la_REGULAR_SOURCES =         \
                common/transport.c              \
                common/stream-transport.c       \
                common/internal-transport.c     \
-               common/dgram-transport.c        \
-               common/core-transport.c
+               common/dgram-transport.c
 
 libmurphy_common_la_SOURCES =                          \
                $(libmurphy_common_la_REGULAR_SOURCES)  \
@@ -599,55 +598,6 @@ plugin_signalling_ladir      = $(SIGNALLING_PLUGINdir)
 plugin_LTLIBRARIES    += plugin-signalling.la
 endif
 
-# decision plugin
-DECISION_PLUGIN_SOURCES = plugins/decision/plugin-decision.c \
-                         plugins/decision/pdp.c             \
-                         plugins/decision/pep.c             \
-                         plugins/decision/table.c           \
-                         plugins/decision/transport.c       \
-                         plugins/decision/message.c
-
-DECISION_PLUGIN_CFLAGS  =
-DECISION_PLUGIN_LIBS    =
-
-if !DISABLED_PLUGIN_DECISION
-if BUILTIN_PLUGIN_DECISION
-BUILTIN_PLUGINS += $(DECISION_PLUGIN_SOURCES)
-BUILTIN_CFLAGS  += $(DECISION_PLUGIN_CFLAGS)
-BUILTIN_LIBS    += $(DECISION_PLUGIN_LIBS)
-else
-plugin_decision_la_SOURCES = $(DECISION_PLUGIN_SOURCES)
-plugin_decision_la_CFLAGS  = $(DECISION_PLUGIN_CFLAGS) \
-                            $(MURPHY_CFLAGS) $(AM_CFLAGS)
-plugin_decision_la_LDFLAGS = -module -avoid-version
-plugin_decision_la_LIBADD  = $(DECISION_PLUGIN_LIBS)
-
-plugin_LTLIBRARIES    += plugin-decision.la
-endif
-
-lib_LTLIBRARIES   += libpep.la
-libpep_la_SOURCES  = plugins/decision/pep-client.c \
-                    plugins/decision/pep-db.c
-libpep_la_CFLAGS   =
-libpep_la_LIBADD   = libmurphy-common.la
-
-# enforcement point test client
-bin_PROGRAMS += test-ep test-pep
-
-test_ep_SOURCES = plugins/decision/test-ep.c
-test_ep_CFLAGS  = $(AM_CFLAGS)
-test_ep_LDADD   = libmurphy-core.la   \
-                 libmurphy-common.la \
-                 -lreadline
-
-test_pep_SOURCES = plugins/decision/test-pep.c
-test_pep_CFLAGS  = $(AM_CFLAGS)
-test_pep_LDADD   = libpep.la    \
-                  libmurphy-common.la \
-                 -lreadline
-endif
-
-
 ###################################
 # murphy daemon
 #
index 7293328..3e4552b 100644 (file)
@@ -1,28 +1,8 @@
 #include <stdlib.h>
 #include <murphy/common/debug.h>
 
-/* common/core-transport.c */
-static mrp_debug_info_t info_0[] = {
-    { .line = 17, .func = "core_resolve" },
-    { .line = 25, .func = "core_open" },
-    { .line = 31, .func = "core_close" },
-    { .line = 37, .func = "core_bind" },
-    { .line = 44, .func = "core_listen" },
-    { .line = 50, .func = "core_accept" },
-    { .line = 56, .func = "core_connect" },
-    { .line = 63, .func = "core_disconnect" },
-    { .line = 69, .func = "core_send" },
-    { .line = 75, .func = "core_sendraw" },
-    { .line = 81, .func = "core_senddata" },
-    { .line = 0, .func = NULL }
-};
-static mrp_debug_file_t file_0 = {
-    .file = "common/core-transport.c",
-    .info = info_0
-};
-
 /* common/debug.c */
-static mrp_debug_info_t info_1[] = {
+static mrp_debug_info_t info_0[] = {
     { .line = 57, .func = "free_rule_cb" },
     { .line = 65, .func = "init_rules" },
     { .line = 84, .func = "reset_rules" },
@@ -46,13 +26,13 @@ static mrp_debug_info_t info_1[] = {
     { .line = 619, .func = "flush_file_table" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_1 = {
+static mrp_debug_file_t file_0 = {
     .file = "common/debug.c",
-    .info = info_1
+    .info = info_0
 };
 
 /* common/dgram-transport.c */
-static mrp_debug_info_t info_2[] = {
+static mrp_debug_info_t info_1[] = {
     { .line = 82, .func = "parse_address" },
     { .line = 199, .func = "dgrm_resolve" },
     { .line = 249, .func = "dgrm_open" },
@@ -73,25 +53,25 @@ static mrp_debug_info_t info_2[] = {
     { .line = 692, .func = "dgrm_senddatato" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_2 = {
+static mrp_debug_file_t file_1 = {
     .file = "common/dgram-transport.c",
-    .info = info_2
+    .info = info_1
 };
 
 /* common/file-utils.c */
-static mrp_debug_info_t info_3[] = {
+static mrp_debug_info_t info_2[] = {
     { .line = 42, .func = "translate_glob" },
     { .line = 53, .func = "dirent_type" },
     { .line = 71, .func = "mrp_scan_dir" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_3 = {
+static mrp_debug_file_t file_2 = {
     .file = "common/file-utils.c",
-    .info = info_3
+    .info = info_2
 };
 
 /* common/hashtbl.c */
-static mrp_debug_info_t info_4[] = {
+static mrp_debug_info_t info_3[] = {
     { .line = 68, .func = "calc_buckets" },
     { .line = 84, .func = "mrp_htbl_create" },
     { .line = 127, .func = "mrp_htbl_destroy" },
@@ -106,13 +86,13 @@ static mrp_debug_info_t info_4[] = {
     { .line = 343, .func = "mrp_htbl_find" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_4 = {
+static mrp_debug_file_t file_3 = {
     .file = "common/hashtbl.c",
-    .info = info_4
+    .info = info_3
 };
 
 /* common/internal-transport.c */
-static mrp_debug_info_t info_5[] = {
+static mrp_debug_info_t info_4[] = {
     { .line = 75, .func = "process_queue" },
     { .line = 144, .func = "internal_initialize_table" },
     { .line = 205, .func = "internal_resolve" },
@@ -133,13 +113,13 @@ static mrp_debug_info_t info_5[] = {
     { .line = 556, .func = "internal_senddata" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_5 = {
+static mrp_debug_file_t file_4 = {
     .file = "common/internal-transport.c",
-    .info = info_5
+    .info = info_4
 };
 
 /* common/log.c */
-static mrp_debug_info_t info_6[] = {
+static mrp_debug_info_t info_5[] = {
     { .line = 43, .func = "mrp_log_parse_levels" },
     { .line = 84, .func = "mrp_log_parse_target" },
     { .line = 97, .func = "mrp_log_enable" },
@@ -151,13 +131,13 @@ static mrp_debug_info_t info_6[] = {
     { .line = 226, .func = "set_default_logging" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_6 = {
+static mrp_debug_file_t file_5 = {
     .file = "common/log.c",
-    .info = info_6
+    .info = info_5
 };
 
 /* common/mainloop.c */
-static mrp_debug_info_t info_7[] = {
+static mrp_debug_info_t info_6[] = {
     { .line = 212, .func = "add_slave_io_watch" },
     { .line = 246, .func = "slave_io_events" },
     { .line = 265, .func = "free_io_watch" },
@@ -219,13 +199,13 @@ static mrp_debug_info_t info_7[] = {
     { .line = 1545, .func = "dump_pollfds" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_7 = {
+static mrp_debug_file_t file_6 = {
     .file = "common/mainloop.c",
-    .info = info_7
+    .info = info_6
 };
 
 /* common/mm.c */
-static mrp_debug_info_t info_8[] = {
+static mrp_debug_info_t info_7[] = {
     { .line = 95, .func = "setup" },
     { .line = 122, .func = "cleanup" },
     { .line = 133, .func = "memblk_alloc" },
@@ -267,13 +247,13 @@ static mrp_debug_info_t info_8[] = {
     { .line = 970, .func = "chunk_free" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_8 = {
+static mrp_debug_file_t file_7 = {
     .file = "common/mm.c",
-    .info = info_8
+    .info = info_7
 };
 
 /* common/msg.c */
-static mrp_debug_info_t info_9[] = {
+static mrp_debug_info_t info_8[] = {
     { .line = 49, .func = "destroy_field" },
     { .line = 83, .func = "create_field" },
     { .line = 257, .func = "msg_destroy" },
@@ -314,13 +294,13 @@ static mrp_debug_info_t info_9[] = {
     { .line = 2037, .func = "mrp_msgbuf_pull" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_9 = {
+static mrp_debug_file_t file_8 = {
     .file = "common/msg.c",
-    .info = info_9
+    .info = info_8
 };
 
 /* common/stream-transport.c */
-static mrp_debug_info_t info_10[] = {
+static mrp_debug_info_t info_9[] = {
     { .line = 73, .func = "parse_address" },
     { .line = 191, .func = "strm_resolve" },
     { .line = 241, .func = "strm_open" },
@@ -338,13 +318,13 @@ static mrp_debug_info_t info_10[] = {
     { .line = 634, .func = "strm_senddata" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_10 = {
+static mrp_debug_file_t file_9 = {
     .file = "common/stream-transport.c",
-    .info = info_10
+    .info = info_9
 };
 
 /* common/transport.c */
-static mrp_debug_info_t info_11[] = {
+static mrp_debug_info_t info_10[] = {
     { .line = 47, .func = "check_request_callbacks" },
     { .line = 71, .func = "mrp_transport_register" },
     { .line = 87, .func = "mrp_transport_unregister" },
@@ -371,22 +351,22 @@ static mrp_debug_info_t info_11[] = {
     { .line = 505, .func = "recv_data" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_11 = {
+static mrp_debug_file_t file_10 = {
     .file = "common/transport.c",
-    .info = info_11
+    .info = info_10
 };
 
 /* common/utils.c */
-static mrp_debug_info_t info_12[] = {
+static mrp_debug_info_t info_11[] = {
     { .line = 45, .func = "notify_parent" },
     { .line = 58, .func = "mrp_daemonize" },
     { .line = 194, .func = "mrp_string_comp" },
     { .line = 200, .func = "mrp_string_hash" },
     { .line = 0, .func = NULL }
 };
-static mrp_debug_file_t file_12 = {
+static mrp_debug_file_t file_11 = {
     .file = "common/utils.c",
-    .info = info_12
+    .info = info_11
 };
 
 /* table of all files */
@@ -403,7 +383,6 @@ static mrp_debug_file_t *debug_files[] = {
     &file_9,
     &file_10,
     &file_11,
-    &file_12,
     NULL
 };
 
index 6dd7c05..a31a716 100644 (file)
@@ -30,7 +30,6 @@
 #ifndef __MURPHY_HASHTBL_H__
 #define __MURPHY_HASHTBL_H__
 
-#include <stdint.h>
 
 #include <murphy/common/macros.h>
 
index 4722caf..8b521f1 100644 (file)
@@ -585,123 +585,6 @@ int mrp_msg_get(mrp_msg_t *msg, ...)
 }
 
 
-int mrp_msg_iterate_get(mrp_msg_t *msg, void **it, ...)
-{
-#define HANDLE_TYPE(_type, _member)                       \
-    case MRP_MSG_FIELD_##_type:                           \
-        valp          = va_arg(ap, typeof(valp));         \
-        valp->_member = f->_member;                       \
-        break
-
-#define HANDLE_ARRAY(_type, _member)                      \
-    case MRP_MSG_FIELD_##_type:                           \
-        cntp          = va_arg(ap, typeof(cntp));         \
-        valp          = va_arg(ap, typeof(valp));         \
-        *cntp         = f->size[0];                       \
-        valp->_member = f->_member;                       \
-        break
-
-
-    mrp_msg_field_t *f;
-    mrp_msg_value_t *valp;
-    uint32_t        *cntp;
-    mrp_list_hook_t *start, *p;
-    uint16_t         tag, type;
-    int              found;
-    va_list          ap;
-
-    va_start(ap, it);
-
-    /*
-     * Okay... this might look a bit weird at first sight. This is
-     * mostly because we don't use the standard list iterating macros
-     * in the inner loop. There is a good reason for that: we want to
-     * minimise the number of times we scan the message which is just
-     * a linked list of fields. We do this by arranging the nested
-     * loops below in such a way that if the order of fields to fetch
-     * in the argument list matches the order of fields in the message
-     * we end up running the outer and inner loops in a 'phase lock'.
-     * So if the caller fetches the fields in the correct order we end
-     * up scanning the message at most once but only up to the last
-     * field to fetch.
-     */
-
-    start = (*it) ? (mrp_list_hook_t *)*it : msg->fields.next;
-
-    while ((tag = va_arg(ap, unsigned int)) != MRP_MSG_FIELD_INVALID) {
-        type  = va_arg(ap, unsigned int);
-        found = FALSE;
-
-        for (p = start; p != start->prev; p = p->next) {
-            if (p == &msg->fields)
-                continue;
-
-            f = mrp_list_entry(p, typeof(*f), hook);
-
-            if (f->tag != tag)
-                continue;
-
-            if (f->type != type)
-                goto out;
-
-            switch (type) {
-                HANDLE_TYPE(STRING, str);
-                HANDLE_TYPE(BOOL  , bln);
-                HANDLE_TYPE(UINT8 , u8 );
-                HANDLE_TYPE(SINT8 , s8 );
-                HANDLE_TYPE(UINT16, u16);
-                HANDLE_TYPE(SINT16, s16);
-                HANDLE_TYPE(UINT32, u32);
-                HANDLE_TYPE(SINT32, s32);
-                HANDLE_TYPE(UINT64, u64);
-                HANDLE_TYPE(SINT64, s64);
-                HANDLE_TYPE(DOUBLE, dbl);
-            default:
-                if (type & MRP_MSG_FIELD_ARRAY) {
-                    switch (type & ~MRP_MSG_FIELD_ARRAY) {
-                        HANDLE_ARRAY(STRING, astr);
-                        HANDLE_ARRAY(BOOL  , abln);
-                        HANDLE_ARRAY(UINT8 , au8 );
-                        HANDLE_ARRAY(SINT8 , as8 );
-                        HANDLE_ARRAY(UINT16, au16);
-                        HANDLE_ARRAY(SINT16, as16);
-                        HANDLE_ARRAY(UINT32, au32);
-                        HANDLE_ARRAY(SINT32, as32);
-                        HANDLE_ARRAY(UINT64, au64);
-                        HANDLE_ARRAY(SINT64, as64);
-                        HANDLE_ARRAY(DOUBLE, adbl);
-                    default:
-                        goto out;
-
-                    }
-                }
-                else
-                    goto out;
-            }
-
-            start = p->next;
-            found = TRUE;
-            break;
-        }
-
-        if (!found)
-            break;
-    }
-
- out:
-    va_end(ap);
-
-    if (found)
-        *it = start;
-
-    return found;
-
-#undef HANDLE_TYPE
-#undef HANDLE_ARRAY
-
-}
-
-
 static const char *field_type_name(uint16_t type)
 {
 #define BASIC(t, n) [MRP_MSG_FIELD_##t] = n
index 7860197..078610c 100644 (file)
@@ -209,7 +209,7 @@ int mrp_msg_set(mrp_msg_t *msg, uint16_t tag, ...);
 int mrp_msg_iterate(mrp_msg_t *msg, void **it, uint16_t *tagp,
                     uint16_t *typep, mrp_msg_value_t *valp, size_t *sizep);
 
-/** Iterate through the matching fields of a message. You should not delete
+/** Iterate through the matching fields of a message. You should not  delete
  * any of the fields while iterating through the message. */
 int mrp_msg_iterate_matching(mrp_msg_t *msg, void **it, uint16_t *tagp,
                              uint16_t *typep, mrp_msg_value_t *valp,
@@ -221,9 +221,6 @@ mrp_msg_field_t *mrp_msg_find(mrp_msg_t *msg, uint16_t tag);
 /** Get the given fields (with matching tags and types) from the message. */
 int mrp_msg_get(mrp_msg_t *msg, ...) MRP_NULLTERM;
 
-/** Iterate through the message getting the given fields. */
-int mrp_msg_iterate_get(mrp_msg_t *msg, void **it, ...);
-
 /** Dump a message. */
 int mrp_msg_dump(mrp_msg_t *msg, FILE *fp);
 
index c307c13..a6bf2f8 100644 (file)
@@ -99,12 +99,6 @@ typedef struct {
 } mrp_plugin_arg_t;
 
 
-/** Macro for declaring a plugin argument table. */
-#define MRP_PLUGIN_ARGUMENTS(table, ...)     \
-    static mrp_plugin_arg_t table[] =        \
-        __VA_ARGS__                          \
-
-
 /** Convenience macros for setting up argument tables with type and defaults. */
 #define MRP_PLUGIN_ARG_STRING(name, defval)                                \
     { key: name, type: MRP_PLUGIN_ARG_TYPE_STRING, { str: defval } }
index 8ced359..0c6316e 100644 (file)
@@ -207,22 +207,15 @@ void db_cmd_cb(mrp_console_t *c, void *user_data, int argc, char **argv)
         p += l;
         n -= l;
 
-        if ((tx = mqi_begin_transaction()) == MQI_HANDLE_INVALID)
-            mrp_console_printf(c, "failed to create DB transaction\n");
+        tx = mqi_begin_transaction();
         r = mql_exec_string(mql_result_string, buf);
 
-        if (!mql_result_is_success(r)) {
+        if (!mql_result_is_success(r))
             mrp_console_printf(c, "failed to execute DB command '%s'\n",
                                buf);
-        }
-        else {
+        else
             mrp_console_printf(c, "DB command executed OK\n");
-            mrp_console_printf(c, "%s\n", mql_result_string_get(r));
-        }
-
-        mql_result_free(r);
-        if (mqi_commit_transaction(tx) < 0)
-            mrp_console_printf(c, "failed to commit DB transaction\n");
+        mqi_commit_transaction(tx);
     }
 }