1 #include <klibc/string.h>
5 isorr_parse_px(struct iso_drecache* cache, void* px_start)
7 struct isorr_px* px = (struct isorr_px*)px_start;
8 cache->fno = px->sn.le;
9 // TODO read other file attributes
10 return px->header.length;
14 isorr_tf_gettime(struct isorr_tf* tf, int* index, u32_t type)
17 if ((tf->flags & type)) {
18 if ((tf->flags & ISORR_TF_LONG_FORM)) {
20 iso9660_dt2unix((struct iso_datetime*)(tf->times + 17 * *index));
23 iso9660_dt22unix((struct iso_datetime2*)(tf->times + 7 * *index));
31 isorr_parse_tf(struct iso_drecache* cache, void* tf_start)
33 struct isorr_tf* tf = (struct isorr_tf*)tf_start;
35 cache->ctime = isorr_tf_gettime(tf, &i, ISORR_TF_CTIME);
36 cache->mtime = isorr_tf_gettime(tf, &i, ISORR_TF_MTIME);
37 cache->atime = isorr_tf_gettime(tf, &i, ISORR_TF_ATIME);
38 // TODO read other file attributes
39 return tf->header.length;
43 isorr_parse_nm(struct iso_drecache* cache, void* nm_start)
49 nm = (struct isorr_nm*)(nm_start + adv);
50 u32_t len_name = nm->header.length - sizeof(*nm);
51 memcpy(cache->name_val + i, nm->name, len_name);
53 adv += nm->header.length;
54 } while ((nm->flags & ISORR_NM_CONT) && i < ISO9660_IDLEN - 1);
56 cache->name_val[i] = 0;
57 cache->name = HSTR(cache->name_val, i);
58 hstr_rehash(&cache->name, HSTR_FULL_HASH);