home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / AIX / aixCmdLine.c next >
C/C++ Source or Header  |  1991-09-20  |  6KB  |  188 lines

  1. /*
  2.  * $Id: aixCmdLine.c,v 1.1 1991/09/20 17:58:56 mtranle Exp $
  3.  *
  4.  * Copyright IBM Corporation 1987,1988,1989
  5.  *
  6.  * All Rights Reserved
  7.  *
  8.  * Permission to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted,
  10.  * provided that the above copyright notice appear in all copies and that 
  11.  * both that copyright notice and this permission notice appear in
  12.  * supporting documentation, and that the name of IBM not be
  13.  * used in advertising or publicity pertaining to distribution of the
  14.  * software without specific, written prior permission.
  15.  *
  16.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  18.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  19.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  21.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  22.  * SOFTWARE.
  23.  *
  24. */
  25. #include <sys/select.h>
  26. #include <ctype.h>
  27.  
  28. #include "hftUtils.h"
  29.  
  30. #include "ibmTrace.h"
  31.  
  32. static char sccsid[] = "@(#)AIXCmdLine.c    3.3 88/09/26 03:52:28";
  33.  
  34. extern    int     AIXMouseChordDelay;
  35.  
  36. #ifdef IBM_GSL
  37. extern    char    *gslCommandLineScreenOption;
  38. #endif
  39.  
  40. /***====================================================================***/
  41.  
  42. #ifndef NO_SECRETS
  43. static    int    aixShowSecretArgs= 0;
  44. #endif
  45.  
  46. void
  47. AIXUseMsg()
  48. {
  49.     ErrorF("The \"X\" command accepts the following flags:\n");
  50.     ErrorF("   -a  <accel>     specify the mouse acceleration\n");
  51.     ErrorF("   -bp <color>     specify a BlackPixel color\n");
  52.     ErrorF("   -c  <volume>    specify the key click volume\n");
  53.     ErrorF("   -D  <file>      specify the color definition data base file\n");
  54.     ErrorF("   -f  <volume>    specify the beep volume\n");
  55.     ErrorF("   -fc <font>      specify the font for cursor glyphs and masks\n");
  56.     ErrorF("   -fn <font>      specify the default text font\n");
  57.     ErrorF("   -fp <path>      specify the search path for fonts\n");
  58.     ErrorF("   -m              use monochrome display characteristics\n");
  59.     ErrorF("   -n :<num>       specify the connection number\n");
  60.     ErrorF("   -p  <interval>  specify the screen saver interval\n");
  61.     ErrorF("   -r              disables auto repeat\n");
  62.     ErrorF("   -s <delay>      specify the screen saver delay\n");
  63.     ErrorF("   -t <threshold>  specify the mouse threshold\n");
  64.     ErrorF("   -to <time>      specify the time between connection checks\n");
  65.     ErrorF("   -T              disable the Ctrl-Alt-Backspace key sequence\n");
  66.     ErrorF("   -v              activate screen saver with background color\n");
  67.     ErrorF("   -wp <color>     specify a WhitePixel color\n");
  68. #ifndef NO_SECRETS
  69.     if (aixShowSecretArgs) {
  70.     ErrorF("For the moment, X also accepts some undocumented, unsupported\n");
  71.     ErrorF("flags.  These flags are *not* guaranteed to exist in future\n");
  72.     ErrorF("releases or to work all that well in this release.\n");
  73.     ErrorF("These unsupported flags are:\n");
  74.     ErrorF("   -bs             enable backing store (default)\n");
  75. #ifdef IBM_SPECIAL_MALLOC
  76.     ErrorF("   -malloc [0-5]   set malloc check level\n");
  77. #endif
  78.     ErrorF("   -mdelay <count> set delay for middle button chord (default 10)\n");
  79.     ErrorF("   -nobs           disable backing store\n");
  80.     ErrorF("   -nohdwr         use generic functions where applicable\n");
  81.     ErrorF("   -pckeys         swap CAPS LOCK and CTRL (for touch typists)\n");
  82. #ifdef IBM_SPECIAL_MALLOC
  83.     ErrorF("   -plumber <file> dump malloc arena to named file\n");
  84. #endif
  85.     ErrorF("   -quiet          do not print information messages (default)\n");
  86.     ErrorF("   -refresh        refresh clients to restore HFT\n");
  87.     ErrorF("   -repaint        repaint to restore HFT (default)\n");
  88.     ErrorF("   -rtkeys         use CAPS LOCK and CTRL as labelled (default)\n");
  89. #ifdef TRACE_X
  90.     ErrorF("   -trace          trace execution of IBM specific functions\n");
  91. #endif /* TRACE_X */
  92.     ErrorF("   -verbose        print information messages\n");
  93.     ErrorF("   -wrap           wrap mouse in both dimensions\n");
  94.     ErrorF("   -wrapx          wrap mouse in X only\n");
  95.     ErrorF("   -wrapy          wrap mouse in Y only\n");
  96.     }
  97. #endif
  98.     ErrorF("See the X User's Guide or X server manual page for more information\n");
  99. }
  100.  
  101. /***====================================================================***/
  102.  
  103. extern    int    ibmRefreshOnActivate;
  104.  
  105. int
  106. AIXProcessArgument(argc,argv,i)
  107. int     argc;
  108. char    *argv[];
  109. int    i;
  110. {
  111. extern    char    *rgbPath;
  112. extern    char    *display;
  113.  
  114.     TRACE(("AIXProcessArgument(%d,0x%x,%d)\n",argc,argv,i));
  115.     if        (( strcmp( argv[i], "-c" ) == 0) && ((i+1) < argc))
  116.     {
  117.        if ((argv[i+1][0] >= '0') && (argv[i+1][0] <= '9'))
  118.         argv[i] = "c";
  119.        return(0);
  120.     }
  121.     else if ( strcmp( argv[i], "-D" ) == 0)
  122.     {
  123.         if(++i < argc)
  124.         rgbPath = argv[i];
  125.         else 
  126.         return(0);
  127.         return(2);
  128.     }
  129. #ifdef IBM_GSL
  130.     else if (strcmp(argv[i], "-dd") == 0) {
  131.     if (++i<argc) {
  132.         gslCommandLineScreenOption= argv[i];
  133.         return(2);
  134.     }
  135.     }
  136. #endif
  137.     else if (strcmp(argv[i], "-mdelay") == 0 ) { 
  138.     if ((++i<argc)&&(isdigit(argv[i][0]))) {
  139.         AIXMouseChordDelay= atoi(argv[i]);
  140.         return(2);
  141.     }
  142.     }
  143.     else if ( strcmp( argv[i], "-n") == 0) {
  144.     char *dpy= argv[++i];
  145.  
  146.     if (i<argc) {
  147.         if (dpy[0]==':') {
  148.         display= &dpy[1];
  149.         }
  150.         else {
  151.         ErrorF("display specification must begin with ':'\n");
  152.         UseMsg();
  153.         exit(1);
  154.         }
  155.     }
  156.     else {
  157.         ErrorF("must specify display number after -n\n");
  158.         UseMsg();
  159.         exit(1);
  160.     }
  161.     return(2);
  162.     }
  163.     else if ( strcmp( argv[i], "-refresh" ) == 0 ) {
  164.     ibmRefreshOnActivate= 1;
  165.     return(1);
  166.     }
  167.     else if ( strcmp( argv[i], "-repaint" ) == 0 ) {
  168.     ibmRefreshOnActivate= 0;
  169.     return(1);
  170.     }
  171. #ifndef NO_SECRETS
  172.     else if (strcmp(argv[i],"-secrethelp")==0) {
  173.     aixShowSecretArgs= 1;
  174.     AIXUseMsg();
  175.     exit(1);
  176.     }
  177.     else if (strcmp(argv[i],"-erik")==0) {
  178.     extern int ibmUsePCKeys,ibmXWrapScreen,ibmRefreshOnActivate;
  179.     ibmUsePCKeys= 1;
  180.     ibmXWrapScreen= 1;
  181.     ibmRefreshOnActivate= 1;
  182.     return(1);
  183.     }
  184. #endif
  185.     return(0);
  186. }
  187.  
  188.