#define KTYPE_IMP

#include "ldc.hh"

tSORT_TBL sort_tbl= {  { 0, FALSE, NULL, NULL, NULL, NULL, NULL },
  { 1, FALSE, "number", NULL, NULL, NULL, NULL }
};

unsigned sort_tbl_size= 2;

static int _arg_buf[]= {  1
};

kdatum _eval_opn(_oid, _arg)
int _oid;
kdatum _arg[];
{
  return NULL;
}

tOPN_TBL opn_tbl= {  { 0, 0, 0, NULL, FALSE, FALSE, NULL, NULL },
  { 1, 1, 0, NULL, FALSE, FALSE, "one", (kdatum(*)())one },
  { 2, 1, 1, _arg_buf, FALSE, FALSE, "succ", (kdatum(*)())succ }
};

unsigned opn_tbl_size= 3;

/* one: -> number */
kdatum one()
{  static kdatum _v= NULL;

  if (_v == NULL)
  {  _v= kd_alloc();
    _v->opn= 1;
    (void) kd_const(_v);
  }
  return _v;
}

/* succ: number -> number */
kdatum succ(_p1)
kdatum _p1;
{  kdatum _v;
  klink _s1;

  _v= kd_alloc();
  _v->opn= 2;

  _s1= kd_link();
  _s1->arg= (kdatum)_p1;
  _v->lnk= _s1;

  return _v;
}

void ldcinit() {}
