ReactOS 0.4.15-dev-8422-g6219a1a
cabman.cxx File Reference
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include "cabman.h"
Include dependency graph for cabman.cxx:

Go to the source code of this file.

Functions

charPad (char *Str, char PadChar, ULONG Length)
 
charDate2Str (char *Str, USHORT Date)
 
charTime2Str (char *Str, USHORT Time)
 
charAttr2Str (char *Str, USHORT Attr)
 
int main (int argc, char *argv[])
 

Function Documentation

◆ Attr2Str()

char * Attr2Str ( char Str,
USHORT  Attr 
)

Definition at line 126 of file cabman.cxx.

135{
136 /* Archive */
137 if (Attr & CAB_ATTRIB_ARCHIVE)
138 Str[0] = 'A';
139 else
140 Str[0] = '-';
141
142 /* Hidden */
143 if (Attr & CAB_ATTRIB_HIDDEN)
144 Str[1] = 'H';
145 else
146 Str[1] = '-';
147
148 /* Read only */
149 if (Attr & CAB_ATTRIB_READONLY)
150 Str[2] = 'R';
151 else
152 Str[2] = '-';
153
154 /* System */
155 if (Attr & CAB_ATTRIB_SYSTEM)
156 Str[3] = 'S';
157 else
158 Str[3] = '-';
159
160 Str[4] = '\0';
161 return Str;
162}
#define CAB_ATTRIB_HIDDEN
Definition: cabinet.c:64
#define CAB_ATTRIB_READONLY
Definition: cabinet.c:63
#define CAB_ATTRIB_SYSTEM
Definition: cabinet.c:65
#define CAB_ATTRIB_ARCHIVE
Definition: cabinet.c:68

Referenced by CCABManager::DisplayCabinet().

◆ Date2Str()

char * Date2Str ( char Str,
USHORT  Date 
)

Definition at line 55 of file cabman.cxx.

64{
65 ULONG dw;
66
67 /* Month */
68 Str[0] = (char)('0' + ((Date & 0x01E0) >> 5) / 10);
69 Str[1] = (char)('0' + ((Date & 0x01E0) >> 5) % 10);
70 Str[2] = '-';
71 /* Day */
72 Str[3] = (char)('0' + (Date & 0x001F) / 10);
73 Str[4] = (char)('0' + (Date & 0x001F) % 10);
74 Str[5] = '-';
75 /* Year */
76 dw = 1980 + ((Date & 0xFE00) >> 9);
77 Str[6] = (char)('0' + dw / 1000); dw %= 1000;
78 Str[7] = (char)('0' + dw / 100); dw %= 100;
79 Str[8] = (char)('0' + dw / 10); dw %= 10;
80 Str[9] = (char)('0' + dw % 10);
81 Str[10] = '\0';
82 return Str;
83}
unsigned char
Definition: typeof.h:29
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
uint32_t ULONG
Definition: typedefs.h:59

Referenced by CCABManager::DisplayCabinet().

◆ main()

int main ( int argc  ,
char argv[] 
)

Definition at line 681 of file cabman.cxx.

688{
689 CCABManager CABMgr;
690
691 if (!CABMgr.ParseCmdline(argc, argv))
692 return 2;
693
694 return CABMgr.Run() ? 0 : 1;
695}
static int argc
Definition: ServiceArgs.c:12
bool Run()
Definition: cabman.cxx:573
bool ParseCmdline(int argc, char *argv[])
Definition: cabman.cxx:224
#define argv
Definition: mplay32.c:18

◆ Pad()

char * Pad ( char Str,
char  PadChar,
ULONG  Length 
)

Definition at line 29 of file cabman.cxx.

41{
42 ULONG Len;
43
44 Len = (ULONG)strlen(Str);
45
46 if (Len < Length)
47 {
48 memcpy(&Str[Length - Len], Str, Len + 1);
49 memset(Str, PadChar, Length - Len);
50 }
51 return Str;
52}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define Len
Definition: deflate.h:82
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define memset(x, y, z)
Definition: compat.h:39

Referenced by A_SHAFinal(), CCABManager::DisplayCabinet(), test_pack_MIDL_FORMAT_STRING(), and UDPv4ChecksumCalculate().

◆ Time2Str()

char * Time2Str ( char Str,
USHORT  Time 
)

Definition at line 86 of file cabman.cxx.

95{
96 bool PM;
97 ULONG Hour;
98 ULONG dw;
99
100 Hour = ((Time & 0xF800) >> 11);
101 PM = (Hour >= 12);
102 Hour %= 12;
103 if (Hour == 0)
104 Hour = 12;
105
106 if (Hour >= 10)
107 Str[0] = (char)('0' + Hour / 10);
108 else Str[0] = ' ';
109 Str[1] = (char)('0' + Hour % 10);
110 Str[2] = ':';
111 /* Minute */
112 Str[3] = (char)('0' + ((Time & 0x07E0) >> 5) / 10);
113 Str[4] = (char)('0' + ((Time & 0x07E0) >> 5) % 10);
114 Str[5] = ':';
115 /* Second */
116 dw = 2 * (Time & 0x001F);
117 Str[6] = (char)('0' + dw / 10);
118 Str[7] = (char)('0' + dw % 10);
119
120 Str[8] = PM? 'p' : 'a';
121 Str[9] = '\0';
122 return Str;
123}
static PLARGE_INTEGER Time
Definition: time.c:105

Referenced by CCABManager::DisplayCabinet().