## OGMJobExec

OGMJobExec — A spawn that runs a command line

## Synopsis

    #include <ogmjob-exec.h>

    gdouble             (*OGMJobWatch)                      (OGMJobExec *exec,
                                                             const gchar *buffer,
                                                             gpointer data);
    struct              OGMJobExec;
    OGMJobSpawn *       ogmjob_exec_new                     (const gchar *command_line);
    OGMJobSpawn *       ogmjob_exec_newv                    (gchar **argv);
    gint                ogmjob_exec_get_status              (OGMJobExec *exec);
    void                ogmjob_exec_add_watch               (OGMJobExec *exec,
                                                             OGMJobWatch watch_func,
                                                             gpointer watch_data);
    void                ogmjob_exec_add_watch_full          (OGMJobExec *exec,
                                                             OGMJobWatch watch_func,
                                                             gpointer watch_data,
                                                             gboolean watch_out,
                                                             gboolean watch_err,
                                                             gboolean swapped);

## Object Hierarchy

      GObject
       +----OGMJobSpawn
             +----OGMJobExec

## Description

## Details

### OGMJobWatch ()

    gdouble             (*OGMJobWatch)                      (OGMJobExec *exec,
                                                             const gchar *buffer,
                                                             gpointer data);

Specifies the type of functions passed to `ogmjob_exec_add_watch()`, and `ogmjob_exec_add_watch_full()`.

`exec` : | An OGMJobExec
`buffer` : | The data read
`data` : | The user data
Returns : | The progress made, or -1

### struct OGMJobExec

    struct OGMJobExec;

### ogmjob_exec_new ()

    OGMJobSpawn *       ogmjob_exec_new                     (const gchar *command_line);

Creates a new OGMJobExec.

`command_line` : | A command line
Returns : | The new OGMJobExec

### ogmjob_exec_newv ()

    OGMJobSpawn *       ogmjob_exec_newv                    (gchar **argv);

Creates a new OGMJobExec.

`argv` : | An argument vector
Returns : | The new OGMJobExec

### ogmjob_exec_get_status ()

    gint                ogmjob_exec_get_status              (OGMJobExec *exec);

Returns the execution status.

`exec` : | An OGMJobExec
Returns : | The execution status

### ogmjob_exec_add_watch ()

    void                ogmjob_exec_add_watch               (OGMJobExec *exec,
                                                             OGMJobWatch watch_func,
                                                             gpointer watch_data);

Invokes `watch_func` each time data is available on stdin or stdout.

`exec` : | An OGMJobExec
`watch_func` : | An OGMJobWatch
`watch_data` : | User data

### ogmjob_exec_add_watch_full ()

    void                ogmjob_exec_add_watch_full          (OGMJobExec *exec,
                                                             OGMJobWatch watch_func,
                                                             gpointer watch_data,
                                                             gboolean watch_out,
                                                             gboolean watch_err,
                                                             gboolean swapped);

Invokes `watch_func` each time data is available on stdin or stdout.

`exec` : | An OGMJobExec
`watch_func` : | An OGMJobWatch
`watch_data` : | User data
`watch_out` : | Whether to watch stdin
`watch_err` : | Whether to watch stdout
`swapped` : | Whether to swap exec and `watch_data` when calling `watch_func`