/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2000-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#include "ivlib.h"
/* This method allows a new interval to simply overwrite
** any portion of older intervals that it overlaps with.
** Adjacent intervals with the same data are merged.
**
** Written by Kiem-Phong Vo and Glenn Fowler.
*/
struct Flat_s
{
};
struct Flseg_s
{
};
/* create a new segment identical to "obj" */
static void*
{
/* the use of sizeof(Flseg_t) is deliberate */
return 0;
return sg;
}
/* free a segment */
static void
{
}
/* during build, segments are sorted by "lo" values only */
static int
{
}
/* during search, we are looking for a segment containing some point.
** since a point is a segment with identical ends, the being compared
** objects must be either distinct or have a containing relationship.
*/
static int
{
return -1;
return 1;
else
return 0;
}
static int
{
unsigned char* pt;
return -1;
{
}
/* the possibilities for this case are:
** ........ ........ ........ ... ...
** ++++ ++++++ ++++++++++++++++
*/
{
{
return 0;
/* set left side of old segment */
return -1;
{
/* set right side of old segment */
return -1;
}
return 0;
}
else
/* set left side of old segment */
}
/* the possibilities for this case are:
** ........ ........ ........ ... ....
** ++++ ++++++++ +++++++++++++++++++++++
*/
{
{
return 0;
/* right side of old seg */
}
else
}
/* the possibilities for this case are:
** ........ ........ ........ ... ...
** +++++++ ++++++++++ ++++++++++++++++++++++++
*/
{
break;
}
else
/* mergeable with previous segment */
if ((sg = dtprev(dt,&seg)) && data == sg->data && fvcmp(size, (fvadd(size, iv->r1, sg->hi, iv->unit), iv->r1), lo) == 0)
{
}
/* mergeable with next segment */
if ((sg = dtnext(dt, &seg)) && data == sg->data && fvcmp(size, (fvadd(size, iv->r1, hi, iv->unit), iv->r1), sg->lo) == 0)
{
}
/* a new segment */
}
static int
{
}
static unsigned char*
{
return 0;
{
}
/* see if inside some segment */
}
static Ivseg_t*
{
return 0;
{
}
/* find the segment containing pt or just beyond it */
}
static int
{
switch (type)
{
case IV_OPEN:
return -1;
{
return -1;
}
break;
case IV_CLOSE:
return -1;
break;
}
return 0;
}
{
"flat",
"The flat interval method allows a new interval to simply overwrite any portion of older intervals that it overlaps with. Adjacent intervals with the same data are merged.",
0,
};