add libvncserver
[presencevnc] / libvnc / vncterm / example.c
1 #include "VNConsole.h"
2 #include "vga.h"
3
4 int main(int argc,char **argv)
5 {
6   vncConsolePtr c=vcGetConsole(&argc,argv,80,25,&vgaFont,FALSE);
7   char buffer[1024];
8   int i,j,l;
9   for(j=32;j<256;j+=16) {
10     vcPrintF(c,"%02x: ",j);
11     for(i=j;i<j+16;i++)
12       vcPutChar(c,i);
13     vcPutChar(c,'\n');
14   }
15   i=0;
16   while(1) {
17     vcPrintF(c,"%d :> ",i);
18     vcGetString(c,buffer,1024);
19     l=strlen(buffer)-1;
20     while(l>=0 && buffer[l]=='\n')
21       buffer[l]=0;
22     if(!strcmp(buffer,"quit"))
23       return(0);
24     if(!strcmp(buffer,"s"))
25       vcScroll(c,2);
26     if(!strcmp(buffer,"S"))
27       vcScroll(c,-2);
28     i++;
29   }
30   return(0);
31 }