Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / apps / gperf / src / gperf.cpp
bloba00f8000daadb6b0fcf700d168d85305f134aff4
1 // -*- C++ -*-
3 // Driver program for the gperf hash function generator.
5 /**
6 * Copyright (C) 1989 Free Software Foundation, Inc.
7 * written by Douglas C. Schmidt (d.schmidt@vanderbilt.edu)
9 * This file is part of GNU GPERF.
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #include "Gen_Perf.h"
27 #include "Options.h"
28 #include "ace/OS_NS_time.h"
29 #include "ace/OS_NS_stdio.h"
30 #include "ace/OS_main.h"
32 int
33 ACE_TMAIN (int argc, ACE_TCHAR *argv[])
35 // Sets the Options.
36 if (option.parse_args (argc, argv) == -1)
37 return 1;
39 time_t clock;
40 ACE_OS::time (&clock);
41 struct tm *tm = ACE_OS::localtime (&clock);
43 if (option[DEBUGGING])
44 ACE_OS::printf ("/* starting time is %d:%02d:%02d */\n",
45 tm->tm_hour,
46 tm->tm_min,
47 tm->tm_sec);
49 // Initializes the key word list.
50 Gen_Perf gperf;
52 // Generates and prints the gperf hash table. Don't use exit here,
53 // it skips the destructors.
54 int const status = gperf.run ();
56 ACE_OS::time (&clock);
57 tm = ACE_OS::localtime (&clock);
59 if (option[DEBUGGING])
60 ACE_OS::printf ("/* ending time is %d:%02d:%02d */\n",
61 tm->tm_hour,
62 tm->tm_min,
63 tm->tm_sec);
64 return status;