home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / windows / x / 15794 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  2.7 KB

  1. Path: sparky!uunet!gatech!concert!duke!news.duke.edu!bal1!ndd
  2. From: ndd@bal1 (Ned Danieley)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: Disappearing command line arguments
  5. Message-ID: <4948@news.duke.edu>
  6. Date: 28 Aug 92 14:01:10 GMT
  7. References: <1992Aug27.162750.16114@scubed.com>
  8. Sender: news@news.duke.edu
  9. Distribution: na
  10. Lines: 56
  11. Nntp-Posting-Host: bal1.mc.duke.edu
  12. X-Newsreader: Tin 1.1 PL5
  13.  
  14. Jeff Stevens (stevens@scubed.com) wrote:
  15. : In article <1992Aug27.035954.16698@scubed.com>, stevens@scubed.com (Jeff Stevens) writes:
  16. : |>   XtInitialize (and variants) removes all Xt command line arguments
  17. : |> from the command line list argv and reduces argc accordingly.  However,
  18. : |> it also removes a "-d" flag, and sometimes removes a "-t" flag.  "-d"
  19. : |> appears to be equivalent to "-display".  These are not documented toolkit 
  20. : |> options, and I can't find any reference to them in the X source code.
  21. ..
  22. : Thanks to the people who responded so quickly to the above question.  I had
  23. : not realized that any unique abbreviation of an option flag would be interpreted
  24. : as the option flag.  This seems like a dangerous feature, since it means that
  25. : if the command line is parsed by the application other than by the resource
  26. : manager, application flags must be distinct not only from the standard toolkit
  27. : flags, but also from any unique abbreviation of these flags or any application
  28. : supplied flags.  The only safe solution to this problem is to explicitly 
  29. : reference each flag in the application defined options table.
  30. : -- 
  31. : ----------------------------------------------------------
  32. : Jeff Stevens    stevens@s3mars.scubed.com, stevens@seismo.css.gov
  33.  
  34.  
  35. This is something that I complained about several years ago, but
  36. didn't get much sympathy. what I did was to stick an ifndef in
  37. mit/lib/X/ParseCmd.c to skip the code that does that match, and
  38. then put the proper define in my site.def. this means that you
  39. have to use the full length names for all X options, but we
  40. decided that was easier than changing all our programs.
  41.  
  42.  
  43. diff -c ParseCmd.c.dist ParseCmd.c.bal
  44. *** ParseCmd.c.dist     Wed Oct 30 15:00:26 1991
  45. --- ParseCmd.c.bal      Wed Oct 30 15:01:11 1991
  46. ***************
  47. *** 123,133 ****
  48. --- 123,135 ----
  49.                     break;
  50.                 }
  51.             }
  52. + #ifndef       BAL
  53.             else if (!argchar) {
  54.                 /* may be an abbreviation for this option */
  55.                 matches++;
  56.                 foundOption = i;
  57.             }
  58. + #endif
  59.             else if (table_is_sorted == Sorted && optchar > argchar) {
  60.                 break;
  61.             }
  62.  
  63. --
  64. Ned Danieley (ndd@sunbar.mc.duke.edu)
  65. Basic Arrhythmia Laboratory
  66. Box 3140, Duke University Medical Center
  67. Durham, NC  27710   (919) 660-5111 or 660-5100
  68.