1 .TH lustreapi 3 "2019 Sep 13" Lustre user application interface library
3 llapi_fid_parse \- parse ASCII FID string into binary lu_fid
6 .B #include <lustre/lustreapi.h>
8 .BI "int llapi_fid_parse(const char *" fidstr ", struct lu_fid *" fid ,
9 .BI " char **" endptr ");"
15 converts an ASCII FID string into a binary
17 for use in other interfaces such as
18 .BR llapi_layout_get_by_fid() .
20 should contain three numbers in the form
21 .IR fid_seq : fid_oid : fid_ver
22 and may optionally be enclosed in square braces
24 It will skip any leading whitespace before the FID.
30 stores the address of the first invalid character in
32 or the character immediately following the end of the parsed FID.
42 a negative errno on failure and sets errno.
47 is NULL or does not contain a valid FID format.
51 contains numeric values that exceed valid values for a component.
54 #include <lustre/lustreapi.h>
56 int main(int argc, char *argv[])
58 char fidstr = "[0x200000004:0x2:0x0] [0x200000400:0x345:0x0]";
59 struct lu_fid fid1, fid2;
64 rc = llapi_fid_parse(fidstr, &fid1, &end);
66 fprintf(stderr, "invalid first FID '%s': %s\\n",
67 fidstr, strerror(-rc));
72 rc = llapi_fid_parse(fidstr, &fid2, &end);
74 fprintf(stderr, "invalid second FID '%s': %s\\n",
75 fidstr, strerror(-rc));
79 printf("fid1=" DFID " fid2="DFID"\\n", PFID(&fid1), PFID(&fid2));
85 .BR llapi_path2parent (3),