Subversion Repositories tendra.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
#   		 Crown Copyright (c) 1997
2
#   
3
#   This TenDRA(r) Computer Program is subject to Copyright
4
#   owned by the United Kingdom Secretary of State for Defence
5
#   acting through the Defence Evaluation and Research Agency
6
#   (DERA).  It is made available to Recipients with a
7
#   royalty-free licence for its use, reproduction, transfer
8
#   to other parties and amendment for any purpose not excluding
9
#   product development provided that any such use et cetera
10
#   shall be deemed to be acceptance of the following conditions:-
11
#   
12
#       (1) Its Recipients shall ensure that this Notice is
13
#       reproduced upon any copies or amended versions of it;
14
#   
15
#       (2) Any amended version of it shall be clearly marked to
16
#       show both the nature of and the organisation responsible
17
#       for the relevant amendment or amendments;
18
#   
19
#       (3) Its onward transfer from a recipient to another
20
#       party shall be deemed to be that party's acceptance of
21
#       these conditions;
22
#   
23
#       (4) DERA gives no warranty or assurance as to its
24
#       quality or suitability for any purpose and DERA accepts
25
#       no liability whatsoever in relation to any use to which
26
#       it may be put.
27
#
28
+USE "posix", "sys/types.h" ;
29
 
30
/* These types are abstracted */
31
+IF %% __STRICT_POSIX %%
32
+TYPEDEF uid_t ~passwd_uid_t ;
33
+TYPEDEF gid_t ~passwd_gid_t ;
34
+ELSE
35
+TYPE ( arith ) ~passwd_uid_t.1 ;
36
+TYPE ( arith ) ~passwd_gid_t.1 ;
37
+MACRO uid_t __passwd_uid2uid ( ~passwd_uid_t ) ;
38
+MACRO ~passwd_uid_t __uid2passwd_uid ( uid_t ) ;
39
+MACRO gid_t __passwd_gid2gid ( ~passwd_gid_t ) ;
40
+MACRO ~passwd_gid_t __gid2passwd_gid ( gid_t ) ;
41
+IFNDEF ~building_libs
42
%%
43
#pragma accept conversion __passwd_uid2uid
44
#pragma accept conversion __uid2passwd_uid
45
#pragma accept conversion __passwd_gid2gid
46
#pragma accept conversion __gid2passwd_gid
47
%%
48
%%%
49
#include <pwd.h>
50
#define __passwd_uid2uid( X )	( uid_t ) ( X )
51
#define __uid2passwd_uid( X )	( __local_passwd_uid_t ) ( X )
52
#define __passwd_gid2gid( X )	( gid_t ) ( X )
53
#define __gid2passwd_gid( X )	( __local_passwd_gid_t ) ( X )
54
%%%
55
+ENDIF
56
+ENDIF
57
 
58
+FIELD struct passwd {
59
    char *pw_name ;
60
    ~passwd_uid_t pw_uid ;
61
    ~passwd_gid_t pw_gid ;
62
    char *pw_dir ;
63
    char *pw_shell ;
64
} ;
65
 
66
+FUNC struct passwd *getpwnam ( const char * ) ;
67
+FUNC struct passwd *getpwuid ( uid_t ) ;