%{ #include %} function nfsfh:string(_nfsfh:long) %{ struct nfs_fh *fh = (struct nfs_fh *)(long) kread(&(THIS->_nfsfh)); char buf[MAXSTRINGLEN], *str, octet[10]; int cc=0, i, j; unsigned short ofs, len; sprintf(buf+cc, "fh: %d: ", fh->size); cc = strlen(buf); str = buf+cc; len = fh->size; for (ofs = 0; ofs < len; ofs += 16) { /* sprintf(str, "%03d: ", ofs ); */ for (i=0; i < 16; i++) { if ((i + ofs) < len) sprintf(octet, "%02x", fh->data[ofs + i]); else strcpy(octet, " "); strcat(str, octet); } /* strcat(str, " \n"); */ j = strlen(str); str += j; } snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); CATCH_DEREF_FAULT(); %}