From b0693061137de237c38965c556c7d6ded8977394 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson
Date: Thu, 7 Feb 2013 14:46:19 +0100
Subject: erl_interface: Change enum erlang_char_encoding to a typedef
to make the API independent of the actual type of erlang_char_encoding
---
lib/erl_interface/doc/src/ei.xml | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
(limited to 'lib/erl_interface/doc/src/ei.xml')
diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml
index 03eea49224..dfe181bd1d 100644
--- a/lib/erl_interface/doc/src/ei.xml
+++ b/lib/erl_interface/doc/src/ei.xml
@@ -86,18 +86,21 @@
DATA TYPES
- enum erlang_char_encoding
+ erlang_char_encoding
-
-enum erlang_char_encoding {
- ERLANG_ASCII, ERLANG_LATIN1, ERLANG_UTF8
-};
+typedef enum {
+ ERLANG_ASCII = 1,
+ ERLANG_LATIN1 = 2,
+ ERLANG_UTF8 = 4
+}erlang_char_encoding;
- The character encoding used for atoms. ERLANG_ASCII represents 7-bit ASCII.
+
The character encodings used for atoms. ERLANG_ASCII represents 7-bit ASCII.
Latin1 and UTF8 are different extensions of 7-bit ASCII. All 7-bit ASCII characters
are valid Latin1 and UTF8 characters. ASCII and Latin1 both represent each character
- by one byte. A UTF8 character can consist of one to four bytes.
+ by one byte. A UTF8 character can consist of one to four bytes. Note that these
+ constants are bit-flags and can be combined with bitwise-or.
@@ -250,10 +253,10 @@ enum erlang_char_encoding {
- intei_encode_atom_as(char *buf, int *index, const char *p, enum erlang_char_encoding from_enc, enum erlang_char_encoding to_enc)
- intei_encode_atom_len_as(char *buf, int *index, const char *p, int len, enum erlang_char_encoding from_enc, enum erlang_char_encoding to_enc)
- intei_x_encode_atom_as(ei_x_buff* x, const char *p, enum erlang_char_encoding from_enc, enum erlang_char_encoding to_enc)
- intei_x_encode_atom_len_as(ei_x_buff* x, const char *p, int len, enum erlang_char_encoding from_enc, enum erlang_char_encoding to_enc)
+ intei_encode_atom_as(char *buf, int *index, const char *p, erlang_char_encoding from_enc, erlang_char_encoding to_enc)
+ intei_encode_atom_len_as(char *buf, int *index, const char *p, int len, erlang_char_encoding from_enc, erlang_char_encoding to_enc)
+ intei_x_encode_atom_as(ei_x_buff* x, const char *p, erlang_char_encoding from_enc, erlang_char_encoding to_enc)
+ intei_x_encode_atom_len_as(ei_x_buff* x, const char *p, int len, erlang_char_encoding from_enc, erlang_char_encoding to_enc)
Encode an atom
Encodes an atom in the binary format with character encoding
@@ -534,7 +537,7 @@ ei_x_encode_empty_list(&x);
- intei_decode_atom_as(const char *buf, int *index, char *p, int plen, enum erlang_char_encoding want, enum erlang_char_encoding* was, enum erlang_char_encoding* result)
+ intei_decode_atom_as(const char *buf, int *index, char *p, int plen, erlang_char_encoding want, erlang_char_encoding* was, erlang_char_encoding* result)
Decode an atom
This function decodes an atom from the binary format. The
--
cgit v1.2.3