Lines Matching refs:pax
23 * pax ico format
72 ico_done(Pax_t* pax, register Paxarchive_t* ap)
88 ico_getprologue(Pax_t* pax, Paxformat_t* fp, register Paxarchive_t* ap, Paxfile_t* f, register unsigned char* p, size_t size)
98 if (paxseek(pax, ap, ICO_HEADER, SEEK_SET, 1) != ICO_HEADER)
103 return paxnospace(pax);
107 if (paxread(pax, ap, ico->dir, n, n, 0) <= 0)
118 ico_getheader(Pax_t* pax, register Paxarchive_t* ap, register Paxfile_t* f)
143 f->st->st_uid = pax->uid;
144 f->st->st_gid = pax->gid;
148 if (paxseek(pax, ap, offset, SEEK_SET, 1) != offset)
154 ico_getdata(Pax_t* pax, register Paxarchive_t* ap, register Paxfile_t* f, int fd)
165 if (!(sp = paxpart(pax, ap, f->st->st_size)))
171 if (paxdata(pax, ap, f, fd, hdr, ICO_HEADER))
175 if (paxdata(pax, ap, f, fd, dir, ICO_DIRECTORY))
177 while ((n = sfread(sp, pax->buf, sizeof(pax->buf))) > 0)
178 if (paxdata(pax, ap, f, fd, pax->buf, n))
181 (*pax->errorf)(NiL, pax, 2, "%s: %s: unexpected EOF", ap->name, f->name);
186 ico_putprologue(Pax_t* pax, register Paxarchive_t* ap, int append)
194 return paxnospace(pax);
205 ico_putheader(Pax_t* pax, Paxarchive_t* ap, Paxfile_t* f)
211 ico_putdata(Pax_t* pax, Paxarchive_t* ap, Paxfile_t* f, int fd)
223 return paxnospace(pax);
228 if ((n = sizeof(pax->buf)) > z)
230 if ((n = sfread(sp, pax->buf, n)) <= 0)
232 if (pax->errorf)
233 (*pax->errorf)(NiL, pax, 2, "%s: %s: read error", ap->name, f->name);
236 p = (unsigned char*)pax->buf;
241 if (pax->errorf)
242 (*pax->errorf)(NiL, pax, 2, "%s: %s: read error", ap->name, f->name);
266 if (pax->errorf)
267 (*pax->errorf)(NiL, pax, 2, "%s: %s: not an icon resource or image", ap->name, f->name);
276 if (pax->errorf)
277 (*pax->errorf)(NiL, pax, 2, "%s: %s: write error", ap->name, f->name);
284 ico_putepilogue(Pax_t* pax, Paxarchive_t* ap)
303 paxwrite(pax, ap, b, size);
305 while ((i = sfread(ico->data, pax->buf, sizeof(pax->buf))) > 0)
306 paxwrite(pax, ap, pax->buf, i);
309 if (pax->errorf)
310 (*pax->errorf)(NiL, pax, 2, "%s: write error", ap->name);