aboutsummaryrefslogtreecommitdiff
path: root/man/man3/proto.html
blob: 59e4fccd0dbdf6df39943d465dbee313a4e1df18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<head>
<title>proto(3) - Plan 9 from User Space</title>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
</head>
<body bgcolor=#ffffff>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=10><td>
<tr><td width=20><td>
<tr><td width=20><td><b>PROTO(3)</b><td align=right><b>PROTO(3)</b>
<tr><td width=20><td colspan=2>
    <br>
<p><font size=+1><b>NAME     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    rdproto &ndash; parse and process a proto file listing<br>
    
</table>
<p><font size=+1><b>SYNOPSIS     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>#include &lt;u.h&gt;<br>
    #include &lt;libc.h&gt;<br>
    #include &lt;disk.h&gt;<br>
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    </font></tt>
    <tt><font size=+1>typedef void Protoenum(char *new, char *old, Dir *d, void *a)<br>
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    </font></tt>
    <tt><font size=+1>typedef void Protowarn(char *msg, void *a)<br>
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    </font></tt>
    <tt><font size=+1>int rdproto(char *proto, char *root, Protoenum *enm,<br>
     
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Protowarn *warn, void *a)<br>
            
        </table>
        
    </table>
    </font></tt>
</table>
<p><font size=+1><b>DESCRIPTION     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <i>Rdproto</i> reads and interprets the named <i>proto</i> file relative to
    the root directory <i>root</i>. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    Each line of the <i>proto</i> file specifies a file to copy. Blank lines
    and lines beginning with <tt><font size=+1>#</font></tt> are ignored. Indentation (usually tabs)
    is significant, with each level of indentation corresponding to
    a level in the file tree. Fields within a line are separated by
    white space. The first field is the last path element in the destination
    file tree. The second field specifies the permissions. The third
    field is the owner of the file, and the fourth is the group owning
    the file. The fifth field is the name of the file from which to
    copy; this file is read from the current name space, not the source
    file tree. All fields except the first are optional. Specifying
    <tt><font size=+1>&#8722;</font></tt> for
    permissions, owner, or group causes <i>rdproto</i> to fetch the corresponding
    information from the file rather than override it. (This is the
    default behavior when the fields are not present; explicitly specifying
    <tt><font size=+1>&#8722;</font></tt> is useful when one wishes to set, say, the file owner without
    setting the permissions.) 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    Names beginning with a <tt><font size=+1>$</font></tt> are expanded as environment variables.
    If the first file specified in a directory is <tt><font size=+1>*</font></tt>, all of the files
    in that directory are considered listed. If the first file is
    <tt><font size=+1>+</font></tt>, all of the files are copied, and all subdirectories are recursively
    considered listed. All files are considered relative to <i>root</i>.
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    For each file named by the <i>proto</i>, <i>enm</i> is called with <i>new</i> pointing
    at the name of the file (without the root prefix), <i>old</i> pointing
    at the name of the source file (with the root prefix, when applicable),
    and <i>Dir</i> at the desired directory information for the new file.
    Only the <tt><font size=+1>name</font></tt>, <tt><font size=+1>uid</font></tt>, <tt><font size=+1>gid</font></tt>, <tt><font size=+1>mode</font></tt>, <tt><font size=+1>mtime</font></tt>, and <tt><font size=+1>length</font></tt> fields
    are guaranteed to be valid. The argument <i>a</i> is the same argument
    passed to <i>rdproto</i>; typically it points at some extra state used
    by the enumeration function. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    When files or directories do not exist or cannot be read by <i>rdproto</i>,
    it formats a warning message, calls <i>warn</i>, and continues processing;
    if <i>warn</i> is nil, <i>rdproto</i> prints the warning message to standard
    error. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    <i>Rdproto</i> returns zero if <i>proto</i> was processed, &ndash;1 if it could not
    be opened.<br>
    
</table>
<p><font size=+1><b>FILES     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>/sys/lib/sysconfig/proto/</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directory of prototype files.<br>
    <tt><font size=+1>/sys/lib/sysconfig/proto/portproto</font></tt>&nbsp;&nbsp;&nbsp;generic prototype file.<br>
    
</table>
<p><font size=+1><b>SOURCE     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>/usr/local/plan9/src/libdisk/proto.c<br>
    </font></tt>
</table>
<p><font size=+1><b>SEE ALSO    </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <a href="../man8/mk9660.html"><i>mk9660</i>(8)</a>, Plan 9&#8217;s <i>mkfs</i>(8)<br>
    
</table>

<td width=20>
<tr height=20><td>
</table>
<!-- TRAILER -->
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=15><td width=10><td><td width=10>
<tr><td><td>
<center>
<a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a>
</center>
</table>
<!-- TRAILER -->
</body></html>