2003-01-30 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Thu, 30 Jan 2003 23:02:14 +0000 (23:02 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Thu, 30 Jan 2003 23:02:14 +0000 (23:02 +0000)
* types.h: File removed.
* Makefile.am (libgpgme_la_SOURCES): Remove types.h.
* io.h (struct spawn_fd_item_s): Do not include "types.h".
* key.h: Likewise.
* context.h: Likewise.
* cengine-gpgsm.h: Likewise.
* engine.h: Include "gpgme.h" instead "types.h".  Add prototypes
for EngineStatusHandler, EngineColonLineHandler and
EngineCommandHandler.
(_gpgme_engine_set_status_handler): Change parameter type from
GpgmeStatusHandler to EngineStatusHandler.
(_gpgme_engine_set_command_handler): Change parameter type from
GpgmeCommandHandler to EngineCommandHandler.
(_gpgme_engine_set_colon_line_handler): Change parameter type from
GpgmeColonLineHandler to EngineColonLineHandler.
* engine-backend.h: Include "engine.h" instead "types.h".
(struct engine_ops): Change Gpgme*Handler parameters in members
set_command_handler, set_colon_line_handler and set_status_handler
to Engine*Handler.
* engine.c (_gpgme_engine_set_status_handler): Change parameter
type from GpgmeStatusHandler to EngineStatusHandler.
(_gpgme_engine_set_command_handler): Change parameter type from
GpgmeCommandHandler to EngineCommandHandler.
(_gpgme_engine_set_colon_line_handler): Change parameter type from
GpgmeColonLineHandler to EngineColonLineHandler.
* rungpg.c (struct gpg_object_s): Change type of member status.fnc
from GpgmeStatusHandler to EngineStatusHandler.  Change type of
member colon.fnc from GpgmeColonLineHandler to
EngineColonLineHandler.  Change type of member cmd.fnc from
GpgmeCommandHandler to EngineCommandHandler.
* engine-gpgsm.c (struct gpgsm_object_s): Likewise.
* rungpg.c (gpg_set_status_handler): Change parameter type from
GpgmeStatusHandler to EngineStatusHandler.
* engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
(assuan_simple_command): Likewise.
* rungpg.c (gpg_set_colon_line_handler): Change parameter type
from GpgmeColonLineHandler to EngineColonLineHandler.
* engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
* rungpg.c (gpg_set_command_handler): Change parameter type from
GpgmeCommandHandler to EngineCommandHandler.

gpgme/ChangeLog
gpgme/Makefile.am
gpgme/context.h
gpgme/engine-backend.h
gpgme/engine-gpgsm.c
gpgme/engine.c
gpgme/engine.h
gpgme/io.h
gpgme/key.h
gpgme/rungpg.c
gpgme/types.h [deleted file]

index 2a7e61edd515219db32ca4cae5aeb59f27f1e36f..5d1abe950e099aac113c55ced4636c03596a42dc 100644 (file)
@@ -1,5 +1,46 @@
 2003-01-30  Marcus Brinkmann  <marcus@g10code.de>
 
+       * types.h: File removed.
+       * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
+       * io.h (struct spawn_fd_item_s): Do not include "types.h".
+       * key.h: Likewise.
+       * context.h: Likewise.
+       * cengine-gpgsm.h: Likewise.
+       * engine.h: Include "gpgme.h" instead "types.h".  Add prototypes
+       for EngineStatusHandler, EngineColonLineHandler and
+       EngineCommandHandler.
+       (_gpgme_engine_set_status_handler): Change parameter type from
+       GpgmeStatusHandler to EngineStatusHandler.
+       (_gpgme_engine_set_command_handler): Change parameter type from
+       GpgmeCommandHandler to EngineCommandHandler.
+       (_gpgme_engine_set_colon_line_handler): Change parameter type from
+       GpgmeColonLineHandler to EngineColonLineHandler.
+       * engine-backend.h: Include "engine.h" instead "types.h".
+       (struct engine_ops): Change Gpgme*Handler parameters in members
+       set_command_handler, set_colon_line_handler and set_status_handler
+       to Engine*Handler.
+       * engine.c (_gpgme_engine_set_status_handler): Change parameter
+       type from GpgmeStatusHandler to EngineStatusHandler.
+       (_gpgme_engine_set_command_handler): Change parameter type from
+       GpgmeCommandHandler to EngineCommandHandler.
+       (_gpgme_engine_set_colon_line_handler): Change parameter type from
+       GpgmeColonLineHandler to EngineColonLineHandler.
+       * rungpg.c (struct gpg_object_s): Change type of member status.fnc
+       from GpgmeStatusHandler to EngineStatusHandler.  Change type of
+       member colon.fnc from GpgmeColonLineHandler to
+       EngineColonLineHandler.  Change type of member cmd.fnc from
+       GpgmeCommandHandler to EngineCommandHandler.
+       * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
+       * rungpg.c (gpg_set_status_handler): Change parameter type from
+       GpgmeStatusHandler to EngineStatusHandler.
+       * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
+       (assuan_simple_command): Likewise.
+       * rungpg.c (gpg_set_colon_line_handler): Change parameter type
+       from GpgmeColonLineHandler to EngineColonLineHandler.
+       * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
+       * rungpg.c (gpg_set_command_handler): Change parameter type from
+       GpgmeCommandHandler to EngineCommandHandler.
+
        * engine-gpgsm.c (status_handler): Do not close status fd at end
        of function.
 
index 12d05f1b98b90fdb9ffe0e92cc2f2a7b76a3b3f2..364897f1c42f8063c6719872251c09e35a0107d6 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright (C) 2000 Werner Koch (dd9jn)
-# Copyright (C) 2001, 2002 g10 Code GmbH
+# Copyright (C) 2001, 2002, 2003 g10 Code GmbH
 # 
 # This file is part of GPGME.
 # 
@@ -69,7 +69,7 @@ gpgsm_components =
 endif
 
 libgpgme_la_SOURCES =                                                  \
-       gpgme.h types.h util.h conversion.c context.h ops.h             \
+       gpgme.h util.h conversion.c context.h ops.h                     \
        data.h data.c data-fd.c data-stream.c data-mem.c data-user.c    \
        data-compat.c                                                   \
        recipient.c signers.c                                           \
index 26467cab6256ab26eca7e4ac2e2992c1b4128796..a46a29280a2d3abd5352e65a55023c31763fa300 100644 (file)
@@ -22,7 +22,6 @@
 #define CONTEXT_H
 
 #include "gpgme.h"
-#include "types.h"
 #include "engine.h"
 #include "wait.h"
 
index c97297d7b6dabfda735647a21871deeac17ea926..2a832b3caa2fea8e030867723eed4969f375fbbb 100644 (file)
 #ifndef ENGINE_BACKEND_H
 #define ENGINE_BACKEND_H
 
-#include "types.h"
-
+#include "engine.h"
 
 /* FIXME: Correct check?  */
 #ifdef GPGSM_PATH
 #define ENABLE_GPGSM 1
 #endif
 
-
 struct engine_ops
 {
   /* Static functions.  */
@@ -39,12 +37,12 @@ struct engine_ops
 
   /* Member functions.  */
   void (*release) (void *engine);
-  void (*set_status_handler) (void *engine, GpgmeStatusHandler fnc,
+  void (*set_status_handler) (void *engine, EngineStatusHandler fnc,
                              void *fnc_value);
-  GpgmeError (*set_command_handler) (void *engine, GpgmeCommandHandler fnc,
+  GpgmeError (*set_command_handler) (void *engine, EngineCommandHandler fnc,
                                     void *fnc_value, GpgmeData data);
   GpgmeError (*set_colon_line_handler) (void *engine,
-                                       GpgmeColonLineHandler fnc,
+                                       EngineColonLineHandler fnc,
                                        void *fnc_value);
   GpgmeError (*set_verbosity) (void *engine, int verbosity);
   GpgmeError (*decrypt) (void *engine, GpgmeData ciph, GpgmeData plain);
index 586bc2c8f3603103b3128cfbe77a21100f1664e9..475d917fad63cd76b4e2d307bad995f7660f12be 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "gpgme.h"
 #include "util.h"
-#include "types.h"
 #include "ops.h"
 #include "wait.h"
 #include "io.h"
@@ -77,13 +76,13 @@ struct gpgsm_object_s
 
   struct
   {
-    GpgmeStatusHandler fnc;
+    EngineStatusHandler fnc;
     void *fnc_value;
   } status;
 
   struct
   {
-    GpgmeColonLineHandler fnc;
+    EngineColonLineHandler fnc;
     void *fnc_value;
     struct
     {
@@ -549,7 +548,7 @@ gpgsm_new (void **engine)
 static GpgmeStatusCode parse_status (const char *name);
 
 static GpgmeError
-gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, GpgmeStatusHandler status_fnc,
+gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, EngineStatusHandler status_fnc,
                             void *status_fnc_value)
 {
   AssuanError err;
@@ -1391,7 +1390,7 @@ gpgsm_verify (void *engine, GpgmeData sig, GpgmeData signed_text,
 
 
 static void
-gpgsm_set_status_handler (void *engine, GpgmeStatusHandler fnc,
+gpgsm_set_status_handler (void *engine, EngineStatusHandler fnc,
                          void *fnc_value) 
 {
   GpgsmObject gpgsm = engine;
@@ -1402,7 +1401,7 @@ gpgsm_set_status_handler (void *engine, GpgmeStatusHandler fnc,
 
 
 static GpgmeError
-gpgsm_set_colon_line_handler (void *engine, GpgmeColonLineHandler fnc,
+gpgsm_set_colon_line_handler (void *engine, EngineColonLineHandler fnc,
                              void *fnc_value) 
 {
   GpgsmObject gpgsm = engine;
index fdadef7c9431d2f38b7fddb8e67ca8817aeb72b2..f5891b9ac9d39ebed7cc2cb94a2a1c1b3e798304 100644 (file)
@@ -219,7 +219,7 @@ _gpgme_engine_set_verbosity (EngineObject engine, int verbosity)
 
 void
 _gpgme_engine_set_status_handler (EngineObject engine,
-                                 GpgmeStatusHandler fnc, void *fnc_value)
+                                 EngineStatusHandler fnc, void *fnc_value)
 {
   if (!engine)
     return;
@@ -231,7 +231,7 @@ _gpgme_engine_set_status_handler (EngineObject engine,
 
 GpgmeError
 _gpgme_engine_set_command_handler (EngineObject engine,
-                                  GpgmeCommandHandler fnc, void *fnc_value,
+                                  EngineCommandHandler fnc, void *fnc_value,
                                   GpgmeData linked_data)
 {
   if (!engine)
@@ -245,7 +245,7 @@ _gpgme_engine_set_command_handler (EngineObject engine,
 }
 
 GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine,
-                                                GpgmeColonLineHandler fnc,
+                                                EngineColonLineHandler fnc,
                                                 void *fnc_value)
 {
   if (!engine)
index a56ec85f564f9baa3b78c026ccafdfaa3da72a75..25870ba1907b3ca4b53894cd81d87d43f351c69e 100644 (file)
 #ifndef ENGINE_H
 #define ENGINE_H
 
-#include "types.h"
+#include "gpgme.h"
  
 struct engine_object_s;
 typedef struct engine_object_s *EngineObject;
 
+typedef GpgmeError (*EngineStatusHandler) (void *priv, GpgmeStatusCode code,
+                                          char *args);
+typedef GpgmeError (*EngineColonLineHandler) (void *priv, char *line);
+typedef GpgmeError (*EngineCommandHandler) (void *priv, GpgmeStatusCode code,
+                                           const char *keyword,
+                                           const char **result);
+
 GpgmeError _gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine);
 void _gpgme_engine_release (EngineObject engine);
 void _gpgme_engine_set_status_handler (EngineObject engine,
-                                      GpgmeStatusHandler fnc,
+                                      EngineStatusHandler fnc,
                                       void *fnc_value);
 GpgmeError _gpgme_engine_set_command_handler (EngineObject engine,
-                                             GpgmeCommandHandler fnc,
+                                             EngineCommandHandler fnc,
                                              void *fnc_value,
                                              GpgmeData data);
 GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine,
-                                                GpgmeColonLineHandler fnc,
+                                                EngineColonLineHandler fnc,
                                                 void *fnc_value);
 void _gpgme_engine_set_verbosity (EngineObject engine, int verbosity);
 GpgmeError _gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph,
index 68d20fd9b3d9752c9c19dfb0211527cff7b9424b..cb09969f2e4f2ea14fd70166a170c2824774f1c1 100644 (file)
@@ -1,29 +1,26 @@
 /* io.h - Interface to the I/O functions.
- *     Copyright (C) 2000 Werner Koch (dd9jn)
- *      Copyright (C) 2001, 2002 g10 Code GmbH
- *
- * This file is part of GPGME.
- *
- * GPGME is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GPGME is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
+   Copyright (C) 2000 Werner Koch (dd9jn)
+   Copyright (C) 2001, 2002, 2003 g10 Code GmbH
+
+   This file is part of GPGME.
+   GPGME is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   GPGME is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+   You should have received a copy of the GNU General Public License
+   along with GPGME; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifndef IO_H
 #define IO_H
 
-#include "types.h"
-
 /* A single file descriptor passed to spawn.  For child fds, dup_to
    specifies the fd it should become in the child.  */
 struct spawn_fd_item_s
index f2c4025a701f1fd7ff47922caca6c7a8cb6f2d00..c9e60416bbedd75d738e57f256c2f86b5fd55bca 100644 (file)
@@ -1,6 +1,6 @@
 /* key.h - Key handling interface.
    Copyright (C) 2000 Werner Koch (dd9jn)
-   Copyright (C) 2001, 2002 g10 Code GmbH
+   Copyright (C) 2001, 2002, 2003 g10 Code GmbH
 
    This file is part of GPGME.
  
@@ -22,7 +22,6 @@
 #define KEY_H
 
 #include <time.h>
-#include "types.h"
 #include "context.h"
 
 \f
index 2d5a1a7a583835b53a8166aaccd1d7c79e9bbaa6..74723e6a702817750e47cdf9db5ec0ee4005cb79 100644 (file)
@@ -83,7 +83,7 @@ struct gpg_object_s
     char *buffer;
     size_t readpos;
     int eof;
-    GpgmeStatusHandler fnc;
+    EngineStatusHandler fnc;
     void *fnc_value;
     void *tag;
   } status;
@@ -96,7 +96,7 @@ struct gpg_object_s
     char *buffer;
     size_t readpos;
     int eof;
-    GpgmeColonLineHandler fnc;  /* this indicate use of this structrue */
+    EngineColonLineHandler fnc;  /* this indicate use of this structrue */
     void *fnc_value;
     void *tag;
   } colon;
@@ -113,7 +113,7 @@ struct gpg_object_s
     GpgmeData cb_data;   /* hack to get init the above idx later */
     GpgmeStatusCode code;  /* last code */
     char *keyword;       /* what has been requested (malloced) */
-    GpgmeCommandHandler fnc; 
+    EngineCommandHandler fnc; 
     void *fnc_value;
     /* The kludges never end.  This is used to couple command handlers
        with output data in edit key mode.  */
@@ -408,7 +408,7 @@ gpg_set_verbosity (void *engine, int verbosity)
 /* Note, that the status_handler is allowed to modifiy the args
    value.  */
 static void
-gpg_set_status_handler (void *engine, GpgmeStatusHandler fnc, void *fnc_value)
+gpg_set_status_handler (void *engine, EngineStatusHandler fnc, void *fnc_value)
 {
   GpgObject gpg = engine;
 
@@ -418,7 +418,7 @@ gpg_set_status_handler (void *engine, GpgmeStatusHandler fnc, void *fnc_value)
 
 /* Kludge to process --with-colon output.  */
 static GpgmeError
-gpg_set_colon_line_handler (void *engine, GpgmeColonLineHandler fnc,
+gpg_set_colon_line_handler (void *engine, EngineColonLineHandler fnc,
                            void *fnc_value)
 {
   GpgObject gpg = engine;
@@ -514,7 +514,7 @@ command_cb (void *opaque, char *buffer, size_t length, size_t *nread)
    match such a second call to a first call, the returned value from
    the first call is passed as keyword.  */
 static GpgmeError
-gpg_set_command_handler (void *engine, GpgmeCommandHandler fnc,
+gpg_set_command_handler (void *engine, EngineCommandHandler fnc,
                         void *fnc_value, GpgmeData linked_data)
 {
   GpgObject gpg = engine;
diff --git a/gpgme/types.h b/gpgme/types.h
deleted file mode 100644 (file)
index 8a36c47..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* types.h - Type definitions.
-   Copyright (C) 2000 Werner Koch (dd9jn)
-   Copyright (C) 2001, 2002, 2003 g10 Code GmbH
-   This file is part of GPGME.
-   GPGME is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-   GPGME is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-   You should have received a copy of the GNU General Public License
-   along with GPGME; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#ifndef TYPES_H
-#define TYPES_H
-
-#include "gpgme.h"
-
-/* Declaration of internal objects.  */
-
-typedef GpgmeError (*GpgmeStatusHandler) (GpgmeCtx, GpgmeStatusCode code,
-                                         char *args);
-typedef GpgmeError (*GpgmeColonLineHandler) (GpgmeCtx, char *line);
-typedef GpgmeError (*GpgmeCommandHandler) (void*, GpgmeStatusCode code,
-                                          const char *keyword, const char **result);
-
-
-#endif /* TYPES_H */