[git] GPGME - branch, master, updated. gpgme-1.6.0-309-gde7b67f

by Andre Heinecke cvs at cvs.gnupg.org
Thu Aug 25 11:42:06 CEST 2016


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 "GnuPG Made Easy".

The branch, master has been updated
       via  de7b67f9b2e6bd43a036fa0bcc6a8ca4f5b10986 (commit)
       via  abcd9a283ee8f81870622c8e1dbdc7aad38c0358 (commit)
       via  ece8b02a839d6fc566fea7b6e59fabff164f6cf5 (commit)
      from  9ee103957e4136337b92d238283f8ef30fd4a7c5 (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 de7b67f9b2e6bd43a036fa0bcc6a8ca4f5b10986
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Aug 25 10:46:17 2016 +0200

    Cpp: Change firstSeen / lastSeen return values
    
    * lang/cpp/src/tofuinfo.cpp,
    lang/cpp/src/tofuinfo.h (TofuInfo::firstSeen, TofuInfo::lastSeen):
    Change return values to unsigned long and update doc.

diff --git a/lang/cpp/src/tofuinfo.cpp b/lang/cpp/src/tofuinfo.cpp
index fe8f051..ade262b 100644
--- a/lang/cpp/src/tofuinfo.cpp
+++ b/lang/cpp/src/tofuinfo.cpp
@@ -123,12 +123,12 @@ unsigned short GpgME::TofuInfo::signCount() const
     return isNull() ? 0 : d->mInfo->signcount;
 }
 
-unsigned int GpgME::TofuInfo::firstSeen() const
+unsigned long GpgME::TofuInfo::firstSeen() const
 {
     return isNull() ? 0 : d->mInfo->firstseen;
 }
 
-unsigned int GpgME::TofuInfo::lastSeen() const
+unsigned long GpgME::TofuInfo::lastSeen() const
 {
     return isNull() ? 0 : d->mInfo->lastseen;
 }
diff --git a/lang/cpp/src/tofuinfo.h b/lang/cpp/src/tofuinfo.h
index 4835120..eb5dbcc 100644
--- a/lang/cpp/src/tofuinfo.h
+++ b/lang/cpp/src/tofuinfo.h
@@ -93,11 +93,11 @@ public:
     /* Number of signatures seen for this binding.  Capped at USHRT_MAX.  */
     unsigned short signCount() const;
 
-    /* Number of seconds since the first message was verified. */
-    unsigned int firstSeen() const;
+    /** Number of seconds since epoch when the first message was verified */
+    unsigned long firstSeen() const;
 
-    /* Number of seconds since the last message was verified. */
-    unsigned int lastSeen() const;
+    /** Number of seconds since epoch when the last message was verified */
+    unsigned long lastSeen() const;
 
     /* If non-NULL a human readable string summarizing the TOFU data. */
     const char *description() const;

commit abcd9a283ee8f81870622c8e1dbdc7aad38c0358
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Aug 25 10:45:24 2016 +0200

    Cpp: Add wrapper for gpgme_get_dirinfo
    
    * lang/cpp/src/context.cpp (dirInfo): New.
    * lang/cpp/src/global.h (dirInfo): New.

diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp
index 2619084..62cad20 100644
--- a/lang/cpp/src/context.cpp
+++ b/lang/cpp/src/context.cpp
@@ -1489,6 +1489,11 @@ GpgME::EngineInfo GpgME::engineInfo(GpgME::Protocol proto)
     return EngineInfo();
 }
 
+const char *GpgME::dirInfo(const char *what)
+{
+    return gpgme_get_dirinfo(what);
+}
+
 GpgME::Error GpgME::checkEngine(GpgME::Protocol proto)
 {
     const gpgme_protocol_t p = proto == CMS ? GPGME_PROTOCOL_CMS : GPGME_PROTOCOL_OpenPGP ;
diff --git a/lang/cpp/src/global.h b/lang/cpp/src/global.h
index fc01d1e..3f12323 100644
--- a/lang/cpp/src/global.h
+++ b/lang/cpp/src/global.h
@@ -81,6 +81,15 @@ typedef void (*IOCallback)(void *data, int fd);
 
 GPGMEPP_EXPORT EngineInfo engineInfo(Protocol proto);
 GPGMEPP_EXPORT EngineInfo engineInfo(Engine engine);
+/** Wrapper around gpgme_get_dirinfo. What can be:
+homedir, sysconfdir, bindir, libexecdir, libdir,
+datadir, localedir, agent-socket, agent-ssh-socket,
+dirmngr-socket, uiserver-socket, gpgconf-name, gpg-name,
+gpgsm-name, g13-name
+
+This may be extended in the future.
+*/
+GPGMEPP_EXPORT const char *dirInfo(const char *what);
 
 GPGMEPP_EXPORT Error checkEngine(Protocol proto);
 GPGMEPP_EXPORT Error checkEngine(Engine engine);

commit ece8b02a839d6fc566fea7b6e59fabff164f6cf5
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Aug 25 10:42:49 2016 +0200

    Cpp: Add support for spawn engine
    
    * lang/cpp/src/context.cpp (Context::spawn, Context::spawnAsync): New.
    * lang/cpp/src/context.h: Add prototypes.
    (SpawnFlags): New.
    * lang/cpp/src/global.h (SpawnEngine): Added.

diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp
index 4e66d3b..2619084 100644
--- a/lang/cpp/src/context.cpp
+++ b/lang/cpp/src/context.cpp
@@ -252,6 +252,15 @@ std::unique_ptr<Context> Context::createForEngine(Engine eng, Error *error)
             return std::unique_ptr<Context>();
         }
         break;
+    case SpawnEngine:
+        if (const gpgme_error_t err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_SPAWN)) {
+            gpgme_release(ctx);
+            if (error) {
+                *error = Error(err);
+            }
+            return std::unique_ptr<Context>();
+        }
+        break;
     default:
         if (error) {
             *error = Error::fromCode(GPG_ERR_INV_ARG);
@@ -1311,6 +1320,29 @@ Error Context::setPinentryMode(PinentryMode which)
     return Error(d->lasterr = gpgme_set_pinentry_mode(d->ctx, mode));
 }
 
+// Engine Spawn stuff
+Error Context::spawn(const char *file, const char *argv[],
+                     Data &input, Data &output, Data &err,
+                     SpawnFlags flags)
+{
+    return Error(d->lasterr = gpgme_op_spawn (d->ctx, file, argv,
+        input.impl() ? input.impl()->data : nullptr,
+        output.impl() ? output.impl()->data : nullptr,
+        err.impl() ? err.impl()->data : nullptr,
+        static_cast<int>(flags)));
+}
+
+Error Context::spawnAsync(const char *file, const char *argv[],
+                          Data &input, Data &output, Data &err,
+                          SpawnFlags flags)
+{
+    return Error(d->lasterr = gpgme_op_spawn_start (d->ctx, file, argv,
+        input.impl() ? input.impl()->data : nullptr,
+        output.impl() ? output.impl()->data : nullptr,
+        err.impl() ? err.impl()->data : nullptr,
+        static_cast<int>(flags)));
+}
+
 std::ostream &operator<<(std::ostream &os, Protocol proto)
 {
     os << "GpgME::Protocol(";
@@ -1345,6 +1377,9 @@ std::ostream &operator<<(std::ostream &os, Engine eng)
     case AssuanEngine:
         os << "AssuanEngine";
         break;
+    case SpawnEngine:
+        os << "SpawnEngine";
+        break;
     default:
     case UnknownEngine:
         os << "UnknownEngine";
@@ -1474,6 +1509,8 @@ static gpgme_protocol_t engine2protocol(const GpgME::Engine engine)
         return GPGME_PROTOCOL_ASSUAN;
     case GpgME::G13Engine:
         return GPGME_PROTOCOL_G13;
+    case GpgME::SpawnEngine:
+        return GPGME_PROTOCOL_SPAWN;
     case GpgME::UnknownEngine:
         ;
     }
diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h
index 6518d4c..f5e2b95 100644
--- a/lang/cpp/src/context.h
+++ b/lang/cpp/src/context.h
@@ -346,6 +346,34 @@ public:
     GpgME::Error createVFS(const char *containerFile, const std::vector<Key> &recipients);
     VfsMountResult mountVFS(const char *containerFile, const char *mountDir);
 
+    // Spawn Engine
+    enum SpawnFlags {
+        SpawnNone = 0,
+        SpawnDetached = 1,
+        SpawnAllowSetFg = 2
+    };
+    /** Spwan the process \a file with arguments \a argv.
+     *
+     *  If a data parameter is null the /dev/null will be
+     *  used. (Or other platform stuff).
+     *
+     * @param file The executable to start.
+     * @param argv list of arguments file should be argv[0].
+     * @param input The data to be sent through stdin.
+     * @param output The data to be recieve the stdout.
+     * @param err The data to recieve stderr.
+     * @param flags Additional flags.
+     *
+     * @returns An error or empty error.
+     */
+    GpgME::Error spawn(const char *file, const char *argv[],
+                       Data &input, Data &output, Data &err,
+                       SpawnFlags flags);
+    /** Async variant of spawn. Immediately returns after starting the
+     * process. */
+    GpgME::Error spawnAsync(const char *file, const char *argv[],
+                            Data &input, Data &output,
+                            Data &err, SpawnFlags flags);
     //
     //
     // Run Control
diff --git a/lang/cpp/src/global.h b/lang/cpp/src/global.h
index 508e1d7..fc01d1e 100644
--- a/lang/cpp/src/global.h
+++ b/lang/cpp/src/global.h
@@ -53,7 +53,7 @@ GPGMEPP_EXPORT Error initializeLibrary(int);
 
 enum Protocol { OpenPGP, CMS, UnknownProtocol };
 
-enum Engine { GpgEngine, GpgSMEngine, GpgConfEngine, UnknownEngine, AssuanEngine, G13Engine };
+enum Engine { GpgEngine, GpgSMEngine, GpgConfEngine, UnknownEngine, AssuanEngine, G13Engine, SpawnEngine };
 
 enum KeyListMode {
     Local = 0x1,

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

Summary of changes:
 lang/cpp/src/context.cpp  | 42 ++++++++++++++++++++++++++++++++++++++++++
 lang/cpp/src/context.h    | 28 ++++++++++++++++++++++++++++
 lang/cpp/src/global.h     | 11 ++++++++++-
 lang/cpp/src/tofuinfo.cpp |  4 ++--
 lang/cpp/src/tofuinfo.h   |  8 ++++----
 5 files changed, 86 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list