[git] Assuan - branch, master, updated. libassuan-2.0.1-27-g1a55322

by Werner Koch cvs at cvs.gnupg.org
Thu Feb 24 10:52:22 CET 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPC library used by GnuPG".

The branch, master has been updated
       via  1a5532257ff92c76e6fea407496b5f95356fc061 (commit)
       via  97eb75719c40ea584aa8745638a8496154fbf418 (commit)
      from  556009514f59fd76bf657a67cd3772b3603ab54a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1a5532257ff92c76e6fea407496b5f95356fc061
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Feb 24 10:28:38 2011 +0100

    Add ChangeLog entry for last patch

diff --git a/AUTHORS b/AUTHORS
index 0415cec..790a024 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,9 +15,12 @@ Neal H. Walfield  <neal at g10code.de>
 Marcus Brinkmann  <marcus at g10code.de>
  - Shared library version, bug fixes.
 
-g10 Code GmbH   <info at g10code.com> 
+g10 Code GmbH   <info at g10code.com>
  - all work indicated by mail addresses in ChangeLogs
 
+Ben Kibbey  <bjk at luxsci.net>  Assigns Past and Future Changes For GnuPG.
+ - Fixes and new features
+
 
 Libassuan was orginally part of NewPG, a temporary fork of GnuPG, and
 later split of into a separate library.
@@ -32,4 +35,3 @@ later split of into a separate library.
  This file is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
diff --git a/NEWS b/NEWS
index 2affd80..e2b1e0d 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ Noteworthy changes in version 2.0.2
  ASSUAN_NO_LOGGING        NEW.
  assuan_system_hooks_t	  CHANGED: Added socket and connect members.
  ASSUAN_SYSTEM_HOOKS_VERSION  CHANGED: Bumped to 2.
+ assuan_register_pre_cmd_notify  NEW.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
@@ -246,7 +247,7 @@ Noteworthy changes in version 0.9.0 (2006-09-14)
    printing of the full data, a new environment variable
    ASSUAN_FULL_LOGGING may be set to any value.
 
- * Removed the assuan_domain_* functions. 
+ * Removed the assuan_domain_* functions.
 
  * New functions assuan_pipe_connect_ext and assuan_socket_connect_ext
    to allow connections on a socketpair and to pass descriptors.
@@ -321,7 +322,7 @@ Noteworthy changes in version 0.6.2 (2003-12-18)
    assuan_get_assuan_log_context is not anymore declared as user
    overridable.
 
- * Documentation cleanups. 
+ * Documentation cleanups.
 
 Noteworthy changes in version 0.6.1 (2003-11-17)
 ------------------------------------------------
@@ -338,7 +339,7 @@ Noteworthy changes in version 0.6.0 (2003-08-06)
  * Initial release as a standalone library.
 
 
- Copyright 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+ Copyright 2003, 2004, 2006, 2007, 2011 Free Software Foundation, Inc.
 
  This file is free software; as a special exception the author gives
  unlimited permission to copy and/or distribute it, with or without
diff --git a/src/ChangeLog b/src/ChangeLog
index 46bbe1f..c34af0c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-24  Ben Kibbey  <bjk at luxsci.net>
+
+	* assuan-handler.c (assuan_register_pre_cmd_notify): New callback.
+	* assuan.h (assuan_command_t): Register command object.
+	(pre_cmd_notify_fnc): New prototype.
+
 2011-02-03  Marcus Brinkmann  <marcus at g10code.com>
 
 	* assuan-socket.c (_assuan_sock_new): Call _assuan_socket instead
@@ -37,7 +43,7 @@
 	(_assuan_system_hooks): Add __assuan_socketm, __assuan_connect.
 	* system-w32ce.c (__assuan_socket, __assuan_connect): New functions.
 	(_assuan_system_hooks): Add __assuan_socketm, __assuan_connect.
-	
+
 2010-12-20  Werner Koch  <wk at g10code.com>
 
 	* gpgcedev.c (pipeimpl_new): Check malloc and CreateEvent return

commit 97eb75719c40ea584aa8745638a8496154fbf418
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Sat Feb 5 22:34:24 2011 -0500

    assuan_register_pre_cmd_notify().

diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index 88863eb..da2a9d7 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -58,14 +58,6 @@
 #define _assuan_error(ctx, errcode) gpg_err_make ((ctx)->err_source, errcode)
 
 
-struct cmdtbl_s
-{
-  const char *name;
-  assuan_handler_t handler;
-  const char *helpstr;
-};
-
-
 
 /* The context we use with most functions. */
 struct assuan_context_s
@@ -196,7 +188,7 @@ struct assuan_context_s
   gpg_error_t (*accept_handler)(assuan_context_t);
   void (*finish_handler)(assuan_context_t);
 
-  struct cmdtbl_s *cmdtbl;
+  assuan_command_t cmdtbl;
   size_t cmdtbl_used; /* used entries */
   size_t cmdtbl_size; /* allocated size of table */
   
@@ -212,6 +204,9 @@ struct assuan_context_s
   assuan_handler_t input_notify_fnc;
   assuan_handler_t output_notify_fnc;
 
+  /* This function is called right before a command handler is called. */
+  gpg_error_t (*pre_cmd_notify_fnc)(assuan_context_t, assuan_command_t);
+
   /* This function is called right after a command has been processed.
      It may be used to command related cleanup.  */
   void (*post_cmd_notify_fnc)(assuan_context_t, gpg_error_t);
diff --git a/src/assuan-handler.c b/src/assuan-handler.c
index c19117f..5016fcb 100644
--- a/src/assuan-handler.c
+++ b/src/assuan-handler.c
@@ -400,7 +400,7 @@ assuan_register_command (assuan_context_t ctx, const char *cmd_name,
     }
   else if (ctx->cmdtbl_used >= ctx->cmdtbl_size)
     {
-      struct cmdtbl_s *x;
+      struct _assuan_command_s *x;
 
       x = _assuan_realloc (ctx, ctx->cmdtbl, (ctx->cmdtbl_size+10) * sizeof *x);
       if (!x)
@@ -427,6 +427,17 @@ assuan_get_command_name (assuan_context_t ctx)
 }
 
 gpg_error_t
+assuan_register_pre_cmd_notify (assuan_context_t ctx,
+                                 gpg_error_t (*fnc)(assuan_context_t,
+				   assuan_command_t))
+{
+  if (!ctx)
+    return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE);
+  ctx->pre_cmd_notify_fnc = fnc;
+  return 0;
+}
+
+gpg_error_t
 assuan_register_post_cmd_notify (assuan_context_t ctx,
                                  void (*fnc)(assuan_context_t, gpg_error_t))
 {
@@ -590,6 +601,13 @@ dispatch_command (assuan_context_t ctx, char *line, int linelen)
   line += shift;
   linelen -= shift;
 
+  if (ctx->pre_cmd_notify_fnc) {
+    err = ctx->pre_cmd_notify_fnc(ctx, &ctx->cmdtbl[i]);
+
+    if (err)
+      return PROCESS_DONE(ctx, err);
+  }
+
 /*    fprintf (stderr, "DBG-assuan: processing %s `%s'\n", s, line); */
   ctx->current_cmd_name = ctx->cmdtbl[i].name;
   err = ctx->cmdtbl[i].handler (ctx, line);
diff --git a/src/assuan.h.in b/src/assuan.h.in
index 018d5a1..630aefd 100644
--- a/src/assuan.h.in
+++ b/src/assuan.h.in
@@ -273,11 +273,22 @@ void assuan_set_log_stream (assuan_context_t ctx, FILE *fp);
 
 typedef gpg_error_t (*assuan_handler_t) (assuan_context_t, char *);
 
+struct _assuan_command_s
+{
+  const char *name;
+  assuan_handler_t handler;
+  const char *helpstr;
+};
+
+typedef struct _assuan_command_s *assuan_command_t;
+
 /*-- assuan-handler.c --*/
 gpg_error_t assuan_register_command (assuan_context_t ctx,
 				     const char *cmd_string,
 				     assuan_handler_t handler,
                                      const char *help_string);
+gpg_error_t assuan_register_pre_cmd_notify (assuan_context_t ctx,
+					     gpg_error_t (*fnc)(assuan_context_t, assuan_command_t));
 gpg_error_t assuan_register_post_cmd_notify (assuan_context_t ctx,
 					     void (*fnc)(assuan_context_t,
                                                          gpg_error_t));
diff --git a/src/libassuan.def b/src/libassuan.def
index a2e7b61..575966d 100644
--- a/src/libassuan.def
+++ b/src/libassuan.def
@@ -103,6 +103,7 @@ EXPORTS
     _assuan_w32ce_finish_pipe           @82
     __assuan_socket			@83
     __assuan_connect			@84
+    assuan_register_pre_cmd_notify	@85
 
 ; END
 
diff --git a/src/libassuan.vers b/src/libassuan.vers
index b14a940..261e0e7 100644
--- a/src/libassuan.vers
+++ b/src/libassuan.vers
@@ -24,6 +24,7 @@ LIBASSUAN_1.1 {
   global:
     __assuan_socket;
     __assuan_connect;
+    assuan_register_pre_cmd_notify;
 };
 
 LIBASSUAN_1.0 {

-----------------------------------------------------------------------

Summary of changes:
 AUTHORS              |    6 ++++--
 NEWS                 |    7 ++++---
 src/ChangeLog        |    8 +++++++-
 src/assuan-defs.h    |   13 ++++---------
 src/assuan-handler.c |   20 +++++++++++++++++++-
 src/assuan.h.in      |   11 +++++++++++
 src/libassuan.def    |    1 +
 src/libassuan.vers   |    1 +
 8 files changed, 51 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
IPC library used by GnuPG
http://git.gnupg.org




More information about the Gnupg-commits mailing list