1 #include <lunaix/fs/iso9660.h>
4 isorr_parse_px(struct iso_drecache* cache, void* px_start)
6 struct isorr_px* px = (struct isorr_px*)px_start;
7 cache->fno = px->sn.le;
8 // TODO read other file attributes
9 return px->header.length;
13 isorr_tf_gettime(struct isorr_tf* tf, int* index, u32_t type)
16 if ((tf->flags & type)) {
17 if ((tf->flags & ISORR_TF_LONG_FORM)) {
19 iso9660_dt2unix((struct iso_datetime*)(tf->times + 17 * *index));
22 iso9660_dt22unix((struct iso_datetime2*)(tf->times + 7 * *index));
30 isorr_parse_tf(struct iso_drecache* cache, void* tf_start)
32 struct isorr_tf* tf = (struct isorr_tf*)tf_start;
34 cache->ctime = isorr_tf_gettime(tf, &i, ISORR_TF_CTIME);
35 cache->mtime = isorr_tf_gettime(tf, &i, ISORR_TF_MTIME);
36 cache->atime = isorr_tf_gettime(tf, &i, ISORR_TF_ATIME);
37 // TODO read other file attributes
38 return tf->header.length;
42 isorr_parse_nm(struct iso_drecache* cache, void* nm_start)
48 nm = (struct isorr_nm*)(nm_start + adv);
49 u32_t len_name = nm->header.length - sizeof(*nm);
50 memcpy(cache->name_val + i, nm->name, len_name);
52 adv += nm->header.length;
53 } while ((nm->flags & ISORR_NM_CONT) && i < ISO9660_IDLEN - 1);
55 cache->name_val[i] = 0;
56 cache->name = HSTR(cache->name_val, i);
57 hstr_rehash(&cache->name, HSTR_FULL_HASH);