Displaying 1 result from an estimated 1 matches for "erl_mk_atom".
2020 Jun 01
1
[PATCH] erlang: Port to libei for Erlang 23
...ize_t atomlen = strlen (atom);
if (namelen != atomlen) return 0;
- return strncmp (ERL_ATOM_PTR (atom), name, atomlen) == 0;
+ return strncmp (atom, name, atomlen) == 0;
}
-ETERM *
-make_error (const char *funname)
+int
+make_error (ei_x_buff *buff, const char *funname)
{
- ETERM *error = erl_mk_atom ("error");
- ETERM *msg = erl_mk_string (guestfs_last_error (g));
- ETERM *num = erl_mk_int (guestfs_last_errno (g));
- ETERM *t[3] = { error, msg, num };
- return erl_mk_tuple (t, 3);
+ if (ei_x_encode_tuple_header (buff, 3) != 0) return -1;
+ if (ei_x_encode_atom (buff, "erro...