+/* FIXME mpath : unix or mac name ? (for now it's mac name ) */
+void *get_finderinfo(const char *mpath, struct adouble *adp, void *data)
+{
+ struct extmap *em;
+
+ if (adp) {
+ memcpy(data, ad_entry(adp, ADEID_FINDERI), 32);
+ }
+ else {
+ memcpy(data, ufinderi, 32);
+ }
+
+ if ((!adp || !memcmp(ad_entry(adp, ADEID_FINDERI),ufinderi , 8 ))
+ && (em = getextmap( mpath ))
+ ) {
+ memcpy(data, em->em_type, sizeof( em->em_type ));
+ memcpy(data + 4, em->em_creator, sizeof(em->em_creator));
+ }
+ return data;
+}
+
+/* ---------------------
+*/
+char *set_name(char *data, const char *name, u_int32_t utf8)
+{
+ u_int32_t aint;
+
+ aint = strlen( name );
+
+ if (!utf8) {
+ if (afp_version >= 30) {
+ /* the name is in utf8 */
+ }
+ if (aint > MACFILELEN)
+ aint = MACFILELEN;
+ *data++ = aint;
+ }
+ else {
+ u_int16_t temp;
+
+ if (aint > 255) /* FIXME safeguard, anyway if no ascii char it's game over*/
+ aint = 255;
+
+ utf8 = htonl(utf8);
+ memcpy(data, &utf8, sizeof(utf8));
+ data += sizeof(utf8);
+
+ temp = htons(aint);
+ memcpy(data, &temp, sizeof(temp));
+ data += sizeof(temp);
+ }
+
+ memcpy( data, name, aint );
+ data += aint;
+
+ return data;
+}
+
+/*
+ * FIXME: PDINFO is UTF8 and doesn't need adp
+*/
+#define PARAM_NEED_ADP(b) ((b) & ((1 << FILPBIT_ATTR) |\
+ (1 << FILPBIT_CDATE) |\
+ (1 << FILPBIT_MDATE) |\
+ (1 << FILPBIT_BDATE) |\
+ (1 << FILPBIT_FINFO) |\
+ (1 << FILPBIT_RFLEN) |\
+ (1 << FILPBIT_EXTRFLEN) |\
+ (1 << FILPBIT_PDINFO)))
+
+
+/* -------------------------- */
+int getmetadata(struct vol *vol,