├── .gitignore ├── CommandLineTools.groupproj ├── EOLConv.Converters.pas ├── LICENSE.md ├── README.md ├── cal.dpr ├── cal.dproj ├── cal.res ├── echoc.dpr ├── echoc.dproj ├── echoc.res ├── eolconv.dpr ├── eolconv.dproj ├── eolconv.res ├── exact.dpr ├── exact.dproj ├── exact.res ├── slack.dpr ├── slack.dproj ├── slack.res ├── whereis.dpr ├── whereis.dproj └── whereis.res /.gitignore: -------------------------------------------------------------------------------- 1 | *.stat 2 | *.dproj.local 3 | *.groupproj.local 4 | *.todo 5 | *.exe 6 | *.dsk 7 | *.identcache 8 | __history/** 9 | __recovery/** 10 | Win32/** 11 | Win64/** 12 | *.~dsk 13 | *.tvsconfig 14 | -------------------------------------------------------------------------------- /CommandLineTools.groupproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {B5A33941-01DF-4301-B657-0D0BA886C1A8} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Default.Personality.12 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /EOLConv.Converters.pas: -------------------------------------------------------------------------------- 1 | unit EOLConv.Converters; 2 | 3 | interface 4 | 5 | uses 6 | System.Classes; 7 | 8 | procedure ConvertBytes(const InStream, OutStream: TStream; LineBreaks: TTextLineBreakStyle); 9 | procedure Convert16BE(const InStream, OutStream: TStream; LineBreaks: TTextLineBreakStyle); 10 | procedure Convert16LE(const InStream, OutStream: TStream; LineBreaks: TTextLineBreakStyle); 11 | function ConvertFile(const InFileName, OutFileName: string; LineBreaks: TTextLineBreakStyle): Boolean; 12 | 13 | implementation 14 | 15 | uses 16 | System.SysUtils; 17 | 18 | procedure ConvertBytes(const InStream, OutStream: TStream; LineBreaks: TTextLineBreakStyle); 19 | var 20 | PIn, POut, PEnd: PByte; 21 | CurByte: Byte; 22 | LLen: Integer; 23 | InBuffer, OutBuffer: TArray; 24 | Size: Integer; 25 | begin 26 | if InStream.Size > 1024 * 1024 then 27 | Size := 1024 * 1024 28 | else 29 | Size := InStream.Size; 30 | SetLength(InBuffer, Size); 31 | SetLength(OutBuffer, 2 * Size); 32 | repeat 33 | LLen := InStream.Read(InBuffer[0], Size); 34 | if LLen = 0 then 35 | Break; 36 | 37 | // Start conversion single byte 38 | PIn := @InBuffer[0]; 39 | PEnd := PIn + LLen; 40 | POut := @OutBuffer[0]; 41 | 42 | while PIn < PEnd do 43 | begin 44 | CurByte := PIn^; 45 | if (CurByte = 10) or (CurByte = 13) then 46 | begin 47 | if LineBreaks = tlbsCRLF then 48 | begin 49 | POut^ := 13; 50 | Inc(POut); 51 | end; 52 | POut^ := 10; 53 | Inc(POut); 54 | Inc(PIn); 55 | if (CurByte = 13) and (PIn^ = 10) then 56 | Inc(PIn); 57 | end 58 | else 59 | begin 60 | POut^ := PIn^; 61 | Inc(POut); 62 | Inc(PIn); 63 | end; 64 | end; 65 | OutStream.Write(OutBuffer, POut - PByte(OutBuffer)); 66 | until LLen < Size; 67 | end; 68 | 69 | {$POINTERMATH ON} 70 | 71 | procedure Convert16BE(const InStream, OutStream: TStream; LineBreaks: TTextLineBreakStyle); 72 | var 73 | PIn, POut, PEnd: PWord; 74 | CurChar: Word; 75 | LLen: Integer; 76 | InBuffer, OutBuffer: TArray; 77 | Size: Integer; 78 | begin 79 | if InStream.Size > (1024 * 1024) * SizeOf(Char) then 80 | Size := 1024 * 1024 81 | else 82 | Size := InStream.Size div SizeOf(Char); 83 | SetLength(InBuffer, Size); 84 | SetLength(OutBuffer, 2 * Size); 85 | repeat 86 | LLen := InStream.Read(InBuffer[0], Size * SizeOf(Char)); 87 | if LLen = 0 then 88 | Break; 89 | 90 | // Start conversion single byte 91 | PIn := @InBuffer[0]; 92 | PEnd := PIn + (LLen div SizeOf(Char)); 93 | POut := @OutBuffer[0]; 94 | 95 | while PIn < PEnd do 96 | begin 97 | CurChar := PIn^; 98 | if (CurChar = $0A00) or (CurChar = $0D00) then 99 | begin 100 | if LineBreaks = tlbsCRLF then 101 | begin 102 | POut^ := $0D00; 103 | Inc(POut); 104 | end; 105 | POut^ := $0A00; 106 | Inc(POut); 107 | Inc(PIn); 108 | if (CurChar = $0D00) and (PIn^ = $0A00) then 109 | Inc(PIn); 110 | end 111 | else 112 | begin 113 | POut^ := PIn^; 114 | Inc(POut); 115 | Inc(PIn); 116 | end; 117 | end; 118 | OutStream.Write(OutBuffer[0], (POut - PWord(OutBuffer)) * SizeOf(Char)); 119 | until LLen < Size * SizeOf(Char); 120 | end; 121 | 122 | procedure Convert16LE(const InStream, OutStream: TStream; LineBreaks: TTextLineBreakStyle); 123 | var 124 | PIn, POut, PEnd: PWord; 125 | CurChar: Word; 126 | LLen: Integer; 127 | InBuffer, OutBuffer: TArray; 128 | Size: Integer; 129 | begin 130 | if InStream.Size > (1024 * 1024) * SizeOf(Char) then 131 | Size := 1024 * 1024 132 | else 133 | Size := InStream.Size div SizeOf(Char); 134 | SetLength(InBuffer, Size); 135 | SetLength(OutBuffer, 2 * Size); 136 | repeat 137 | LLen := InStream.Read(InBuffer[0], Size * SizeOf(Char)); 138 | if LLen = 0 then 139 | Break; 140 | 141 | // Start conversion single byte 142 | PIn := @InBuffer[0]; 143 | PEnd := PIn + (LLen div SizeOf(Char)); 144 | POut := @OutBuffer[0]; 145 | 146 | while PIn < PEnd do 147 | begin 148 | CurChar := PIn^; 149 | if (CurChar = $000A) or (CurChar = $000D) then 150 | begin 151 | if LineBreaks = tlbsCRLF then 152 | begin 153 | POut^ := $000D; 154 | Inc(POut); 155 | end; 156 | POut^ := $000A; 157 | Inc(POut); 158 | Inc(PIn); 159 | if (CurChar = $000D) and (PIn^ = $000A) then 160 | Inc(PIn); 161 | end 162 | else 163 | begin 164 | POut^ := PIn^; 165 | Inc(POut); 166 | Inc(PIn); 167 | end; 168 | end; 169 | OutStream.Write(OutBuffer[0], (POut - PWord(@OutBuffer[0])) * SizeOf(Char)); 170 | until LLen < Size * SizeOf(Char); 171 | end; 172 | 173 | function ConvertFile(const InFileName, OutFileName: string; LineBreaks: TTextLineBreakStyle): Boolean; 174 | var 175 | InStream, OutStream: TStream; 176 | InBuffer: array[0..1] of Byte; 177 | begin 178 | Result := True; 179 | OutStream := nil; 180 | try 181 | InStream := TFileStream.Create(InFileName, fmOpenRead); 182 | try 183 | OutStream := TFileStream.Create(OutFileName, fmCreate); 184 | if (InStream.Read(InBuffer[0], 2) = 2) then 185 | begin 186 | // Check for UTF-16 BE BOM 187 | if (InBuffer[0] = $FE) and (InBuffer[1] = $FF) then 188 | begin 189 | OutStream.Write(InBuffer, 2); 190 | Convert16BE(InStream, OutStream, LineBreaks) 191 | end 192 | // Check for UTF-16 LE BOM 193 | else if (InBuffer[0] = $FF) and (InBuffer[1] = $FE) then 194 | begin 195 | OutStream.Write(InBuffer, 2); 196 | Convert16LE(InStream, OutStream, LineBreaks) 197 | end 198 | else 199 | begin 200 | // Assume single-byte encoding 201 | InStream.Position := 0; 202 | ConvertBytes(InStream, OutStream, LineBreaks); 203 | end 204 | end 205 | else 206 | begin 207 | // Size can only be 0 or 1: 208 | if Instream.Size = 1 then 209 | OutStream.Write(InBuffer, 1); 210 | end; 211 | finally 212 | OutStream.Free; 213 | InStream.Free; 214 | end; 215 | except 216 | Result := False; 217 | end; 218 | end; 219 | 220 | end. 221 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2018, Rudy Velthuis 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Command line tools 2 | 3 | In the years I have been programming, I have written many command line tools. Most of them were useful but have been 4 | superseded by tools that came with the operating system. But some have survived, and so I kept them. I want to share 5 | some of them with you. 6 | 7 |
8 |
cal
9 |
A tool which prints the calendar for one or more months to the screen.
10 |
echoc
11 |
A simple tool to display a string in different colours.
12 |
eolconv
13 |
A tool that converts all line endings of a text file to a specified style or to the default for the platform.
14 |
exact
15 |
A tool to show the exact values of floating point variables in single, double and extended precision and in hex.
16 |
slack
17 |
A tool which calculates the disk space wasted, because of cluster size, on the files in a certain directory.
18 |
whereis
19 |
A tool which tries to find which executable (or executables) will be called if you enter its name on the command line.
20 |
21 | 22 | More about these tools [on my web pages](http://rvelthuis.de/programs/commands.html). 23 | -------------------------------------------------------------------------------- /cal.dpr: -------------------------------------------------------------------------------- 1 | { } 2 | { File: cal.dpr } 3 | { Function: Prints simple calendar. } 4 | { Language: Delphi 2009 } 5 | { Author: Rudy Velthuis } 6 | { Copyright: (c) 2008 Rudy Velthuis } 7 | { } 8 | { Note: The Console unit can be downloaded from } 9 | { http://rvelthuis.de/zips/console.zip } 10 | { } 11 | { CAL - Print out month calendar } 12 | { } 13 | { Synopsis } 14 | { } 15 | { cal [-13msyeh?] [[month] year] } 16 | { } 17 | { The CAL utility displays a simple calendar. } 18 | { The options are as follows: } 19 | { } 20 | { -1 Print one month only (default). } 21 | { } 22 | { -3 Print the previous month, the current month, and the } 23 | { next month all on one row. } 24 | { } 25 | { -m Print a calendar where Monday is the first day of the } 26 | { week, as opposed to Sunday. } 27 | { } 28 | { -s Print a calendar where Sunday is the first day of the } 29 | { week (default). } 30 | { } 31 | { -y Display a calendar for the current year. } 32 | { } 33 | { -e Use English month and day names. } 34 | { } 35 | { -h, -? Display this help. } 36 | { } 37 | { A single parameter specifies the year (1 - 9999) to be displayed; } 38 | { note the year must be fully specified: "cal 89" will not display } 39 | { a calendar for 1989. Two parameters denote the month and year; } 40 | { the month is a number between 1 and 12. } 41 | { } 42 | { A year starts on Jan 1. } 43 | { } 44 | { License and disclaimer: } 45 | { } 46 | { Redistribution and use in source and binary forms, with or without } 47 | { modification, are permitted provided that the following conditions are } 48 | { met: } 49 | { } 50 | { * Redistributions of source code must retain the above copyright } 51 | { notice, this list of conditions and the following disclaimer. } 52 | { * Redistributions in binary form must reproduce the above copyright } 53 | { notice, this list of conditions and the following disclaimer in the } 54 | { documentation and/or other materials provided with the distribution. } 55 | { * Neither the name of Rudy Velthuis nor the names of any contributors } 56 | { of this software may be used to endorse or promote products derived } 57 | { from this software without specific prior written permission. } 58 | { } 59 | { THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS } 60 | { "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT } 61 | { LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR } 62 | { A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT } 63 | { OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, } 64 | { SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED } 65 | { TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR } 66 | { PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF } 67 | { LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING } 68 | { NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF } 69 | { THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } 70 | { } 71 | 72 | program cal; 73 | 74 | {$APPTYPE CONSOLE} 75 | 76 | uses 77 | System.SysUtils, 78 | System.DateUtils, 79 | Winapi.Windows; 80 | 81 | var 82 | Month: Integer = High(Word); 83 | Year: Integer = High(Word); 84 | CurrentDay: Word; 85 | CurrentMonth: Word; 86 | CurrentYear: Word; 87 | 88 | ThreeMonths: Boolean = False; 89 | MondayFirst: Boolean = False; 90 | FullYear: Boolean = False; 91 | English: Boolean = False; 92 | ShowToday: Boolean = False; 93 | 94 | var 95 | // Both arrays initialized to English names. 96 | MonthNames: array[Low(FormatSettings.LongMonthNames)..High(FormatSettings.LongMonthNames)] of string = ( 97 | 'January', 'February', 'March', 'April', 'May', 'June', 98 | 'July', 'August', 'September', 'October', 'November', 'December'); 99 | DayNames: array[Low(FormatSettings.ShortDayNames)..High(FormatSettings.ShortDayNames)] of string = ( 100 | 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'); 101 | 102 | resourcestring 103 | HelpText = 104 | 'CAL - Print out month calendar'#13#10 + 105 | #13#10 + 106 | 'Synopsis'#13#10 + 107 | #13#10 + 108 | ' cal [-13msyeh?] [[month] year]'#13#10 + 109 | #13#10 + 110 | 'The CAL utility displays a simple calendar.'#13#10 + 111 | 'The options are as follows:'#13#10 + 112 | #13#10 + 113 | ' -1 Print one month only (default).'#13#10 + 114 | #13#10 + 115 | ' -3 Print the previous month, the current month, and the next month'#13#10 + 116 | ' on one row.'#13#10 + 117 | #13#10 + 118 | ' -m Print a calendar where Monday is the first day of the week, as'#13#10 + 119 | ' opposed to Sunday.'#13#10 + 120 | #13#10 + 121 | ' -s Print a calendar where Sunday is the first day of the week (default).'#13#10 + 122 | #13#10 + 123 | ' -y Display a calendar for the current year.'#13#10 + 124 | #13#10 + 125 | ' -e Use English month and day names.'#13#10 + 126 | #13#10 + 127 | ' -h, -? Display this help.'#13#10 + 128 | #13#10 + 129 | ' A single parameter specifies the year (1 - 9999) to be displayed; note'#13#10 + 130 | ' the year must be fully specified: "cal 89" will not display a calendar'#13#10 + 131 | ' for 1989 or 2089. Two parameters denote the month and year; the month is'#13#10 + 132 | ' a number between 1 and 12.'#13#10 + 133 | #13#10 + 134 | ' A year starts on Jan 1.'; 135 | 136 | // Halts with error number. 137 | procedure Error; 138 | begin 139 | Halt(2); 140 | end; 141 | 142 | // Gets Oem version of string. 143 | function OemString(const S: string): AnsiString; 144 | var 145 | Ansi: AnsiString; 146 | AnsiBuffer: array[0..255] of AnsiChar; 147 | begin 148 | Ansi := AnsiString(S); 149 | if AnsiToOem(PAnsiChar(Ansi), AnsiBuffer) then 150 | Result := AnsiBuffer 151 | else 152 | Result := Ansi; 153 | end; 154 | 155 | // Prints help text. 156 | procedure Help; 157 | begin 158 | Writeln(HelpText); 159 | end; 160 | 161 | // Decodes command line parameters. 162 | procedure DecodeParams; 163 | var 164 | I: Integer; 165 | Param: string; 166 | CurrentDate: TDateTime; 167 | Nums: array[1..2] of Integer; 168 | NumIndex: Integer; 169 | 170 | // Decodes parameter that starts with digit. 171 | procedure DecodeNumber(const AParam: string); 172 | var 173 | Num: Integer; 174 | begin 175 | if TryStrToInt(AParam, Num) then 176 | begin 177 | Inc(NumIndex); 178 | if NumIndex > 2 then 179 | NumIndex := 2; 180 | Nums[NumIndex] := Num; 181 | end 182 | else 183 | Error; 184 | end; 185 | 186 | // Decodes parameter that starts with - or ?. 187 | procedure DecodeOption(const AParam: string); 188 | begin 189 | if Length(AParam) > 1 then 190 | begin 191 | case AParam[2] of 192 | 'H', 'h', '?': // help 193 | begin 194 | Help; 195 | Halt(1); 196 | end; 197 | '1': 198 | begin 199 | ThreeMonths := False; // default 200 | FullYear := False; 201 | end; 202 | '3': 203 | begin 204 | ThreeMonths := True; 205 | FullYear := False; 206 | end; 207 | 's', 'S': 208 | MondayFirst := False; // default 209 | 'm', 'M': 210 | MondayFirst := True; 211 | 'e', 'E': 212 | English := True; 213 | 'y', 'Y': 214 | begin 215 | FullYear := True; 216 | ThreeMonths := False; 217 | end; 218 | end; 219 | end 220 | else 221 | begin 222 | Help; 223 | Halt(1); 224 | end; 225 | end; 226 | 227 | begin 228 | CurrentDate := Now; 229 | DecodeDate(CurrentDate, CurrentYear, CurrentMonth, CurrentDay); 230 | NumIndex := 0; 231 | for I := 1 to ParamCount do 232 | begin 233 | Param := ParamStr(I); 234 | case Param[1] of 235 | '-', '/': 236 | DecodeOption(Param); 237 | '0'..'9': 238 | DecodeNumber(Param); 239 | end; 240 | end; 241 | case NumIndex of 242 | 0: 243 | begin 244 | Month := CurrentMonth; 245 | Year := CurrentYear; 246 | end; 247 | 1: 248 | begin 249 | FullYear := True; 250 | ThreeMonths := False; 251 | Month := 1; 252 | Year := Nums[1]; 253 | end; 254 | 2: 255 | begin 256 | Month := Nums[1]; 257 | Year := Nums[2]; 258 | end; 259 | else 260 | Month := CurrentMonth; 261 | Year := CurrentYear; 262 | end; 263 | if Month > 12 then 264 | Month := CurrentMonth; 265 | if Year > 9999 then 266 | Year := 9999; 267 | if not FullYear then 268 | ShowToday := True; 269 | end; 270 | 271 | // Increments month. Ensures that after December follows January of next year. 272 | procedure IncMonth(var AMonth, AYear: Integer); 273 | begin 274 | Inc(AMonth); 275 | if (AMonth > 12) then 276 | begin 277 | AMonth := 1; 278 | Inc(AYear); 279 | end; 280 | end; 281 | 282 | // Decrements month. Ensures that before January comes December of previous year. 283 | procedure DecMonth(var AMonth, AYear: Integer); 284 | begin 285 | Dec(AMonth); 286 | if (AMonth = 0) then 287 | begin 288 | AMonth := 12; 289 | Dec(AYear); 290 | end; 291 | end; 292 | 293 | // Prints name of month (and year, depending on options) centered above month. 294 | procedure PrintMonthName(AMonth, AYear: Integer); 295 | var 296 | Name: AnsiString; 297 | Left, Right: Integer; 298 | begin 299 | Name := OemString(MonthNames[AMonth]); 300 | if FullYear then 301 | begin 302 | Right := 20 - Length(Name); 303 | Left := Right - Right div 2; 304 | Right := Right - Left; 305 | end 306 | else 307 | begin 308 | Right := 19 - Length(Name) - Length(IntToStr(Year)); 309 | Left := Right div 2; 310 | Right := Right - Left; 311 | end; 312 | Write('': Left, Name); 313 | if not FullYear then 314 | Write(' ', AYear); 315 | Write('': Right); 316 | end; 317 | 318 | // Prints one or more month names (and years) in one line, depending on options. 319 | procedure PrintMonthNames(AMonth, AYear: Integer); 320 | var 321 | M: Integer; 322 | N: Integer; 323 | begin 324 | if ThreeMonths or FullYear then 325 | N := 3 326 | else 327 | N := 1; 328 | for M := 1 to N do 329 | begin 330 | PrintMonthName(AMonth, AYear); 331 | if M <> N then 332 | begin 333 | Write(' '); 334 | IncMonth(AMonth, AYear); 335 | end; 336 | end; 337 | Writeln; 338 | end; 339 | 340 | // Prints one Su-Sa strip (or Mo-Su, depending on options). 341 | procedure PrintDayStrip; 342 | var 343 | D: Integer; 344 | begin 345 | if MondayFirst then 346 | begin 347 | for D := 2 to 7 do 348 | Write(DayNames[D], ' '); 349 | Write(DayNames[1], ' '); 350 | end 351 | else 352 | for D := 1 to 7 do 353 | Write(DayNames[D], ' '); 354 | end; 355 | 356 | // Prints one or more day strips, depending on options. 357 | procedure PrintDayStrips(Month, Year: Integer); 358 | var 359 | M, N: Integer; 360 | begin 361 | if ThreeMonths or FullYear then 362 | N := 3 363 | else 364 | N := 1; 365 | for M := 1 to N do 366 | begin 367 | PrintDayStrip; 368 | if M <> N then 369 | Write(' '); 370 | end; 371 | Writeln; 372 | end; 373 | 374 | // Finds weekday of first day of month. 375 | function WeekDayOfFirst(Month, Year: Word): Integer; 376 | var 377 | D: TDateTime; 378 | begin 379 | D := EncodeDate(Year, Month, 1); 380 | Result := DayOfTheWeek(D); 381 | end; 382 | 383 | // Swaps fore- and background colors on screen 384 | procedure ReverseColor; 385 | var 386 | Info: TConsoleScreenBufferInfo; 387 | begin 388 | if GetConsoleScreenBufferInfo(TTextRec(Output).Handle, Info) then 389 | begin 390 | SetConsoleTextAttribute(TTextRec(Output).Handle, 391 | ((Info.wAttributes and $0F) shl 4) or ((Info.wAttributes and $F0) shr 4)); 392 | end; 393 | end; 394 | 395 | // Prints one of more monthly calendars, depending on options. 396 | procedure PrintMonths(NumMonths, AMonth, AYear: Integer); 397 | var 398 | M, D: Integer; 399 | CurDay: array[1..3] of Integer; 400 | LastDay: array[1..3] of Integer; 401 | Finished: array[1..3] of Boolean; 402 | AllFinished: Boolean; 403 | StartMonth, StartYear: Integer; 404 | begin 405 | PrintMonthNames(AMonth, AYear); 406 | PrintDayStrips(AMonth, AYear); 407 | 408 | StartMonth := AMonth; 409 | StartYear := AYear; 410 | 411 | for M := 1 to NumMonths do 412 | begin 413 | CurDay[M] := 1 - WeekDayOfFirst(AMonth, AYear); 414 | if MondayFirst then 415 | CurDay[M] := CurDay[M] + 1; 416 | 417 | // Avoid empty line. 418 | if CurDay[M] = -6 then 419 | CurDay[M] := 1; 420 | 421 | LastDay[M] := DaysInAMonth(AYear, AMonth); 422 | Finished[M] := False; 423 | IncMonth(AMonth, AYear); 424 | end; 425 | 426 | repeat 427 | AMonth := StartMonth; 428 | AYear := StartYear; 429 | for M := 1 to NumMonths do 430 | begin 431 | for D := 1 to 7 do 432 | begin 433 | // Highlight today 434 | if (CurDay[M] = CurrentDay) and 435 | (AMonth = CurrentMonth) and 436 | (AYear = CurrentYear) then 437 | begin 438 | ReverseColor; 439 | Write(CurDay[M]: 2); 440 | ReverseColor; 441 | end 442 | else if (CurDay[M] > 0) and (CurDay[M] <= LastDay[M]) then 443 | Write(CurDay[M]: 2) 444 | else 445 | Write(' '); 446 | if D <> 7 then 447 | Write(' '); 448 | Inc(CurDay[M]); 449 | end; 450 | if CurDay[M] > LastDay[M] then 451 | Finished[M] := True; 452 | if M <> NumMonths then 453 | Write(' '); 454 | IncMonth(AMonth, AYear); 455 | end; 456 | Writeln; 457 | 458 | AllFinished := True; 459 | for M := 1 to NumMonths do 460 | AllFinished := AllFinished and Finished[M]; 461 | 462 | until AllFinished; 463 | end; 464 | 465 | // Uses local names, if required (default). 466 | procedure HandleNames; 467 | var 468 | I: Integer; 469 | begin 470 | if not English then 471 | begin 472 | // Copy localized names to our arrays. 473 | for I := Low(FormatSettings.LongMonthNames) to High(FormatSettings.LongMonthNames) do 474 | MonthNames[I] := FormatSettings.LongMonthNames[I]; 475 | for I := Low(FormatSettings.ShortDayNames) to High(FormatSettings.ShortDayNames) do 476 | DayNames[I] := FormatSettings.ShortDayNames[I]; 477 | end; 478 | end; 479 | 480 | // Prints calendar depending on options. 481 | procedure PrintCalendar; 482 | var 483 | Q: Integer; 484 | Margin: Integer; 485 | begin 486 | HandleNames; 487 | if ThreeMonths then 488 | begin 489 | // Print previous month, month and next month. 490 | DecMonth(Month, Year); 491 | PrintMonths(3, Month, Year); 492 | end 493 | else if FullYear then 494 | begin 495 | // Center year at top 496 | Margin := 66 - Length(IntToStr(Year)); 497 | Writeln('': Margin div 2, Year); 498 | Writeln; 499 | 500 | // Print 4 rows of 3 months each 501 | Month := 1; 502 | for Q := 1 to 4 do 503 | begin 504 | PrintMonths(3, Month, Year); 505 | if Q <> 4 then 506 | begin 507 | Writeln; 508 | Inc(Month, 3); 509 | end; 510 | end; 511 | end 512 | else 513 | // Print one month 514 | PrintMonths(1, Month, Year); 515 | end; 516 | 517 | begin 518 | try 519 | DecodeParams; 520 | PrintCalendar; 521 | except 522 | on E: Exception do 523 | Writeln(E.ClassName, ': ', E.Message); 524 | end; 525 | end. 526 | 527 | -------------------------------------------------------------------------------- /cal.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvelthuis/CommandLineTools/2f9f42ac42409c6f7c43de270d07323af2f5c291/cal.res -------------------------------------------------------------------------------- /echoc.dpr: -------------------------------------------------------------------------------- 1 | { } 2 | { File: echoc.dpr } 3 | { Function: Program for batch and command files to output text in color. } 4 | { Language: Delphi } 5 | { Author: Rudy Velthuis } 6 | { Copyright: (c) 2007 Rudy Velthuis } 7 | { } 8 | { License and disclaimer: } 9 | { } 10 | { Redistribution and use in source and binary forms, with or without } 11 | { modification, are permitted provided that the following conditions are } 12 | { met: } 13 | { } 14 | { * Redistributions of source code must retain the above copyright } 15 | { notice, this list of conditions and the following disclaimer. } 16 | { * Redistributions in binary form must reproduce the above copyright } 17 | { notice, this list of conditions and the following disclaimer in the } 18 | { documentation and/or other materials provided with the distribution. } 19 | { * Neither the name of Rudy Velthuis nor the names of any contributors } 20 | { of this software may be used to endorse or promote products derived } 21 | { from this software without specific prior written permission. } 22 | { } 23 | { THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS } 24 | { "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT } 25 | { LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR } 26 | { A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT } 27 | { OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, } 28 | { SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED } 29 | { TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR } 30 | { PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF } 31 | { LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING } 32 | { NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF } 33 | { THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } 34 | { } 35 | 36 | program echoc; 37 | 38 | {$APPTYPE CONSOLE} 39 | 40 | uses 41 | Winapi.Windows; 42 | 43 | var 44 | StdOut: THandle; 45 | TextAttr: Byte; 46 | 47 | procedure InitStdOut; 48 | var 49 | BufferInfo: TConsoleScreenBufferInfo; 50 | begin 51 | StdOut := GetStdHandle(STD_OUTPUT_HANDLE); 52 | GetConsoleScreenBufferInfo(StdOut, BufferInfo); 53 | TextAttr := BufferInfo.wAttributes and $FF; 54 | end; 55 | 56 | procedure TextColor(Color: Byte); 57 | begin 58 | TextAttr := (TextAttr and $F0) or (Color and $0F); 59 | SetConsoleTextAttribute(StdOut, TextAttr); 60 | end; 61 | 62 | procedure TextBackground(Color: Byte); 63 | begin 64 | TextAttr := (TextAttr and $0F) or ((Color shl 4) and $F0); 65 | SetConsoleTextAttribute(StdOut, TextAttr); 66 | end; 67 | 68 | 69 | procedure SetColorFromStr(const S: string; Foreground: Boolean); 70 | var 71 | Color: Byte; 72 | I: Integer; 73 | begin 74 | Color := 0; 75 | for I := 1 to Length(S) do 76 | if (S[I] >= '0') and (S[I] <= '9') then 77 | Color := Color * 10 + Ord(S[I]) - Ord('0') 78 | else 79 | Break; 80 | if Foreground then 81 | TextColor(Color) 82 | else 83 | TextBackground(Color); 84 | end; 85 | 86 | procedure WriteStr(const S: string; Separator: Boolean); 87 | var 88 | I: Integer; 89 | begin 90 | for I := 1 to Length(S) do 91 | if S[I] = '^' then 92 | Write(#13#10) 93 | else 94 | Write(S[I]); 95 | if Separator then 96 | Write(' '); 97 | end; 98 | 99 | procedure Help; 100 | const 101 | HelpText = 102 | #13#10 + 103 | 'ECHO in Color, Copyright (c) 2007 by Rudy Velthuis.'#13#10 + 104 | #13#10 + 105 | 'Usage: ECHOC backgnd foregnd "The text"'#13#10 + 106 | #13#10 + 107 | 'Foreground and background colors are numbers 0..15.'#13#10 + 108 | 'A ^ in the text represents a newline.'#13#10; 109 | begin 110 | Writeln(HelpText); 111 | end; 112 | 113 | var 114 | OldColor: Byte; 115 | I: Integer; 116 | 117 | begin 118 | InitStdOut; 119 | OldColor := TextAttr; 120 | if ParamCount = 0 then 121 | Help; 122 | if ParamCount > 0 then 123 | SetColorFromStr(ParamStr(1), False); 124 | if ParamCount > 1 then 125 | SetColorFromStr(ParamStr(2), True); 126 | if ParamCount > 2 then 127 | for I := 3 to ParamCount do 128 | WriteStr(ParamStr(I), I < ParamCount); 129 | TextBackground((OldColor and $F0) shr 4); 130 | TextColor(OldColor and $0F); 131 | end. 132 | -------------------------------------------------------------------------------- /echoc.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {07527150-3963-4361-A62F-CB6CB5EFBE4F} 4 | echoc.dpr 5 | True 6 | Debug 7 | 1153 8 | Console 9 | None 10 | 18.3 11 | Win32 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Base 34 | true 35 | 36 | 37 | true 38 | Base 39 | true 40 | 41 | 42 | true 43 | Base 44 | true 45 | 46 | 47 | true 48 | Cfg_2 49 | true 50 | true 51 | 52 | 53 | true 54 | Cfg_2 55 | true 56 | true 57 | 58 | 59 | true 60 | Cfg_2 61 | true 62 | true 63 | 64 | 65 | true 66 | Cfg_2 67 | true 68 | true 69 | 70 | 71 | false 72 | false 73 | false 74 | false 75 | false 76 | 00400000 77 | echoc 78 | 1031 79 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= 80 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 81 | $(BDS)\bin\delphi_PROJECTICON.ico 82 | $(BDS)\bin\delphi_PROJECTICNS.icns 83 | 84 | 85 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= 86 | Debug 87 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 88 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 89 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 90 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 91 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 92 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 93 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 94 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 95 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 96 | true 97 | true 98 | true 99 | true 100 | true 101 | true 102 | true 103 | true 104 | true 105 | true 106 | android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar 107 | 108 | 109 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera 110 | iPhoneAndiPad 111 | true 112 | Debug 113 | $(MSBuildProjectName) 114 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 115 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 116 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 117 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 118 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 119 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 120 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 121 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 122 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 123 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 124 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 125 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 126 | 127 | 128 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera 129 | iPhoneAndiPad 130 | true 131 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 132 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 133 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 134 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 135 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 136 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 137 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 138 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 139 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 140 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 141 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 142 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 143 | 144 | 145 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 146 | Debug 147 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) 148 | 1033 149 | 150 | 151 | RELEASE;$(DCC_Define) 152 | 0 153 | false 154 | 0 155 | 156 | 157 | DEBUG;$(DCC_Define) 158 | false 159 | true 160 | 161 | 162 | true 163 | 164 | 165 | Debug 166 | 167 | 168 | true 169 | 170 | 171 | C:\Tools\ 172 | 1033 173 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) 174 | D:\Downloads\echoc\(None) 175 | 176 | 177 | 178 | MainSource 179 | 180 | 181 | Cfg_2 182 | Base 183 | 184 | 185 | Base 186 | 187 | 188 | Cfg_1 189 | Base 190 | 191 | 192 | 193 | Delphi.Personality.12 194 | 195 | 196 | 197 | 198 | echoc.dpr 199 | 200 | 201 | Embarcadero C++Builder Office 2000 Servers Package 202 | Embarcadero C++Builder Office XP Servers Package 203 | Microsoft Office 2000 Sample Automation Server Wrapper Components 204 | Microsoft Office XP Sample Automation Server Wrapper Components 205 | 206 | 207 | 208 | False 209 | False 210 | True 211 | False 212 | True 213 | False 214 | True 215 | False 216 | 217 | 218 | 219 | 220 | echoc.exe 221 | true 222 | 223 | 224 | 225 | 226 | true 227 | 228 | 229 | 230 | 231 | true 232 | 233 | 234 | 235 | 236 | true 237 | 238 | 239 | 240 | 241 | true 242 | 243 | 244 | 245 | 246 | 1 247 | 248 | 249 | Contents\MacOS 250 | 0 251 | 252 | 253 | 254 | 255 | classes 256 | 1 257 | 258 | 259 | 260 | 261 | library\lib\armeabi-v7a 262 | 1 263 | 264 | 265 | 266 | 267 | library\lib\armeabi 268 | 1 269 | 270 | 271 | 272 | 273 | library\lib\mips 274 | 1 275 | 276 | 277 | 278 | 279 | library\lib\armeabi-v7a 280 | 1 281 | 282 | 283 | 284 | 285 | res\drawable 286 | 1 287 | 288 | 289 | 290 | 291 | res\values 292 | 1 293 | 294 | 295 | 296 | 297 | res\drawable 298 | 1 299 | 300 | 301 | 302 | 303 | res\drawable-xxhdpi 304 | 1 305 | 306 | 307 | 308 | 309 | res\drawable-ldpi 310 | 1 311 | 312 | 313 | 314 | 315 | res\drawable-mdpi 316 | 1 317 | 318 | 319 | 320 | 321 | res\drawable-hdpi 322 | 1 323 | 324 | 325 | 326 | 327 | res\drawable-xhdpi 328 | 1 329 | 330 | 331 | 332 | 333 | res\drawable-small 334 | 1 335 | 336 | 337 | 338 | 339 | res\drawable-normal 340 | 1 341 | 342 | 343 | 344 | 345 | res\drawable-large 346 | 1 347 | 348 | 349 | 350 | 351 | res\drawable-xlarge 352 | 1 353 | 354 | 355 | 356 | 357 | 1 358 | 359 | 360 | 1 361 | 362 | 363 | 0 364 | 365 | 366 | 367 | 368 | 1 369 | .framework 370 | 371 | 372 | 0 373 | 374 | 375 | 376 | 377 | 1 378 | .dylib 379 | 380 | 381 | 0 382 | .dll;.bpl 383 | 384 | 385 | 386 | 387 | 1 388 | .dylib 389 | 390 | 391 | 1 392 | .dylib 393 | 394 | 395 | 1 396 | .dylib 397 | 398 | 399 | 1 400 | .dylib 401 | 402 | 403 | 0 404 | .bpl 405 | 406 | 407 | 408 | 409 | 0 410 | 411 | 412 | 0 413 | 414 | 415 | 0 416 | 417 | 418 | 0 419 | 420 | 421 | 0 422 | 423 | 424 | 0 425 | 426 | 427 | 428 | 429 | 1 430 | 431 | 432 | 1 433 | 434 | 435 | 1 436 | 437 | 438 | 439 | 440 | 1 441 | 442 | 443 | 1 444 | 445 | 446 | 1 447 | 448 | 449 | 450 | 451 | 1 452 | 453 | 454 | 1 455 | 456 | 457 | 1 458 | 459 | 460 | 461 | 462 | 1 463 | 464 | 465 | 1 466 | 467 | 468 | 1 469 | 470 | 471 | 472 | 473 | 1 474 | 475 | 476 | 1 477 | 478 | 479 | 1 480 | 481 | 482 | 483 | 484 | 1 485 | 486 | 487 | 1 488 | 489 | 490 | 1 491 | 492 | 493 | 494 | 495 | 1 496 | 497 | 498 | 1 499 | 500 | 501 | 1 502 | 503 | 504 | 505 | 506 | 1 507 | 508 | 509 | 510 | 511 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 512 | 1 513 | 514 | 515 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 516 | 1 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 1 525 | 526 | 527 | 1 528 | 529 | 530 | 1 531 | 532 | 533 | 534 | 535 | 536 | 537 | Contents\Resources 538 | 1 539 | 540 | 541 | 542 | 543 | library\lib\armeabi-v7a 544 | 1 545 | 546 | 547 | 1 548 | 549 | 550 | 1 551 | 552 | 553 | 1 554 | 555 | 556 | 1 557 | 558 | 559 | 1 560 | 561 | 562 | 0 563 | 564 | 565 | 566 | 567 | 1 568 | 569 | 570 | 1 571 | 572 | 573 | 574 | 575 | Assets 576 | 1 577 | 578 | 579 | Assets 580 | 1 581 | 582 | 583 | 584 | 585 | Assets 586 | 1 587 | 588 | 589 | Assets 590 | 1 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 12 604 | 605 | 606 | 607 | 608 | 609 | -------------------------------------------------------------------------------- /echoc.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvelthuis/CommandLineTools/2f9f42ac42409c6f7c43de270d07323af2f5c291/echoc.res -------------------------------------------------------------------------------- /eolconv.dpr: -------------------------------------------------------------------------------- 1 | { } 2 | { File: eolconv.dpr } 3 | { Function: Command line tool that converts all line endings of a text } 4 | { file to a specified style or to the default. } 5 | { Language: Delphi } 6 | { Author: Rudy Velthuis } 7 | { Copyright: (c) 2018 Rudy Velthuis } 8 | { } 9 | { License and disclaimer: } 10 | { } 11 | { Redistribution and use in source and binary forms, with or without } 12 | { modification, are permitted provided that the following conditions are } 13 | { met: } 14 | { } 15 | { * Redistributions of source code must retain the above copyright } 16 | { notice, this list of conditions and the following disclaimer. } 17 | { * Redistributions in binary form must reproduce the above copyright } 18 | { notice, this list of conditions and the following disclaimer in the } 19 | { documentation and/or other materials provided with the distribution. } 20 | { * Neither the name of Rudy Velthuis nor the names of any contributors } 21 | { of this software may be used to endorse or promote products derived } 22 | { from this software without specific prior written permission. } 23 | { } 24 | { THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS } 25 | { "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT } 26 | { LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR } 27 | { A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT } 28 | { OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, } 29 | { SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED } 30 | { TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR } 31 | { PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF } 32 | { LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING } 33 | { NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF } 34 | { THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } 35 | { } 36 | 37 | program eolconv; 38 | 39 | {$APPTYPE CONSOLE} 40 | 41 | {$R *.res} 42 | 43 | uses 44 | {$IFDEF DEBUG} 45 | // Can be removed, see http://rvelthuis.de/programs/autoconsole.html 46 | Velthuis.AutoConsole, 47 | {$ENDIF } 48 | Winapi.Windows, 49 | System.SysUtils, 50 | System.Classes, 51 | EOLConv.Converters in 'EOLConv.Converters.pas'; 52 | 53 | const 54 | {$IFDEF MSWINDOWS} 55 | NL = #13#10; 56 | {$ELSE} 57 | NL = #10; 58 | {$ENDIF} 59 | 60 | resourcestring 61 | SCouldNotOpenFile = 'Could not open file ''%s'''; 62 | SCouldNotWriteBackup = 'Could not write backup file for ''%s'''; 63 | SHelpDescription = 'EOLCONV: Convert line ends of text file.' + NL; 64 | SHelp = 65 | 'Syntax: EOLCONV [options ...] Names[s]' + NL + NL + 66 | 'Options start with %s' + NL + 67 | ' -W Convert all to Windows line ends (CR+LF)%s' + NL + 68 | ' -U Convert all to Unix line ends (LF)%s' + NL + 69 | ' -H or -? Show this help' + NL; 70 | 71 | procedure Message(const FormatStr: string; Arguments: array of const); 72 | begin 73 | Writeln(Format(FormatStr, Arguments)); 74 | end; 75 | 76 | function ProcessFile(const FileName: string; LineEndType: TTextLineBreakStyle): Boolean; 77 | var 78 | I: Integer; 79 | BackupName: string; 80 | begin 81 | Result := True; 82 | // Check if file exists. 83 | if not FileExists(FileName) then 84 | begin 85 | Message(SCouldNotOpenFile, [FileName]); 86 | Exit(False); 87 | end; 88 | 89 | // Write backup file: fn+'.~1', fn+'.~2' etc. up to fn+'.~200'. 90 | I := 1; 91 | while FileExists(FileName + '.~' + IntToStr(I)) and (I < 200) do 92 | Inc(I); 93 | if I >= 200 then 94 | begin 95 | Message(SCouldNotWriteBackup, [FileName]); 96 | Exit(False); 97 | end 98 | else 99 | BackupName := FileName + '.~' + IntToStr(I); 100 | 101 | if ConvertFile(FileName, FileName + '.out', LineEndType) then 102 | begin 103 | RenameFile(FileName, BackupName); 104 | RenameFile(FileName + '.out', FileName); 105 | end; 106 | end; 107 | 108 | procedure Help(Description: Boolean); 109 | begin 110 | if Description then 111 | Writeln(SHelpDescription); 112 | {$IFDEF MSWINDOWS} 113 | Message(SHelp, ['- or /', ' (default)', '']); 114 | {$ELSE} 115 | Error(SHelp, ['-', '', ' (default)']); 116 | {$ENDIF} 117 | end; 118 | 119 | procedure ProcessParams(const FileNames: TStringList; var LineEndType: TTextLineBreakStyle); 120 | var 121 | I: Integer; 122 | begin 123 | // No parameters: Help -- syntax only 124 | if ParamCount = 0 then 125 | begin 126 | Help(False); 127 | Halt(1); 128 | end; 129 | 130 | // -H or -?: help with description 131 | if FindCmdLineSwitch('H', True) or FindCmdLineSwitch('?') then 132 | begin 133 | Help(True); 134 | Halt(0); 135 | end; 136 | 137 | // -U: Unix line ends 138 | if FindCmdLineSwitch('U', True) then 139 | LineEndType := tlbsLF 140 | 141 | // -W: Windows line ends 142 | else if FindCmdLineSwitch('W', True) then 143 | LineEndType := tlbsCRLF; 144 | 145 | // No - (or /): file name. 146 | for I := 1 to ParamCount do 147 | if (ParamStr(I)[1] <> '-') {$IFDEF MSWINDOWS} and (ParamStr(I)[1] <> '/') {$ENDIF} then 148 | FileNames.Add(ParamStr(I)); 149 | end; 150 | 151 | var 152 | FileNameList: TStringList; 153 | LineEndType: TTextLineBreakStyle = {$IFDEF MSWINDOWS}tlbsCRLF{$ELSE}tlbsLF{$ENDIF}; 154 | FileName: string; 155 | Success: Boolean = True; 156 | 157 | begin 158 | FileNameList := TStringList.Create; 159 | try 160 | ProcessParams(FileNameList, LineEndType); 161 | for FileName in FileNameList do 162 | Success := Success and ProcessFile(FileName, LineEndType); 163 | finally 164 | FileNameList.Free; 165 | end; 166 | if not Success then 167 | Halt(1); 168 | end. 169 | -------------------------------------------------------------------------------- /eolconv.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {A39E4984-DF47-4BB5-A85C-AB8251A660AE} 4 | 18.3 5 | None 6 | eolconv.dpr 7 | True 8 | Debug 9 | Win32 10 | 1 11 | Console 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Base 34 | true 35 | 36 | 37 | true 38 | Base 39 | true 40 | 41 | 42 | true 43 | Base 44 | true 45 | 46 | 47 | true 48 | Base 49 | true 50 | 51 | 52 | true 53 | Base 54 | true 55 | 56 | 57 | true 58 | Base 59 | true 60 | 61 | 62 | true 63 | Cfg_1 64 | true 65 | true 66 | 67 | 68 | true 69 | Base 70 | true 71 | 72 | 73 | .\$(Platform)\$(Config) 74 | .\$(Platform)\$(Config) 75 | false 76 | false 77 | false 78 | false 79 | false 80 | RESTComponents;emsclientfiredac;DataSnapFireDAC;FireDACIBDriver;emsclient;FireDACCommon;RESTBackendComponents;soapserver;CloudService;FireDACCommonDriver;inet;FireDAC;FireDACSqliteDriver;soaprtl;soapmidas;$(DCC_UsePackage) 81 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 82 | eolconv 83 | 84 | 85 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;bindengine;DataSnapClient;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;DataSnapNativeClient;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage) 86 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 87 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 88 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 89 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 90 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 91 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 92 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 93 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 94 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 95 | android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar 96 | 97 | 98 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;bindengine;DataSnapClient;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;DataSnapNativeClient;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) 99 | 100 | 101 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;bindengine;DataSnapClient;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;DataSnapNativeClient;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) 102 | 103 | 104 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;bindengine;DataSnapClient;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;DataSnapNativeClient;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) 105 | 106 | 107 | DataSnapServerMidas;FireDACADSDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;inetdb;emsedge;dbexpress;IndyCore;dsnap;DataSnapCommon;DataSnapConnectors;bindengine;FireDACOracleDriver;FireDACMySQLDriver;FireDACCommonODBC;DataSnapClient;IndySystem;FireDACDb2Driver;FireDACInfxDriver;emshosting;FireDACPgDriver;FireDACASADriver;FireDACTDataDriver;DbxCommonDriver;DataSnapServer;xmlrtl;DataSnapNativeClient;rtl;DbxClientDriver;CustomIPTransport;bindcomp;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;$(DCC_UsePackage) 108 | 109 | 110 | DBXSqliteDriver;DataSnapServerMidas;DBXInterBaseDriver;tethering;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;fmx;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;bindengine;DBXMySQLDriver;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;DataSnapClient;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;emshosting;FireDACPgDriver;ibmonitor;FireDACASADriver;FireDACTDataDriver;FMXTee;DbxCommonDriver;ibxpress;DataSnapServer;xmlrtl;DataSnapNativeClient;fmxobj;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) 111 | true 112 | 113 | 114 | DBXSqliteDriver;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;svnui;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;DataSnapConnectors;VCLRESTComponents;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;DataSnapClient;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;emshosting;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) 115 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 116 | Debug 117 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 118 | 1033 119 | true 120 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 121 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 122 | 123 | 124 | DBXSqliteDriver;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;Intraweb;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;fmx;fmxdae;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;DataSnapConnectors;VCLRESTComponents;vclie;bindengine;DBXMySQLDriver;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;DataSnapClient;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;emshosting;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;DataSnapNativeClient;fmxobj;vclwinx;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;inetdbxpress;FireDACMongoDBDriver;IndyProtocols;fmxase;$(DCC_UsePackage) 125 | true 126 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 127 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 128 | 129 | 130 | DEBUG;$(DCC_Define) 131 | true 132 | false 133 | true 134 | true 135 | true 136 | 137 | 138 | false 139 | -? 140 | 141 | 142 | false 143 | RELEASE;$(DCC_Define) 144 | 0 145 | 0 146 | 147 | 148 | 149 | MainSource 150 | 151 | 152 | 153 | Cfg_2 154 | Base 155 | 156 | 157 | Base 158 | 159 | 160 | Cfg_1 161 | Base 162 | 163 | 164 | 165 | Delphi.Personality.12 166 | Application 167 | 168 | 169 | 170 | eolconv.dpr 171 | 172 | 173 | 174 | 175 | 176 | eolconv.exe 177 | true 178 | 179 | 180 | 181 | 182 | true 183 | 184 | 185 | 186 | 187 | true 188 | 189 | 190 | 191 | 192 | true 193 | 194 | 195 | 196 | 197 | true 198 | 199 | 200 | 201 | 202 | 1 203 | 204 | 205 | Contents\MacOS 206 | 1 207 | 208 | 209 | Contents\MacOS 210 | 0 211 | 212 | 213 | 214 | 215 | classes 216 | 1 217 | 218 | 219 | 220 | 221 | library\lib\armeabi-v7a 222 | 1 223 | 224 | 225 | 226 | 227 | library\lib\armeabi 228 | 1 229 | 230 | 231 | 232 | 233 | library\lib\mips 234 | 1 235 | 236 | 237 | 238 | 239 | library\lib\armeabi-v7a 240 | 1 241 | 242 | 243 | 244 | 245 | res\drawable 246 | 1 247 | 248 | 249 | 250 | 251 | res\values 252 | 1 253 | 254 | 255 | 256 | 257 | res\drawable 258 | 1 259 | 260 | 261 | 262 | 263 | res\drawable-xxhdpi 264 | 1 265 | 266 | 267 | 268 | 269 | res\drawable-ldpi 270 | 1 271 | 272 | 273 | 274 | 275 | res\drawable-mdpi 276 | 1 277 | 278 | 279 | 280 | 281 | res\drawable-hdpi 282 | 1 283 | 284 | 285 | 286 | 287 | res\drawable-xhdpi 288 | 1 289 | 290 | 291 | 292 | 293 | res\drawable-small 294 | 1 295 | 296 | 297 | 298 | 299 | res\drawable-normal 300 | 1 301 | 302 | 303 | 304 | 305 | res\drawable-large 306 | 1 307 | 308 | 309 | 310 | 311 | res\drawable-xlarge 312 | 1 313 | 314 | 315 | 316 | 317 | 1 318 | 319 | 320 | Contents\MacOS 321 | 1 322 | 323 | 324 | 0 325 | 326 | 327 | 328 | 329 | Contents\MacOS 330 | 1 331 | .framework 332 | 333 | 334 | 0 335 | 336 | 337 | 338 | 339 | 1 340 | .dylib 341 | 342 | 343 | 1 344 | .dylib 345 | 346 | 347 | 1 348 | .dylib 349 | 350 | 351 | Contents\MacOS 352 | 1 353 | .dylib 354 | 355 | 356 | 0 357 | .dll;.bpl 358 | 359 | 360 | 361 | 362 | 1 363 | .dylib 364 | 365 | 366 | 1 367 | .dylib 368 | 369 | 370 | 1 371 | .dylib 372 | 373 | 374 | Contents\MacOS 375 | 1 376 | .dylib 377 | 378 | 379 | 0 380 | .bpl 381 | 382 | 383 | 384 | 385 | 0 386 | 387 | 388 | 0 389 | 390 | 391 | 0 392 | 393 | 394 | 0 395 | 396 | 397 | Contents\Resources\StartUp\ 398 | 0 399 | 400 | 401 | 0 402 | 403 | 404 | 405 | 406 | 1 407 | 408 | 409 | 1 410 | 411 | 412 | 1 413 | 414 | 415 | 416 | 417 | 1 418 | 419 | 420 | 1 421 | 422 | 423 | 1 424 | 425 | 426 | 427 | 428 | 1 429 | 430 | 431 | 1 432 | 433 | 434 | 1 435 | 436 | 437 | 438 | 439 | 1 440 | 441 | 442 | 1 443 | 444 | 445 | 1 446 | 447 | 448 | 449 | 450 | 1 451 | 452 | 453 | 1 454 | 455 | 456 | 1 457 | 458 | 459 | 460 | 461 | 1 462 | 463 | 464 | 1 465 | 466 | 467 | 1 468 | 469 | 470 | 471 | 472 | 1 473 | 474 | 475 | 1 476 | 477 | 478 | 1 479 | 480 | 481 | 482 | 483 | 1 484 | 485 | 486 | 487 | 488 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 489 | 1 490 | 491 | 492 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 493 | 1 494 | 495 | 496 | 497 | 498 | 1 499 | 500 | 501 | 1 502 | 503 | 504 | 505 | 506 | ..\ 507 | 1 508 | 509 | 510 | ..\ 511 | 1 512 | 513 | 514 | 515 | 516 | 1 517 | 518 | 519 | 1 520 | 521 | 522 | 1 523 | 524 | 525 | 526 | 527 | 1 528 | 529 | 530 | 1 531 | 532 | 533 | 1 534 | 535 | 536 | 537 | 538 | ..\ 539 | 1 540 | 541 | 542 | 543 | 544 | Contents 545 | 1 546 | 547 | 548 | 549 | 550 | Contents\Resources 551 | 1 552 | 553 | 554 | 555 | 556 | library\lib\armeabi-v7a 557 | 1 558 | 559 | 560 | 1 561 | 562 | 563 | 1 564 | 565 | 566 | 1 567 | 568 | 569 | 1 570 | 571 | 572 | Contents\MacOS 573 | 1 574 | 575 | 576 | 0 577 | 578 | 579 | 580 | 581 | 1 582 | 583 | 584 | 1 585 | 586 | 587 | 588 | 589 | Assets 590 | 1 591 | 592 | 593 | Assets 594 | 1 595 | 596 | 597 | 598 | 599 | Assets 600 | 1 601 | 602 | 603 | Assets 604 | 1 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | False 618 | False 619 | False 620 | False 621 | False 622 | False 623 | True 624 | False 625 | 626 | 627 | 12 628 | 629 | 630 | 631 | 632 | 633 | -------------------------------------------------------------------------------- /eolconv.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvelthuis/CommandLineTools/2f9f42ac42409c6f7c43de270d07323af2f5c291/eolconv.res -------------------------------------------------------------------------------- /exact.dpr: -------------------------------------------------------------------------------- 1 | { } 2 | { File: exact.dpr } 3 | { Function: Prints exact value of string when converted to IEEE-754 } 4 | { floating point single, double and extended precision. } 5 | { Language: Delphi XE2 or higher } 6 | { Author: Rudy Velthuis } 7 | { Copyright: (c) 2017 Rudy Velthuis } 8 | { } 9 | { Requires: Velthuis.BigDecimals and Velthuis.BigIntegers units from } 10 | { https://github.com/rvelthuis/DelphiBigNumbers/tree/master } 11 | { /Source } 12 | { } 13 | { License and disclaimer: } 14 | { } 15 | { Redistribution and use in source and binary forms, with or without } 16 | { modification, are permitted provided that the following conditions are } 17 | { met: } 18 | { } 19 | { * Redistributions of source code must retain the above copyright } 20 | { notice, this list of conditions and the following disclaimer. } 21 | { * Redistributions in binary form must reproduce the above copyright } 22 | { notice, this list of conditions and the following disclaimer in the } 23 | { documentation and/or other materials provided with the distribution. } 24 | { * Neither the name of Rudy Velthuis nor the names of any contributors } 25 | { of this software may be used to endorse or promote products derived } 26 | { from this software without specific prior written permission. } 27 | { } 28 | { THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS } 29 | { "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT } 30 | { LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR } 31 | { A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT } 32 | { OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, } 33 | { SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED } 34 | { TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR } 35 | { PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF } 36 | { LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING } 37 | { NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF } 38 | { THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } 39 | { } 40 | 41 | program exact; 42 | 43 | {$APPTYPE CONSOLE} 44 | 45 | {$R *.res} 46 | 47 | uses 48 | System.SysUtils, 49 | System.Math, 50 | Velthuis.BigIntegers, 51 | Velthuis.BigDecimals; 52 | 53 | procedure Help; 54 | begin 55 | Writeln; 56 | Writeln('EXACT'); 57 | Writeln; 58 | Writeln('Shows the exact values generated for a floating point string, for the'); 59 | Writeln('IEEE-754 binary floating point single, double and extended precision'); 60 | Writeln('data types, and their hexadecimal representations.'); 61 | Writeln; 62 | Writeln('Examples:'); 63 | Writeln(' EXACT 1.2345'); 64 | Writeln(' EXACT 17.93e17'); 65 | Writeln(' EXACT 1e-30'); 66 | Writeln; 67 | Writeln('http://rvelthuis.de/programs/exact.html'); 68 | Writeln; 69 | end; 70 | 71 | type 72 | PUInt16 = ^UInt16; 73 | PUInt32 = ^UInt32; 74 | PUInt64 = ^UInt64; 75 | 76 | {$POINTERMATH ON} 77 | 78 | function SingleString(Sgl: Single): string; 79 | var 80 | B: BigDecimal; 81 | begin 82 | if IsInfinite(Sgl) then 83 | if Sgl < 0 then 84 | Result := '-Infinity' 85 | else 86 | Result := '+Infinity' 87 | else 88 | begin 89 | B := Sgl; 90 | Result := B.ToString; 91 | end; 92 | end; 93 | 94 | function DoubleString(Dbl: Double): string; 95 | var 96 | B: BigDecimal; 97 | begin 98 | if IsInfinite(Dbl) then 99 | if Dbl < 0 then 100 | Result := '-Infinity' 101 | else 102 | Result := '+Infinity' 103 | else 104 | begin 105 | B := Dbl; 106 | Result := B.ToString; 107 | end; 108 | end; 109 | 110 | function ExtendedString(Ext: Extended): string; 111 | var 112 | B: BigDecimal; 113 | begin 114 | if IsInfinite(Ext) then 115 | if Ext < 0 then 116 | Result := '-Infinity' 117 | else 118 | Result := '+Infinity' 119 | else 120 | begin 121 | B := Ext; 122 | Result := B.ToString; 123 | end; 124 | end; 125 | 126 | function TrimZeroes(const S: string): string; 127 | var 128 | I: Integer; 129 | begin 130 | I := Length(S); 131 | while S[I] = '0' do 132 | Dec(I); 133 | if I <= 0 then 134 | Result := '0' 135 | else 136 | Result := Copy(S, 1, I); 137 | end; 138 | 139 | function SignedStr(I: Integer): string; 140 | begin 141 | if I >= 0 then 142 | Result := '+' + IntToStr(I) 143 | else 144 | Result := IntToStr(I); 145 | end; 146 | 147 | function DoubleToHex(D: Double): string; 148 | begin 149 | case D.SpecialType of 150 | fsZero: 151 | Result := '0x0.0p+0'; 152 | fsNZero: 153 | Result := '-0x0.0p+0'; 154 | fsDenormal: 155 | Result := Format('0x0.%sp-1022', [TrimZeroes(Format('%.13X', [D.Mantissa and $FFFFFFFFFFFFF]))]); 156 | fsNDenormal: 157 | Result := Format('-0x0.%sp-1022', [TrimZeroes(Format('%.13X', [D.Mantissa and $FFFFFFFFFFFFF]))]); 158 | fsPositive: 159 | Result := Format('0x1.%sp%s', [TrimZeroes(Format('%.13X', [D.Mantissa and $FFFFFFFFFFFFF])), SignedStr(D.Exponent)]); 160 | fsNegative: 161 | Result := Format('-0x1.%sp%s', [TrimZeroes(Format('%.13X', [D.Mantissa and $FFFFFFFFFFFFF])), SignedStr(D.Exponent)]); 162 | fsInf: 163 | Result := '+Infinity'; 164 | fsNInf: 165 | Result := '-Infinity'; 166 | fsNaN: 167 | Result := 'NaN'; 168 | end; 169 | end; 170 | 171 | 172 | procedure HexValue(const S: string); 173 | var 174 | BD: BigDecimal; 175 | BI: BigInteger; 176 | Sgl: Single; 177 | Dbl: Double; 178 | Ext: Extended; 179 | begin 180 | if BigInteger.TryParse(S, 16, BI) then 181 | begin 182 | Sgl := PSingle(BI.Data)^; 183 | Dbl := PDouble(BI.Data)^; 184 | Ext := PExtended(BI.Data)^; 185 | Writeln('Hex Value: ', BI.ToString(16)); 186 | Writeln; 187 | Writeln('32 bit float: ', SingleString(Sgl)); 188 | Writeln('64 bit float: ', DoubleString(Dbl), ' (', DoubleToHex(Dbl), ')'); 189 | Writeln('80 bit float: ', ExtendedString(Ext)); 190 | Writeln; 191 | end 192 | else 193 | begin 194 | Writeln(ErrOutput, 'Invalid hex number'); 195 | Writeln; 196 | end; 197 | 198 | end; 199 | 200 | procedure ExactValue(const S: string); 201 | var 202 | B: BigDecimal; 203 | Sgl: Single; 204 | Dbl: Double; 205 | Ext: Extended; 206 | Value: string; 207 | begin 208 | B := S; 209 | Writeln('The value: ', S, ' (', B.ToString, ')'); 210 | Writeln; 211 | 212 | // Single 213 | Sgl := Single(B); 214 | Writeln('32 bit float: ', SingleString(Sgl)); 215 | Writeln(Format('Hex: %.8X', [PUInt32(@Sgl)^])); 216 | Writeln; 217 | 218 | // Double 219 | Dbl := Double(B); 220 | Writeln('64 bit float: ', DoubleString(Dbl)); 221 | Writeln(Format('Hex: %.16X (%s)', [PUInt64(@Dbl)^, DoubleToHex(Dbl)])); 222 | Writeln; 223 | 224 | {$IF SizeOf(Extended) > SizeOf(Double)} 225 | // Extended 226 | Ext := Extended(B); 227 | Writeln('80 bit float: ', ExtendedString(Ext)); 228 | Writeln(Format('Hex: %.4X%.16X', [PUInt16(@Ext)[4], PUInt64(@Ext)^])); 229 | Writeln; 230 | {$IFEND} 231 | end; 232 | 233 | begin 234 | try 235 | if ParamCount < 1 then 236 | Help 237 | else 238 | ExactValue(ParamStr(1)); 239 | except 240 | on E: Exception do 241 | Writeln(E.ClassName, ': ', E.Message); 242 | end; 243 | end. 244 | -------------------------------------------------------------------------------- /exact.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {6F571563-CF64-41C6-B0DB-0D56B472E683} 4 | exact.dpr 5 | True 6 | Debug 7 | 1153 8 | Console 9 | None 10 | 18.4 11 | Win32 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Base 34 | true 35 | 36 | 37 | true 38 | Base 39 | true 40 | 41 | 42 | true 43 | Base 44 | true 45 | 46 | 47 | true 48 | Cfg_2 49 | true 50 | true 51 | 52 | 53 | true 54 | Cfg_2 55 | true 56 | true 57 | 58 | 59 | true 60 | Cfg_2 61 | true 62 | true 63 | 64 | 65 | true 66 | Cfg_2 67 | true 68 | true 69 | 70 | 71 | false 72 | false 73 | false 74 | false 75 | false 76 | 00400000 77 | Exact 78 | 1031 79 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= 80 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 81 | $(BDS)\bin\delphi_PROJECTICON.ico 82 | $(BDS)\bin\delphi_PROJECTICNS.icns 83 | 84 | 85 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= 86 | Debug 87 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 88 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 89 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 90 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 91 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 92 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 93 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 94 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 95 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 96 | true 97 | true 98 | true 99 | true 100 | true 101 | true 102 | true 103 | true 104 | true 105 | true 106 | android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar 107 | 108 | 109 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera 110 | iPhoneAndiPad 111 | true 112 | Debug 113 | $(MSBuildProjectName) 114 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 115 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 116 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 117 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 118 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 119 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 120 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 121 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 122 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 123 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 124 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 125 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 126 | 127 | 128 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera 129 | iPhoneAndiPad 130 | true 131 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 132 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 133 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 134 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 135 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 136 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 137 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 138 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 139 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 140 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 141 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 142 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 143 | 144 | 145 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 146 | Debug 147 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) 148 | 1033 149 | 150 | 151 | RELEASE;$(DCC_Define) 152 | 0 153 | false 154 | 0 155 | 156 | 157 | DEBUG;$(DCC_Define) 158 | false 159 | true 160 | 161 | 162 | true 163 | 164 | 165 | Debug 166 | 167 | 168 | true 169 | 170 | 171 | C:\Tools 172 | 1033 173 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) 174 | (None) 175 | 176 | 177 | 178 | MainSource 179 | 180 | 181 | Cfg_2 182 | Base 183 | 184 | 185 | Base 186 | 187 | 188 | Cfg_1 189 | Base 190 | 191 | 192 | 193 | Delphi.Personality.12 194 | 195 | 196 | 197 | 198 | exact.dpr 199 | 200 | 201 | Embarcadero C++Builder Office 2000 Servers Package 202 | Embarcadero C++Builder Office XP Servers Package 203 | Microsoft Office 2000 Sample Automation Server Wrapper Components 204 | Microsoft Office XP Sample Automation Server Wrapper Components 205 | 206 | 207 | 208 | False 209 | False 210 | True 211 | False 212 | True 213 | False 214 | True 215 | False 216 | 217 | 218 | 219 | 220 | true 221 | 222 | 223 | 224 | 225 | true 226 | 227 | 228 | 229 | 230 | true 231 | 232 | 233 | 234 | 235 | true 236 | 237 | 238 | 239 | 240 | exact.exe 241 | true 242 | 243 | 244 | 245 | 246 | 1 247 | 248 | 249 | Contents\MacOS 250 | 0 251 | 252 | 253 | 254 | 255 | classes 256 | 1 257 | 258 | 259 | 260 | 261 | library\lib\armeabi-v7a 262 | 1 263 | 264 | 265 | 266 | 267 | library\lib\armeabi 268 | 1 269 | 270 | 271 | 272 | 273 | library\lib\mips 274 | 1 275 | 276 | 277 | 278 | 279 | library\lib\armeabi-v7a 280 | 1 281 | 282 | 283 | 284 | 285 | res\drawable 286 | 1 287 | 288 | 289 | 290 | 291 | res\values 292 | 1 293 | 294 | 295 | 296 | 297 | res\drawable 298 | 1 299 | 300 | 301 | 302 | 303 | res\drawable-xxhdpi 304 | 1 305 | 306 | 307 | 308 | 309 | res\drawable-ldpi 310 | 1 311 | 312 | 313 | 314 | 315 | res\drawable-mdpi 316 | 1 317 | 318 | 319 | 320 | 321 | res\drawable-hdpi 322 | 1 323 | 324 | 325 | 326 | 327 | res\drawable-xhdpi 328 | 1 329 | 330 | 331 | 332 | 333 | res\drawable-small 334 | 1 335 | 336 | 337 | 338 | 339 | res\drawable-normal 340 | 1 341 | 342 | 343 | 344 | 345 | res\drawable-large 346 | 1 347 | 348 | 349 | 350 | 351 | res\drawable-xlarge 352 | 1 353 | 354 | 355 | 356 | 357 | 1 358 | 359 | 360 | 1 361 | 362 | 363 | 0 364 | 365 | 366 | 367 | 368 | 1 369 | .framework 370 | 371 | 372 | 0 373 | 374 | 375 | 376 | 377 | 1 378 | .dylib 379 | 380 | 381 | 0 382 | .dll;.bpl 383 | 384 | 385 | 386 | 387 | 1 388 | .dylib 389 | 390 | 391 | 1 392 | .dylib 393 | 394 | 395 | 1 396 | .dylib 397 | 398 | 399 | 1 400 | .dylib 401 | 402 | 403 | 0 404 | .bpl 405 | 406 | 407 | 408 | 409 | 0 410 | 411 | 412 | 0 413 | 414 | 415 | 0 416 | 417 | 418 | 0 419 | 420 | 421 | 0 422 | 423 | 424 | 0 425 | 426 | 427 | 428 | 429 | 1 430 | 431 | 432 | 1 433 | 434 | 435 | 1 436 | 437 | 438 | 439 | 440 | 1 441 | 442 | 443 | 1 444 | 445 | 446 | 1 447 | 448 | 449 | 450 | 451 | 1 452 | 453 | 454 | 1 455 | 456 | 457 | 1 458 | 459 | 460 | 461 | 462 | 1 463 | 464 | 465 | 1 466 | 467 | 468 | 1 469 | 470 | 471 | 472 | 473 | 1 474 | 475 | 476 | 1 477 | 478 | 479 | 1 480 | 481 | 482 | 483 | 484 | 1 485 | 486 | 487 | 1 488 | 489 | 490 | 1 491 | 492 | 493 | 494 | 495 | 1 496 | 497 | 498 | 1 499 | 500 | 501 | 1 502 | 503 | 504 | 505 | 506 | 1 507 | 508 | 509 | 510 | 511 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 512 | 1 513 | 514 | 515 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 516 | 1 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 1 525 | 526 | 527 | 1 528 | 529 | 530 | 1 531 | 532 | 533 | 534 | 535 | 536 | 537 | Contents\Resources 538 | 1 539 | 540 | 541 | 542 | 543 | library\lib\armeabi-v7a 544 | 1 545 | 546 | 547 | 1 548 | 549 | 550 | 1 551 | 552 | 553 | 1 554 | 555 | 556 | 1 557 | 558 | 559 | 1 560 | 561 | 562 | 0 563 | 564 | 565 | 566 | 567 | 1 568 | 569 | 570 | 1 571 | 572 | 573 | 574 | 575 | Assets 576 | 1 577 | 578 | 579 | Assets 580 | 1 581 | 582 | 583 | 584 | 585 | Assets 586 | 1 587 | 588 | 589 | Assets 590 | 1 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 12 604 | 605 | 606 | 607 | 608 | 609 | -------------------------------------------------------------------------------- /exact.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvelthuis/CommandLineTools/2f9f42ac42409c6f7c43de270d07323af2f5c291/exact.res -------------------------------------------------------------------------------- /slack.dpr: -------------------------------------------------------------------------------- 1 | { } 2 | { File: slack.dpr } 3 | { Function: Program to calculate slack caused by cluster size. } 4 | { Language: Delphi for Win32 } 5 | { Author: Rudy Velthuis } 6 | { Copyright: (c) 2005 Rudy Velthuis } 7 | { } 8 | { License and disclaimer: } 9 | { } 10 | { Redistribution and use in source and binary forms, with or without } 11 | { modification, are permitted provided that the following conditions are } 12 | { met: } 13 | { } 14 | { * Redistributions of source code must retain the above copyright } 15 | { notice, this list of conditions and the following disclaimer. } 16 | { * Redistributions in binary form must reproduce the above copyright } 17 | { notice, this list of conditions and the following disclaimer in the } 18 | { documentation and/or other materials provided with the distribution. } 19 | { * Neither the name of Rudy Velthuis nor the names of any contributors } 20 | { of this software may be used to endorse or promote products derived } 21 | { from this software without specific prior written permission. } 22 | { } 23 | { THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS } 24 | { "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT } 25 | { LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR } 26 | { A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT } 27 | { OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, } 28 | { SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED } 29 | { TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR } 30 | { PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF } 31 | { LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING } 32 | { NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF } 33 | { THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } 34 | { } 35 | 36 | 37 | program slack; 38 | 39 | {$APPTYPE CONSOLE} 40 | 41 | {$IFDEF CONDITIONALEXPRESSIONS} 42 | {$IF CompilerVersion >= 17.0} 43 | {$DEFINE CANINLINE} 44 | {$IFEND} 45 | {$ENDIF} 46 | 47 | uses 48 | SysUtils, 49 | Windows; 50 | 51 | var 52 | ClusterSize: Word; 53 | StartDirectory: string; 54 | FileCount: Int64; 55 | DirectorySize: Int64; 56 | FileSystemName: array[0..9] of Char; 57 | 58 | function GetClusterSize(Drive: Char): Longint; 59 | {$IFDEF CANINLINE} inline; {$ENDIF} 60 | var 61 | SectorsPerCluster, 62 | BytesPerSector, 63 | Dummy: Cardinal; 64 | begin 65 | SectorsPerCluster := 0; 66 | BytesPerSector := 0; 67 | GetDiskFreeSpace(PChar(Drive + ':\'), SectorsPerCluster, 68 | BytesPerSector, Dummy, Dummy); 69 | Result := SectorsPerCluster * BytesPerSector; 70 | GetVolumeInformation(PChar(Drive + ':\'), nil, 0, nil, Dummy, Dummy, 71 | FileSystemName, SizeOf(FileSystemName)); 72 | end; 73 | 74 | procedure Help; 75 | {$IFDEF CANINLINE} inline; {$ENDIF} 76 | begin 77 | Writeln; 78 | Writeln('Usage: SLACK [Options] Filename'); 79 | Writeln; 80 | Writeln('Options start with - or /'); 81 | Writeln(' -H or -? Show this help'); 82 | Writeln; 83 | Writeln('SLACK calculates the number of wasted bytes caused by cluster size.'); 84 | Writeln; 85 | Halt; 86 | end; 87 | 88 | procedure DecodeParams; 89 | {$IFDEF CANINLINE} inline; {$ENDIF} 90 | var 91 | ParamNo: Integer; 92 | Param: string; 93 | begin 94 | if ParamCount = 0 then 95 | GetDir(0, StartDirectory) 96 | else 97 | begin 98 | for ParamNo := 1 to ParamCount do 99 | begin 100 | Param := ParamStr(ParamNo); 101 | if (Length(Param) > 1) and ((Param[1] = '-') or (Param[1] = '/')) then 102 | case UpCase(Param[2]) of 103 | 'H', '?': 104 | Help; 105 | else 106 | Help; 107 | end 108 | else 109 | StartDirectory := ExpandFileName(ParamStr(ParamNo)); 110 | end; 111 | end; 112 | end; 113 | 114 | { Calculates the wasted bytes for a file with the given size. } 115 | function CalcWaste(Size: Uint64): Int64; // Uint64 gives AV! 116 | {$IFDEF CANINLINE} inline; {$ENDIF} 117 | var 118 | Diff: Longint; 119 | begin 120 | Diff := Size mod ClusterSize; 121 | if Diff > 0 then 122 | CalcWaste := ClusterSize - Diff 123 | else 124 | CalcWaste := 0; 125 | end; 126 | 127 | { Calculates the wasted bytes of all files in a directory and } 128 | { its subdirectories. } 129 | function CalcDirWaste(Dir: string): Int64; 130 | { Can't inline: recursive } 131 | var 132 | SR: TSearchRec; 133 | Error: Integer; 134 | begin 135 | Result := 0; 136 | Dir := IncludeTrailingPathDelimiter(Dir); 137 | Error := SysUtils.FindFirst(Dir + '*.*', faAnyFile, SR); 138 | try 139 | while Error = 0 do 140 | begin 141 | if ((SR.Attr and faDirectory) <> 0) and 142 | (SR.Name <> '.') and (SR.Name <> '..') then 143 | Inc(Result, CalcDirWaste(Dir + SR.Name)) 144 | else 145 | begin 146 | Inc(Result, CalcWaste(SR.Size)); 147 | Inc(FileCount); 148 | Inc(DirectorySize, SR.Size); 149 | end; 150 | Error := SysUtils.FindNext(SR); 151 | end; 152 | finally 153 | SysUtils.FindClose(SR); 154 | end; 155 | end; 156 | 157 | function FormatInt(L: Int64): string; 158 | {$IFDEF CANINLINE} inline; {$ENDIF} 159 | begin 160 | Result := Format('%.n', [L + 0.0]); 161 | end; 162 | 163 | function FormatSizes(L: Int64): string; 164 | {$IFDEF CANINLINE} inline; {$ENDIF} 165 | begin 166 | Result := FormatInt(L) + ' bytes'; 167 | if L > 1024 then 168 | begin 169 | Result := Result + ' = ' + FormatInt(L div 1024) + ' KB'; 170 | if L > 1024 * 1024 then 171 | Result := Result + ' = ' + FormatInt(L div (1024 * 1024)) + ' MB'; 172 | end; 173 | end; 174 | 175 | var 176 | Wasted: Int64; 177 | 178 | begin 179 | try 180 | DecodeParams; 181 | if not DirectoryExists(StartDirectory) then 182 | begin 183 | Writeln; 184 | Writeln('Invalid directory: ', StartDirectory); 185 | Halt(1); 186 | end; 187 | DirectorySize := 0; 188 | FileCount := 0; 189 | ClusterSize := GetClusterSize(StartDirectory[1]); 190 | Writeln; 191 | Writeln('Path: ', StartDirectory); 192 | Writeln('File system type: ', FileSystemName); 193 | Writeln('Cluster size: ', FormatInt(ClusterSize), ' bytes'); 194 | Write('Calculating wasted disk space, please wait...'); 195 | Wasted := CalcDirWaste(StartDirectory); 196 | Write(#13' '#13); 197 | Writeln('Total file sizes: ', FormatSizes(DirectorySize)); 198 | Writeln('Wasted: ', FormatSizes(Wasted)); 199 | Writeln('Percentage wasted: ', (100.0 * Wasted / (DirectorySize + Wasted)):0:1, 200 | '%'); 201 | Writeln('Files: ', FormatInt(FileCount), ', wasted ', FormatInt(Wasted div FileCount), ' bytes per file' ); 202 | except 203 | on E: Exception do 204 | Writeln('Error: Exception', E.ClassName, ' with message: ', E.Message); 205 | end; 206 | end. 207 | 208 | -------------------------------------------------------------------------------- /slack.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvelthuis/CommandLineTools/2f9f42ac42409c6f7c43de270d07323af2f5c291/slack.res -------------------------------------------------------------------------------- /whereis.dpr: -------------------------------------------------------------------------------- 1 | { } 2 | { File: whereis.dpr } 3 | { Function: Whereis command line tool } 4 | { Language: Delphi for Win32 } 5 | { Author: Rudy Velthuis } 6 | { Copyright: (c) 2005 Rudy Velthuis } 7 | { } 8 | { License and disclaimer: } 9 | { } 10 | { Redistribution and use in source and binary forms, with or without } 11 | { modification, are permitted provided that the following conditions are } 12 | { met: } 13 | { } 14 | { * Redistributions of source code must retain the above copyright } 15 | { notice, this list of conditions and the following disclaimer. } 16 | { * Redistributions in binary form must reproduce the above copyright } 17 | { notice, this list of conditions and the following disclaimer in the } 18 | { documentation and/or other materials provided with the distribution. } 19 | { * Neither the name of Rudy Velthuis nor the names of any contributors } 20 | { of this software may be used to endorse or promote products derived } 21 | { from this software without specific prior written permission. } 22 | { } 23 | { THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS } 24 | { "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT } 25 | { LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR } 26 | { A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT } 27 | { OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, } 28 | { SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED } 29 | { TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR } 30 | { PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF } 31 | { LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING } 32 | { NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF } 33 | { THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. } 34 | { } 35 | 36 | program whereis; 37 | 38 | {$APPTYPE CONSOLE} 39 | {$IFDEF ConditionalExpressions} 40 | {$IF RTLVersion >= 17.0} 41 | {$WARN SYMBOL_PLATFORM OFF} 42 | {$INLINE AUTO} 43 | {$IFEND} 44 | {$ENDIF} 45 | 46 | uses 47 | Windows, 48 | SysUtils, 49 | Classes; 50 | 51 | const 52 | CRLF = #13#10; 53 | 54 | var 55 | Debugging: Boolean = False; 56 | 57 | resourcestring 58 | StrHelp = 59 | 'Syntax: WHEREIS [options ...] Name[s]' + CRLF + CRLF + 60 | 'Options start with - or /' + CRLF + 61 | ' -W emulate Which: find first executable like OS does' + CRLF + 62 | ' -D show debug output' + CRLF + 63 | ' -H or -? show this help'; 64 | StrCouldNotFind = 'Could not find %s'; 65 | 66 | procedure ShowHelp; 67 | begin 68 | Writeln(StrHelp); 69 | Halt(1); 70 | end; 71 | 72 | procedure AddString(const S: string; List: TStrings); 73 | begin 74 | if List.IndexOf(S) < 0 then 75 | List.Add(S); 76 | end; 77 | 78 | procedure ParseParameters(Names: TStrings; var FirstResultOnly: Boolean); 79 | var 80 | I: Integer; 81 | S: string; 82 | begin 83 | for I := 1 to ParamCount do 84 | begin 85 | S := ParamStr(I); 86 | if (Length(S) = 2) and ((S[1] = '/') or (S[1] = '-')) then 87 | case UpCase(S[2]) of 88 | 'W': FirstResultOnly := True; 89 | 'H', '?': ShowHelp; 90 | 'D': Debugging := True; 91 | end 92 | else 93 | AddString(S, Names); 94 | end; 95 | end; 96 | 97 | procedure GetDelimitedText(S: string; Delimiter: Char; ResultList: TStrings); 98 | var 99 | Start, Stop: Integer; 100 | Len: Integer; 101 | begin 102 | Len := Length(S); 103 | if Len = 0 then 104 | Exit; 105 | if S[Len] <> Delimiter then 106 | begin 107 | S := S + Delimiter; 108 | Inc(Len); 109 | end; 110 | Start := 1; 111 | while Start <= Len do 112 | begin 113 | Stop := Start; 114 | while S[Stop] <> Delimiter do 115 | Inc(Stop); 116 | AddString(Copy(S, Start, Stop - Start), ResultList); 117 | Start := Stop + 1; 118 | end; 119 | end; 120 | 121 | function ExecutableDirectory: string; 122 | begin 123 | // Here, we don't want the executable directory of Whereis, we want the 124 | // directory in which the command interpreter resides. 125 | Result := ExcludeTrailingBackslash(ExtractFileDir( 126 | GetEnvironmentVariable('COMSPEC'))); 127 | if Debugging then 128 | Writeln('Executable directory: ', Result); 129 | end; 130 | 131 | function CurrentDirectory: string; 132 | inline; 133 | begin 134 | SetLength(Result, 2 * MAX_PATH); 135 | GetCurrentDirectory(Length(Result) - 1, PChar(Result)); 136 | Result := PChar(Result); 137 | if Debugging then 138 | Writeln('Current directory: ', Result); 139 | end; 140 | 141 | function SystemDirectory: string; 142 | inline; 143 | begin 144 | SetLength(Result, 2 * MAX_PATH); 145 | GetSystemDirectory(PChar(Result), Length(Result) - 1); 146 | Result := PChar(Result); 147 | if Debugging then 148 | Writeln('System directory: ', Result); 149 | end; 150 | 151 | function WindowsDirectory: string; 152 | inline; 153 | begin 154 | SetLength(Result, 2 * MAX_PATH); 155 | GetWindowsDirectory(PChar(Result), Length(Result) - 1); 156 | Result := PChar(Result); 157 | if Debugging then 158 | Writeln('Windows directory: ', Result); 159 | end; 160 | 161 | procedure InitDirectories(ResultList: TStrings); 162 | inline; 163 | begin 164 | AddString(ExecutableDirectory, ResultList); 165 | AddString(CurrentDirectory, ResultList); 166 | AddString(SystemDirectory, ResultList); 167 | AddString(WindowsDirectory, ResultList); 168 | GetDelimitedText(GetEnvironmentVariable('PATH'), ';', ResultList); 169 | end; 170 | 171 | const 172 | DefaultExtensions = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'; 173 | 174 | procedure InitExtensions(Extensions: TStrings); inline; 175 | begin 176 | // PATHEXT may not exist in some OSes. 177 | GetDelimitedText(DefaultExtensions, ';', Extensions); 178 | GetDelimitedText(GetEnvironmentVariable('PATHEXT'), ';', Extensions); 179 | end; 180 | 181 | function FindFiles(const Directory, FileName: string; 182 | ResultList: TStrings): Boolean; 183 | var 184 | SearchRec: TSearchRec; 185 | Found: Boolean; 186 | FullDir: string; 187 | begin 188 | Result := False; 189 | FullDir := IncludeTrailingBackslash(Directory); 190 | 191 | Found := FindFirst(FullDir + FileName, faAnyFile, SearchRec) = 0; 192 | while Found do 193 | begin 194 | Result := True; 195 | AddString(FullDir + SearchRec.Name, ResultList); 196 | Found := FindNext(SearchRec) = 0; 197 | end; 198 | FindClose(SearchRec); 199 | end; 200 | 201 | function HasExecutableExtension(const Name: string; Extensions: TStrings): Boolean; 202 | begin 203 | Result := Extensions.IndexOf(ExtractFileExt(Name)) >= 0; 204 | end; 205 | 206 | function SearchExecutable(const Directory, Name: string; 207 | Extensions, ResultList: TStrings; FirstResultOnly: Boolean): Boolean; 208 | var 209 | I: Integer; 210 | begin 211 | Result := False; 212 | if HasExecutableExtension(Name, Extensions) then 213 | Result := FindFiles(Directory, Name, ResultList) 214 | else 215 | for I := 0 to Extensions.Count - 1 do 216 | begin 217 | Result := FindFiles(Directory, Name + Extensions[I], ResultList); 218 | if Result and FirstResultOnly then 219 | Exit; 220 | end; 221 | end; 222 | 223 | procedure SearchDirectories(const Name: string; 224 | Directories, Extensions, ResultList: TStrings; FirstResultOnly: Boolean); 225 | // inlining this routine crashes app! 226 | var 227 | I: Integer; 228 | begin 229 | for I := 0 to Directories.Count - 1 do 230 | if SearchExecutable(Directories[I], Name, Extensions, ResultList, 231 | FirstResultOnly) then 232 | if FirstResultOnly then 233 | Break; 234 | end; 235 | 236 | var 237 | Directories: TStringList; 238 | Extensions: TStringList; 239 | Results: TStringList; 240 | Names: TStringList; 241 | FirstResultOnly: Boolean = False; 242 | I, J: Integer; 243 | 244 | begin 245 | Writeln; 246 | Results := TStringList.Create; 247 | Directories := TStringList.Create; 248 | Extensions := TStringList.Create; 249 | Names := TStringList.Create; 250 | try 251 | ParseParameters(Names, FirstResultOnly); 252 | InitDirectories(Directories); 253 | InitExtensions(Extensions); 254 | if Names.Count = 0 then 255 | ShowHelp; 256 | for I := 0 to Names.Count - 1 do 257 | begin 258 | Results.Clear; 259 | SearchDirectories(Names[I], Directories, Extensions, Results, 260 | FirstResultOnly); 261 | if Results.Count > 0 then 262 | begin 263 | for J := 0 to Results.Count - 1 do 264 | Writeln(Results[J]); 265 | Writeln; 266 | end 267 | else 268 | begin 269 | Writeln(Format(StrCouldNotFind, [Names[I]])); 270 | Writeln; 271 | end; 272 | end; 273 | finally 274 | Names.Free; 275 | Extensions.Free; 276 | Directories.Free; 277 | Results.Free; 278 | end; 279 | end. 280 | 281 | -------------------------------------------------------------------------------- /whereis.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {4955D0A6-A55A-4F0F-95E7-5410B4297943} 4 | whereis.dpr 5 | True 6 | Debug 7 | 1153 8 | Console 9 | None 10 | 18.3 11 | Win32 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Base 34 | true 35 | 36 | 37 | true 38 | Base 39 | true 40 | 41 | 42 | true 43 | Base 44 | true 45 | 46 | 47 | true 48 | Cfg_2 49 | true 50 | true 51 | 52 | 53 | true 54 | Cfg_2 55 | true 56 | true 57 | 58 | 59 | true 60 | Cfg_2 61 | true 62 | true 63 | 64 | 65 | false 66 | false 67 | false 68 | false 69 | false 70 | 00400000 71 | Whereis 72 | 1031 73 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= 74 | System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) 75 | $(BDS)\bin\delphi_PROJECTICON.ico 76 | $(BDS)\bin\delphi_PROJECTICNS.icns 77 | 78 | 79 | package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= 80 | Debug 81 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 82 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 83 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 84 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 85 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 86 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 87 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 88 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 89 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 90 | true 91 | true 92 | true 93 | true 94 | true 95 | true 96 | true 97 | true 98 | true 99 | true 100 | android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar 101 | 102 | 103 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera 104 | iPhoneAndiPad 105 | true 106 | Debug 107 | $(MSBuildProjectName) 108 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 109 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 110 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 111 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 112 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 113 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 114 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 115 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 116 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 117 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 118 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 119 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 120 | 121 | 122 | CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSCameraUsageDescription=The reason for accessing the camera 123 | iPhoneAndiPad 124 | true 125 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 126 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 127 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 128 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 129 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 130 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 131 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 132 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 133 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 134 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 135 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 136 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 137 | 138 | 139 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 140 | Debug 141 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) 142 | 1033 143 | 144 | 145 | RELEASE;$(DCC_Define) 146 | 0 147 | false 148 | 0 149 | 150 | 151 | DEBUG;$(DCC_Define) 152 | false 153 | true 154 | 155 | 156 | true 157 | 158 | 159 | Debug 160 | 161 | 162 | true 163 | 164 | 165 | 166 | MainSource 167 | 168 | 169 | Cfg_2 170 | Base 171 | 172 | 173 | Base 174 | 175 | 176 | Cfg_1 177 | Base 178 | 179 | 180 | 181 | Delphi.Personality.12 182 | 183 | 184 | 185 | 186 | whereis.dpr 187 | 188 | 189 | 190 | False 191 | False 192 | True 193 | False 194 | True 195 | False 196 | True 197 | False 198 | 199 | 200 | 201 | 202 | true 203 | 204 | 205 | 206 | 207 | true 208 | 209 | 210 | 211 | 212 | true 213 | 214 | 215 | 216 | 217 | true 218 | 219 | 220 | 221 | 222 | whereis.exe 223 | true 224 | 225 | 226 | 227 | 228 | 1 229 | 230 | 231 | Contents\MacOS 232 | 0 233 | 234 | 235 | 236 | 237 | classes 238 | 1 239 | 240 | 241 | 242 | 243 | library\lib\armeabi-v7a 244 | 1 245 | 246 | 247 | 248 | 249 | library\lib\armeabi 250 | 1 251 | 252 | 253 | 254 | 255 | library\lib\mips 256 | 1 257 | 258 | 259 | 260 | 261 | library\lib\armeabi-v7a 262 | 1 263 | 264 | 265 | 266 | 267 | res\drawable 268 | 1 269 | 270 | 271 | 272 | 273 | res\values 274 | 1 275 | 276 | 277 | 278 | 279 | res\drawable 280 | 1 281 | 282 | 283 | 284 | 285 | res\drawable-xxhdpi 286 | 1 287 | 288 | 289 | 290 | 291 | res\drawable-ldpi 292 | 1 293 | 294 | 295 | 296 | 297 | res\drawable-mdpi 298 | 1 299 | 300 | 301 | 302 | 303 | res\drawable-hdpi 304 | 1 305 | 306 | 307 | 308 | 309 | res\drawable-xhdpi 310 | 1 311 | 312 | 313 | 314 | 315 | res\drawable-small 316 | 1 317 | 318 | 319 | 320 | 321 | res\drawable-normal 322 | 1 323 | 324 | 325 | 326 | 327 | res\drawable-large 328 | 1 329 | 330 | 331 | 332 | 333 | res\drawable-xlarge 334 | 1 335 | 336 | 337 | 338 | 339 | 1 340 | 341 | 342 | 1 343 | 344 | 345 | 0 346 | 347 | 348 | 349 | 350 | 1 351 | .framework 352 | 353 | 354 | 0 355 | 356 | 357 | 358 | 359 | 1 360 | .dylib 361 | 362 | 363 | 0 364 | .dll;.bpl 365 | 366 | 367 | 368 | 369 | 1 370 | .dylib 371 | 372 | 373 | 1 374 | .dylib 375 | 376 | 377 | 1 378 | .dylib 379 | 380 | 381 | 1 382 | .dylib 383 | 384 | 385 | 0 386 | .bpl 387 | 388 | 389 | 390 | 391 | 0 392 | 393 | 394 | 0 395 | 396 | 397 | 0 398 | 399 | 400 | 0 401 | 402 | 403 | 0 404 | 405 | 406 | 0 407 | 408 | 409 | 410 | 411 | 1 412 | 413 | 414 | 1 415 | 416 | 417 | 1 418 | 419 | 420 | 421 | 422 | 1 423 | 424 | 425 | 1 426 | 427 | 428 | 1 429 | 430 | 431 | 432 | 433 | 1 434 | 435 | 436 | 1 437 | 438 | 439 | 1 440 | 441 | 442 | 443 | 444 | 1 445 | 446 | 447 | 1 448 | 449 | 450 | 1 451 | 452 | 453 | 454 | 455 | 1 456 | 457 | 458 | 1 459 | 460 | 461 | 1 462 | 463 | 464 | 465 | 466 | 1 467 | 468 | 469 | 1 470 | 471 | 472 | 1 473 | 474 | 475 | 476 | 477 | 1 478 | 479 | 480 | 1 481 | 482 | 483 | 1 484 | 485 | 486 | 487 | 488 | 1 489 | 490 | 491 | 492 | 493 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 494 | 1 495 | 496 | 497 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 498 | 1 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 1 507 | 508 | 509 | 1 510 | 511 | 512 | 1 513 | 514 | 515 | 516 | 517 | 518 | 519 | Contents\Resources 520 | 1 521 | 522 | 523 | 524 | 525 | library\lib\armeabi-v7a 526 | 1 527 | 528 | 529 | 1 530 | 531 | 532 | 1 533 | 534 | 535 | 1 536 | 537 | 538 | 1 539 | 540 | 541 | 1 542 | 543 | 544 | 0 545 | 546 | 547 | 548 | 549 | 1 550 | 551 | 552 | 1 553 | 554 | 555 | 556 | 557 | Assets 558 | 1 559 | 560 | 561 | Assets 562 | 1 563 | 564 | 565 | 566 | 567 | Assets 568 | 1 569 | 570 | 571 | Assets 572 | 1 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 12 586 | 587 | 588 | 589 | 590 | 591 | -------------------------------------------------------------------------------- /whereis.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvelthuis/CommandLineTools/2f9f42ac42409c6f7c43de270d07323af2f5c291/whereis.res --------------------------------------------------------------------------------