The functions definitions in cdt are all surrounded by an `#if __STD_C`, if __STD_C is not defined than the old style function definition is used. These days STD C is the standard and the old style function defintions are obsolete.
They have been removed from lib/cdt, but not from the subprojects.
**
** Written by Kiem-Phong Vo (05/25/96)
*/
-#if __STD_C
int dtclose(reg Dt_t* dt)
-#else
-int dtclose(dt)
-reg Dt_t* dt;
-#endif
{
Dtdisc_t *disc;
int ev = 0;
** Written by Kiem-Phong Vo (5/26/96)
*/
-#if __STD_C
static Void_t* dtmemory(Dt_t* dt,Void_t* addr,size_t size,Dtdisc_t* disc)
-#else
-static Void_t* dtmemory(dt, addr, size, disc)
-Dt_t* dt; /* dictionary */
-Void_t* addr; /* address to be manipulate */
-size_t size; /* size to obtain */
-Dtdisc_t* disc; /* discipline */
-#endif
{
if(addr)
{ if(size == 0)
else return size > 0 ? malloc(size) : NIL(Void_t*);
}
-#if __STD_C
Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t* disc, int type)
-#else
-Dtdisc_t* dtdisc(dt,disc,type)
-Dt_t* dt;
-Dtdisc_t* disc;
-int type;
-#endif
{
reg Dtsearch_f searchf;
reg Dtlink_t *r, *t;
** Written by Kiem-Phong Vo (5/25/96).
*/
-#if __STD_C
Dtlink_t* dtextract(reg Dt_t* dt)
-#else
-Dtlink_t* dtextract(dt)
-reg Dt_t* dt;
-#endif
{
reg Dtlink_t *list, **s, **ends;
** Written by Kiem-Phong Vo (5/25/96).
*/
-#if __STD_C
Dtlink_t* dtflatten(Dt_t* dt)
-#else
-Dtlink_t* dtflatten(dt)
-Dt_t* dt;
-#endif
{
reg Dtlink_t *t, *r, *list, *last, **s, **ends;
*/
/* resize the hash table */
-#if __STD_C
static void dthtab(Dt_t* dt)
-#else
-static void dthtab(dt)
-Dt_t* dt;
-#endif
{
reg Dtlink_t *t, *r, *p, **s, **hs, **is, **olds;
int n, k;
}
}
-#if __STD_C
static Void_t* dthash(Dt_t* dt, reg Void_t* obj, int type)
-#else
-static Void_t* dthash(dt,obj,type)
-Dt_t* dt;
-reg Void_t* obj;
-int type;
-#endif
{
reg Dtlink_t *t, *r = NULL, *p;
reg Void_t *k, *key;
** Written by Kiem-Phong Vo (05/25/96)
*/
-#if __STD_C
static Void_t* dtlist(reg Dt_t* dt, reg Void_t* obj, reg int type)
-#else
-static Void_t* dtlist(dt, obj, type)
-reg Dt_t* dt;
-reg Void_t* obj;
-reg int type;
-#endif
{
reg int lk, sz, ky;
reg Dtcompar_f cmpf;
** Written by Kiem-Phong Vo (05/25/96)
*/
-#if __STD_C
Dtmethod_t* dtmethod(Dt_t* dt, Dtmethod_t* meth)
-#else
-Dtmethod_t* dtmethod(dt, meth)
-Dt_t* dt;
-Dtmethod_t* meth;
-#endif
{
reg Dtlink_t *list, *r;
reg Dtdisc_t* disc = dt->disc;
** Written by Kiem-Phong Vo (5/25/96)
*/
-#if __STD_C
Dt_t* dtopen(Dtdisc_t* disc, Dtmethod_t* meth)
-#else
-Dt_t* dtopen(disc, meth)
-Dtdisc_t* disc;
-Dtmethod_t* meth;
-#endif
{
Dt_t* dt = (Dt_t*)Version; /* shut-up unuse warning */
reg int e;
** Written by Kiem-Phong Vo (5/25/96)
*/
-#if __STD_C
Void_t* dtrenew(Dt_t* dt, reg Void_t* obj)
-#else
-Void_t* dtrenew(dt, obj)
-Dt_t* dt;
-reg Void_t* obj;
-#endif
{
reg Void_t* key;
reg Dtlink_t *e, *t, **s;
** Written by Kiem-Phong Vo (5/25/96)
*/
-#if __STD_C
int dtrestore(reg Dt_t* dt, reg Dtlink_t* list)
-#else
-int dtrestore(dt, list)
-reg Dt_t* dt;
-reg Dtlink_t* list;
-#endif
{
reg Dtlink_t *t, **s, **ends;
reg int type;
** Written by Kiem-Phong Vo (5/25/96)
*/
-#if __STD_C
static int treecount(reg Dtlink_t* e)
-#else
-static int treecount(e)
-reg Dtlink_t* e;
-#endif
{ return e ? treecount(e->left) + treecount(e->right) + 1 : 0;
}
-#if __STD_C
int dtsize(Dt_t* dt)
-#else
-int dtsize(dt)
-Dt_t* dt;
-#endif
{
reg Dtlink_t* t;
reg int size;
** Written by Kiem-Phong Vo (5/25/96)
*/
-#if __STD_C
static void dttstat(Dtstat_t* ds, Dtlink_t* root, int depth, int* level)
-#else
-static void dttstat(ds,root,depth,level)
-Dtstat_t* ds;
-Dtlink_t* root;
-int depth;
-int* level;
-#endif
{
if(root->left)
dttstat(ds,root->left,depth+1,level);
level[depth] += 1;
}
-#if __STD_C
static void dthstat(reg Dtdata_t* data, Dtstat_t* ds, reg int* count)
-#else
-static void dthstat(data, ds, count)
-reg Dtdata_t* data;
-Dtstat_t* ds;
-reg int* count;
-#endif
{
reg Dtlink_t* t;
reg int n, h;
}
}
-#if __STD_C
int dtstat(reg Dt_t* dt, Dtstat_t* ds, int all)
-#else
-int dtstat(dt, ds, all)
-reg Dt_t* dt;
-Dtstat_t* ds;
-int all;
-#endif
{
reg int i;
static int *Count, Size;
** Written by Kiem-Phong Vo (02/28/03)
*/
-#if __STD_C
uint dtstrhash(reg uint h, Void_t* args, reg int n)
-#else
-uint dtstrhash(h,args,n)
-reg uint h;
-Void_t* args;
-reg int n;
-#endif
{
reg unsigned char* s = (unsigned char*)args;
** Written by Kiem-Phong Vo (5/25/96)
*/
-#if __STD_C
static Void_t* dttree(Dt_t* dt, Void_t* obj, int type)
-#else
-static Void_t* dttree(dt,obj,type)
-Dt_t* dt;
-Void_t* obj;
-int type;
-#endif
{
Dtlink_t *root, *t;
int cmp, lk, sz, ky;
** Written by Kiem-Phong Vo (09/17/2001)
*/
-#if __STD_C
static Dtlink_t* treebalance(Dtlink_t* list, int size)
-#else
-static Dtlink_t* treebalance(list, size)
-Dtlink_t* list;
-int size;
-#endif
{
int n;
Dtlink_t *l, *mid;
return mid;
}
-#if __STD_C
int dttreeset(Dt_t* dt, int minp, int balance)
-#else
-int dttreeset(dt, minp, balance)
-Dt_t* dt;
-int minp;
-int balance;
-#endif
{
int size;
*/
-#if __STD_C
static Void_t* dtvsearch(Dt_t* dt, reg Void_t* obj, reg int type)
-#else
-static Void_t* dtvsearch(dt,obj,type)
-Dt_t* dt;
-reg Void_t* obj;
-reg int type;
-#endif
{
Dt_t *d, *p;
Void_t *o, *n, *ok, *nk;
}
}
-#if __STD_C
Dt_t* dtview(reg Dt_t* dt, reg Dt_t* view)
-#else
-Dt_t* dtview(dt,view)
-reg Dt_t* dt;
-reg Dt_t* view;
-#endif
{
reg Dt_t* d;
** Written by Kiem-Phong Vo (5/25/96)
*/
-#if __STD_C
int dtwalk(reg Dt_t* dt, int (*userf)(Dt_t*, Void_t*, Void_t*), Void_t* data)
-#else
-int dtwalk(dt,userf,data)
-reg Dt_t* dt;
-int(* userf)();
-Void_t* data;
-#endif
{
reg Void_t *obj, *next;
reg Dt_t* walk;