From 781d3454c27e898ad58a58ec724161d71faee77c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 3 Apr 2009 20:30:54 +0000 Subject: [PATCH] confdb.h: continue API changes: const+size_t * include/corosync/confdb.h (confdb_object_create_notify_fn_t): (confdb_object_delete_notify_fn_t): * tools/corosync-objctl.c (tail_object_created, tail_object_deleted): git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2001 fd59a12c-fef9-0310-b244-a6a79926bd2f --- include/corosync/confdb.h | 8 ++++---- tools/corosync-objctl.c | 27 ++++++++++++++------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/include/corosync/confdb.h b/include/corosync/confdb.h index 19f67886..f3e24fa6 100644 --- a/include/corosync/confdb.h +++ b/include/corosync/confdb.h @@ -73,14 +73,14 @@ typedef void (*confdb_object_create_notify_fn_t) ( confdb_handle_t handle, hdb_handle_t parent_object_handle, hdb_handle_t object_handle, - uint8_t *name_pt, - int name_len); + const void *name_pt, + size_t name_len); typedef void (*confdb_object_delete_notify_fn_t) ( confdb_handle_t handle, hdb_handle_t parent_object_handle, - uint8_t *name_pt, - int name_len); + const void *name_pt, + size_t name_len); typedef struct { confdb_object_create_notify_fn_t confdb_object_create_change_notify_fn; diff --git a/tools/corosync-objctl.c b/tools/corosync-objctl.c index a544538d..70af9f17 100644 --- a/tools/corosync-objctl.c +++ b/tools/corosync-objctl.c @@ -82,13 +82,13 @@ static void tail_key_changed(confdb_handle_t handle, static void tail_object_created(confdb_handle_t handle, hdb_handle_t parent_object_handle, hdb_handle_t object_handle, - uint8_t *name_pt, - int name_len); + const void *name_pt, + size_t name_len); static void tail_object_deleted(confdb_handle_t handle, hdb_handle_t parent_object_handle, - uint8_t *name_pt, - int name_len); + const void *name_pt, + size_t name_len); static confdb_callbacks_t callbacks = { .confdb_key_change_notify_fn = tail_key_changed, @@ -429,21 +429,22 @@ static void tail_key_changed(confdb_handle_t handle, static void tail_object_created(confdb_handle_t handle, hdb_handle_t parent_object_handle, hdb_handle_t object_handle, - uint8_t *name_pt, - int name_len) + const void *name_pt, + size_t name_len) { - name_pt[name_len] = '\0'; - printf("object_created> %s\n", name_pt); + fputs("object_created>", stdout); + print_name(stdout, name_pt, name_len); + fputs("\n", stdout); } static void tail_object_deleted(confdb_handle_t handle, hdb_handle_t parent_object_handle, - uint8_t *name_pt, - int name_len) + const void *name_pt, + size_t name_len) { - name_pt[name_len] = '\0'; - - printf("object_deleted> %s\n", name_pt); + fputs("object_deleted>", stdout); + print_name(stdout, name_pt, name_len); + fputs("\n", stdout); } static void listen_for_object_changes(confdb_handle_t handle)