+ if (eid != ADEID_COMMENT && add->ad_eid[ eid ].ade_len != len ) {
+ continue;
+ }
+
+ ad_setentrylen( add, eid, len );
+ memcpy( ad_entry( add, eid ), ad_entry( ads, eid ), len );
+ }
+ add->ad_rlen = ads->ad_rlen;
+ return 0;
+}
+
+/* ------------------- */
+int ad_rebuild_sfm_header(struct adouble *ad)
+{
+ u_int32_t temp;
+
+ u_int16_t attr;
+ char *buf;
+
+ /*
+ * Rebuild any header information that might have changed.
+ */
+ buf = ad->ad_data;
+ /* FIXME */
+/* temp = htonl( ad->ad_magic ); */
+ temp = ad->ad_magic;
+ memcpy(buf, &temp, sizeof( temp ));
+
+/* temp = htonl( ad->ad_version ); */
+ temp = ad->ad_version;
+ memcpy(buf +4, &temp, sizeof( temp ));
+
+ /* need to save attrib */
+ if (!ad_getattr(ad, &attr)) {
+ attr &= ~htons(ATTRBIT_DOPEN | ATTRBIT_ROPEN);
+
+ memcpy(buf +48 +4, &attr, sizeof(attr));
+
+ }
+ return AD_SFM_LEN;
+}
+
+
+int ad_flush( struct adouble *ad)