ReactOS 0.4.16-dev-297-gc569aee
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
12typedef struct _CABINET_NAME
13{
16 char Name[128];
18
19typedef struct _DISK_NUMBER
20{
25
26typedef enum
27{
38} DFP_TOKEN;
39
40
41typedef enum
42{
50
51
52typedef enum
53{
57} NEWTYPE;
58
59
60/* Classes */
61
62class CDFParser : public CCabinet
63{
64public:
65 CDFParser();
66 virtual ~CDFParser();
67 ULONG Load(char* FileName);
68 ULONG Parse();
69 void SetFileRelativePath(char* Path);
72 std::string FileRelativePath;
73private:
74 /* Event handlers */
75 virtual bool OnDiskLabel(ULONG Number, char* Label) override;
76 virtual bool OnCabinetName(ULONG Number, char* Name) override;
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 */
106 char Line[PATH_MAX + 6]; /* "PATH" xEOL */
110 /* Token */
113 char CurrentString[256];
114
115 /* State */
119 /* Standard directive variable */
126 char InfFileName[256];
142 char SourceDir[256];
145};
146
147/* EOF */
PRTL_UNICODE_STRING_BUFFER Path
#define PATH_MAX
Definition: types.h:280
PWCHAR Label
Definition: format.c:70
Definition: dfp.h:63
ULONG MaxDiskFileCount
Definition: dfp.h:135
ULONG ReservePerCabinetSize
Definition: dfp.h:139
PCABINET_NAME DiskLabel
Definition: dfp.h:129
ULONG MaxCabinetSize
Definition: dfp.h:134
bool DiskCreated
Definition: dfp.h:117
ULONG FolderSizeThreshold
Definition: dfp.h:133
PCABINET_NAME CabinetName
Definition: dfp.h:122
bool ReadLine()
Definition: dfp.cxx:1193
void SetFileRelativePath(char *Path)
Definition: dfp.cxx:348
bool IsNextToken(DFP_TOKEN Token, bool NoSpaces)
Definition: dfp.cxx:1175
bool MaxDiskSizeAllSet
Definition: dfp.h:137
ULONG CabinetFileCountThreshold
Definition: dfp.h:121
bool SetDiskName(PCABINET_NAME *List, ULONG Number, char *String)
Definition: dfp.cxx:468
ULONG LineLength
Definition: dfp.h:107
void WriteInfLine(char *InfLine)
Definition: dfp.cxx:88
bool FileLoaded
Definition: dfp.h:101
bool InfModeEnabled
Definition: dfp.h:144
char CurrentString[256]
Definition: dfp.h:113
bool GetDiskName(PCABINET_NAME *List, ULONG Number, char *String)
Definition: dfp.cxx:506
ULONG CurrentInteger
Definition: dfp.h:112
FILE * FileHandle
Definition: dfp.h:102
ULONG CurrentOffset
Definition: dfp.h:105
bool CabinetNameTemplateSet
Definition: dfp.h:123
ULONG MaxDiskSizeAll
Definition: dfp.h:138
ULONG PerformNewCommand()
Definition: dfp.cxx:895
ULONG PerformFileCopy()
Definition: dfp.cxx:1022
bool Cabinet
Definition: dfp.h:120
ULONG CurrentChar
Definition: dfp.h:109
virtual bool OnCabinetName(ULONG Number, char *Name) override
Definition: dfp.cxx:413
bool GetDiskNumber(PDISK_NUMBER *List, ULONG Number, PULONG Value)
Definition: dfp.cxx:572
void DoInfFileName(char *InfFileName)
Definition: dfp.cxx:764
char SourceDir[256]
Definition: dfp.h:142
ULONG CompressionType
Definition: dfp.h:128
bool FolderCreated
Definition: dfp.h:118
char CabinetNameTemplate[128]
Definition: dfp.h:124
bool DiskLabelTemplateSet
Definition: dfp.h:130
char DiskLabelTemplate[128]
Definition: dfp.h:131
ULONG CurrentLine
Definition: dfp.h:108
bool DontGenerateInf
Definition: dfp.h:71
bool InfFileOnly
Definition: dfp.h:70
std::string FileRelativePath
Definition: dfp.h:72
bool DoCabinetName(ULONG Number, char *Name)
Definition: dfp.cxx:630
void DoCabinetNameTemplate(char *Template)
Definition: dfp.cxx:646
void DoDiskLabelTemplate(char *Template)
Definition: dfp.cxx:616
bool SetDiskNumber(PDISK_NUMBER *List, ULONG Number, ULONG Value)
Definition: dfp.cxx:534
ULONG PerformCommand()
Definition: dfp.cxx:1002
bool DoDiskLabel(ULONG Number, char *Label)
Definition: dfp.cxx:600
bool InfFileNameSet
Definition: dfp.h:125
void NextToken()
Definition: dfp.cxx:1232
ULONG ReservePerDataBlockSize
Definition: dfp.h:140
DFP_TOKEN CurrentToken
Definition: dfp.h:111
ULONG ReservePerFolderSize
Definition: dfp.h:141
char InfFileName[256]
Definition: dfp.h:126
ULONG FileBufferSize
Definition: dfp.h:104
ULONG PerformSetCommand()
Definition: dfp.cxx:799
void SkipSpaces()
Definition: dfp.cxx:1164
bool CabinetCreated
Definition: dfp.h:116
virtual bool OnDiskLabel(ULONG Number, char *Label) override
Definition: dfp.cxx:361
ULONG PerformInfEndCommand()
Definition: dfp.cxx:990
ULONG SetupNewDisk()
Definition: dfp.cxx:777
char * FileBuffer
Definition: dfp.h:103
ULONG Parse()
Definition: dfp.cxx:193
FILE * InfFileHandle
Definition: dfp.h:143
ULONG Load(char *FileName)
Definition: dfp.cxx:138
ULONG DoMaxDiskSize(bool NumberValid, ULONG Number)
Definition: dfp.cxx:660
virtual ~CDFParser()
Definition: dfp.cxx:50
ULONG PerformInfBeginCommand()
Definition: dfp.cxx:978
bool Compress
Definition: dfp.h:127
ULONG FolderFileCountThreshold
Definition: dfp.h:132
CDFParser()
Definition: dfp.cxx:22
PDISK_NUMBER MaxDiskSize
Definition: dfp.h:136
SETTYPE
Definition: dfp.h:42
@ stInfFileName
Definition: dfp.h:48
@ stCabinetName
Definition: dfp.h:43
@ stDiskLabelTemplate
Definition: dfp.h:46
@ stMaxDiskSize
Definition: dfp.h:47
@ stDiskLabel
Definition: dfp.h:45
@ stCabinetNameTemplate
Definition: dfp.h:44
struct _CABINET_NAME * PCABINET_NAME
struct _DISK_NUMBER * PDISK_NUMBER
NEWTYPE
Definition: dfp.h:53
@ ntFolder
Definition: dfp.h:56
@ ntDisk
Definition: dfp.h:54
@ ntCabinet
Definition: dfp.h:55
struct _CABINET_NAME CABINET_NAME
struct _DISK_NUMBER DISK_NUMBER
DFP_TOKEN
Definition: dfp.h:27
@ TokenUnknown
Definition: dfp.h:28
@ TokenIdentifier
Definition: dfp.h:30
@ TokenPeriod
Definition: dfp.h:35
@ TokenSemi
Definition: dfp.h:33
@ TokenInteger
Definition: dfp.h:29
@ TokenBackslash
Definition: dfp.h:36
@ TokenEnd
Definition: dfp.h:37
@ TokenString
Definition: dfp.h:31
@ TokenSpace
Definition: dfp.h:32
@ TokenEqual
Definition: dfp.h:34
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:207
Definition: ncftp.h:79
struct _CABINET_NAME * Next
Definition: dfp.h:14
ULONG DiskNumber
Definition: dfp.h:15
struct _DISK_NUMBER * Next
Definition: dfp.h:21
ULONG Number
Definition: dfp.h:23
ULONG DiskNumber
Definition: dfp.h:22
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550