Re: XForms: fl_initialize(argc,argv)

From: yann.guichoux@ago.fr
Date: Mon Jul 24 2000 - 10:18:36 EDT

  • Next message: Steve Lamont: "Re: XForms: fl_initialize(argc,argv)"

    # To subscribers of the xforms list from yann.guichoux@ago.fr :

    Steve Lamont wrote:

    > # To subscribers of the xforms list from Steve Lamont <spl@ncmir.ucsd.edu> :
    >
    > > I have got some problems when trying to parse the command line options
    > > of my application after a call to fl_initialize() .
    > > (before this call, it works fine)
    > >
    > > some arguments seem to be eaten...(differents from the forms library's
    > > options)
    > >
    > > is it a bug or should i do something before parsing the arguments ?
    >
    > Without an example, it is difficult to even guess. Can you provide
    > such a piece of example code, please?
    >

    sorry...here is a piece of example code ...

    the things i do are very simple...(always ;-))

    void main (int argc, char **argv)
    {

     FILE *fp;
     struct rasterfile header;
     unsigned char *picture;
     static int *pi_a;
     static int *pi_b;

    /*** intialisation ***/

      flimage_enable_gif();

     ps_readFileName=NULL;
     ps_saveFileName=NULL;

    /***parsing arguments ***/

     if(argc<=1)
     {

      goto usage ;
     }

     for (i = 1; i < argc; i++)
     {
          if (argv[i][0] == '-')
          {
               switch (argv[i][1])
               {

                case 'A':
                       b_module=FALSE;
                       b_reelle=TRUE;
                       b_imaginaire=FALSE;
                  break;

                    case 'B':
                       b_module=FALSE;
                       b_reelle=FALSE;
                       b_imaginaire=TRUE;
                    break;

    .....more case

                default :
                       goto usage;

               }

          }
          else
          {
                   ps_readFileName=&argv[i][0];
          }

         }

      fl_initialize(&argc, argv, "sarViewer", 0,0); ---> if i put this line before
    parsing arguments some of the arguments are lost...(using dbx, a memory
    access error is detected while trying to read argv[i] with i<argc)

    .
    .
    .
    .
    .
    .

    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Mon Jul 24 2000 - 06:28:52 EDT