Complete the definition of the index_entry record
Most of the values are ignored, though
This commit is contained in:
@@ -107,16 +107,16 @@ geef_index_add(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
|
|||||||
if (!enif_get_tuple(env, argv[1], &arity, &eentry))
|
if (!enif_get_tuple(env, argv[1], &arity, &eentry))
|
||||||
return enif_make_badarg(env);
|
return enif_make_badarg(env);
|
||||||
|
|
||||||
if (arity != 4)
|
if (arity != 13)
|
||||||
return enif_make_badarg(env);
|
return enif_make_badarg(env);
|
||||||
|
|
||||||
/* TODO: check for the 'tree_entry' tag */
|
/* TODO: check for the 'tree_entry' tag */
|
||||||
memset(&entry, 0, sizeof(entry));
|
memset(&entry, 0, sizeof(entry));
|
||||||
|
|
||||||
if (!enif_get_uint(env, eentry[1], &entry.mode))
|
if (!enif_get_uint(env, eentry[5], &entry.mode))
|
||||||
return enif_make_badarg(env);
|
return enif_make_badarg(env);
|
||||||
|
|
||||||
if (!enif_inspect_iolist_as_binary(env, eentry[3], &path))
|
if (!enif_inspect_iolist_as_binary(env, eentry[12], &path))
|
||||||
return enif_make_badarg(env);
|
return enif_make_badarg(env);
|
||||||
|
|
||||||
if (!geef_terminate_binary(&path))
|
if (!geef_terminate_binary(&path))
|
||||||
@@ -124,7 +124,7 @@ geef_index_add(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
|
|||||||
|
|
||||||
entry.path = (char *) path.data;
|
entry.path = (char *) path.data;
|
||||||
/* Extract the oid from the tuple */
|
/* Extract the oid from the tuple */
|
||||||
if (!enif_get_tuple(env, eentry[2], &arity, &oid))
|
if (!enif_get_tuple(env, eentry[9], &arity, &oid))
|
||||||
return enif_make_badarg(env);
|
return enif_make_badarg(env);
|
||||||
|
|
||||||
if (!enif_inspect_binary(env, oid[1], &id))
|
if (!enif_inspect_binary(env, oid[1], &id))
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
-record(geef_ref, {handle, name :: binary(), type :: atom(), target :: binary() | geef_oid()}).
|
-record(geef_ref, {handle, name :: binary(), type :: atom(), target :: binary() | geef_oid()}).
|
||||||
-record(geef_oid, {oid}).
|
-record(geef_oid, {oid}).
|
||||||
-record(geef_object, {type :: atom(), handle}).
|
-record(geef_object, {type :: atom(), handle}).
|
||||||
-record(geef_index_entry, {mode, id :: geef_oid(), path :: iolist()}).
|
-record(geef_index_entry,
|
||||||
|
{ctime :: non_neg_integer(), mtime :: non_neg_integer(),
|
||||||
|
dev :: non_neg_integer(), ino :: non_neg_integer(),
|
||||||
|
mode :: non_neg_integer(), uid :: non_neg_integer(), gid :: non_neg_integer(),
|
||||||
|
size :: non_neg_integer(),
|
||||||
|
id :: geef_oid(),
|
||||||
|
flags, flags_extended,
|
||||||
|
path :: iolist()}).
|
||||||
|
|
||||||
-type geef_ref() :: #geef_ref{}.
|
-type geef_ref() :: #geef_ref{}.
|
||||||
-type geef_oid() :: #geef_oid{}.
|
-type geef_oid() :: #geef_oid{}.
|
||||||
|
|||||||
Reference in New Issue
Block a user