OSDN Git Service

Update version number to 1.2.1.0
[tortoisegit/TortoiseGitJp.git] / src / TGitCache / CacheInterface.h
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // External Cache Copyright (C) 2005-2006,2008 - TortoiseSVN\r
4 \r
5 // This program is free software; you can redistribute it and/or\r
6 // modify it under the terms of the GNU General Public License\r
7 // as published by the Free Software Foundation; either version 2\r
8 // of the License, or (at your option) any later version.\r
9 \r
10 // This program is distributed in the hope that it will be useful,\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 // GNU General Public License for more details.\r
14 \r
15 // You should have received a copy of the GNU General Public License\r
16 // along with this program; if not, write to the Free Software Foundation,\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 //\r
19 \r
20 #pragma once\r
21 #include "wininet.h"\r
22 \r
23 #include "GitStatus.h"\r
24 // The name of the named-pipe for the cache\r
25 #ifdef WIN64\r
26 #define TSVN_CACHE_PIPE_NAME _T("\\\\.\\pipe\\TGitCache64")\r
27 #define TSVN_CACHE_COMMANDPIPE_NAME _T("\\\\.\\pipe\\TGitCacheCommand64")\r
28 #define TSVN_CACHE_WINDOW_NAME _T("TGitCacheWindow64")\r
29 #define TSVN_CACHE_MUTEX_NAME _T("TGitCacheMutex64")\r
30 #else\r
31 #define TSVN_CACHE_PIPE_NAME _T("\\\\.\\pipe\\TGitCache")\r
32 #define TSVN_CACHE_COMMANDPIPE_NAME _T("\\\\.\\pipe\\TGitCacheCommand")\r
33 #define TSVN_CACHE_WINDOW_NAME _T("TGitCacheWindow")\r
34 #define TSVN_CACHE_MUTEX_NAME _T("TGitCacheMutex")\r
35 #endif\r
36 \r
37 CString GetCachePipeName();\r
38 CString GetCacheCommandPipeName();\r
39 CString GetCacheMutexName();\r
40 \r
41 CString GetCacheID();\r
42 \r
43 \r
44 typedef enum git_node_kind_t\r
45 {\r
46         git_node_none,\r
47         git_node_file,\r
48         git_node_dir,\r
49         git_node_unknown,\r
50 \r
51 }git_node_kind;\r
52 \r
53 \r
54 /**\r
55  * \ingroup TSVNCache\r
56  * A structure passed as a request from the shell (or other client) to the external cache\r
57  */ \r
58 struct TSVNCacheRequest\r
59 {\r
60         DWORD flags;\r
61         WCHAR path[MAX_PATH+1];\r
62 };\r
63 \r
64 // CustomActions will use this header but does not need nor understand the SVN types ...\r
65 \r
66 //#ifdef SVN_WC_H\r
67 \r
68 /**\r
69  * \ingroup TSVNCache\r
70  * The structure returned as a response\r
71  */\r
72 struct TSVNCacheResponse\r
73 {\r
74         git_wc_status2_t m_status;\r
75         git_wc_entry_t m_entry;\r
76         git_node_kind_t m_kind;\r
77         char m_url[INTERNET_MAX_URL_LENGTH+1];\r
78         char m_owner[255];              ///< owner of the lock\r
79         char m_author[255];\r
80         bool m_readonly;                ///< whether the file is write protected or not\r
81         bool m_needslock;               ///< whether the file has the svn:needs-lock property set or not (only works with the new working copy version)\r
82 };\r
83 \r
84 //#endif // SVN_WC_H\r
85 \r
86 /**\r
87  * \ingroup TSVNCache\r
88  * a cache command\r
89  */\r
90 struct TSVNCacheCommand\r
91 {\r
92         BYTE command;                           ///< the command to execute\r
93         WCHAR path[MAX_PATH+1];         ///< path to do the command for\r
94 };\r
95 \r
96 #define         TSVNCACHECOMMAND_END            0               ///< ends the thread handling the pipe communication\r
97 #define         TSVNCACHECOMMAND_CRAWL          1               ///< start crawling the specified path for changes\r
98 #define         TSVNCACHECOMMAND_REFRESHALL     2               ///< Refreshes the whole cache, usually necessary after the "treat unversioned files as modified" option changed.\r
99 #define         TSVNCACHECOMMAND_RELEASE        3               ///< Releases all open handles for the specified path and all paths below\r
100 \r
101 \r
102 /// Set this flag if you already know whether or not the item is a folder\r
103 #define TSVNCACHE_FLAGS_FOLDERISKNOWN           0x01\r
104 /// Set this flag if the item is a folder\r
105 #define TSVNCACHE_FLAGS_ISFOLDER                        0x02\r
106 /// Set this flag if you want recursive folder status (safely ignored for file paths)\r
107 #define TSVNCACHE_FLAGS_RECUSIVE_STATUS         0x04\r
108 /// Set this flag if notifications to the shell are not allowed\r
109 #define TSVNCACHE_FLAGS_NONOTIFICATIONS         0x08\r