| 656 | } |
| 657 | |
| 658 | static cbm_userconfig_snapshot_status_t snapshot_input(cbm_userconfig_source_state_t state, |
| 659 | const void *bytes, size_t len) { |
| 660 | if (state == CBM_USERCONFIG_SOURCE_ABSENT) |
| 661 | return (!bytes && len == 0) ? CBM_USERCONFIG_SNAPSHOT_OK : CBM_USERCONFIG_SNAPSHOT_INVALID; |
| 662 | if (state != CBM_USERCONFIG_SOURCE_PRESENT || !bytes || len == 0) |
| 663 | return CBM_USERCONFIG_SNAPSHOT_INVALID; |
| 664 | return len > MAX_CONFIG_SIZE ? CBM_USERCONFIG_SNAPSHOT_LIMIT : CBM_USERCONFIG_SNAPSHOT_OK; |
| 665 | } |
| 666 | |
| 667 | cbm_userconfig_snapshot_status_t cbm_userconfig_from_project_bytes( |
| 668 | cbm_userconfig_source_state_t state, const void *bytes, size_t len, cbm_userconfig_t **out) { |
no outgoing calls
no test coverage detected