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