#include <s3.h>

#define CB_DOUBLE 1
#define CB_SINGLE 0

cb_box(ur,uc,lr,lc,dbox)
int ur, uc, lr, lc, dbox;
char boxtype[6];  /* ul ur hor vert ll lr */
{
  int i;
  char boxtype[6];

  if(dbox)
  {
    boxtype[0] = 'É';
    boxtype[1] = '»';
    boxtype[2] = 'Í';
    boxtype[3] = 'º';
    boxtype[4] = 'È';
    boxtype[5] = '¼';
  }
  else
  {
    boxtype[0] = 'Ú';
    boxtype[1] = '¿';
    boxtype[2] = 'Ä';
    boxtype[3] = '³';
    boxtype[4] = 'À';
    boxtype[5] = 'Ù';
  }

  s3(ur,uc,boxtype[0]);
  s3(ur,lc,boxtype[1]);
  for(i=++uc;i<lc;i++)
  {
    s3(ur,i,boxtype[2]);
    s3(lr,i,boxtype[2]);
  }
  for(i=++ur;i<lr;i++)
  {
    s3(i,uc,boxtype[3]);
    s3(i,lc,boxtype[3]);
  }
  s3(lr,uc,boxtype[4]);
  s3(lr,lc,boxtype[5]);
  if(ur == lr)
  {
    s3(ur,uc,boxtype[2]);
    s3(ur,lc,boxtype[2]);
  }
  if(uc == lc)
  {
    s3(ur,uc,boxtype[3]);
    s3(lr,uc,boxtype[3]);
  }
}
