cvsignore-happiness-20060801
[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     u_short flag;               /*Union tag, or specifies absence of prototype */
71     union {
72         char *path;             /*Path, dir prefix, or absolute path of prototype */
73         afs_uint32 rdev;        /*Device number */
74     } info;
75 } PROTOTYPE;
76
77 typedef struct owner_struct {
78     char *username;             /*Associated owner */
79     char *groupname;            /*Associated group */
80 } OWNER;
81
82 typedef struct mode_struct {
83     u_short inherit_flag;       /*Specifies whether the mode is inherited
84                                  * from the prototype or is given by the
85                                  * mode field */
86     afs_uint32 modeval;
87 } MODE;
88
89 typedef struct entry {
90     struct entry *nextp;        /*Ptr to next entry in the same dir */
91     struct node *nodep;         /*Ptr to config tree node w/info on this file */
92     int hash;                   /*Hashed value for quick filename comparison */
93     char *name;                 /*Actual file/directory name */
94 } ENTRY, *ENTRYPTR;
95
96 typedef struct node {
97     ENTRYPTR entryp;            /*Ptr to child list for this node, if a directory */
98     u_short flag;               /*Keeps track of updates to fields of this node */
99     u_short type;               /*Type of file/directory */
100     u_short updtspec;           /*Update spec */
101     PROTOTYPE proto;            /*Prototype info */
102     short uid;                  /*Ownership info */
103     short gid;                  /*Group info */
104     u_short mode;               /*Mode info */
105     time_t mtime;               /*Last modification time */
106 } CTREE, *CTREEPTR;
107
108 extern int status;              /*Operating status */
109 extern int opt_lazy;            /*Just tell what you would have done, don't do it */
110 extern int opt_silent;          /*Don't print any error messages */
111 extern int opt_verbose;         /*Be chatty? */
112 extern int opt_reboot;          /*Do files that will cause reboot */
113 #ifdef KFLAG
114 extern int opt_kflag;           /* $$question: why was this ifdefed? */
115 #endif /* KFLAG */
116 extern int opt_debug;           /*Turn debugging output on */
117
118 extern CTREEPTR config_root;    /*Top of the config tree */