Branch data Line data Source code
1 : : // Copyright 2019-2026 David Robillard <d@drobilla.net> 2 : : // SPDX-License-Identifier: ISC 3 : : 4 : : #include "fixed.h" 5 : : 6 : : #include <exess/exess.h> 7 : : 8 : : #include <stdint.h> 9 : : #include <stdlib.h> 10 : : 11 : : EXESS_NONBLOCKING ExessResult 12 : 16928 : exess_read_int(const char* const str, int32_t* const out) 13 : : { 14 : 16928 : int64_t value = 0; 15 : 16928 : const ExessResult r = read_signed(str, INT32_MIN, INT32_MAX, &value); 16 : : 17 [ + + ]: 16928 : if (!r.status) { 18 : 16919 : *out = (int32_t)value; 19 : : } 20 : : 21 : 16928 : return r; 22 : : } 23 : : 24 : : EXESS_NONBLOCKING ExessResult 25 : 16967 : exess_write_int(const int32_t value, const size_t buf_size, char* const buf) 26 : : { 27 : 16967 : return exess_write_long(value, buf_size, buf); 28 : : }