IdeSubprocessLauncher

IdeSubprocessLauncher

Functions

Properties

gboolean clean-env Read / Write
gchar * cwd Read / Write
GStrv environ Read / Write
GSubprocessFlags flags Read / Write / Construct
gboolean run-on-host Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── IdeSubprocessLauncher

Description

Functions

ide_subprocess_launcher_new ()

IdeSubprocessLauncher *
ide_subprocess_launcher_new (GSubprocessFlags flags);

ide_subprocess_launcher_get_cwd ()

const gchar *
ide_subprocess_launcher_get_cwd (IdeSubprocessLauncher *self);

ide_subprocess_launcher_set_cwd ()

void
ide_subprocess_launcher_set_cwd (IdeSubprocessLauncher *self,
                                 const gchar *cwd);

ide_subprocess_launcher_get_flags ()

GSubprocessFlags
ide_subprocess_launcher_get_flags (IdeSubprocessLauncher *self);

ide_subprocess_launcher_set_flags ()

void
ide_subprocess_launcher_set_flags (IdeSubprocessLauncher *self,
                                   GSubprocessFlags flags);

ide_subprocess_launcher_get_run_on_host ()

gboolean
ide_subprocess_launcher_get_run_on_host
                               (IdeSubprocessLauncher *self);

Gets if the process should be executed on the host system. This might be useful for situations where running in a contained environment is not sufficient to perform the given task.

Currently, only flatpak is supported for breaking out of the containment zone and requires the application was built with --allow=devel.

Returns

TRUE if the process should be executed outside the containment zone.


ide_subprocess_launcher_set_run_on_host ()

void
ide_subprocess_launcher_set_run_on_host
                               (IdeSubprocessLauncher *self,
                                gboolean run_on_host);

Sets the “run-on-host” property. See ide_subprocess_launcher_get_run_on_host() for more information.


ide_subprocess_launcher_append_path ()

void
ide_subprocess_launcher_append_path (IdeSubprocessLauncher *self,
                                     const gchar *append_path);

ide_subprocess_launcher_get_clear_env ()

gboolean
ide_subprocess_launcher_get_clear_env (IdeSubprocessLauncher *self);

ide_subprocess_launcher_set_clear_env ()

void
ide_subprocess_launcher_set_clear_env (IdeSubprocessLauncher *self,
                                       gboolean clear_env);

ide_subprocess_launcher_get_environ ()

const gchar * const   *
ide_subprocess_launcher_get_environ (IdeSubprocessLauncher *self);

ide_subprocess_launcher_set_environ ()

void
ide_subprocess_launcher_set_environ (IdeSubprocessLauncher *self,
                                     const gchar * const *environ_);

Replace the environment variables by a new list of variables.

Parameters

self

an IdeSubprocessLauncher

 

environ_

the list of environment variables to set.

[array zero-terminated=1][element-type utf8][nullable]

ide_subprocess_launcher_getenv ()

const gchar *
ide_subprocess_launcher_getenv (IdeSubprocessLauncher *self,
                                const gchar *key);

ide_subprocess_launcher_setenv ()

void
ide_subprocess_launcher_setenv (IdeSubprocessLauncher *self,
                                const gchar *key,
                                const gchar *value,
                                gboolean replace);

ide_subprocess_launcher_insert_argv ()

void
ide_subprocess_launcher_insert_argv (IdeSubprocessLauncher *self,
                                     guint index,
                                     const gchar *arg);

ide_subprocess_launcher_replace_argv ()

void
ide_subprocess_launcher_replace_argv (IdeSubprocessLauncher *self,
                                      guint index,
                                      const gchar *arg);

ide_subprocess_launcher_overlay_environment ()

void
ide_subprocess_launcher_overlay_environment
                               (IdeSubprocessLauncher *self,
                                IdeEnvironment *environment);

ide_subprocess_launcher_get_argv ()

const gchar * const   *
ide_subprocess_launcher_get_argv (IdeSubprocessLauncher *self);

ide_subprocess_launcher_push_args ()

void
ide_subprocess_launcher_push_args (IdeSubprocessLauncher *self,
                                   const gchar * const *args);

This function is semantically identical to calling ide_subprocess_launcher_push_argv() for each element of args .

If args is NULL, this function does nothing.

Parameters

self

an IdeSubprocessLauncher

 

args

the arguments.

[array zero-terminated=1][element-type utf8][nullable]

ide_subprocess_launcher_push_argv ()

void
ide_subprocess_launcher_push_argv (IdeSubprocessLauncher *self,
                                   const gchar *argv);

ide_subprocess_launcher_pop_argv ()

gchar *
ide_subprocess_launcher_pop_argv (IdeSubprocessLauncher *self);

ide_subprocess_launcher_set_argv ()

void
ide_subprocess_launcher_set_argv (IdeSubprocessLauncher *self,
                                  const gchar * const *argv);

ide_subprocess_launcher_spawn ()

IdeSubprocess *
ide_subprocess_launcher_spawn (IdeSubprocessLauncher *self,
                               GCancellable *cancellable,
                               GError **error);

Synchronously spawn a process using the internal state.

Returns

an IdeSubprocess or NULL upon error.

[transfer full]


ide_subprocess_launcher_set_stdout_file_path ()

void
ide_subprocess_launcher_set_stdout_file_path
                               (IdeSubprocessLauncher *self,
                                const gchar *stdout_file_path);

ide_subprocess_launcher_take_fd ()

void
ide_subprocess_launcher_take_fd (IdeSubprocessLauncher *self,
                                 gint source_fd,
                                 gint dest_fd);

ide_subprocess_launcher_take_stdin_fd ()

void
ide_subprocess_launcher_take_stdin_fd (IdeSubprocessLauncher *self,
                                       gint stdin_fd);

ide_subprocess_launcher_take_stdout_fd ()

void
ide_subprocess_launcher_take_stdout_fd
                               (IdeSubprocessLauncher *self,
                                gint stdout_fd);

ide_subprocess_launcher_take_stderr_fd ()

void
ide_subprocess_launcher_take_stderr_fd
                               (IdeSubprocessLauncher *self,
                                gint stderr_fd);

Types and Values

IDE_TYPE_SUBPROCESS_LAUNCHER

#define IDE_TYPE_SUBPROCESS_LAUNCHER (ide_subprocess_launcher_get_type())

struct IdeSubprocessLauncherClass

struct IdeSubprocessLauncherClass {
  GObjectClass parent_class;

  IdeSubprocess *(*spawn) (IdeSubprocessLauncher  *self,
                           GCancellable           *cancellable,
                           GError                **error);
};

IdeSubprocessLauncher

typedef struct _IdeSubprocessLauncher IdeSubprocessLauncher;

Property Details

The “clean-env” property

  “clean-env”                gboolean

If the environment should be cleared before setting environment variables.

Flags: Read / Write

Default value: FALSE


The “cwd” property

  “cwd”                      gchar *

Current Working Directory.

Flags: Read / Write

Default value: NULL


The “environ” property

  “environ”                  GStrv

Environ.

Flags: Read / Write


The “flags” property

  “flags”                    GSubprocessFlags

Flags.

Flags: Read / Write / Construct


The “run-on-host” property

  “run-on-host”              gboolean

Run on Host.

Flags: Read / Write

Default value: FALSE