file_id_string() without talloc
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
return file_id_string(talloc_tos(), id);
}
+char *file_id_str_buf(struct file_id fid, struct file_id_buf *dst)
+{
+ snprintf(dst->buf,
+ sizeof(dst->buf),
+ "%"PRIu64":%"PRIu64":%"PRIu64,
+ fid.devid,
+ fid.inode,
+ fid.extid);
+ return dst->buf;
+}
+
/*
an allocated string for a file_id structure
*/
/* The following definitions come from lib/file_id.c */
bool file_id_equal(const struct file_id *id1, const struct file_id *id2);
+
+/*
+ * strlen("18446744073709551615")=20 times 3 plus 2 colons plus trailing 0
+ */
+struct file_id_buf { char buf[63]; };
+char *file_id_str_buf(struct file_id fid, struct file_id_buf *dst);
+
/*
a static-like (on talloc_tos()) string for a file_id structure
*/