summaryrefslogtreecommitdiffstats
path: root/vncterm/example.c
blob: e9d49b93b71d397cf5a62254c954beb785b4226d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "VNConsole.h"
#include "vga.h"

int main(int argc,char **argv)
{
  vncConsolePtr c=vcGetConsole(&argc,argv,80,25,&vgaFont,FALSE);
  char buffer[1024];
  int i,j,l;
  for(j=32;j<256;j+=16) {
    vcPrintF(c,"%02x: ",j);
    for(i=j;i<j+16;i++)
      vcPutChar(c,i);
    vcPutChar(c,'\n');
  }
  i=0;
  while(1) {
    vcPrintF(c,"%d :> ",i);
    vcGetString(c,buffer,1024);
    l=strlen(buffer)-1;
    while(l>=0 && buffer[l]=='\n')
      buffer[l]=0;
    //rfbLog("%s (%d)",buffer,strlen(buffer));
    if(!strcmp(buffer,"quit"))
      return(0);
    if(!strcmp(buffer,"s"))
      vcScroll(c,2);
    if(!strcmp(buffer,"S"))
      vcScroll(c,-2);
    i++;
  }
  return(0);
}