ReactOS  0.4.14-dev-390-g34947ad
main.cxx File Reference
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include "cabman.h"
Include dependency graph for main.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[])
 

Variables

CCABManager CABMgr
 

Function Documentation

◆ Attr2Str()

char* Attr2Str ( char Str,
USHORT  Attr 
)

Definition at line 126 of file main.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_SYSTEM
Definition: cabinet.c:63
#define CAB_ATTRIB_HIDDEN
Definition: cabinet.c:62
#define CAB_ATTRIB_READONLY
Definition: cabinet.c:61
#define CAB_ATTRIB_ARCHIVE
Definition: cabinet.c:66

Referenced by CCABManager::DisplayCabinet().

◆ Date2Str()

char* Date2Str ( char Str,
USHORT  Date 
)

Definition at line 55 of file main.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 dw
Definition: atlbase.h:40
unsigned int ULONG
Definition: retypes.h:1

Referenced by CCABManager::DisplayCabinet().

◆ main()

int main ( int argc  ,
char argv[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

Definition at line 660 of file main.cxx.

667 {
668  bool status = false;
669 
671 
672  return (status ? 0 : 1);
673 }
static int argc
Definition: ServiceArgs.c:12
bool Run()
Definition: main.cxx:558
bool ParseCmdline(int argc, char *argv[])
Definition: main.cxx:223
#define argv
Definition: mplay32.c:18
CCABManager CABMgr
Definition: main.cxx:658
Definition: ps.c:97

◆ Pad()

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

Definition at line 29 of file main.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
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int ULONG
Definition: retypes.h:1
#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 main.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 }
unsigned char
Definition: typeof.h:29
REFIID LPVOID DWORD dw
Definition: atlbase.h:40
unsigned int ULONG
Definition: retypes.h:1
static PLARGE_INTEGER Time
Definition: time.c:105

Referenced by CCABManager::DisplayCabinet().

Variable Documentation

◆ CABMgr

CCABManager CABMgr

Definition at line 658 of file main.cxx.

Referenced by main(), and CDFParser::Parse().