2000-12-21 20:44:10 +00:00
|
|
|
/*
|
|
|
|
|
* Interval header
|
|
|
|
|
* Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2000-12-29 15:00:53 +00:00
|
|
|
#ifdef INTERVAL_INLINE
|
2000-12-21 20:44:10 +00:00
|
|
|
#include "interval_inline.h"
|
2000-12-29 15:00:53 +00:00
|
|
|
#else
|
2001-01-15 11:06:53 +00:00
|
|
|
void interval_any(interval_t *i);
|
|
|
|
|
void interval_none(interval_t *i);
|
|
|
|
|
int interval_setinteger(interval_t *i);
|
2000-12-21 20:44:10 +00:00
|
|
|
int interval_empty(const interval_t *i);
|
|
|
|
|
int interval_single(const interval_t *i);
|
|
|
|
|
int interval_value(const interval_t *i);
|
|
|
|
|
int interval_min(const interval_t *i);
|
|
|
|
|
int interval_max(const interval_t *i);
|
|
|
|
|
int interval_test(const interval_t *i, unsigned int val);
|
2000-12-29 15:00:53 +00:00
|
|
|
void interval_copy(interval_t *dst, const interval_t *src);
|
2001-01-19 18:28:50 +00:00
|
|
|
void interval_floor(interval_t *i);
|
|
|
|
|
void interval_unfloor(interval_t *i);
|
2001-01-15 11:06:53 +00:00
|
|
|
int interval_always_eq(const interval_t *i1, const interval_t *i2);
|
|
|
|
|
int interval_never_eq(const interval_t *i1, const interval_t *i2);
|
2000-12-29 15:00:53 +00:00
|
|
|
#endif
|
|
|
|
|
|
2001-01-15 11:06:53 +00:00
|
|
|
void interval_add(const interval_t *a, const interval_t *b, interval_t *c);
|
|
|
|
|
void interval_sub(const interval_t *a, const interval_t *b, interval_t *c);
|
|
|
|
|
void interval_mul(const interval_t *a, const interval_t *b, interval_t *c);
|
|
|
|
|
void interval_div(const interval_t *a, const interval_t *b, interval_t *c);
|
|
|
|
|
void interval_muldiv(const interval_t *a, const interval_t *b,
|
|
|
|
|
const interval_t *c, interval_t *d);
|
|
|
|
|
void interval_muldivk(const interval_t *a, const interval_t *b,
|
|
|
|
|
unsigned int k, interval_t *c);
|
|
|
|
|
void interval_mulkdiv(const interval_t *a, unsigned int k,
|
|
|
|
|
const interval_t *b, interval_t *c);
|
2001-01-17 11:00:32 +00:00
|
|
|
void interval_print(const interval_t *i, snd_output_t *out);
|
2001-01-15 11:06:53 +00:00
|
|
|
int interval_refine_min(interval_t *i, unsigned int min, int openmin);
|
|
|
|
|
int interval_refine_max(interval_t *i, unsigned int max, int openmax);
|
2000-12-29 15:00:53 +00:00
|
|
|
int interval_refine(interval_t *i, const interval_t *v);
|
|
|
|
|
int interval_refine_first(interval_t *i);
|
|
|
|
|
int interval_refine_last(interval_t *i);
|
|
|
|
|
int interval_refine_set(interval_t *i, unsigned int val);
|
2001-01-22 16:07:11 +00:00
|
|
|
void boundary_sub(int a, int adir, int b, int bdir, int *c, int *cdir);
|
|
|
|
|
int boundary_lt(unsigned int a, int adir, unsigned int b, int bdir);
|
|
|
|
|
int boundary_nearer(int min, int mindir, int best, int bestdir, int max, int maxdir);
|