aboutsummaryrefslogtreecommitdiff
path: root/sp/src/public/vstdlib/iprocessutils.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /sp/src/public/vstdlib/iprocessutils.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/public/vstdlib/iprocessutils.h')
-rw-r--r--sp/src/public/vstdlib/iprocessutils.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/sp/src/public/vstdlib/iprocessutils.h b/sp/src/public/vstdlib/iprocessutils.h
new file mode 100644
index 00000000..6eb64486
--- /dev/null
+++ b/sp/src/public/vstdlib/iprocessutils.h
@@ -0,0 +1,64 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//===========================================================================//
+
+#ifndef IPROCESSUTILS_H
+#define IPROCESSUTILS_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "appframework/IAppSystem.h"
+
+
+//-----------------------------------------------------------------------------
+// Handle to a process
+//-----------------------------------------------------------------------------
+typedef int ProcessHandle_t;
+enum
+{
+ PROCESS_HANDLE_INVALID = 0,
+};
+
+
+//-----------------------------------------------------------------------------
+// Interface version
+//-----------------------------------------------------------------------------
+#define PROCESS_UTILS_INTERFACE_VERSION "VProcessUtils001"
+
+
+//-----------------------------------------------------------------------------
+// Interface for makefiles to build differently depending on where they are run from
+//-----------------------------------------------------------------------------
+abstract_class IProcessUtils : public IAppSystem
+{
+public:
+ // Starts, stops a process
+ virtual ProcessHandle_t StartProcess( const char *pCommandLine, bool bConnectStdPipes ) = 0;
+ virtual ProcessHandle_t StartProcess( int argc, const char **argv, bool bConnectStdPipes ) = 0;
+ virtual void CloseProcess( ProcessHandle_t hProcess ) = 0;
+ virtual void AbortProcess( ProcessHandle_t hProcess ) = 0;
+
+ // Returns true if a process is complete
+ virtual bool IsProcessComplete( ProcessHandle_t hProcess ) = 0;
+
+ // Waits until a process is complete
+ virtual void WaitUntilProcessCompletes( ProcessHandle_t hProcess ) = 0;
+
+ // Methods used to write input into a process
+ virtual int SendProcessInput( ProcessHandle_t hProcess, char *pBuf, int nBufLen ) = 0;
+
+ // Methods used to read output back from a process
+ virtual int GetProcessOutputSize( ProcessHandle_t hProcess ) = 0;
+ virtual int GetProcessOutput( ProcessHandle_t hProcess, char *pBuf, int nBufLen ) = 0;
+
+ // Returns the exit code for the process. Doesn't work unless the process is complete
+ virtual int GetProcessExitCode( ProcessHandle_t hProcess ) = 0;
+};
+
+
+#endif // IPROCESSUTILS_H