Example #1
0
int ei_x_encode_empty_list(ei_x_buff* x)
{
    int i = x->index;
    ei_encode_empty_list(NULL, &i);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_empty_list(x->buff, &x->index);
}
Example #2
0
int ei_x_encode_version(ei_x_buff* x)
{
    int i = x->index;
    ei_encode_version(NULL, &i);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_version(x->buff, &x->index);
}
Example #3
0
int ei_x_encode_double(ei_x_buff* x, double dbl)
{
    int i = x->index;
    ei_encode_double(NULL, &i, dbl);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_double(x->buff, &x->index, dbl);
}
Example #4
0
int ei_x_encode_boolean(ei_x_buff* x, int p)
{
    int i = x->index;
    ei_encode_boolean(NULL, &i, p);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_boolean(x->buff, &x->index, p);
}
Example #5
0
int ei_x_encode_char(ei_x_buff* x, char p)
{
    int i = x->index;
    ei_encode_char(NULL, &i, p);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_char(x->buff, &x->index, p);
}
Example #6
0
int ei_x_encode_tuple_header(ei_x_buff* x, long n)
{
    int i = x->index;
    ei_encode_tuple_header(NULL, &i, n);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_tuple_header(x->buff, &x->index, n);
}
Example #7
0
int ei_x_encode_pid(ei_x_buff* x, const erlang_pid* pid)
{
    int i = x->index;
    ei_encode_pid(NULL, &i, pid);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_pid(x->buff, &x->index, pid);
}
Example #8
0
int ei_x_encode_term(ei_x_buff* x, void* t)
{
  int i = x->index;
  ei_encode_term(NULL, &i, t);
  if (!x_fix_buff(x, i))
    return -1;
  return ei_encode_term(x->buff, &x->index, t);
}
Example #9
0
int ei_x_encode_bignum(ei_x_buff* x, mpz_t n)
{
    int i = x->index;
    ei_encode_bignum(NULL, &i, n);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_bignum(x->buff, &x->index, n);
}
Example #10
0
int ei_x_encode_binary(ei_x_buff* x, const void* p, int len)
{
    int i = x->index;
    ei_encode_binary(NULL, &i, p, len);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_binary(x->buff, &x->index, p, len);
}
Example #11
0
int ei_x_encode_string_len(ei_x_buff* x, const char* s, int len)
{
    int i = x->index;
    ei_encode_string_len(NULL, &i, s, len);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_string_len(x->buff, &x->index, s, len);
}
Example #12
0
/*
 * For some 64 bit operations on some operating systems code
 * compiled with GNU cc depends on "libgcc" for some 64 bit
 * operations missing in hardware (or because of gcc bugs).
 * If user code was linked together with the ei lib
 * using other linkers than GNU ld this may cause problems.
 * We moved ei_x_encode_ulonglong() here from "ei_x_encode.c" 
 * to limit this problem to users that actually use the ei 
 * longlong operations, not all ei_x users.
 */
int ei_x_encode_ulonglong(ei_x_buff* x, EI_ULONGLONG n)
{
    int i = x->index;
    ei_encode_ulonglong(NULL, &i, n);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_ulonglong(x->buff, &x->index, n);
}
Example #13
0
int ei_x_encode_trace(ei_x_buff* x, const erlang_trace* trace)
{
    int i = x->index;
    ei_encode_trace(NULL, &i, trace);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_trace(x->buff, &x->index, trace);
}
Example #14
0
int ei_x_append_buf(ei_x_buff* x, const char* buf, int len)
{
    if (!x_fix_buff(x, x->index+len))
	return -1;
    memcpy(&x->buff[x->index], buf, len);
    x->index += len;
    return 0;
}
Example #15
0
int ei_x_encode_port(ei_x_buff* x, const erlang_port* port)
{
    int i = x->index;
    ei_encode_port(NULL, &i, port);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_port(x->buff, &x->index, port);
}
Example #16
0
int ei_x_encode_ref(ei_x_buff* x, const erlang_ref* ref)
{
    int i = x->index;
    ei_encode_ref(NULL, &i, ref);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_ref(x->buff, &x->index, ref);
}
Example #17
0
int ei_x_encode_fun(ei_x_buff* x, const erlang_fun* fun)
{
    int i = x->index;
    ei_encode_fun(NULL, &i, fun);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_fun(x->buff, &x->index, fun);
}
Example #18
0
int ei_x_encode_ulong(ei_x_buff* x, unsigned long n)
{
    int i = x->index;
    ei_encode_ulong(NULL, &i, n);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_ulong(x->buff, &x->index, n);
}
Example #19
0
int ei_x_encode_atom_len_as(ei_x_buff* x, const char* s, int len,
			    enum erlang_char_encoding from_enc,
			    enum erlang_char_encoding to_enc)
{
    int i = x->index;
    ei_encode_atom_len_as(NULL, &i, s, len, from_enc, to_enc);
    if (!x_fix_buff(x, i))
	return -1;
    return ei_encode_atom_len_as(x->buff, &x->index, s, len, from_enc, to_enc);
}