source: trunk/third/sendmail/libsm/flags.c @ 19204

Revision 19204, 1.2 KB 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) 2000-2001 Sendmail, Inc. and its suppliers.
3 *      All rights reserved.
4 * Copyright (c) 1990, 1993
5 *      The Regents of the University of California.  All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Chris Torek.
9 *
10 * By using this file, you agree to the terms and conditions set
11 * forth in the LICENSE file which can be found at the top level of
12 * the sendmail distribution.
13 */
14
15#include <sm/gen.h>
16SM_RCSID("@(#)$Id: flags.c,v 1.1.1.1 2003-04-08 15:06:04 zacheiss Exp $")
17#include <sys/types.h>
18#include <sys/file.h>
19#include <errno.h>
20#include <sm/io.h>
21
22/*
23**  SM_FLAGS -- translate external (user) flags into internal flags
24**
25**      Paramters:
26**              flags -- user select flags
27**
28**      Returns:
29**              Internal flag value matching user selected flags
30*/
31
32int
33sm_flags(flags)
34        register int flags;
35{
36        register int ret;
37
38        switch(flags)
39        {
40          case SM_IO_RDONLY:    /* open for reading */
41                ret = SMRD;
42                break;
43
44          case SM_IO_WRONLY:    /* open for writing */
45                ret = SMWR;
46                break;
47
48          case SM_IO_APPEND:    /* open for appending */
49                ret = SMWR;
50                break;
51
52          case SM_IO_RDWR:      /* open for read and write */
53                ret = SMRW;
54                break;
55
56          default:
57                ret = 0;
58                break;
59        }
60        return ret;
61}
Note: See TracBrowser for help on using the repository browser.