/***********************************************************************
* *
* 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> *
* *
***********************************************************************/
#include "rshdr.h"
/* Process a bunch of records
**
** Written by Kiem-Phong Vo (07/08/96)
*/
#if __STD_C
#else
#endif
{
r->right = r+1;
return r;
}
#if __STD_C
#else
#endif
{
return -1;
return -1;
}
/* reset record counter */
/* space for keys */
s_key = 0;
if(defkeyf) /* max expansion for key */
{ if(key <= 0)
}
else if(dsamelen) /* embedded key with fixed length */
{ datalen = d;
if(keylen <= 0)
}
for(s_process = 0;; )
{ /* start a new sorted chain */
if(!list)
return -1;
}
p_loop = 0; /* accumulate amount processed in this loop */
return -1;
return -1;
if(n == RS_DELETE)
goto delete_key;
}
{ if(!(endd = (uchar*)vmalloc(rs->vm,r->datalen)) || !(r->data = (uchar*)memcpy(endd, r->data, r->datalen)))
return -1;
}
}
return -1;
}
goto next_loop;
}
do
{ if(single)
else if(dsamelen) /* fixed length records */
{ if(s_loop < d)
break;
datalen = d;
}
#if _PACKAGE_ast
else if (d & ~0xff) /* Recfmt_t record descriptor */
break;
}
#endif
else /* records separated by some separator */
break;
}
return -1;
for (;;)
{ if(!defkeyf) /* key is part of data */
}
else /* key must be constructed separately */
{ /* make sure there is enough space */
{ if(k < RS_RESERVE &&
k = RS_RESERVE;
if(m_key) /* try to extend key space in place */
s_key += k;
else /* fix current segment */
}
}
if(!m_key)
return -1;
s_key = k;
}
}
if(k < 0)
return -1;
r->keylen = k;
{ /* each key is allocated separately */
s_key = 0;
}
else
{ c_key += k;
s_key -= k;
}
}
break;
return -1;
if(n == RS_DELETE)
{ c_key -= k;
s_key += k;
}
goto delete_raw;
}
if (!(endd = (uchar*)vmalloc(rs->vm,r->datalen)) || !(r->data = (uchar*)memcpy(endd, r->data, r->datalen)))
return -1;
}
return -1;
break;
}
}
if(m_key) /* fix memory segment */
return s_process;
}