4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
35 main(int argc
, char **argv
)
37 /* Make sure we are in the correct locale */
38 (void) setlocale(LC_ALL
, "");
39 (void) textdomain(TEXT_DOMAIN
);
41 /* Superficial check of the arguments. Note usage() exits the pgm */
46 * OK, hand it off to bart_create() or bart_compare().
48 * Since the command line was 'bart create ..', or 'bart compare ..',
49 * those subcommands should start parsing options at &argv[1], and
50 * (argc-1) to be consistent.
52 if (strcmp(argv
[1], "create") == 0)
53 return (bart_create((argc
-1), (argv
+1)));
54 else if (strcmp(argv
[1], "compare") == 0) {
55 return (bart_compare((argc
-1), (argv
+1)));
64 (void) fprintf(stderr
, USAGE_MSG
);
68 safe_calloc(size_t size
)
72 ptr
= calloc((size_t)1, size
);