SET service: accurate results for symmetric mode
[oweals/gnunet.git] / src / include / gnunet_os_lib.h
index 79adb6fa2661e1272c698cf68f74505432584296..431988042ff6e8db1fe09b47c9a1c920d05a49c8 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2001, 2002, 2003, 2004, 2005, 2006, 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -229,13 +229,14 @@ GNUNET_OS_get_libexec_binary_path (const char *progname);
  * @param addrlen length of the address
  * @return #GNUNET_OK to continue iteration, #GNUNET_SYSERR to abort
  */
-typedef int (*GNUNET_OS_NetworkInterfaceProcessor) (void *cls,
-                                                    const char *name,
-                                                    int isDefault,
-                                                    const struct sockaddr *addr,
-                                                    const struct sockaddr *broadcast_addr,
-                                                    const struct sockaddr *netmask,
-                                                    socklen_t addrlen);
+typedef int
+(*GNUNET_OS_NetworkInterfaceProcessor) (void *cls,
+                                        const char *name,
+                                        int isDefault,
+                                        const struct sockaddr *addr,
+                                        const struct sockaddr *broadcast_addr,
+                                        const struct sockaddr *netmask,
+                                        socklen_t addrlen);
 
 
 /**
@@ -310,6 +311,7 @@ GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc);
  * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
  * @param pipe_stdin pipe to use to send input to child process (or NULL)
  * @param pipe_stdout pipe to use to get output from child process (or NULL)
+ * @param pipe_stderr pipe to use to get error output from child process (or NULL)
  * @param filename name of the binary
  * @param argv NULL-terminated array of arguments to the process
  * @return pointer to process structure of the new process, NULL on error
@@ -319,6 +321,7 @@ GNUNET_OS_start_process_vap (int pipe_control,
                              enum GNUNET_OS_InheritStdioFlags std_inheritance,
                             struct GNUNET_DISK_PipeHandle *pipe_stdin,
                             struct GNUNET_DISK_PipeHandle *pipe_stdout,
+                            struct GNUNET_DISK_PipeHandle *pipe_stderr,
                             const char *filename,
                             char *const argv[]);
 
@@ -330,6 +333,7 @@ GNUNET_OS_start_process_vap (int pipe_control,
  * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
  * @param pipe_stdin pipe to use to send input to child process (or NULL)
  * @param pipe_stdout pipe to use to get output from child process (or NULL)
+ * @param pipe_stderr pipe to use to get error output from child process (or NULL)
  * @param filename name of the binary
  * @param ... NULL-terminated list of arguments to the process
  * @return pointer to process structure of the new process, NULL on error
@@ -339,6 +343,7 @@ GNUNET_OS_start_process (int pipe_control,
                          enum GNUNET_OS_InheritStdioFlags std_inheritance,
                         struct GNUNET_DISK_PipeHandle *pipe_stdin,
                          struct GNUNET_DISK_PipeHandle *pipe_stdout,
+                         struct GNUNET_DISK_PipeHandle *pipe_stderr,
                          const char *filename, ...);
 
 
@@ -349,6 +354,7 @@ GNUNET_OS_start_process (int pipe_control,
  * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
  * @param pipe_stdin pipe to use to send input to child process (or NULL)
  * @param pipe_stdout pipe to use to get output from child process (or NULL)
+ * @param pipe_stderr pipe to use to get error output from child process (or NULL)
  * @param filename name of the binary
  * @param va NULL-terminated list of arguments to the process
  * @return pointer to process structure of the new process, NULL on error
@@ -358,6 +364,7 @@ GNUNET_OS_start_process_va (int pipe_control,
                             enum GNUNET_OS_InheritStdioFlags std_inheritance,
                            struct GNUNET_DISK_PipeHandle *pipe_stdin,
                             struct GNUNET_DISK_PipeHandle *pipe_stdout,
+                            struct GNUNET_DISK_PipeHandle *pipe_stderr,
                             const char *filename, va_list va);
 
 /**
@@ -382,9 +389,9 @@ GNUNET_OS_start_process_v (int pipe_control,
 
 /**
  * Start a process.  This function is similar to the GNUNET_OS_start_process_*
- * except that the @a filename and @argv can have whole strings which contain
+ * except that the filename and arguments can have whole strings which contain
  * the arguments.  These arguments are to be separated by spaces and are parsed
- * in the order they appear.  Arguments containing spaces can be used by 
+ * in the order they appear.  Arguments containing spaces can be used by
  * quoting them with @em ".
  *
  * @param pipe_control should a pipe be used to send signals to the child?
@@ -393,18 +400,16 @@ GNUNET_OS_start_process_v (int pipe_control,
  *         must be NULL on platforms where dup is not supported
  * @param filename name of the binary.  It is valid to have the arguments
  *         in this string when they are separated by spaces.
- * @param ... more arguments.  Should be of type <tt>char *</tt>.  It is valid
+ * @param ... more arguments.  Should be of type `char *`.  It is valid
  *         to have the arguments in these strings when they are separated by
- *         spaces.
- * @param argv NULL-terminated list of arguments to the process,
- *             including the process name as the first argument
+ *         spaces.  The last argument MUST be NULL.
  * @return pointer to process structure of the new process, NULL on error
  */
 struct GNUNET_OS_Process *
 GNUNET_OS_start_process_s (int pipe_control,
                            unsigned int std_inheritance,
                            const SOCKTYPE * lsocks,
-                           const char *first_arg, ...);
+                           const char *filename, ...);
 
 
 /**
@@ -465,7 +470,7 @@ GNUNET_OS_process_status (struct GNUNET_OS_Process *proc,
 
 /**
  * Wait for a process to terminate.  The return code is discarded.
- * You must not use 'GNUNET_OS_process_status' on the same process
+ * You must not use #GNUNET_OS_process_status() on the same process
  * after calling this function!  This function is blocking and should
  * thus only be used if the child process is known to have terminated
  * or to terminate very soon.
@@ -480,7 +485,7 @@ GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
 /**
  * Connects this process to its parent via pipe;
  * essentially, the parent control handler will read signal numbers
- * from the 'GNUNET_OS_CONTROL_PIPE' (as given in an environment
+ * from the #GNUNET_OS_CONTROL_PIPE (as given in an environment
  * variable) and raise those signals.
  *
  * @param cls closure (unused)
@@ -510,7 +515,9 @@ GNUNET_OS_install_parent_control_handler (void *cls,
  *         #GNUNET_SYSERR on error (no such binary or not executable)
  */
 int
-GNUNET_OS_check_helper_binary (const char *binary, int check_suid, const char * params);
+GNUNET_OS_check_helper_binary (const char *binary,
+                               int check_suid,
+                               const char *params);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */