diff options
author | Andre Heinecke <[email protected]> | 2016-08-25 08:42:49 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2016-08-25 09:41:57 +0000 |
commit | ece8b02a839d6fc566fea7b6e59fabff164f6cf5 (patch) | |
tree | ae54aa2cfca996c0751ae31a887981a40711b9c8 /lang/cpp/src/context.h | |
parent | core: Add GPGME_KEYLIST_MODE_WITH_TOFU. (diff) | |
download | gpgme-ece8b02a839d6fc566fea7b6e59fabff164f6cf5.tar.gz gpgme-ece8b02a839d6fc566fea7b6e59fabff164f6cf5.zip |
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.
Diffstat (limited to 'lang/cpp/src/context.h')
-rw-r--r-- | lang/cpp/src/context.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h index 6518d4cf..f5e2b958 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 |