CTF writer: Add function to add an integer environment field value
authorSimon Marchi <simon.marchi@polymtl.ca>
Sun, 19 Jun 2016 02:54:52 +0000 (22:54 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 25 Jul 2016 22:05:14 +0000 (18:05 -0400)
commitd7503815516dc78258eb0a6d7ffd2aa9e83caadd
tree5f8908415823b0cbf09e36b333b4895f15bf7f46
parent6b30e7f33df8f9f85e69fb7dc615f56de1ef082b
CTF writer: Add function to add an integer environment field value

From the Python API, it's only possible to set an environment field
value as a string (whatever you pass, it gets stringified). This patch
adds a function to the CTF writer to allow setting an integer (int64_t)
environment field, and then exposes it in the Python interface.

The Python method Writer.add_environment_field now uses the type of the
passed value to determine which underlying C function to call (string or
integer). Any other type is rejected. This causes a behavior change,
since passing an integer value to add_environment_field used to produce
a string version of the value, whereas it will now produce an integer
version. However, I think it will now behave more closely to the
expectation of a lambda user.

Example:

  w.add_environment_field("foo", 2)

Result before:

  env {
    foo = "2";
  };

Result after:

  env {
    foo = 2;
  };

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
bindings/python/babeltrace/nativebt.i
bindings/python/babeltrace/writer.py
formats/ctf/writer/writer.c
include/babeltrace/ctf-writer/writer.h
This page took 0.024715 seconds and 4 git commands to generate.