python:tests: Store keys as bytes rather than as lists of ints
[samba.git] / source3 / lib / file_id.h
1 /*
2    Unix SMB/CIFS implementation.
3
4    file_id structure handling
5
6    Copyright (C) Andrew Tridgell 2007
7
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef __LIB_FILE_ID_H__
23 #define __LIB_FILE_ID_H__
24
25 #include "librpc/gen_ndr/file_id.h"
26
27 /* The following definitions come from lib/file_id.c  */
28
29 bool file_id_equal(const struct file_id *id1, const struct file_id *id2);
30
31 /*
32  * strlen("18446744073709551615")=20 times 3 plus 2 colons plus trailing 0
33  */
34 struct file_id_buf { char buf[63]; };
35 char *file_id_str_buf(struct file_id fid, struct file_id_buf *dst);
36
37 /*
38   a static-like (on talloc_tos()) string for a file_id structure
39  */
40 const char *file_id_string_tos(const struct file_id *id);
41 /*
42   an allocated string for a file_id structure
43  */
44 const char *file_id_string(TALLOC_CTX *mem_ctx, const struct file_id *id);
45 void push_file_id_16(char *buf, const struct file_id *id);
46 void push_file_id_24(char *buf, const struct file_id *id);
47 void pull_file_id_24(const char *buf, struct file_id *id);
48
49 /*
50  * Make a SMB File-ID from itime
51  */
52 uint64_t make_file_id_from_itime(SMB_STRUCT_STAT *st);
53
54 #endif