/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1996-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 *
* *
* Phong Vo <kpv@research.att.com> *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
/* Verify that records are sorted.
**
** Written by Kiem-Phong Vo (09/18/96).
*/
#include "rshdr.h"
typedef struct rsverify_s
ulong o; /* obj's ordinal */
ulong n; /* number of objects */
} Rsverify_t;
#if __STD_C
#else
#endif
{
if(verify->n > 0) /* compare with current obj */
OBJHEAD(p);
}
/* out of order */
return -1;
if(cmp == 0)
if(n < 0) /* abort now */
return -1;
else if(n == 0) /* pretend this didn't exist */
goto done;
}
/* else if(n > 0); start comparing from this one */
}
}
if(p->left == p) /* p->data was our allocation */
{ if(p->data)
}
/* switch current object */
done: /* free obj */
verify->n += 1;
return 0;
}
#if __STD_C
#else
#endif
{
{ /* save data space for last object */
p->data = k;
p->left = p; /* so we know that p->data is our space */
}
}
/* public method */
{ verifyinsert,
sizeof(Rsverify_t),
"verify",
"Verify that the input is sorted."
};
#ifdef NoF
#endif