summaryrefslogtreecommitdiffstats
path: root/vncterm/example.c
diff options
context:
space:
mode:
authordscho <dscho>2003-02-09 18:05:54 +0000
committerdscho <dscho>2003-02-09 18:05:54 +0000
commit23f45bc7641dbe9b87ba281cf54ba844fe7edcee (patch)
treefdebf0bd19eaed02335ff89e1d431acb93b0dc16 /vncterm/example.c
parent28a84b63fe186a443704ade90a3e6370f127a2ec (diff)
downloadlibtdevnc-23f45bc7641dbe9b87ba281cf54ba844fe7edcee.tar.gz
libtdevnc-23f45bc7641dbe9b87ba281cf54ba844fe7edcee.zip
included vncterm
Diffstat (limited to 'vncterm/example.c')
-rw-r--r--vncterm/example.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/vncterm/example.c b/vncterm/example.c
new file mode 100644
index 0000000..fd77d54
--- /dev/null
+++ b/vncterm/example.c
@@ -0,0 +1,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;
+ //fprintf(stderr,"%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);
+}