gsubprocess.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2012 Colin Walters <[email protected]>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: Colin Walters <[email protected]>
  19. */
  20. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  21. #error "Only <gio/gio.h> can be included directly."
  22. #endif
  23. #ifndef __G_SUBPROCESS_H__
  24. #define __G_SUBPROCESS_H__
  25. #include <gio/giotypes.h>
  26. G_BEGIN_DECLS
  27. #define G_TYPE_SUBPROCESS (g_subprocess_get_type ())
  28. #define G_SUBPROCESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SUBPROCESS, GSubprocess))
  29. #define G_IS_SUBPROCESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SUBPROCESS))
  30. GLIB_AVAILABLE_IN_2_40
  31. GType g_subprocess_get_type (void) G_GNUC_CONST;
  32. /**** Core API ****/
  33. GLIB_AVAILABLE_IN_2_40
  34. GSubprocess * g_subprocess_new (GSubprocessFlags flags,
  35. GError **error,
  36. const gchar *argv0,
  37. ...) G_GNUC_NULL_TERMINATED;
  38. GLIB_AVAILABLE_IN_2_40
  39. GSubprocess * g_subprocess_newv (const gchar * const *argv,
  40. GSubprocessFlags flags,
  41. GError **error);
  42. GLIB_AVAILABLE_IN_2_40
  43. GOutputStream * g_subprocess_get_stdin_pipe (GSubprocess *subprocess);
  44. GLIB_AVAILABLE_IN_2_40
  45. GInputStream * g_subprocess_get_stdout_pipe (GSubprocess *subprocess);
  46. GLIB_AVAILABLE_IN_2_40
  47. GInputStream * g_subprocess_get_stderr_pipe (GSubprocess *subprocess);
  48. GLIB_AVAILABLE_IN_2_40
  49. const gchar * g_subprocess_get_identifier (GSubprocess *subprocess);
  50. #ifdef G_OS_UNIX
  51. GLIB_AVAILABLE_IN_2_40
  52. void g_subprocess_send_signal (GSubprocess *subprocess,
  53. gint signal_num);
  54. #endif
  55. GLIB_AVAILABLE_IN_2_40
  56. void g_subprocess_force_exit (GSubprocess *subprocess);
  57. GLIB_AVAILABLE_IN_2_40
  58. gboolean g_subprocess_wait (GSubprocess *subprocess,
  59. GCancellable *cancellable,
  60. GError **error);
  61. GLIB_AVAILABLE_IN_2_40
  62. void g_subprocess_wait_async (GSubprocess *subprocess,
  63. GCancellable *cancellable,
  64. GAsyncReadyCallback callback,
  65. gpointer user_data);
  66. GLIB_AVAILABLE_IN_2_40
  67. gboolean g_subprocess_wait_finish (GSubprocess *subprocess,
  68. GAsyncResult *result,
  69. GError **error);
  70. GLIB_AVAILABLE_IN_2_40
  71. gboolean g_subprocess_wait_check (GSubprocess *subprocess,
  72. GCancellable *cancellable,
  73. GError **error);
  74. GLIB_AVAILABLE_IN_2_40
  75. void g_subprocess_wait_check_async (GSubprocess *subprocess,
  76. GCancellable *cancellable,
  77. GAsyncReadyCallback callback,
  78. gpointer user_data);
  79. GLIB_AVAILABLE_IN_2_40
  80. gboolean g_subprocess_wait_check_finish (GSubprocess *subprocess,
  81. GAsyncResult *result,
  82. GError **error);
  83. GLIB_AVAILABLE_IN_2_40
  84. gint g_subprocess_get_status (GSubprocess *subprocess);
  85. GLIB_AVAILABLE_IN_2_40
  86. gboolean g_subprocess_get_successful (GSubprocess *subprocess);
  87. GLIB_AVAILABLE_IN_2_40
  88. gboolean g_subprocess_get_if_exited (GSubprocess *subprocess);
  89. GLIB_AVAILABLE_IN_2_40
  90. gint g_subprocess_get_exit_status (GSubprocess *subprocess);
  91. GLIB_AVAILABLE_IN_2_40
  92. gboolean g_subprocess_get_if_signaled (GSubprocess *subprocess);
  93. GLIB_AVAILABLE_IN_2_40
  94. gint g_subprocess_get_term_sig (GSubprocess *subprocess);
  95. GLIB_AVAILABLE_IN_2_40
  96. gboolean g_subprocess_communicate (GSubprocess *subprocess,
  97. GBytes *stdin_buf,
  98. GCancellable *cancellable,
  99. GBytes **stdout_buf,
  100. GBytes **stderr_buf,
  101. GError **error);
  102. GLIB_AVAILABLE_IN_2_40
  103. void g_subprocess_communicate_async (GSubprocess *subprocess,
  104. GBytes *stdin_buf,
  105. GCancellable *cancellable,
  106. GAsyncReadyCallback callback,
  107. gpointer user_data);
  108. GLIB_AVAILABLE_IN_2_40
  109. gboolean g_subprocess_communicate_finish (GSubprocess *subprocess,
  110. GAsyncResult *result,
  111. GBytes **stdout_buf,
  112. GBytes **stderr_buf,
  113. GError **error);
  114. GLIB_AVAILABLE_IN_2_40
  115. gboolean g_subprocess_communicate_utf8 (GSubprocess *subprocess,
  116. const char *stdin_buf,
  117. GCancellable *cancellable,
  118. char **stdout_buf,
  119. char **stderr_buf,
  120. GError **error);
  121. GLIB_AVAILABLE_IN_2_40
  122. void g_subprocess_communicate_utf8_async (GSubprocess *subprocess,
  123. const char *stdin_buf,
  124. GCancellable *cancellable,
  125. GAsyncReadyCallback callback,
  126. gpointer user_data);
  127. GLIB_AVAILABLE_IN_2_40
  128. gboolean g_subprocess_communicate_utf8_finish (GSubprocess *subprocess,
  129. GAsyncResult *result,
  130. char **stdout_buf,
  131. char **stderr_buf,
  132. GError **error);
  133. G_END_DECLS
  134. #endif /* __G_SUBPROCESS_H__ */