Re: Another suggested libgnome API change

On Mon, Sep 03, 2001 at 11:56:10PM -0400, Havoc Pennington wrote:
> Maciej Stachowiak <mjs noisehavoc org> writes: 
> > char **gnome_commandline_to_shell_argv        (char  *commandline);
> How is this different from g_shell_parse_argv? It puts the user shell
> in front of the argv?

as far as I've understood this is rather like

"/bin/favourite/shell" "-c" "command"

Now thinking about that that's pretty useless to add as a function.  the
convenient function was "run async in shell", but here you already have
to do at least 3 calls, so you might as well just do

  char *argv[4];
  argv[0] = gnome_util_user_shell ();
  argv[1] = "-c";
  argv[2] = command;
  argv[3] = 0;
  g_spawn_async (<all 5 billion arguments here>);
  g_free (argv[0]);

I suppose (current gnome-exec):

  gnome_execute_shell (NULL, command);

was a lot nicer.

With the proposed api we'd get

  char **argv;
  argv = gnome_commandline_to_shell_argv (command);
  g_spawn_async (<all 5 billion arguments here>);
  g_strfreev (argv);

I'm now leaning back towards just keeping the gnome-exec like functions,
those really were a lot simpler.


George <jirka 5z com>
   - I'm getting better!
   - No, you're not. You'll be stone dead in a moment.
                       -- Monty Python

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]