Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtlogin / apollo / passwd.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: passwd.h /main/3 1995/10/27 16:19:23 rswiston $ */
24 /*                                                                      *
25  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
26  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
27  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
28  * (c) Copyright 1993, 1994 Novell, Inc.                                *
29  */
30 /* passwd.h us/unix/include/apollo/sys, brian
31    Password definitions
32
33
34      --------------------------------------------------------------------------
35     |   THE FOLLOWING PROGRAMS ARE THE SOLE PROPERTY OF APOLLO COMPUTER INC.   |
36     |         AND CONTAIN ITS PROPRIETARY AND CONFIDENTIAL INFORMATION.        |
37      --------------------------------------------------------------------------
38
39 Changes:
40     12/27/88    gilbert Modifications for C++.
41     03/25/88    brian   ANSI version (from .ins.c)
42     11/05/87    betsy   need to include des.ins.c 
43     08/31/87    betsy   add support for unix encryption, remove passwd_$create
44                           for sr10 registry
45     07/07/87    pato    drop the (wrong) explicit values for passwd_$encrypt_t
46     04/02/86    lwa     Change enum to short enum.
47     01/13/86    nazgul  Created C version
48     04/05/82    PJL     changes for DES encryption
49 */
50
51 #ifndef apollo_sys_passwd_ins_c
52 #define apollo_sys_passwd_ins_c
53
54
55 /*  Enable function prototypes for ANSI C and C++  */
56 #if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
57 #    define _PROTOTYPES
58 #endif
59
60 /*  Required for C++ V2.0  */
61 #ifdef  __cplusplus
62     extern "C" {
63 #endif
64
65 #ifdef _PROTOTYPES
66 #define std_$call       extern
67 #endif
68
69 #include "apollo/des.h"         /* copy from <apollo/sys/des.h>  */
70
71 #define  passwd_$mod     3
72 #define  passwd_$maxlen 8
73
74 typedef  short  enum { passwd_$none, passwd_$des,
75                        passwd_$unix, passwd_$unix_bits }   passwd_$encrypt_t;
76 typedef  struct {
77     passwd_$encrypt_t  ptype;
78     union {
79         char  plain[8];                 /* passwd_$none */
80         struct {                        /* passwd_$des, passwd_$unix_bits   */
81             short       rand;
82             des_$text   bits;
83         } des; 
84         struct {                        /* passwd_$unix */
85             char        salt[2];
86             char        cipher[12]; 
87         } unix_encrypted;
88     } pw_union;
89 } passwd_$rec_t;
90
91 typedef  char  passwd_$str_t[passwd_$maxlen];            
92
93 std_$call boolean   passwd_$check(
94 #ifdef _PROTOTYPES
95                 passwd_$str_t           & pass_str,
96                 short                   & pass_len,
97                 passwd_$rec_t           & enc_passwd,
98                 status_$t               * status
99 #endif
100 );
101
102 #ifdef  __cplusplus
103     }
104 #endif
105
106 #endif