GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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.

Data Structures

struct  redirect
 Spawns a new process. More...
 
struct  signal
 
struct  binding
 
struct  spawn
 

Macros

#define MAX_ARGS   256
 
#define MAX_BINDINGS   256
 
#define MAX_SIGNALS   32
 
#define MAX_REDIRECTS   32
 
#define NEXT_ARG(var, type)   ((type) *(var)++)
 

Functions

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

Detailed Description

GIS Library - Handles process spawning.

(C) 2001-2008 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

#define MAX_ARGS   256

Definition at line 44 of file spawn.c.

Referenced by G_spawn().

#define MAX_BINDINGS   256

Definition at line 45 of file spawn.c.

#define MAX_REDIRECTS   32

Definition at line 47 of file spawn.c.

#define MAX_SIGNALS   32

Definition at line 46 of file spawn.c.

#define NEXT_ARG (   var,
  type 
)    ((type) *(var)++)

Definition at line 734 of file spawn.c.

Function Documentation

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 924 of file spawn.c.

References G_spawn_ex(), MAX_ARGS, NULL, and spawn::num_args.

Referenced by G_gishelp(), I_list_groups(), and I_list_subgroups().

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 902 of file spawn.c.

Referenced by db_start_driver(), and G_spawn().

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]argsarguments
Returns
-1 on error
process status on success

Definition at line 881 of file spawn.c.

int G_wait ( int  i_pid)

Definition at line 955 of file spawn.c.

References errno, FALSE, and n.

Referenced by db_shutdown_driver().