7 pstring(uchar *p, char *s)
19 * We are moving the string before the length,
20 * so you can S2M a struct into an existing message
22 memmove(p + BIT16SZ, s, n);
30 pqid(uchar *p, Qid *q)
48 return BIT16SZ+strlen(s);
58 n += BIT32SZ; /* size */
59 n += BIT8SZ; /* type */
60 n += BIT16SZ; /* tag */
69 n += stringsz(f->version);
78 n += stringsz(f->uname);
79 n += stringsz(f->aname);
85 n += stringsz(f->uname);
86 n += stringsz(f->aname);
93 for(i=0; i<f->nwname; i++)
94 n += stringsz(f->wname[i]);
104 n += stringsz(f->name);
141 n += stringsz(f->version);
145 n += stringsz(f->ename);
197 convS2M(Fcall *f, uchar *ap, uint nap)
225 p = pstring(p, f->version);
229 PBIT16(p, f->oldtag);
236 p = pstring(p, f->uname);
237 p = pstring(p, f->aname);
245 p = pstring(p, f->uname);
246 p = pstring(p, f->aname);
252 PBIT32(p, f->newfid);
254 PBIT16(p, f->nwname);
256 if(f->nwname > MAXWELEM)
258 for(i=0; i<f->nwname; i++)
259 p = pstring(p, f->wname[i]);
272 p = pstring(p, f->name);
282 PBIT64(p, f->offset);
291 PBIT64(p, f->offset);
295 memmove(p, f->data, f->count);
315 memmove(p, f->stat, f->nstat);
324 p = pstring(p, f->version);
328 p = pstring(p, f->ename);
335 p = pqid(p, &f->aqid);
339 p = pqid(p, &f->qid);
345 if(f->nwqid > MAXWELEM)
347 for(i=0; i<f->nwqid; i++)
348 p = pqid(p, &f->wqid[i]);
353 p = pqid(p, &f->qid);
354 PBIT32(p, f->iounit);
361 memmove(p, f->data, f->count);
379 memmove(p, f->stat, f->nstat);