lynx_value_create_map

Introduction

Create a lynx_value of type map.

Syntax

lynx_api_status lynx_value_create_map(lynx_api_env env,
                                      lynx_value* result);

Parameters

KeyDescription
[in] envThe environment in which lynx value runs, typically nullptr.
[out] resultA lynx_value representing a map.

Return Value

Returns lynx_api_ok if the API succeeded.

Example

It creates an object on the heap, whose memory is managed by reference count, and calls lynx_value_remove_reference to free it when it is used up.

lynx_value val;
lynx_api_status status = lynx_value_create_map(env, &val);
if (status != lynx_api_ok) {
  // handle error.
}
// do something.
lynx_value_remove_reference(env, val, NULL);
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.