File: gpgme.info, Node: Running other Programs, Next: Using the Assuan protocol, Up: Miscellaneous 7.7.1 Running other Programs ---------------------------- GPGME features an internal subsystem to run the actual backend engines. Along with data abstraction object this subsystem can be used to run arbitrary simple programs which even need not be related to cryptographic features. It may for example be used to run tools which are part of the GnuPG system but are not directly accessible with the GPGME API. -- Function: gpgme_error_t gpgme_op_spawn (gpgme_ctx_t CTX, const char *FILE, const char *ARGV[], gpgme_data_t DATAIN, gpgme_data_t DATAOUT, gpgme_data_t DATAERR, unsigned int FLAGS) SINCE: 1.5.0 The function ‘gpgme_op_spawn’ runs the program FILE with the arguments taken from the NULL terminated array ARGV. If no arguments are required ARGV may be given as ‘NULL’. In the latter case or if ‘argv[0]’ is the empty string, GPGME uses the basename of FILE for ‘argv[0]’. The file descriptors ‘stdin’, ‘stdout’, and ‘stderr’ are connected to the data objects DATAIN, DATAOUT, and DATAERR. If NULL is passed for one of these data objects the corresponding file descriptor is connected to ‘/dev/null’. The value in FLAGS is a bitwise-or combination of one or multiple of the following bit values: ‘GPGME_SPAWN_DETACHED’ SINCE: 1.5.0 Under Windows this flag inhibits the allocation of a new console for the program. This is useful for a GUI application which needs to call a command line helper tool. ‘GPGME_SPAWN_ALLOW_SET_FG’ SINCE: 1.5.0 Under Windows this flag allows the called program to put itself into the foreground. -- Function: gpgme_error_t gpgme_op_spawn_start (gpgme_ctx_t CTX, const char *FILE, const char *ARGV[], gpgme_data_t DATAIN, gpgme_data_t DATAOUT, gpgme_data_t DATAERR, unsigned int FLAGS) SINCE: 1.5.0 This is the asynchronous variant of ‘gpgme_op_spawn’.