aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src
diff options
context:
space:
mode:
authorVitaliy Batichko <[email protected]>2010-11-23 18:44:24 +0200
committerVitaliy Batichko <[email protected]>2010-12-08 20:15:50 +0200
commit95392e693e210189df82173c9bcd345b58b004fe (patch)
tree5bc44e021138b21883ddb70ee95bc1410dc272fa /lib/erl_interface/src
parentad5b84bd154e27d9e4db3af12b8b4326c564b2bf (diff)
downloadotp-95392e693e210189df82173c9bcd345b58b004fe.tar.gz
otp-95392e693e210189df82173c9bcd345b58b004fe.tar.bz2
otp-95392e693e210189df82173c9bcd345b58b004fe.zip
Add PID (~p) type parameters to ei_format
Diffstat (limited to 'lib/erl_interface/src')
-rw-r--r--lib/erl_interface/src/misc/ei_format.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/erl_interface/src/misc/ei_format.c b/lib/erl_interface/src/misc/ei_format.c
index 96203a0d15..dbd7a4479a 100644
--- a/lib/erl_interface/src/misc/ei_format.c
+++ b/lib/erl_interface/src/misc/ei_format.c
@@ -52,6 +52,7 @@ union arg {
long l;
unsigned long u;
double d;
+ erlang_pid* pid;
};
static int eiformat(const char** s, union arg** args, ei_x_buff* x);
@@ -232,6 +233,7 @@ static int pquotedatom(const char** fmt, ei_x_buff* x)
* u - An unsigned long integer
* f - A float
* d - A double float
+ * p - An Erlang PID
*/
static int pformat(const char** fmt, union arg** args, ei_x_buff* x)
{
@@ -267,6 +269,10 @@ static int pformat(const char** fmt, union arg** args, ei_x_buff* x)
res = ei_x_encode_double(x, (*args)->d);
(*args)++;
break;
+ case 'p':
+ res = ei_x_encode_pid(x, (*args)->pid);
+ (*args)++;
+ break;
default:
res = -1;
break;
@@ -424,6 +430,9 @@ static int read_args(const char* fmt, va_list ap, union arg **argp)
case 'd':
args[i++].d = va_arg(ap, double);
break;
+ case 'p':
+ args[i++].pid = va_arg(ap, erlang_pid*);
+ break;
default:
ei_free(args); /* Invalid specifier */
return -1;