Lines Matching refs:file
52 fixedident(Dssfile_t* file, void* buf, size_t n, Dssdisc_t* disc)
64 file->skip = sizeof(Bgproute_t);
65 file->ident = swap;
72 * fixed file openf
76 fixedopen(Dssfile_t* file, Dssdisc_t* disc)
78 if (file->flags & DSS_FILE_READ)
80 if (!sfreserve(file->io, file->skip, 0))
86 if (!(file->data = (void*)vmnewof(file->dss->vm, 0, Fixedstate_t, 1, 0)))
92 ((Fixedstate_t*)file->data)->swap = file->ident;
94 else if (!(file->flags & DSS_FILE_APPEND))
104 sfwrite(file->io, &hdr, sizeof(hdr));
114 fixedread(Dssfile_t* file, Dssrecord_t* record, Dssdisc_t* disc)
116 register Fixedstate_t* state = (Fixedstate_t*)file->data;
119 if (!(rp = (Bgproute_t*)sfreserve(file->io, sizeof(*rp), 0)))
121 if (sfvalue(file->io))
124 (*disc->errorf)(NiL, disc, 2, "%s: last record incomplete", file->format->name);
153 fixedwrite(Dssfile_t* file, Dssrecord_t* record, Dssdisc_t* disc)
155 if (sfwrite(file->io, record->data, sizeof(Bgproute_t)) != sizeof(Bgproute_t))
158 (*disc->errorf)(NiL, disc, 2, "%s: write error", file->format->name);
169 fixedclose(Dssfile_t* file, Dssdisc_t* disc)
171 if (!file->data)
173 vmfree(file->dss->vm, file->data);