diff options
author | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
commit | a2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch) | |
tree | ad3d6c4fcc8dd0f403f8105598943616246fe172 /modules/es_unix/unix_cmd.h |
Initial checkin1.5.6
Diffstat (limited to 'modules/es_unix/unix_cmd.h')
-rw-r--r-- | modules/es_unix/unix_cmd.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/es_unix/unix_cmd.h b/modules/es_unix/unix_cmd.h new file mode 100644 index 000000000..8da81ccbd --- /dev/null +++ b/modules/es_unix/unix_cmd.h @@ -0,0 +1,56 @@ +/************************************************* +* Unix Command Execution Header File * +* (C) 1999-2006 The Botan Project * +*************************************************/ + +#ifndef BOTAN_EXT_UNIX_CMD_H__ +#define BOTAN_EXT_UNIX_CMD_H__ + +#include <botan/types.h> +#include <botan/data_src.h> +#include <string> +#include <vector> + +namespace Botan { + +/************************************************* +* Unix Program Info * +*************************************************/ +struct Unix_Program + { + Unix_Program(const char* n, u32bit p) + { name_and_args = n; priority = p; working = true; } + + std::string name_and_args; + u32bit priority; + bool working; + }; + +/************************************************* +* Command Output DataSource * +*************************************************/ +class DataSource_Command : public DataSource + { + public: + u32bit read(byte[], u32bit); + u32bit peek(byte[], u32bit, u32bit) const; + bool end_of_data() const; + std::string id() const; + + int fd() const; + + DataSource_Command(const std::string&, const std::string&); + ~DataSource_Command(); + private: + void create_pipe(const std::string&); + void shutdown_pipe(); + + const u32bit MAX_BLOCK_USECS, KILL_WAIT; + + std::vector<std::string> arg_list; + struct pipe_wrapper* pipe; + }; + +} + +#endif |