convert fs publish to MQ
[oweals/gnunet.git] / src / include / gnunet_os_lib.h
index 4a1a6377af6e31206d5dd089155a5798e3186058..39c70c8bd4db09c78ef3ccff7d7075e8ed6ac62f 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2011 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -199,6 +199,100 @@ enum GNUNET_OS_ProcessStatusType
 };
 
 
+/**
+ * Project-specific data used to help the OS subsystem
+ * find installation paths.
+ */
+struct GNUNET_OS_ProjectData
+{
+  /**
+   * Name of a library that is installed in the "lib/" directory of
+   * the project, such as "libgnunetutil".  Used to locate the
+   * installation by scanning dependencies of the current process.
+   */
+  const char *libname;
+
+  /**
+   * Name of the project that is used in the "libexec" prefix, For
+   * example, "gnunet".  Certain helper binaries are then expected to
+   * be installed in "$PREFIX/libexec/gnunet/" and resources in
+   * "$PREFIX/share/gnunet/".
+   */
+  const char *project_dirname;
+
+  /**
+   * Name of a project-specific binary that should be in "$PREFIX/bin/".
+   * Used to determine installation path from $PATH variable.
+   * For example "gnunet-arm".  On W32, ".exe" should be omitted.
+   */
+  const char *binary_name;
+
+  /**
+   * Name of an environment variable that can be used to override
+   * installation path detection, for example "GNUNET_PREFIX".
+   */
+  const char *env_varname;
+
+  /**
+   * Alternative name of an environment variable that can be used to
+   * override installation path detection, if "env_varname" is not
+   * set. Again, for example, "GNUNET_PREFIX".
+   */
+  const char *env_varname_alt;
+
+  /**
+   * Name of an environment variable that can be used to override
+   * the location from which default configuration files are loaded
+   * from, for example "GNUNET_BASE_CONFIG".
+   */
+  const char *base_config_varname;
+
+  /**
+   * E-mail address for reporting bugs.
+   */
+  const char *bug_email;
+
+  /**
+   * Project homepage.
+   */
+  const char *homepage;
+
+  /**
+   * Configuration file name (in $XDG_CONFIG_HOME) to use.
+   */
+  const char *config_file;
+
+  /**
+   * Configuration file name to use (if $XDG_CONFIG_HOME is not set).
+   */
+  const char *user_config_file;
+
+};
+
+
+/**
+ * Return default project data used by 'libgnunetutil' for GNUnet.
+ */
+const struct GNUNET_OS_ProjectData *
+GNUNET_OS_project_data_default (void);
+
+
+/**
+ * @return current (actual) project data.
+ */
+const struct GNUNET_OS_ProjectData *
+GNUNET_OS_project_data_get (void);
+
+
+/**
+ * Setup OS subsystem with project data.
+ *
+ * @param pd project data used to determine paths.
+ */
+void
+GNUNET_OS_init (const struct GNUNET_OS_ProjectData *pd);
+
+
 /**
  * Get the path to a specific GNUnet installation directory or, with
  * #GNUNET_OS_IPK_SELF_PREFIX, the current running apps installation
@@ -495,12 +589,9 @@ GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
  * variable) and raise those signals.
  *
  * @param cls closure (unused)
- * @param tc scheduler context (unused)
  */
 void
-GNUNET_OS_install_parent_control_handler (void *cls,
-                                          const struct
-                                          GNUNET_SCHEDULER_TaskContext *tc);
+GNUNET_OS_install_parent_control_handler (void *cls);
 
 
 /**