1 // SSTypes.h:structure definitions for SourceSafe files
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_SSTYPES_H__6602C07F_65ED_4FD7_A730_6D416805378A__INCLUDED_)
6 #define AFX_SSTYPES_H__6602C07F_65ED_4FD7_A730_6D416805378A__INCLUDED_
10 #endif // _MSC_VER > 1000
14 typedef unsigned char byte
;
15 typedef unsigned long ulong
;
16 typedef unsigned short ushort
;
18 #if !defined(_MSC_VER)
19 // for non-Windows compilation, choose a 32-bit unsigned type here
20 #include <sys/types.h>
21 typedef u_int32_t __time32_t
;
24 //---------------------------------------------------------------------------
25 // OLE API documentation
26 // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvss/html/vssauto.asp
27 //---------------------------------------------------------------------------
29 struct RECORD_HEADER
{
36 short flags
; // 00 = item, 01 == project
37 char name
[34]; // short name
38 ulong nsmap
; // offset into the names.dat
42 // TODO: in the OLE API: VSSITEM_PROJECT = 0; VSSITEM_FILE = 1
43 #define SSITEM_PROJECT 1
54 short type
; // 1 Project, 2 File
56 short numberOfActions
;
58 // This is the last name that was given to the item
61 char latestExt
[2]; // .A or .B
63 // offsets for records
64 ulong historyOffsetBegin
; // first EL Header
65 ulong historyOffsetLast
; // last EL oder FD HEader
66 ulong historyOffsetEnd
; // size of the file
69 struct DH_FILE
: public DH
{
75 // 0x04 == store only latest revision
77 // 0x40 == checked out
79 char shareSrcSpec
[10];
81 ulong offsetBFRecord
; // offset to the last BR record in the file
82 ulong offsetPFRecord
; // offset to the last PF record in the file
83 short numberOfBranches
; // number of the BF records
84 short numberOfReferences
; // Reference count for the item
86 ulong offsetCFRecord1
; // file checked out, ptr to CF record
87 ulong offsetCFRecord2
; // file not checked out, ptr to CF record
88 int unknown
; // changes after checkin
92 // diese scheinen immer Paare zu bilden, nach einem Checkin ändert sich
104 // dito wie dxx, jedoch zum ersten mal nach einem Checkin
114 short numberOfItems
; // including projects
115 short numberOfProjects
; // number of subprojects
118 struct DH_PROJECT
: public DH
{
121 char parentSpec
[258]; // of last checkout
127 short numberOfItems
; // including projects
128 short numberOfProjects
;
136 Destroyed_Project
= 4,
140 Recovered_Project
= 8,
142 Renamed_Project
= 10,
144 Moved_Project_From
= 12,
145 Moved_Project_To
= 13,
146 Shared_File
= 14, // Share, Pin, Unpin
147 Branch_File
= 15, // reported as Rollback im Parent Project
152 ArchiveVersion_File
= 20,
153 // missing action 21, probably RestoreVersion_File
155 Archive_Project
= 23,
157 Restore_Project
= 25,
159 /// --- pseudo actions ---
166 struct VERSION_RECORD
{
167 ulong previous
; // previous VERSION_RECORD
168 ushort actionID
; // eAction action;
175 // This seems to be always be a pointer to the next record
176 // If (lengthComment != 0) this next record is the comment record
177 ulong offsetToNextRecordOrComment
;
179 // This offset seems to be NULL in most cases
180 // In case of a LabelAction this is the offset to the so called LabelComment Record
181 // In addition the lengthLabelComment is > 0
182 ulong offsetToLabelComment
;
184 // Length of the comment strings
186 short lengthLabelComment
;
194 //struct CREATED_PROJECT_ACTION {
196 // char physical[10];
199 //struct ADDED_PROJECT_ACTION {
201 // char physical[10];
204 //struct ADDED_FILE_ACTION {
206 // char physical[10];
209 struct DESTROYED_ACTION
{
215 //struct DESTROYED_PROJECT_ACTION {
218 // char physical[10];
221 //struct DESTROYED_FILE_ACTION {
224 // char physical[10];
227 //struct DELETED_PROJECT_ACTION {
229 // char physical[10];
232 //struct DELETED_FILE_ACTION {
234 // char physical[10];
237 //struct RECOVERED_PROJECT_ACTION {
239 // char physical[10];
242 //struct RECOVERED_FILE_ACTION {
244 // char physical[10];
247 struct RENAMED_ACTION
{
249 SSNAME name
; // old name
253 struct SHARED_FILE_ACTION
{
254 char srcPathSpec
[260];
256 short subActionAndVersion
; // -1: shared, 0: pinned; >0 unpinned, number denotes the Version which was unpinned
257 short pinnedToVersion
; // >0: pinned to version, ==0 unpinned
258 short padding2
; // reference ins project file? Nr des shares?
262 struct MOVED_PROJECT_ACTION
{
268 //struct CREATED_FILE_ACTION {
270 // char physical[10];
273 struct CHECKED_IN_ACTION
{
274 ulong offsetFileDelta
;
276 char checkInSpec
[260];
279 struct ROLLBACK_ACTION
{
285 struct ARCHIVE_VERSIONS_ACTION
{
289 short archiveVersion
;
290 char targetFile
[252];
293 struct BRANCH_FILE_ACTION
{
317 char checkOutFolder
[256];
321 // char parentSpec[80];
322 // char fileSpec2[60];
323 // char padding3[120];
324 char parentSpec
[260];
330 // Check Out: flag1=01, flag2=40, flag3=00
331 // Check In : flag1=00, flag2=00, flag3=10
337 int numberOfVersions
;
341 short command
; // 01 copy, 00 replace, 02
348 ulong previousOffset
;
354 ulong previousOffset
;
355 char branchToPhys
[10];
359 //---------------------------------------------------------------------------
360 struct PROJECT_ENTRY
{
363 // 0x02 store binary diffs
364 // 0x04 store only latest revision
366 // 0x100 ??, or only one byte??
370 short pinnedToVersion
;
374 //---------------------------------------------------------------------------
400 //---------------------------------------------------------------------------
404 static const char* ActionToString (eAction e
);
409 #endif // !defined(AFX_SSTYPES_H__6602C07F_65ED_4FD7_A730_6D416805378A__INCLUDED_)