home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / v / vgalib12.tar / vgalib / runx.c < prev    next >
C/C++ Source or Header  |  1992-11-09  |  646b  |  37 lines

  1. #include <vga.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. #include <sys/kd.h>
  6. #include <fcntl.h>
  7. #include <termcap.h>
  8.  
  9. main(int argc, char* argv[])
  10. {
  11.     int  tty0_fd;   
  12.     int  i, p;
  13.     char *cl;
  14.     char *buffer=0; 
  15.     char *termtype=getenv("TERM");
  16.  
  17.     vga_setmode(G640x480x16); 
  18.  
  19.     if (fork() == 0) {
  20.     execlp("startx", "startx", NULL);
  21.     _exit(1);
  22.     } 
  23.     wait(NULL);
  24.  
  25.     vga_setmode(TEXT); 
  26.  
  27.     tty0_fd = open("/dev/tty0", O_RDWR);
  28.     ioctl(tty0_fd, KDSETMODE, KD_GRAPHICS); 
  29.     ioctl(tty0_fd, KDSETMODE, KD_TEXT);
  30.  
  31.     tgetent(buffer, termtype);
  32.     cl=tgetstr("cl",0);
  33.     printf("%s\n",cl);
  34.  
  35.     exit(1);
  36. }
  37.