3 rdproto \- parse and process a proto file listing
13 typedef void Protoenum(char *new, char *old, Dir *d, void *a)
16 typedef void Protowarn(char *msg, void *a)
19 int rdproto(char *proto, char *root, Protoenum *enm,
22 Protowarn *warn, void *a)
25 reads and interprets the named
33 file specifies a file to copy except lines in the form of
35 wich sets an attribute (see below).
36 Blank lines and lines beginning with
39 Indentation (usually tabs) is significant,
40 with each level of indentation corresponding to a level in the file tree.
41 Fields within a line are separated by white space.
42 The first field is the last path element in the destination file tree.
43 The second field specifies the permissions.
44 The third field is the owner of the file,
45 and the fourth is the group owning the file.
46 The fifth field is the name of the file from which to copy;
47 this file is read from the current name space,
48 not the source file tree.
49 All fields except the first are optional.
52 for permissions, owner, or group
55 to fetch the corresponding information
56 from the file rather than override it.
57 (This is the default behavior when the fields
58 are not present; explicitly specifying
60 is useful when one wishes to set, say,
61 the file owner without setting the permissions.)
63 Names beginning with a
65 are expanded as environment variables.
66 If the first file specified in a directory is
68 all of the files in that directory are considered listed.
71 all of the files are copied, and all subdirectories
72 are recursively considered listed.
73 All files are considered relative to
76 Attributes, lines in the form of
78 apply to all files in the current
79 indention level after the attribute line.
80 Attributes are inherited to deeper levels but
81 each level can override them individualy.
84 skips all file names matching the regular expression
92 If owner or group is left unspecified on a file, the attributes
96 will override these fields.
99 attribute adds, sets or masks file permission bits if permissions
100 where not explicitly specified on the file. If multiple
104 is not a set operation (forced by
107 the modes are combined.
108 Except for the special
112 has the same syntax as in
115 For each file named by the
120 pointing at the name of the file (without the root prefix),
122 pointing at the name of the source file (with the root prefix,
126 at the desired directory information for the new file.
135 fields are guaranteed to be valid.
138 is the same argument passed to
140 typically it points at some extra state
141 used by the enumeration function.
143 When files or directories do not exist or
146 it formats a warning message, calls
148 and continues processing;
153 prints the warning message to standard error.
159 was processed, \-1 if it could not be opened.
161 .TF /sys/lib/sysconfig/proto/portproto
163 .B /sys/lib/sysconfig/proto/
164 directory of prototype files.
166 .B /sys/lib/sysconfig/proto/portproto
167 generic prototype file.
169 .B /sys/src/libdisk/proto.c