Skip to content

MapSet

Description

Default replace-set aliases the L-form of MapSetOnly: replace any and all existing entries for in_key with a single (key, value) mapping, taking ownership of both sources when their respective copy_init handler is absent.

Parameters

Name Direction Description
m in,out Map handle.
in_key in Addressable key.
in_value in Addressable value.

Success

Returns true; exactly one entry mapping in_key to in_value now exists.

Failure

Returns false on allocation failure; the map and both sources are unchanged.

Usage example (Cross-references)

Usage examples (Cross-references)
    #define MapMustSet(m, in_key, in_value)                                                                                \
        do {                                                                                                               \
            if (!MapSet((m), (in_key), (in_value))) {                                                                      \
                LOG_FATAL("MapMustSet failed");                                                                            \
            }                                                                                                              \
Last updated on