diff options
author | Sverker Eriksson <[email protected]> | 2013-02-08 16:23:48 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-02-08 16:23:48 +0100 |
commit | 27d5ba9e31c666bd0a7e278b02df3a5b4ecb8e0b (patch) | |
tree | c6017fc754dc4ff2f39dc7989009d31c8fd9a81c /lib/erl_interface/include | |
parent | 7d1060c624676c5dde532d1cb59fa177329f4178 (diff) | |
parent | b0693061137de237c38965c556c7d6ded8977394 (diff) | |
download | otp-27d5ba9e31c666bd0a7e278b02df3a5b4ecb8e0b.tar.gz otp-27d5ba9e31c666bd0a7e278b02df3a5b4ecb8e0b.tar.bz2 otp-27d5ba9e31c666bd0a7e278b02df3a5b4ecb8e0b.zip |
Merge branch 'sverk/erl_interface-enum-typedef'
* sverk/erl_interface-enum-typedef:
erl_interface: Change enum erlang_char_encoding to a typedef
Diffstat (limited to 'lib/erl_interface/include')
-rw-r--r-- | lib/erl_interface/include/ei.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h index 29d53ab3a2..66dc64a69d 100644 --- a/lib/erl_interface/include/ei.h +++ b/lib/erl_interface/include/ei.h @@ -190,17 +190,16 @@ extern volatile int __erl_errno; #define MAXATOMLEN_UTF8 (255*4 + 1) #define MAXNODELEN EI_MAXALIVELEN+1+EI_MAXHOSTNAMELEN -enum erlang_char_encoding { +typedef enum { ERLANG_ASCII = 1, ERLANG_LATIN1 = 2, ERLANG_UTF8 = 4, - ERLANG_ANY = ERLANG_ASCII|ERLANG_LATIN1|ERLANG_UTF8 -}; +}erlang_char_encoding; /* a pid */ typedef struct { char node[MAXATOMLEN_UTF8]; - enum erlang_char_encoding node_org_enc; + erlang_char_encoding node_org_enc; unsigned int num; unsigned int serial; unsigned int creation; @@ -209,7 +208,7 @@ typedef struct { /* a port */ typedef struct { char node[MAXATOMLEN_UTF8]; - enum erlang_char_encoding node_org_enc; + erlang_char_encoding node_org_enc; unsigned int id; unsigned int creation; } erlang_port; @@ -217,7 +216,7 @@ typedef struct { /* a ref */ typedef struct { char node[MAXATOMLEN_UTF8]; - enum erlang_char_encoding node_org_enc; + erlang_char_encoding node_org_enc; int len; unsigned int n[3]; unsigned int creation; @@ -246,7 +245,7 @@ typedef struct { typedef struct { long arity; char module[MAXATOMLEN_UTF8]; - enum erlang_char_encoding module_org_enc; + erlang_char_encoding module_org_enc; char md5[16]; long index; long old_index; @@ -441,16 +440,16 @@ int ei_x_encode_string(ei_x_buff* x, const char* s); int ei_x_encode_string_len(ei_x_buff* x, const char* s, int len); int ei_encode_atom(char *buf, int *index, const char *p); int ei_encode_atom_as(char *buf, int *index, const char *p, - enum erlang_char_encoding from, enum erlang_char_encoding to); + erlang_char_encoding from, erlang_char_encoding to); int ei_encode_atom_len(char *buf, int *index, const char *p, int len); int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len, - enum erlang_char_encoding from, enum erlang_char_encoding to); + erlang_char_encoding from, erlang_char_encoding to); int ei_x_encode_atom(ei_x_buff* x, const char* s); int ei_x_encode_atom_as(ei_x_buff* x, const char* s, - enum erlang_char_encoding from, enum erlang_char_encoding to); + erlang_char_encoding from, erlang_char_encoding to); int ei_x_encode_atom_len(ei_x_buff* x, const char* s, int len); int ei_x_encode_atom_len_as(ei_x_buff* x, const char* s, int len, - enum erlang_char_encoding from, enum erlang_char_encoding to); + erlang_char_encoding from, erlang_char_encoding to); int ei_encode_binary(char *buf, int *index, const void *p, long len); int ei_x_encode_binary(ei_x_buff* x, const void* s, int len); int ei_encode_pid(char *buf, int *index, const erlang_pid *p); @@ -500,7 +499,7 @@ int ei_decode_boolean(const char *buf, int *index, int *p); int ei_decode_char(const char *buf, int *index, char *p); int ei_decode_string(const char *buf, int *index, char *p); int ei_decode_atom(const char *buf, int *index, char *p); -int ei_decode_atom_as(const char *buf, int *index, char *p, int destlen, enum erlang_char_encoding want, enum erlang_char_encoding* was, enum erlang_char_encoding* result); +int ei_decode_atom_as(const char *buf, int *index, char *p, int destlen, erlang_char_encoding want, erlang_char_encoding* was, erlang_char_encoding* result); int ei_decode_binary(const char *buf, int *index, void *p, long *len); int ei_decode_fun(const char* buf, int* index, erlang_fun* p); void free_fun(erlang_fun* f); |