ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/Spectre/Spectre.cpp
(Generate patch)

Comparing trunk/Spectre/Spectre.cpp (file contents):
Revision 317 by douglas, 2003-07-30T21:23:14-07:00 vs.
Revision 318 by douglas, 2004-03-22T20:22:17-08:00

# Line 1 | Line 1
1 + /* ============================================================================
2 + * Spectre Samba Mounter
3 + *
4 + * Copyright © 2003-2004, Douglas Thrift. 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 + * 1. Redistributions of source code must retain the above copyright notice,
10 + *    this list of conditions and the following disclaimer.
11 + *
12 + * 2. 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 + * 3. The end-user documentation included with the redistribution, if any, must
17 + *    include the following acknowledgment:
18 + *
19 + *       "This product includes software developed by Douglas Thrift
20 + *       (http://computers.douglasthrift.net/spectre.xml)."
21 + *
22 + *    Alternately, this acknowledgment may appear in the software itself, if
23 + *    and wherever such third-party acknowledgments normally appear.
24 + *
25 + * 4. The names "Douglas Thrift" and "Spectre Samba Mounter" must not be used
26 + *    to endorse or promote products derived from this software without
27 + *    specific prior written permission. For written permission, please visit
28 + *    http://www.douglasthrift.net/contact.cgi for contact information.
29 + *
30 + * 5. Products derived from this software may not be called "Spectre Samba
31 + *    Mounter", nor may "Spectre Samba Mounter" appear in their name, without
32 + *    prior written permission.
33 + *
34 + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
35 + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
36 + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
37 + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
38 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
39 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
40 + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
41 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
42 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
43 + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 + * ============================================================================
45 + */
46   // Spectre Samba Mounter
47   //
48   // Douglas Thrift
49   //
50 < // $Id: Spectre.cpp,v 1.14 2003/07/31 04:23:14 douglas Exp $
50 > // $Id: Spectre.cpp,v 1.15 2004/03/23 04:22:17 douglas Exp $
51  
52   #include "Spectre.h"
53   #include "Maker.h"
# Line 11 | Line 56
56  
57   string program;
58   string programName = "Spectre Samba Mounter";
59 < string programVersion = "1.0rc2";
59 > string programVersion = "1.0";
60   bool debug = false;
61  
62   Config config;
# Line 51 | Line 96 | int spectre(vector<string>& args)
96          set<string> makes;
97          set<string> mounts;
98          set<string> unmounts;
99 <        
99 >
100          for (int index = 1; index < args.size(); index++)
101          {
102                  if (args[index] == "-help")
# Line 67 | Line 112 | int spectre(vector<string>& args)
112                  else if (args[index] == "-make")
113                  {
114                          if (!make) make = true;
115 <                        
115 >
116                          if (++index < args.size())
117                          {
118                                  makes.insert(args[index]);
# Line 277 | Line 322 | void usage()
322   void version()
323   {
324          cout << programName << " " << programVersion << " "<< platform() << "\n\n"
325 <                << "   Copyright (C) 2003, Douglas Thrift. All Rights Reserved.\n\n"
325 >                << "   Copyright © 2003, Douglas Thrift. All Rights Reserved.\n\n"
326                  << "   This product includes software developed by Douglas Thrift\n"
327                  << "   (http://computers.douglasthrift.net/).\n";
328   }
# Line 287 | Line 332 | void automake(set<string>& makes)
332          vector<string> args;
333  
334          args.push_back("spectre");
335 <        
335 >
336          ipstream findsmb(config.findsmb, args);
337  
338          if (debug) cerr << "findsmb = {\n";
# Line 369 | Line 414 | void automount(set<string>& mounts)
414          vector<string> args;
415  
416          args.push_back("spectre");
417 <        
417 >
418          ipstream findsmb(config.findsmb, args);
419  
420          if (debug) cerr << "findsmb = {\n";
# Line 387 | Line 432 | void automount(set<string>& mounts)
432          while (findsmb.good());
433  
434          set<string> hosts;
435 <        
435 >
436          automake(hosts, findsmb);
437  
438          if (debug) cerr << "}\n";
# Line 500 | Line 545 | void configure()
545          do
546          {
547                  string line;
548 <                
548 >
549                  getline(fin, line);
550  
551                  if (line.find('#') == 0 || line == "")

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines