Loading...
Searching...
No Matches
spawn.c File Reference

GIS Library - Handles process spawning. More...

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <signal.h>`
`#include <stdarg.h>`
`#include <unistd.h>`
`#include <fcntl.h>`
`#include <errno.h>`
`#include <sys/types.h>`
`#include <sys/wait.h>`
`#include <grass/config.h>`
`#include <grass/gis.h>`
`#include <grass/glocale.h>`
`#include <grass/spawn.h>`
Include dependency graph for spawn.c:

Go to the source code of this file.

## Macros

#define | MAX_ARGS 256
#define | MAX_BINDINGS 256
#define | MAX_SIGNALS 32
#define | MAX_REDIRECTS 32
#define | NEXT_ARG(var, type)
#define | NEXT_ARG_INT(var)

## Functions

int | G_vspawn_ex (const char *command, const char **args)
| Spawn new process based on command.
int | G_spawn_ex (const char *command,...)
| Spawn new process based on command.
int | G_spawn (const char *command,...)
| Spawn new process based on command.
int | G_wait (int i_pid)

## Detailed Description

GIS Library - Handles process spawning.

(C) 2001-2014 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
  Glynn Clements

Date
  2004-2006

Definition in file spawn.c.

## Macro Definition Documentation

## MAX_ARGS

#define MAX_ARGS 256

Definition at line 43 of file spawn.c.

Referenced by G_spawn().

## MAX_BINDINGS

#define MAX_BINDINGS 256

Definition at line 44 of file spawn.c.

## MAX_REDIRECTS

#define MAX_REDIRECTS 32

Definition at line 46 of file spawn.c.

## MAX_SIGNALS

#define MAX_SIGNALS 32

Definition at line 45 of file spawn.c.

## NEXT_ARG

#define NEXT_ARG | ( |  | var,
|  |  | type )

Value:
((type) * (var)++)

Definition at line 732 of file spawn.c.

## NEXT_ARG_INT

#define NEXT_ARG_INT | ( |  | var | ) |

Value:
(int)((intptr_t)*(var)++)

Definition at line 733 of file spawn.c.

## Function Documentation

## G_spawn()

int G_spawn | ( | const char * | command,
|  |  | ... )

Spawn new process based on command.

Parameters

  [in] | command |

Returns
  -1 on error
  process status on success

Definition at line 920 of file spawn.c.

References G_spawn_ex(), MAX_ARGS, and NULL.

## G_spawn_ex()

int G_spawn_ex | ( | const char * | command,
|  |  | ... )

Spawn new process based on command.

This is a more advanced version of G_spawn().

Parameters

  [in] | command |

Returns
  -1 on error
  process status on success

Definition at line 899 of file spawn.c.

Referenced by G_spawn().

## G_vspawn_ex()

int G_vspawn_ex | ( | const char * | command,
|  | const char ** | args )

Spawn new process based on command.

This is a more advanced version of G_spawn().

Parameters

  [in] | command |
  [in] | args | arguments

Returns
  -1 on error
  process status on success

Definition at line 879 of file spawn.c.

## G_wait()

int G_wait | ( | int | i_pid | ) |

Definition at line 950 of file spawn.c.

References FALSE.

Referenced by G_popen_close().