source: trunk/third/sendmail/libsm/t-cf.c @ 19204

Revision 19204, 942 bytes checked in by zacheiss, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r19203, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2 * Copyright (c) 2001 Sendmail, Inc. and its suppliers.
3 *      All rights reserved.
4 *
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
8 *
9 */
10
11#include <sm/gen.h>
12SM_IDSTR(id, "@(#)$Id: t-cf.c,v 1.1.1.1 2003-04-08 15:06:05 zacheiss Exp $")
13
14#include <errno.h>
15#include <stdio.h>
16#include <stdlib.h>
17#include <string.h>
18#include <sm/cf.h>
19
20int
21main(argc, argv)
22        int argc;
23        char **argv;
24{
25        SM_CF_OPT_T opt;
26        int err;
27
28        if (argc != 3)
29        {
30                fprintf(stderr, "Usage: %s .cf-file option\n", argv[0]);
31                exit(1);
32        }
33        opt.opt_name = argv[2];
34        opt.opt_val = NULL;
35        err = sm_cf_getopt(argv[1], 1, &opt);
36        if (err)
37        {
38                fprintf(stderr, "%s: %s\n", argv[1], strerror(err));
39                exit(1);
40        }
41        if (opt.opt_val == NULL)
42                printf("Error: option \"%s\" not found\n", opt.opt_name);
43        else
44                printf("%s=%s\n", opt.opt_name, opt.opt_val);
45        return 0;
46}
Note: See TracBrowser for help on using the repository browser.