MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / r_packcatdata

Function r_packcatdata

dep/hfsutils/libhfs/record.c:131–247  ·  view source on GitHub ↗

* NAME: record->packcatdata() * DESCRIPTION: pack catalog record data */

Source from the content-addressed store, hash-verified

129 * DESCRIPTION: pack catalog record data
130 */
131void r_packcatdata(const CatDataRec *data, byte *pdata, unsigned int *len)
132{
133 const byte *start = pdata;
134 int i;
135
136 d_storesb(&pdata, data->cdrType);
137 d_storesb(&pdata, data->cdrResrv2);
138
139 switch (data->cdrType)
140 {
141 case cdrDirRec:
142 d_storesw(&pdata, data->u.dir.dirFlags);
143 d_storeuw(&pdata, data->u.dir.dirVal);
144 d_storeul(&pdata, data->u.dir.dirDirID);
145 d_storesl(&pdata, data->u.dir.dirCrDat);
146 d_storesl(&pdata, data->u.dir.dirMdDat);
147 d_storesl(&pdata, data->u.dir.dirBkDat);
148
149 d_storesw(&pdata, data->u.dir.dirUsrInfo.frRect.top);
150 d_storesw(&pdata, data->u.dir.dirUsrInfo.frRect.left);
151 d_storesw(&pdata, data->u.dir.dirUsrInfo.frRect.bottom);
152 d_storesw(&pdata, data->u.dir.dirUsrInfo.frRect.right);
153 d_storesw(&pdata, data->u.dir.dirUsrInfo.frFlags);
154 d_storesw(&pdata, data->u.dir.dirUsrInfo.frLocation.v);
155 d_storesw(&pdata, data->u.dir.dirUsrInfo.frLocation.h);
156 d_storesw(&pdata, data->u.dir.dirUsrInfo.frView);
157
158 d_storesw(&pdata, data->u.dir.dirFndrInfo.frScroll.v);
159 d_storesw(&pdata, data->u.dir.dirFndrInfo.frScroll.h);
160 d_storesl(&pdata, data->u.dir.dirFndrInfo.frOpenChain);
161 d_storesw(&pdata, data->u.dir.dirFndrInfo.frUnused);
162 d_storesw(&pdata, data->u.dir.dirFndrInfo.frComment);
163 d_storesl(&pdata, data->u.dir.dirFndrInfo.frPutAway);
164
165 for (i = 0; i < 4; ++i)
166 d_storesl(&pdata, data->u.dir.dirResrv[i]);
167
168 break;
169
170 case cdrFilRec:
171 d_storesb(&pdata, data->u.fil.filFlags);
172 d_storesb(&pdata, data->u.fil.filTyp);
173
174 d_storesl(&pdata, data->u.fil.filUsrWds.fdType);
175 d_storesl(&pdata, data->u.fil.filUsrWds.fdCreator);
176 d_storesw(&pdata, data->u.fil.filUsrWds.fdFlags);
177 d_storesw(&pdata, data->u.fil.filUsrWds.fdLocation.v);
178 d_storesw(&pdata, data->u.fil.filUsrWds.fdLocation.h);
179 d_storesw(&pdata, data->u.fil.filUsrWds.fdFldr);
180
181 d_storeul(&pdata, data->u.fil.filFlNum);
182
183 d_storeuw(&pdata, data->u.fil.filStBlk);
184 d_storeul(&pdata, data->u.fil.filLgLen);
185 d_storeul(&pdata, data->u.fil.filPyLen);
186
187 d_storeuw(&pdata, data->u.fil.filRStBlk);
188 d_storeul(&pdata, data->u.fil.filRLgLen);

Callers 2

r_packcatrecFunction · 0.85
v_putcatrecFunction · 0.85

Calls 6

d_storesbFunction · 0.85
d_storeswFunction · 0.85
d_storeuwFunction · 0.85
d_storeulFunction · 0.85
d_storeslFunction · 0.85
d_storestrFunction · 0.85

Tested by

no test coverage detected