1d5ac70f0Sopenharmony_ci/* 2d5ac70f0Sopenharmony_ci * Interval header 3d5ac70f0Sopenharmony_ci * Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org> 4d5ac70f0Sopenharmony_ci * 5d5ac70f0Sopenharmony_ci * 6d5ac70f0Sopenharmony_ci * This library is free software; you can redistribute it and/or modify 7d5ac70f0Sopenharmony_ci * it under the terms of the GNU Lesser General Public License as 8d5ac70f0Sopenharmony_ci * published by the Free Software Foundation; either version 2.1 of 9d5ac70f0Sopenharmony_ci * the License, or (at your option) any later version. 10d5ac70f0Sopenharmony_ci * 11d5ac70f0Sopenharmony_ci * This program is distributed in the hope that it will be useful, 12d5ac70f0Sopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 13d5ac70f0Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14d5ac70f0Sopenharmony_ci * GNU Lesser General Public License for more details. 15d5ac70f0Sopenharmony_ci * 16d5ac70f0Sopenharmony_ci * You should have received a copy of the GNU Lesser General Public 17d5ac70f0Sopenharmony_ci * License along with this library; if not, write to the Free Software 18d5ac70f0Sopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19d5ac70f0Sopenharmony_ci * 20d5ac70f0Sopenharmony_ci */ 21d5ac70f0Sopenharmony_ci 22d5ac70f0Sopenharmony_citypedef struct _snd_interval snd_interval_t; 23d5ac70f0Sopenharmony_ci 24d5ac70f0Sopenharmony_ci#ifdef SND_INTERVAL_INLINE 25d5ac70f0Sopenharmony_ci#include "interval_inline.h" 26d5ac70f0Sopenharmony_ci#else 27d5ac70f0Sopenharmony_civoid snd_interval_any(snd_interval_t *i); 28d5ac70f0Sopenharmony_civoid snd_interval_none(snd_interval_t *i); 29d5ac70f0Sopenharmony_ciint snd_interval_setinteger(snd_interval_t *i); 30d5ac70f0Sopenharmony_ciint snd_interval_empty(const snd_interval_t *i); 31d5ac70f0Sopenharmony_ciint snd_interval_single(const snd_interval_t *i); 32d5ac70f0Sopenharmony_ciint snd_interval_value(const snd_interval_t *i); 33d5ac70f0Sopenharmony_civoid snd_interval_set_value(snd_interval_t *i, unsigned int val); 34d5ac70f0Sopenharmony_ciint snd_interval_min(const snd_interval_t *i); 35d5ac70f0Sopenharmony_ciint snd_interval_max(const snd_interval_t *i); 36d5ac70f0Sopenharmony_civoid snd_interval_set_minmax(snd_interval_t *i, unsigned int min, unsigned int max); 37d5ac70f0Sopenharmony_ciint snd_interval_test(const snd_interval_t *i, unsigned int val); 38d5ac70f0Sopenharmony_civoid snd_interval_copy(snd_interval_t *dst, const snd_interval_t *src); 39d5ac70f0Sopenharmony_civoid snd_interval_floor(snd_interval_t *i); 40d5ac70f0Sopenharmony_civoid snd_interval_unfloor(snd_interval_t *i); 41d5ac70f0Sopenharmony_ciint snd_interval_always_eq(const snd_interval_t *i1, const snd_interval_t *i2); 42d5ac70f0Sopenharmony_ciint snd_interval_never_eq(const snd_interval_t *i1, const snd_interval_t *i2); 43d5ac70f0Sopenharmony_ci#endif 44d5ac70f0Sopenharmony_ci 45d5ac70f0Sopenharmony_ci/* make local functions really local */ 46d5ac70f0Sopenharmony_ci#define snd_interval_add snd1_interval_add 47d5ac70f0Sopenharmony_ci#define snd_interval_sub snd1_interval_sub 48d5ac70f0Sopenharmony_ci#define snd_interval_mul snd1_interval_mul 49d5ac70f0Sopenharmony_ci#define snd_interval_div snd1_interval_div 50d5ac70f0Sopenharmony_ci#define snd_interval_muldiv snd1_interval_muldiv 51d5ac70f0Sopenharmony_ci#define snd_interval_muldivk snd1_interval_muldivk 52d5ac70f0Sopenharmony_ci#define snd_interval_mulkdiv snd1_interval_mulkdiv 53d5ac70f0Sopenharmony_ci#define snd_interval_print snd1_interval_print 54d5ac70f0Sopenharmony_ci#define snd_interval_refine_min snd1_interval_refine_min 55d5ac70f0Sopenharmony_ci#define snd_interval_refine_max snd1_interval_refine_max 56d5ac70f0Sopenharmony_ci#define snd_interval_refine snd1_interval_refine 57d5ac70f0Sopenharmony_ci#define snd_interval_refine_first snd1_interval_refine_first 58d5ac70f0Sopenharmony_ci#define snd_interval_refine_last snd1_interval_refine_last 59d5ac70f0Sopenharmony_ci#define snd_interval_refine_set snd1_interval_refine_set 60d5ac70f0Sopenharmony_ci 61d5ac70f0Sopenharmony_civoid snd_interval_add(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); 62d5ac70f0Sopenharmony_civoid snd_interval_sub(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); 63d5ac70f0Sopenharmony_civoid snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); 64d5ac70f0Sopenharmony_civoid snd_interval_div(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); 65d5ac70f0Sopenharmony_civoid snd_interval_muldiv(const snd_interval_t *a, const snd_interval_t *b, 66d5ac70f0Sopenharmony_ci const snd_interval_t *c, snd_interval_t *d); 67d5ac70f0Sopenharmony_civoid snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b, 68d5ac70f0Sopenharmony_ci unsigned int k, snd_interval_t *c); 69d5ac70f0Sopenharmony_civoid snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k, 70d5ac70f0Sopenharmony_ci const snd_interval_t *b, snd_interval_t *c); 71d5ac70f0Sopenharmony_civoid snd_interval_print(const snd_interval_t *i, snd_output_t *out); 72d5ac70f0Sopenharmony_ciint snd_interval_refine_min(snd_interval_t *i, unsigned int min, int openmin); 73d5ac70f0Sopenharmony_ciint snd_interval_refine_max(snd_interval_t *i, unsigned int max, int openmax); 74d5ac70f0Sopenharmony_ciint snd_interval_refine(snd_interval_t *i, const snd_interval_t *v); 75d5ac70f0Sopenharmony_ciint snd_interval_refine_first(snd_interval_t *i); 76d5ac70f0Sopenharmony_ciint snd_interval_refine_last(snd_interval_t *i); 77d5ac70f0Sopenharmony_ciint snd_interval_refine_set(snd_interval_t *i, unsigned int val); 78d5ac70f0Sopenharmony_civoid boundary_sub(int a, int adir, int b, int bdir, int *c, int *cdir); 79d5ac70f0Sopenharmony_ciint boundary_lt(unsigned int a, int adir, unsigned int b, int bdir); 80d5ac70f0Sopenharmony_ciint boundary_nearer(int min, int mindir, int best, int bestdir, int max, int maxdir); 81