3 eplumb, plumbfree, plumbopen, plumbsend, plumbsendtext, plumblookup, plumbpack, plumbpackattr, plumbaddattr, plumbdelattr, plumbrecv, plumbunpack, plumbunpackpartial, plumbunpackattr, Plumbmsg \- plumb messages
11 .ta \w'\fLPlumbattr* 'u
14 int plumbopen(char *port, int omode)
17 int plumbsend(int fd, Plumbmsg *m)
20 int plumbsendtext(int fd, char *src, char *dst, char *wdir, char *data)
23 void plumbfree(Plumbmsg *m)
26 Plumbmsg* plumbrecv(int fd)
29 char* plumbpack(Plumbmsg *m, int *np)
32 Plumbmsg* plumbunpack(char *buf, int n)
35 Plumbmsg* plumbunpackpartial(char *buf, int n, int *morep)
38 char* plumbpackattr(Plumbattr *a)
41 Plumbattr* plumbunpackattr(char *a)
44 char* plumblookup(Plumbattr *a, char *name)
47 Plumbattr* plumbaddattr(Plumbattr *a, Plumbattr *new)
50 Plumbattr* plumbdelattr(Plumbattra *a, char *name)
53 int eplumb(int key, char *port)
55 These routines manipulate
57 messages, transmitting them, receiving them, and
58 converting them between text and these data structures:
61 .ta 6n +\w'\fLPlumbattr 'u +\w'ndata; 'u
92 begins with a slash, it is taken as a literal file name;
95 searches for the location of the
97 service and opens the port there.
99 For programs using the
103 registers, using the given
105 receipt of messages from the named
109 formats and writes message
111 to the file descriptor
113 which will usually be the result of
117 is a simplified version for text-only messages; it assumes
127 .BI strlen( data )\f1.
130 frees all the data associated with the message
132 all the components of which must therefore have been allocated with
136 returns the next message available on the file descriptor
143 as a character string in the format of
147 to the length in bytes of the string.
149 does the inverse, translating the
156 .I Plumbunpackpartial
157 enables unpacking of messages that arrive in pieces.
159 .I plumbunpackpartial
160 for a given message must be sufficient to unpack the header;
161 subsequent calls permit unpacking messages with long data sections.
164 points to the beginning of the complete message received so far, and
166 reports the total number of bytes received for that message.
167 If the message is complete, the return value will be as in
171 is not null, the return value will be
175 will be set to the number of bytes remaining to be read for this message to be complete
176 (recall that the byte count is in the header).
177 Those bytes should be read by the caller, placed at location
179 and the message unpacked again.
180 If an error is encountered, the return value will be
191 structures into a null-terminated string.
192 If an attribute value contains white space, quote characters, or equal signs,
193 the value will be quoted appropriately.
194 A newline character will terminate processing.
196 converts the null-terminated string
207 for an attribute with the given
209 and returns the associated value.
210 The returned string is the original value, not a copy.
211 If the attribute has no value, the returned value will be the empty string;
212 if the attribute does not occur in the list at all, the value will be nil.
218 (which may be a list) to the attribute list
220 and returns the new list.
224 for the first attribute with name
226 and deletes it from the list, returning the resulting list.
228 is a no-op if no such attribute exists.
237 When appropriate, including when a
239 fails, these routine set