patch1 for wafeperl 0.2 to allow xt command line argument processing 
Author Message
 patch1 for wafeperl 0.2 to allow xt command line argument processing

 Hi there!

 This patch for wafeperl 0.2 adds the following functionality:

   a) xt command line argument processing
      (wafeperl will accept -display ..., -bg pink, etc)
   b) better application class names derived from the perl script
      (in order to use application default files, etc)
   c) support for editres protocol when used with
      OSF/Motif + X11R5 (the Athena version supported
      editres from the beginning)

 Notes concerning (a): When the command line arguments are

 As it looks to me, arguments cannot be removed from the Perl
 argument list from the c level without patching Perl itself. For

 by using Wafe's argument list:

    sub setargv {

      local($ARGC) = &wafe_cmd('return [set argc]');
      for($i=0; $i<$ARGC; $i++) {

      }
    }

    &setargv();

 In order to apply the patch change to .../perl-4.036/wafeperl and issue

     patch < wafeperl-0.2-patch1    

 try with the new version:

        wafe-sample -font fixed -bg turquoise

 Greetings,

 -gustaf

 PS: wafeperl-0.1 was announced here a few weeks ago. README files for
 wafeperl and wafe con be found in ftp.wu-wien.ac.at:pub/src/X11/wafe/*.
========================================================== wafeperl-0.2-patch1
*** wafesub.mus.orig    Fri Dec 10 23:39:36 1993
--- wafesub.mus Fri Dec 10 23:33:39 1993
***************
*** 99,114 ****
  void
  init_wafe()
  {
!     int argc = 1;
!     char *progname = "perl";
!     char *argv[1];
      char *filename = "wafesub.c";
-     wafeScriptName = progname;
-     argv[0] = progname;

      /* setup Xt and Wafe */
!     wafeTopLevel = XtVaAppInitialize(&wafeAppContext, progname, NULL, 0,
                                 &argc, argv, NULL, NULL);
      wafeInit(argc,argv,
             False /* inputMode */,  
             False /* promptMode */
--- 99,136 ----
  void
  init_wafe()
  {
!     int argc;
!     char **argv;
!     char *wafeAppClass;
      char *filename = "wafesub.c";

+     int i;
+     char *p;
+
+     wafeScriptName = "perl";
+
+     argc = origargc-1;
+     argv = (char*) XtMalloc(sizeof(char*)*argc);
+    
+     for(i=0;i<origargc;i++)
+       {
+       /* fprintf(stderr,"i=%d: <%s>\n",i,origargv[i]);*/
+       if (i>0) argv[i-1] = origargv[i];
+       }
+
+     wafeAppClass = XtNewString(argv[0]);
+     if ((p = strrchr(wafeAppClass, '/')))
+       wafeAppClass = ++p;
+     while((p = strrchr(wafeAppClass, '.')))
+       *p = '-';
+     *wafeAppClass = toupper(*wafeAppClass);
+
+
      /* setup Xt and Wafe */
!     wafeTopLevel = XtVaAppInitialize(&wafeAppContext, wafeAppClass, NULL, 0,
                                 &argc, argv, NULL, NULL);
+     MOTIF_EDITRES_HANDLER(wafeTopLevel);
+
      wafeInit(argc,argv,
             False /* inputMode */,  
             False /* promptMode */
=============================================================
--

Postdoctoral/Visiting Scientist    Tel: (914) 784 7086
IBM T.J.Watson Research Center, P.O.Box 704
Yorktown Heights, New York 10598



Sun, 09 Jun 1996 05:40:42 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. wafeperl 0.2 available

2. Help! with command line arguments

3. running perl at command line with arguments: script.cgi?text=text

4. Command line arguments.

5. Simple reordering of command line arguments.

6. Command line arguments?

7. Passing form values back to a script as command line arguments

8. How to set varible from command line argument??

9. Modification of command line arguments

10. Where are command line arguments described?

11. passing arguments on the command line to the script

12. Variable to get arguments from command line

 

 
Powered by phpBB® Forum Software