1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

New option --output-file.

This commit is contained in:
Bruno Haible
2003-01-28 12:18:10 +00:00
parent 281d151d8e
commit f54d310530
8 changed files with 73 additions and 2 deletions

View File

@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "options.h"
#include "input.h"
#include "search.h"
@@ -78,6 +79,16 @@ main (int argc, char *argv[])
searcher.optimize ();
list = searcher._head;
/* Open the output file. */
if (option.get_output_file_name ())
if (strcmp (option.get_output_file_name (), "-") != 0)
if (!freopen (option.get_output_file_name (), "w", stdout))
{
fprintf (stderr, "Cannot open output file '%s'\n",
option.get_output_file_name ());
exit (1);
}
{
/* Output the hash function code. */
Output outputter (searcher._head,