gsubprocesslauncher.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright © 2012,2013 Colin Walters <[email protected]>
  4. * Copyright © 2012,2013 Canonical Limited
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General
  17. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  18. *
  19. * Author: Ryan Lortie <[email protected]>
  20. * Author: Colin Walters <[email protected]>
  21. */
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_SUBPROCESS_LAUNCHER_H__
  26. #define __G_SUBPROCESS_LAUNCHER_H__
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_SUBPROCESS_LAUNCHER (g_subprocess_launcher_get_type ())
  30. #define G_SUBPROCESS_LAUNCHER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SUBPROCESS_LAUNCHER, GSubprocessLauncher))
  31. #define G_IS_SUBPROCESS_LAUNCHER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SUBPROCESS_LAUNCHER))
  32. GLIB_AVAILABLE_IN_2_40
  33. GType g_subprocess_launcher_get_type (void) G_GNUC_CONST;
  34. GLIB_AVAILABLE_IN_2_40
  35. GSubprocessLauncher * g_subprocess_launcher_new (GSubprocessFlags flags);
  36. GLIB_AVAILABLE_IN_2_40
  37. GSubprocess * g_subprocess_launcher_spawn (GSubprocessLauncher *self,
  38. GError **error,
  39. const gchar *argv0,
  40. ...);
  41. GLIB_AVAILABLE_IN_2_40
  42. GSubprocess * g_subprocess_launcher_spawnv (GSubprocessLauncher *self,
  43. const gchar * const *argv,
  44. GError **error);
  45. GLIB_AVAILABLE_IN_2_40
  46. void g_subprocess_launcher_set_environ (GSubprocessLauncher *self,
  47. gchar **env);
  48. GLIB_AVAILABLE_IN_2_40
  49. void g_subprocess_launcher_setenv (GSubprocessLauncher *self,
  50. const gchar *variable,
  51. const gchar *value,
  52. gboolean overwrite);
  53. GLIB_AVAILABLE_IN_2_40
  54. void g_subprocess_launcher_unsetenv (GSubprocessLauncher *self,
  55. const gchar *variable);
  56. GLIB_AVAILABLE_IN_2_40
  57. const gchar * g_subprocess_launcher_getenv (GSubprocessLauncher *self,
  58. const gchar *variable);
  59. GLIB_AVAILABLE_IN_2_40
  60. void g_subprocess_launcher_set_cwd (GSubprocessLauncher *self,
  61. const gchar *cwd);
  62. GLIB_AVAILABLE_IN_2_40
  63. void g_subprocess_launcher_set_flags (GSubprocessLauncher *self,
  64. GSubprocessFlags flags);
  65. /* Extended I/O control, only available on UNIX */
  66. #ifdef G_OS_UNIX
  67. GLIB_AVAILABLE_IN_2_40
  68. void g_subprocess_launcher_set_stdin_file_path (GSubprocessLauncher *self,
  69. const gchar *path);
  70. GLIB_AVAILABLE_IN_2_40
  71. void g_subprocess_launcher_take_stdin_fd (GSubprocessLauncher *self,
  72. gint fd);
  73. GLIB_AVAILABLE_IN_2_40
  74. void g_subprocess_launcher_set_stdout_file_path (GSubprocessLauncher *self,
  75. const gchar *path);
  76. GLIB_AVAILABLE_IN_2_40
  77. void g_subprocess_launcher_take_stdout_fd (GSubprocessLauncher *self,
  78. gint fd);
  79. GLIB_AVAILABLE_IN_2_40
  80. void g_subprocess_launcher_set_stderr_file_path (GSubprocessLauncher *self,
  81. const gchar *path);
  82. GLIB_AVAILABLE_IN_2_40
  83. void g_subprocess_launcher_take_stderr_fd (GSubprocessLauncher *self,
  84. gint fd);
  85. GLIB_AVAILABLE_IN_2_40
  86. void g_subprocess_launcher_take_fd (GSubprocessLauncher *self,
  87. gint source_fd,
  88. gint target_fd);
  89. /* Child setup, only available on UNIX */
  90. GLIB_AVAILABLE_IN_2_40
  91. void g_subprocess_launcher_set_child_setup (GSubprocessLauncher *self,
  92. GSpawnChildSetupFunc child_setup,
  93. gpointer user_data,
  94. GDestroyNotify destroy_notify);
  95. #endif
  96. G_END_DECLS
  97. #endif /* __G_SUBPROCESS_H__ */