aboutsummaryrefslogtreecommitdiffstats
path: root/libibex/mkindex.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-02-17 10:10:05 +0800
committerDan Winship <danw@src.gnome.org>2000-02-17 10:10:05 +0800
commit89fefc5c8cac87a722f4efd61b49e2c75e765687 (patch)
tree115161dc87397c35da70e03e724c85ded3f0abd9 /libibex/mkindex.c
parent704369d07078a4a6a28552eaaad30d3758052d30 (diff)
downloadgsoc2013-evolution-89fefc5c8cac87a722f4efd61b49e2c75e765687.tar.gz
gsoc2013-evolution-89fefc5c8cac87a722f4efd61b49e2c75e765687.tar.zst
gsoc2013-evolution-89fefc5c8cac87a722f4efd61b49e2c75e765687.zip
fix license and indent style
svn path=/trunk/; revision=1814
Diffstat (limited to 'libibex/mkindex.c')
-rw-r--r--libibex/mkindex.c103
1 files changed, 56 insertions, 47 deletions
diff --git a/libibex/mkindex.c b/libibex/mkindex.c
index 8018caef69..9d6841e90b 100644
--- a/libibex/mkindex.c
+++ b/libibex/mkindex.c
@@ -1,6 +1,22 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- Copyright 2000 Helix Code Inc.
-*/
+ * Copyright (C) 2000 Helix Code Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
/* mkindex.c: a simple client, part 1 */
#include <errno.h>
@@ -14,62 +30,55 @@ extern int optind;
extern char *optarg;
static void
-usage(void)
+usage (void)
{
- fprintf(stderr, "Usage: mkindex [-f indexfile] file ...\n");
- exit(1);
+ fprintf (stderr, "Usage: mkindex [-f indexfile] file ...\n");
+ exit (1);
}
int
-main(int argc, char **argv)
+main (int argc, char **argv)
{
- ibex *ib;
- int opt;
- char *file = "INDEX";
+ ibex *ib;
+ int opt;
+ char *file = "INDEX";
- while ((opt = getopt(argc, argv, "f:")) != -1)
- {
- switch (opt)
- {
- case 'f':
- file = optarg;
- break;
+ while ((opt = getopt (argc, argv, "f:")) != -1) {
+ switch (opt) {
+ case 'f':
+ file = optarg;
+ break;
- default:
- usage();
- break;
+ default:
+ usage ();
+ break;
+ }
}
- }
- argc -= optind;
- argv += optind;
-
- if (argc == 0)
- usage();
+ argc -= optind;
+ argv += optind;
- ib = ibex_open(file, TRUE);
- if (!ib)
- {
- fprintf(stderr, "Couldn't open index file %s: %s\n",
- file, strerror(errno));
- exit(1);
- }
+ if (argc == 0)
+ usage ();
- while (argc--)
- {
- if (ibex_index_file(ib, argv[argc]) == -1)
- {
- fprintf(stderr, "Couldn't index %s: %s\n", argv[argc],
- strerror(errno));
- exit(1);
+ ib = ibex_open (file, TRUE);
+ if (!ib) {
+ fprintf (stderr, "Couldn't open index file %s: %s\n",
+ file, strerror (errno));
+ exit (1);
}
- }
+ while (argc--) {
+ if (ibex_index_file (ib, argv[argc]) == -1) {
+ fprintf (stderr, "Couldn't index %s: %s\n",
+ argv[argc], strerror (errno));
+ exit (1);
+ }
+ }
- if (ibex_close(ib) != 0)
- {
- fprintf(stderr, "Failed to write index file %s: %s\n",
- file, strerror(errno));
- exit(1);
- }
- exit(0);
+ if (ibex_close (ib) != 0) {
+ fprintf (stderr, "Failed to write index file %s: %s\n",
+ file, strerror (errno));
+ exit (1);
+ }
+ exit (0);
}