## GvaMameProcess

GvaMameProcess — An abstraction of a UNIX process running MAME

## Synopsis

                        GvaMameProcess;
    GvaProcess *        gva_mame_process_new                (GPid pid,
                                                             gint priority,
                                                             gint standard_input,
                                                             gint standard_output,
                                                             gint standard_error);
    GvaProcess *        gva_mame_process_spawn              (const gchar *arguments,
                                                             gint priority,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----GvaProcess
             +----GvaMameProcess

## Description

A GvaMameProcess is a type of GvaProcess designed specifically for communicating with a child process running MAME.

## Details

### GvaMameProcess

    typedef struct _GvaMameProcess GvaMameProcess;

Contains only private data that should be read and manipulated using the functions below.

### gva_mame_process_new ()

    GvaProcess *        gva_mame_process_new                (GPid pid,
                                                             gint priority,
                                                             gint standard_input,
                                                             gint standard_output,
                                                             gint standard_error);

Creates a new GvaMameProcess from the given parameters. A GSource is created at the given `priority` for each of the file descriptors. The internal process value is initialized to zero.

`pid` : | child process ID
`priority` : | priority for the event sources
`standard_input` : | file descriptor for the child's stdin
`standard_output` : | file descriptor for the child's stdout
`standard_error` : | file descriptor for the child's stderr
Returns : | a new GvaMameProcess

### gva_mame_process_spawn ()

    GvaProcess *        gva_mame_process_spawn              (const gchar *arguments,
                                                             gint priority,
                                                             GError **error);

Spawns a child process running MAME with `arguments`. The resulting GvaProcess instance will monitor the child process for error messages. If an error occurs while spawning, the function returns `NULL` and sets `error`.

`arguments` : | command-line arguments
`priority` : | priority for the event sources
`error` : | return location for a GError, or `NULL`
Returns : | a new GvaProcess, or `NULL` if an error occurred