ReactOS  0.4.15-dev-309-g7c8d563
dfp.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS cabinet manager
4  * FILE: tools/cabman/dfp.h
5  * PURPOSE: Directive file parser header
6  */
7 
8 #pragma once
9 
10 #include "cabinet.h"
11 
12 typedef struct _CABINET_NAME
13 {
16  char Name[128];
18 
19 typedef struct _DISK_NUMBER
20 {
21  struct _DISK_NUMBER *Next;
25 
26 typedef enum
27 {
38 } DFP_TOKEN;
39 
40 
41 typedef enum
42 {
49 } SETTYPE;
50 
51 
52 typedef enum
53 {
57 } NEWTYPE;
58 
59 
60 /* Classes */
61 
62 class CDFParser : public CCabinet
63 {
64 public:
65  CDFParser();
66  virtual ~CDFParser();
67  ULONG Load(char* FileName);
68  ULONG Parse();
69  void SetFileRelativePath(char* Path);
72  char FileRelativePath[300];
73 private:
74  /* Event handlers */
75  virtual bool OnDiskLabel(ULONG Number, char* Label);
76  virtual bool OnCabinetName(ULONG Number, char* Name);
77 
78  void WriteInfLine(char* InfLine);
83  bool DoDiskLabel(ULONG Number, char* Label);
84  void DoDiskLabelTemplate(char* Template);
85  bool DoCabinetName(ULONG Number, char* Name);
86  void DoCabinetNameTemplate(char* Template);
87  void DoInfFileName(char* InfFileName);
88  ULONG DoMaxDiskSize(bool NumberValid, ULONG Number);
96  void SkipSpaces();
97  bool IsNextToken(DFP_TOKEN Token, bool NoSpaces);
98  bool ReadLine();
99  void NextToken();
100  /* Parsing */
103  char* FileBuffer;
106  char Line[PATH_MAX + 6]; /* "PATH" xEOL */
110  /* Token */
113  char CurrentString[256];
114 
115  /* State */
119  /* Standard directive variable */
120  bool Cabinet;
126  char InfFileName[256];
127  bool Compress;
131  char DiskLabelTemplate[128];
142  char SourceDir[256];
145 };
146 
147 /* EOF */
ULONG DiskNumber
Definition: dfp.h:22
char InfFileName[256]
Definition: dfp.h:126
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2373
ULONG ReservePerDataBlockSize
Definition: dfp.h:140
PCABINET_NAME CabinetName
Definition: dfp.h:122
Definition: dfp.h:56
void DoCabinetNameTemplate(char *Template)
Definition: dfp.cxx:655
bool SetDiskNumber(PDISK_NUMBER *List, ULONG Number, ULONG Value)
Definition: dfp.cxx:543
ULONG PerformNewCommand()
Definition: dfp.cxx:904
ULONG PerformCommand()
Definition: dfp.cxx:1011
bool GetDiskName(PCABINET_NAME *List, ULONG Number, char *String)
Definition: dfp.cxx:515
ULONG ReservePerCabinetSize
Definition: dfp.h:139
bool SetDiskName(PCABINET_NAME *List, ULONG Number, char *String)
Definition: dfp.cxx:477
bool Compress
Definition: dfp.h:127
ULONG CurrentOffset
Definition: dfp.h:105
bool FolderCreated
Definition: dfp.h:118
bool MaxDiskSizeAllSet
Definition: dfp.h:137
virtual bool OnDiskLabel(ULONG Number, char *Label)
Definition: dfp.cxx:370
DFP_TOKEN
Definition: dfp.h:26
bool DontGenerateInf
Definition: dfp.h:71
ULONG CurrentInteger
Definition: dfp.h:112
struct _CABINET_NAME CABINET_NAME
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID _Out_ PHANDLE Token
ULONG MaxDiskFileCount
Definition: dfp.h:135
Definition: dfp.h:55
void SetFileRelativePath(char *Path)
Definition: dfp.cxx:356
bool DoCabinetName(ULONG Number, char *Name)
Definition: dfp.cxx:639
static WCHAR String[]
Definition: stringtable.c:55
bool InfFileNameSet
Definition: dfp.h:125
PDISK_NUMBER MaxDiskSize
Definition: dfp.h:136
ULONG SetupNewDisk()
Definition: dfp.cxx:786
ULONG ReservePerFolderSize
Definition: dfp.h:141
struct _DISK_NUMBER * PDISK_NUMBER
bool DiskLabelTemplateSet
Definition: dfp.h:130
void DoDiskLabelTemplate(char *Template)
Definition: dfp.cxx:625
bool IsNextToken(DFP_TOKEN Token, bool NoSpaces)
Definition: dfp.cxx:1183
ULONG DiskNumber
Definition: dfp.h:15
ULONG CurrentLine
Definition: dfp.h:108
void WriteInfLine(char *InfLine)
Definition: dfp.cxx:90
DFP_TOKEN CurrentToken
Definition: dfp.h:111
bool CabinetCreated
Definition: dfp.h:116
SETTYPE
Definition: dfp.h:41
bool CabinetNameTemplateSet
Definition: dfp.h:123
CDFParser()
Definition: dfp.cxx:22
ULONG FileBufferSize
Definition: dfp.h:104
ULONG Number
Definition: dfp.h:23
Definition: dfp.h:34
bool Cabinet
Definition: dfp.h:120
char CabinetNameTemplate[128]
Definition: dfp.h:124
FILE * FileHandle
Definition: dfp.h:102
struct _DISK_NUMBER DISK_NUMBER
char DiskLabelTemplate[128]
Definition: dfp.h:131
ULONG DoMaxDiskSize(bool NumberValid, ULONG Number)
Definition: dfp.cxx:669
LIST_ENTRY List
Definition: psmgr.c:57
bool InfFileOnly
Definition: dfp.h:70
virtual ~CDFParser()
Definition: dfp.cxx:52
ULONG CompressionType
Definition: dfp.h:128
ULONG MaxDiskSizeAll
Definition: dfp.h:138
ULONG CurrentChar
Definition: dfp.h:109
#define PATH_MAX
Definition: types.h:280
void NextToken()
Definition: dfp.cxx:1240
ULONG Parse()
Definition: dfp.cxx:195
ULONG PerformFileCopy()
Definition: dfp.cxx:1031
virtual bool OnCabinetName(ULONG Number, char *Name)
Definition: dfp.cxx:422
Definition: ncftp.h:79
ULONG PerformInfBeginCommand()
Definition: dfp.cxx:987
Definition: dfp.h:37
char FileRelativePath[300]
Definition: dfp.h:72
char CurrentString[256]
Definition: dfp.h:113
bool FileLoaded
Definition: dfp.h:101
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:204
bool ReadLine()
Definition: dfp.cxx:1201
ULONG FolderFileCountThreshold
Definition: dfp.h:132
bool InfModeEnabled
Definition: dfp.h:144
PRTL_UNICODE_STRING_BUFFER Path
char * FileBuffer
Definition: dfp.h:103
bool GetDiskNumber(PDISK_NUMBER *List, ULONG Number, PULONG Value)
Definition: dfp.cxx:581
NEWTYPE
Definition: dfp.h:52
Definition: dfp.h:32
ULONG CabinetFileCountThreshold
Definition: dfp.h:121
struct _CABINET_NAME * PCABINET_NAME
unsigned int * PULONG
Definition: retypes.h:1
ULONG FolderSizeThreshold
Definition: dfp.h:133
Definition: dfp.h:54
void SkipSpaces()
Definition: dfp.cxx:1172
ULONG PerformInfEndCommand()
Definition: dfp.cxx:999
bool DoDiskLabel(ULONG Number, char *Label)
Definition: dfp.cxx:609
unsigned int ULONG
Definition: retypes.h:1
PWCHAR Label
Definition: format.c:70
Definition: dfp.h:33
char SourceDir[256]
Definition: dfp.h:142
ULONG LineLength
Definition: dfp.h:107
ULONG Load(char *FileName)
Definition: dfp.cxx:140
struct _DISK_NUMBER * Next
Definition: dfp.h:21
ULONG MaxCabinetSize
Definition: dfp.h:134
void DoInfFileName(char *InfFileName)
Definition: dfp.cxx:773
bool DiskCreated
Definition: dfp.h:117
ULONG PerformSetCommand()
Definition: dfp.cxx:808
struct _CABINET_NAME * Next
Definition: dfp.h:14
FILE * InfFileHandle
Definition: dfp.h:143
Definition: dfp.h:62
PCABINET_NAME DiskLabel
Definition: dfp.h:129