Exemplo n.º 1
0
void main(void)
{
  UCHAR cmd[0x8000];
  BOOL exitflag;

  log_init();

  hello();

  log(greeting);
  log("DosLogWrite address: %x\n", DosLogWrite);

  exitflag=FALSE;
  // Ok. Here we just in endless loop. Except for EXIT command.

  // create the global env. array
  env_create();

  while (!exitflag)
  {
    showpath();
    read_cmd (cmd);
    exitflag = parse_cmd (cmd);
  }

  // destroy the global env. array
  env_destroy();

  exit(0);
}
Exemplo n.º 2
0
/*
 * Update the number-of-files-tagged display in the given viewport header
 */
static void
show_what(VIEW * vp)
{
    RING *gbl = vp->gbl;
    char buffer[80];
    static char datechr[] = "acm";
    int y, x;

    move((int) vp->base_row, 0);
    if (gbl->tag_count)
	(void) standout();

    buffer[0] = EOS;
    if (gbl->tag_opt) {
	sprintf(buffer, "(%d files, %ld %s) ",
		gbl->tag_count,
		(long) ((gbl->tag_opt > 1) ? gbl->tag_bytes : gbl->tag_blocks),
		(gbl->tag_opt > 1) ? "bytes" : "blocks");
    }
    sprintf(buffer + strlen(buffer), "%u of %u [%ctime]",
	    gbl->curfile + 1,
	    gbl->numfiles,
	    datechr[gbl->dateopt]);
    showpath(gbl->new_wd, 999, -1, (int) strlen(buffer) + 3);
    getyx(stdscr, y, x);
    (void) y;
    x = COLS - (int) strlen(buffer) - x;
    while (x-- > 0)
	addch(' ');

    addstr(buffer);
    if (gbl->tag_count)
	(void) standend();
}
Exemplo n.º 3
0
void check_time(struct pathtype *path)
{
	  timecount++;
	  if (timecount<50) return;
	  timecount=0;
	  oldtime=newtime;
	  if ((newtime=time(NULL)-starttime)>oldtime)
	  {
		  if (mainmover=='b') blacks+=(newtime-oldtime); else whites+=(newtime-oldtime);
		  if (options.analysis)
		  {
				if (mousex>175 && mousey>120) hide_mouse();
				if (mainmover=='b')
				{
					 shownumber(game.blacks[game.movenum]+blacks, 260, 184);
				} else
				{
					 shownumber(game.whites[game.movenum]+whites, 188, 184);
				}
				if (mousex>175 && mousey>120) show_mouse();
				showpath(195,path);
		  }
		  oldtime=newtime;
		  if (options.playstyle==CHAMPIONSHIP || options.playstyle==FIXEDTIME)
		  {
				nomore=(newtime>maxtime);
				if (options.analysis) show_time_bar((int)newtime, (int)maxtime, (mainmover=='b'));
		  }
	  }
}
Exemplo n.º 4
0
Arquivo: horse.c Projeto: Alexoner/dsa
void visit(Point *poi,int n,int i)
{
    int j;//CRITICAL!!!
    printf("the %dth step\n",n+1);
	poi[n+1].x=poi[n].x+a[i];
	poi[n+1].y=poi[n].y+b[i];
	map[poi[n+1].x][poi[n+1].y]=n+2;
    showmap();
	for(j=0;j<8;j++)
    {
        if(right(poi,n+1,j)==1)
        {
            visit(poi,n+1,j);
            map[poi[n+2].x][poi[n+2].y]=0;
        }
        else if(right(poi,n+1,j)==MAX)
        {
            printf("done\n");
            showpath();
            return;
        }
    }
}