gsubprocesslauncher.h 6.4 KB

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