[Pkg-gnupg-commit] [libassuan] 19/437: * assuan-handler.c (assuan_register_input_notify): New. (assuan_register_output_notify): New.
Eric Dorland
eric at moszumanska.debian.org
Fri May 22 05:33:17 UTC 2015
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libassuan.
commit 47e100a5fe010c4dad695d15f6941f5402565810
Author: Werner Koch <wk at gnupg.org>
Date: Tue Nov 27 17:39:09 2001 +0000
* assuan-handler.c (assuan_register_input_notify): New.
(assuan_register_output_notify): New.
---
src/ChangeLog | 5 +++++
src/assuan-defs.h | 4 +++-
src/assuan-handler.c | 24 ++++++++++++++++++++++++
src/assuan.h | 4 ++++
4 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index d1cc560..dc7403a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2001-11-27 Werner Koch <wk at gnupg.org>
+
+ * assuan-handler.c (assuan_register_input_notify): New.
+ (assuan_register_output_notify): New.
+
2001-11-26 Werner Koch <wk at gnupg.org>
* assuan.h: Added more status codes.
diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index 2bbc9b8..2b64bf1 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -70,8 +70,10 @@ struct assuan_context_s {
size_t cmdtbl_size; /* allocated size of table */
void (*bye_notify_fnc)(ASSUAN_CONTEXT);
- void (*cancel_notify_fnc)(ASSUAN_CONTEXT);
void (*reset_notify_fnc)(ASSUAN_CONTEXT);
+ void (*cancel_notify_fnc)(ASSUAN_CONTEXT);
+ void (*input_notify_fnc)(ASSUAN_CONTEXT, const char *);
+ void (*output_notify_fnc)(ASSUAN_CONTEXT, const char *);
int input_fd; /* set by INPUT command */
diff --git a/src/assuan-handler.c b/src/assuan-handler.c
index 524a8cf..13f1f9d 100644
--- a/src/assuan-handler.c
+++ b/src/assuan-handler.c
@@ -107,6 +107,8 @@ std_handler_input (ASSUAN_CONTEXT ctx, char *line)
if (rc)
return rc;
ctx->input_fd = fd;
+ if (ctx->input_notify_fnc)
+ ctx->input_notify_fnc (ctx, line);
return 0;
}
@@ -120,6 +122,8 @@ std_handler_output (ASSUAN_CONTEXT ctx, char *line)
if (rc)
return rc;
ctx->output_fd = fd;
+ if (ctx->output_notify_fnc)
+ ctx->output_notify_fnc (ctx, line);
return 0;
}
@@ -253,6 +257,26 @@ assuan_register_cancel_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT))
return 0;
}
+int
+assuan_register_input_notify (ASSUAN_CONTEXT ctx,
+ void (*fnc)(ASSUAN_CONTEXT, const char *))
+{
+ if (!ctx)
+ return ASSUAN_Invalid_Value;
+ ctx->input_notify_fnc = fnc;
+ return 0;
+}
+
+int
+assuan_register_output_notify (ASSUAN_CONTEXT ctx,
+ void (*fnc)(ASSUAN_CONTEXT, const char *))
+{
+ if (!ctx)
+ return ASSUAN_Invalid_Value;
+ ctx->output_notify_fnc = fnc;
+ return 0;
+}
+
/* Helper to register the standards commands */
int
diff --git a/src/assuan.h b/src/assuan.h
index 66f546a..10eb3a5 100644
--- a/src/assuan.h
+++ b/src/assuan.h
@@ -104,6 +104,10 @@ int assuan_register_reset_notify (ASSUAN_CONTEXT ctx,
void (*fnc)(ASSUAN_CONTEXT));
int assuan_register_cancel_notify (ASSUAN_CONTEXT ctx,
void (*fnc)(ASSUAN_CONTEXT));
+int assuan_register_input_notify (ASSUAN_CONTEXT ctx,
+ void (*fnc)(ASSUAN_CONTEXT, const char *));
+int assuan_register_output_notify (ASSUAN_CONTEXT ctx,
+ void (*fnc)(ASSUAN_CONTEXT, const char *));
int assuan_process (ASSUAN_CONTEXT ctx);
int assuan_process_next (ASSUAN_CONTEXT ctx);
int assuan_get_active_fds (ASSUAN_CONTEXT ctx, int what,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libassuan.git
More information about the Pkg-gnupg-commit
mailing list