+ unsigned int cell;
+ unsigned int acc_sz;
+ enum dtprop_types type;
+};
+
+typedef struct dtprop_def dt_proplet[];
+
+struct dtprop_xval
+{
+ union {
+ u32_t u32;
+ ptr_t u64;
+ struct dtn* phandle;
+ union {
+ dt_enc_t composite;
+ union dtp_baseval* cval;
+ };
+ };
+ struct dtprop_def* archetype;
+};
+
+struct dtpropx
+{
+ const struct dtprop_def* proplet;
+ int proplet_len;
+ int proplet_sz;
+
+ struct dtp_val* raw;
+ off_t row_loc;
+};
+
+#define dtprop_u32 (struct dtprop_def){ 1, 0, DTP_U32 }
+#define dtprop_u64 (struct dtprop_def){ 2, 0, DTP_U64 }
+#define dtprop_handle (struct dtprop_def){ 1, 0, DTP_PHANDLE }
+#define dtprop_compx(cell) (struct dtprop_def){ cell, 0, DTP_COMPX }
+#define dtprop_end (struct dtprop_def){ 0, 0, DTP_END }
+#define dtprop_(type, cell) (struct dtprop_def){ cell, 0, type }
+
+#define dtprop_reglike(base) \
+ ({ \
+ dt_proplet p = { \
+ dtprop_compx(base->addr_c), \
+ dtprop_compx(base->sz_c), \
+ dtprop_end \
+ }; \
+ dt_proplet; \
+ })
+
+#define dtprop_rangelike(node) \
+ ({ \
+ dt_proplet p = { \
+ dtprop_compx(base->addr_c), \
+ dtprop_compx(base->parent->addr_c), \
+ dtprop_compx(base->sz_c), \
+ dtprop_end \
+ }; \
+ dt_proplet; \
+ })
+
+#define dtprop_strlst_foreach(pos, prop) \
+ for (pos = (prop)->str_lst; \
+ pos <= &(prop)->str_lst[(prop)->size - 1]; \
+ pos = &pos[strlen(pos) + 1])
+
+void
+dtpx_compile_proplet(struct dtprop_def* proplet);
+
+void
+dtpx_prepare_with(struct dtpropx* propx, struct dtp_val* prop,
+ struct dtprop_def* proplet);
+
+#define dtproplet_compile(proplet) \
+ dtpx_compile_proplet(proplet, \
+ sizeof(proplet) / sizeof(struct dtprop_def))
+
+bool
+dtpx_goto_row(struct dtpropx*, int row);
+
+bool
+dtpx_next_row(struct dtpropx*);
+
+bool
+dtpx_extract_at(struct dtpropx*, struct dtprop_xval*, int col);
+
+bool
+dtpx_extract_loc(struct dtpropx*, struct dtprop_xval*,
+ int row, int col);
+
+bool
+dtpx_extract_row(struct dtpropx*, struct dtprop_xval*, int len);
+
+static inline u32_t
+dtpx_xvalu32(struct dtprop_xval* val){
+ return val->archetype->type == DTP_COMPX ?
+ val->cval->u32_val : val->u32;
+}
+
+static inline u64_t
+dtpx_xvalu64(struct dtprop_xval* val){
+ return val->archetype->type == DTP_COMPX ?
+ val->cval->u64_val : val->u64;