File: pocl_run_command.h

package info (click to toggle)
pocl 7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 29,768 kB
  • sloc: lisp: 151,669; ansic: 135,425; cpp: 65,801; python: 1,846; sh: 1,084; ruby: 255; pascal: 231; tcl: 180; makefile: 174; asm: 81; java: 72; xml: 49
file content (45 lines) | stat: -rw-r--r-- 1,258 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "pocl_export.h"

#include <stddef.h>

#ifndef POCL_RUN_COMMAND_H
#define POCL_RUN_COMMAND_H

#ifdef __cplusplus
extern "C"
{
#endif

  /**
   * Wrapper for running commands.
   *
   * \param args The list of arguments terminated by NULL, including the path
   * to the program to be run.
   * \return The return value from the executed command.
   */
  POCL_EXPORT
  int pocl_run_command (const char **args);

  /**
   * Wrapper for running commands with their output captured to a buffer.
   *
   * \todo This currently might block forever if capture_string is too small
   * for all the output.
   *
   * \param capture_string The target for storing the stdout and stderr.
   * \param captured_bytes [in/out] Input the number of bytes allocated in
   *        capture_string, outputs the number of bytes written there.
   * \param args The list of arguments terminated by NULL, including the path
   * to the program to be run.
   * \return The return value from the executed command.
   */
  POCL_EXPORT
  int pocl_run_command_capture_output (char *capture_string,
                                       size_t *captured_bytes,
                                       const char **args);

#ifdef __cplusplus
}
#endif

#endif // POCL_RUN_COMMAND_H