2 * scsilist.cpp - Outputs the contents of a ScsiDeviceList.
4 * Author: Robert Nelson, August, 2006 <robertn@the-nelsons.org>
8 * This file was contributed to the Bacula project by Robert Nelson.
10 * Robert Nelson has been granted a perpetual, worldwide,
11 * non-exclusive, no-charge, royalty-free, irrevocable copyright
12 * license to reproduce, prepare derivative works of, publicly
13 * display, publicly perform, sublicense, and distribute the original
14 * work contributed by Robert Nelson to the Bacula project in source
17 * If you wish to license contributions from Robert Nelson
18 * under an alternate open source license please contact
19 * Robert Nelson <robertn@the-nelsons.org>.
22 Bacula® - The Network Backup Solution
24 Copyright (C) 2006-2006 Free Software Foundation Europe e.V.
26 The main author of Bacula is Kern Sibbald, with contributions from
27 many others, a complete list can be found in the file AUTHORS.
28 This program is Free Software; you can redistribute it and/or
29 modify it under the terms of version three of the GNU Affero General Public
30 License as published by the Free Software Foundation and included
33 This program is distributed in the hope that it will be useful, but
34 WITHOUT ANY WARRANTY; without even the implied warranty of
35 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36 General Public License for more details.
38 You should have received a copy of the GNU Affero General Public License
39 along with this program; if not, write to the Free Software
40 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
43 Bacula® is a registered trademark of Kern Sibbald.
44 The licensor of Bacula is the Free Software Foundation Europe
45 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
46 Switzerland, email:ftf@fsfeurope.org.
49 #if defined(_MSC_VER) && defined(_DEBUG)
59 #include "ScsiDeviceList.h"
61 #if defined(_MSC_VER) && defined(_DEBUG)
65 int _tmain(int argc, _TCHAR* argv[])
67 #if defined(_MSC_VER) && defined(_DEBUG)
68 CMemoryState InitialMemState, FinalMemState, DiffMemState;
70 InitialMemState.Checkpoint();
75 CScsiDeviceList DeviceList;
77 if (!DeviceList.Populate())
79 DeviceList.PrintLastError();
84 _T("Device Type Physical Name\n") \
85 _T("====== ==== ======== ====\n")
87 _fputts(HEADING, stdout);
89 for (DWORD index = 0; index < DeviceList.size(); index++) {
91 CScsiDeviceListEntry &entry = DeviceList[index];
93 if (entry.GetType() != CScsiDeviceListEntry::Disk) {
95 _tprintf(_T("%-28s %-7s %-11s %-27s\n"),
96 entry.GetIdentifier(),
98 entry.GetDevicePath(),
99 entry.GetDeviceName());
103 #if defined(_MSC_VER) && defined(_DEBUG)
106 InitialMemState.DumpAllObjectsSince();
108 FinalMemState.Checkpoint();
109 DiffMemState.Difference(InitialMemState, FinalMemState);
110 DiffMemState.DumpStatistics();
113 if (argc > 1 && _tcsnicmp(argv[1], _T("/pause"), sizeof(_T("/pause")) - sizeof(TCHAR)) == 0) {
114 _fputts(_T("\nPress any key to continue\n"), stderr);