Skip to content
MapMustSetOnlyR

MapMustSetOnlyR

Description

Aborting variant of MapSetOnlyR. See that macro for parameter semantics and success-state effects.

Success

Returns to the caller. The underlying MapSetOnlyR call succeeded; see MapSetOnlyR for the post-state.

Failure

Does not return - aborts via LOG_FATAL / Abort when the underlying MapSetOnlyR call returns false.

Usage example (Cross-references)

Usage examples (Cross-references)
        do {                                                                                                               \
            if (!MapSetOnlyR((m), (in_key), (in_value))) {                                                                 \
                LOG_FATAL("MapMustSetOnlyR failed");                                                                       \
            }                                                                                                              \
        } while (0)
        result = result && MapGetFirstPtr(&map, 3) && (*MapGetFirstPtr(&map, 3) == 333);
    
        MapMustSetOnlyR(&map, 4, 40);
        result = result && (MapValueCountForKey(&map, 4) == 1);
        result = result && MapGetFirstPtr(&map, 4) && (*MapGetFirstPtr(&map, 4) == 40);
Last updated on