cleanup-licensing-and-transarc-references-20030309
[openafs.git] / src / package / package.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /*------------------------------------------------------------------------
11  * package.h
12  *
13  * Description:
14  *      Definitions for package, the AFS workstation configuration
15  *      facility.
16  *
17  *------------------------------------------------------------------------*/
18
19 #include <utmp.h>
20 #include <sys/types.h>
21
22 /*
23  * Flags specifying update actions
24  */
25 #define U_LOSTFOUND     0001
26 #define U_RMEXTRA       0002
27 #define U_NOOVERWRITE   0004
28 #define U_RENAMEOLD     0010
29 #define U_ABSPATH       0020
30 #define U_REBOOT        0040
31
32 /*
33  * Specification of prototype info
34  */
35 #define P_NONE  0
36 #define P_FILE  1
37 #define P_DEV   2
38
39 /*
40  * Flag for ownership info
41  */
42 #define UID_INHERIT 01
43 #define GID_INHERIT 02
44
45 /*
46  * Lookup modes for the configuration tree
47  */
48 #define C_LOCATE    01
49 #define C_CREATE    02
50
51 /*
52  * Flags for fields of config tree nodes
53  */
54 #define F_TYPE  0001
55 #define F_UPDT  0002
56 #define F_PROTO 0004
57 #define F_UID   0010
58 #define F_GID   0020
59 #define F_MODE  0040
60 #define F_MTIME 0100
61
62 /*
63  * Current operating status
64  */
65 #define status_noerror  0
66 #define status_error    2
67 #define status_reboot   4
68
69 typedef struct prototype_struct
70 {
71     u_short flag;       /*Union tag, or specifies absence of prototype*/
72     union {
73         char *path;     /*Path, dir prefix, or absolute path of prototype*/
74         afs_uint32      rdev;   /*Device number*/
75     } info;
76 } PROTOTYPE;
77
78 typedef struct owner_struct
79 {
80     char *username;     /*Associated owner*/
81     char *groupname;    /*Associated group*/
82 } OWNER;
83
84 typedef struct mode_struct
85 {
86     u_short inherit_flag;   /*Specifies whether the mode is inherited
87                               from the prototype or is given by the
88                               mode field */
89     afs_uint32 modeval;
90 } MODE;
91
92 typedef struct entry
93 {
94     struct entry *nextp;        /*Ptr to next entry in the same dir*/
95     struct node *nodep;         /*Ptr to config tree node w/info on this file*/
96     int hash;                   /*Hashed value for quick filename comparison*/
97     char *name;                 /*Actual file/directory name*/
98 } ENTRY, *ENTRYPTR;
99
100 typedef struct node
101 {
102     ENTRYPTR entryp;    /*Ptr to child list for this node, if a directory*/
103     u_short flag;       /*Keeps track of updates to fields of this node*/
104     u_short type;       /*Type of file/directory*/
105     u_short updtspec;   /*Update spec*/
106     PROTOTYPE proto;    /*Prototype info*/
107     short uid;          /*Ownership info*/
108     short gid;          /*Group info*/
109     u_short mode;       /*Mode info*/
110     time_t mtime;       /*Last modification time*/
111 } CTREE, *CTREEPTR;
112
113 extern int status;      /*Operating status*/
114 extern int opt_lazy;    /*Just tell what you would have done, don't do it*/
115 extern int opt_silent;  /*Don't print any error messages*/
116 extern int opt_verbose; /*Be chatty?*/
117 extern int opt_reboot;  /*Do files that will cause reboot*/
118 #ifdef KFLAG
119 extern int opt_kflag;   /* $$question: why was this ifdefed? */
120 #endif /* KFLAG */
121 extern int opt_debug;   /*Turn debugging output on*/
122
123 extern CTREEPTR config_root;    /*Top of the config tree*/