Revert "usbd - Do not start moused by default when a usb mouse is connected"
[dragonfly.git] / contrib / sendmail-8.14 / libsm / flags.c
blob97c38fa5ffd198e3e4818c0c99132456f58c59ef
1 /*
2 * Copyright (c) 2000-2001, 2004, 2006 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.
7 * This code is derived from software contributed to Berkeley by
8 * Chris Torek.
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.
15 #include <sm/gen.h>
16 SM_RCSID("@(#)$Id: flags.c,v 1.23 2006/12/19 19:44:23 ca Exp $")
17 #include <sys/types.h>
18 #include <sys/file.h>
19 #include <errno.h>
20 #include <sm/io.h>
21 #include "local.h"
24 ** SM_FLAGS -- translate external (user) flags into internal flags
26 ** Paramters:
27 ** flags -- user select flags
29 ** Returns:
30 ** Internal flag value matching user selected flags
33 int
34 sm_flags(flags)
35 int flags;
37 int ret;
39 switch(SM_IO_MODE(flags))
41 case SM_IO_RDONLY: /* open for reading */
42 ret = SMRD;
43 break;
45 case SM_IO_WRONLY: /* open for writing */
46 ret = SMWR;
47 break;
49 case SM_IO_APPEND: /* open for appending */
50 ret = SMWR;
51 break;
53 case SM_IO_RDWR: /* open for read and write */
54 ret = SMRW;
55 break;
57 default:
58 ret = 0;
59 break;
61 if (SM_IS_BINARY(flags))
62 ret |= SM_IO_BINARY;
63 return ret;