1 /*----------------------------------------------------------------------------
2 --
3 --  Module:           xtmAfsAclBs
4 --
5 --  Project:          XDiary
6 --  System:           xtm - X Desktop Calendar
7 --    Subsystem:      <>
8 --    Function block: <>
9 --
10 --  Description:
11 --    Interface file for module xtmAfsAclBs.
12 --
13 --  Filename:         xtmAfsAclBs.h
14 --
15 --  Authors:          Roger Larsson, Ulrika Bornetun
16 --  Creation date:    1991-10-15
17 --
18 --
19 --  (C) Copyright Ulrika Bornetun, Roger Larsson (1995)
20 --      All rights reserved
21 --
22 --  Permission to use, copy, modify, and distribute this software and its
23 --  documentation for any purpose and without fee is hereby granted,
24 --  provided that the above copyright notice appear in all copies. Ulrika
25 --  Bornetun and Roger Larsson make no representations about the usability
26 --  of this software for any purpose. It is provided "as is" without express
27 --  or implied warranty.
28 ----------------------------------------------------------------------------*/
29 
30 /* SCCS module identifier. */
31 /* SCCSID = @(#) Module: xtmAfsAclBs.h, Version: 1.1, Date: 95/02/18 15:58:53 */
32 
33 
34 /* Include this file only once. */
35 #ifndef define_xtmAfsAclBase_h
36 #  define define_xtmAfsAclBase_h
37 
38 
39 /*----------------------------------------------------------------------------
40 --  Include files
41 ----------------------------------------------------------------------------*/
42 
43 #include "Standard.h"
44 #include "LstLinked.h"
45 
46 
47 /*----------------------------------------------------------------------------
48 --  Macro definitions
49 ----------------------------------------------------------------------------*/
50 
51 /* We can handle ids up to this length. */
52 #define XTM_AF_MAX_ID_LENGTH     500
53 
54 /* Access flags. */
55 #define XTM_AF_FLAG_READ           1
56 #define XTM_AF_FLAG_WRITE          2
57 #define XTM_AF_FLAG_INSERT         4
58 #define XTM_AF_FLAG_LOOKUP         8
59 #define XTM_AF_FLAG_DELETE        16
60 #define XTM_AF_FLAG_LOCK          32
61 #define XTM_AF_FLAG_ADMINISTER    64
62 
63 #define XTM_AF_FLAG_ALL     (XTM_AF_FLAG_READ       | XTM_AF_FLAG_WRITE  | \
64                              XTM_AF_FLAG_INSERT     | XTM_AF_FLAG_LOOKUP | \
65                              XTM_AF_FLAG_DELETE     | XTM_AF_FLAG_LOCK   | \
66                              XTM_AF_FLAG_ADMINISTER)
67 
68 /* Access flags. */
69 #define XTM_AF_NOID               32766
70 
71 
72 /*----------------------------------------------------------------------------
73 --  Type declarations
74 ----------------------------------------------------------------------------*/
75 
76 /* Status variable. */
77 typedef enum {
78   XTM_AF_OK, XTM_AF_ERROR
79 } XTM_AF_STATUS;
80 
81 /* Acl information. */
82 typedef struct {
83   Boolean  positive;
84   UINT32   rights;
85   char     id[ XTM_AF_MAX_ID_LENGTH + 1 ];
86 } XTM_AF_ACL_INFO;
87 
88 
89 /*----------------------------------------------------------------------------
90 --  Global definitions
91 ----------------------------------------------------------------------------*/
92 
93 
94 /*----------------------------------------------------------------------------
95 --  Function prototypes
96 ----------------------------------------------------------------------------*/
97 
98 
99 
100 /*----------------------------------------------------------------------------
101 --  Functions
102 ----------------------------------------------------------------------------*/
103 
104 XTM_AF_STATUS
105   xtmAfAccess( char    *filename,
106                UINT32  rights );
107 
108 void
109   xtmAfAclFlagToString( UINT32  flags,
110                         char    *acl_string );
111 
112 UINT32
113   xtmAfAclStringToFlag( char  *acl_string );
114 
115 int
116   xtmAfFetchId( char  *long_id );
117 
118 XTM_AF_STATUS
119   xtmAfGetAclForFile( char           *filename,
120                       LST_DESC_TYPE  *acl_list );
121 
122 XTM_AF_STATUS
123   xtmAfInitialize();
124 
125 XTM_AF_STATUS
126   xtmAfIsAfsFile( char  *filename );
127 
128 XTM_AF_STATUS
129   xtmAfIsAfsMountPoint( char  *dir_path,
130                         char  *filename );
131 
132 XTM_AF_STATUS
133   xtmAfSetAclForFile( char           *filename,
134                       LST_DESC_TYPE  acl_list );
135 
136 #endif
137