Merge branch 'selection-navigation'
[TortoiseGit.git] / src / libgit2 / system-call.h
blob57b24b3f496a081f7945f7ee0b78bfc653419896
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2014 TortoiseGit
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "common.h"
22 typedef struct {
23 PROCESS_INFORMATION pi;
24 HANDLE in;
25 HANDLE out;
26 HANDLE err;
27 bool running;
28 git_buf *outBuf;
29 git_buf *errBuf;
30 HANDLE asyncReadOutThread;
31 HANDLE asyncReadErrorThread;
32 } COMMAND_HANDLE;
34 void command_init(COMMAND_HANDLE *commandHandle);
35 int command_start(wchar_t *cmd, COMMAND_HANDLE *commandHandle, LPWSTR pEnv, DWORD flags);
36 void command_close_stdout(COMMAND_HANDLE *commandHandle);
37 void command_close_stdin(COMMAND_HANDLE *commandHandle);
38 DWORD command_close(COMMAND_HANDLE *commandHandle);
39 int command_read_stdout(COMMAND_HANDLE *commandHandle, char *buffer, size_t buf_size, size_t *bytes_read);
40 int command_write(COMMAND_HANDLE *commandHandle, const char *buffer, size_t len);
41 int command_write_gitbuf(COMMAND_HANDLE *commandHandle, const git_buf *buf);
42 int commmand_start_stdout_reading_thread(COMMAND_HANDLE *commandHandle, git_buf *dest);
43 int command_wait_stdout_reading_thread(COMMAND_HANDLE *commandHandle);