File: shellcommand.h.html

package info (click to toggle)
rudiments 0.31-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,516 kB
  • ctags: 3,248
  • sloc: asm: 23,776; cpp: 22,792; sh: 7,769; ansic: 1,769; makefile: 1,054; xml: 169; perl: 19
file content (88 lines) | stat: -rw-r--r-- 5,309 bytes parent folder | download | duplicates (2)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<html>
<head>
<title>~/src/firstworks/rudiments-0.31/include/rudiments/shellcommand.h.html</title>
<meta name="Generator" content="Vim/7.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#0000ff">// </font><span style="background-color: #ffff00"><font color="#0000ff">FIXME</font></span><font color="#0000ff">: implement this class</font>

<font color="#0000ff">// Copyright (c) 2003 David Muse</font>
<font color="#0000ff">// See the COPYING file for more information.</font>

<font color="#a020f0">#ifndef RUDIMENTS_SHELLCOMMAND_H</font>
<font color="#a020f0">#define RUDIMENTS_SHELLCOMMAND_H</font>

<font color="#a020f0">#include </font><font color="#ff00ff">&lt;rudiments/private/shellcommandincludes.h&gt;</font>

<font color="#0000ff">// The shellcommand class provides methods for running commands, reading their</font>
<font color="#0000ff">// output or writing input to them.</font>

<font color="#0000ff">// wrap:</font>
<font color="#0000ff">//      stdlib.h - system()</font>
<font color="#0000ff">//      unistd.h - execve()/fexecve(),execv(),execle(),execl(),execvp(),execlp()</font>
<font color="#0000ff">//      stdio.h - popen(), pclose()</font>
<font color="#0000ff">//      not in many systems -</font>
<font color="#0000ff">//              spawn.h - posix spawn interface</font>
<font color="#0000ff">//                              posix_spawn()</font>
<font color="#0000ff">//                              posix_spawnp()</font>
<font color="#0000ff">//                              posix_spawnattr_init()</font>
<font color="#0000ff">//                              posix_spawnattr_destroy()</font>
<font color="#0000ff">//                              posix_spawnattr_getsigdefault()</font>
<font color="#0000ff">//                              posix_spawnattr_setsigdefault()</font>
<font color="#0000ff">//                              posix_spawnattr_getsigmask()</font>
<font color="#0000ff">//                              posix_spawnattr_setsigmask()</font>
<font color="#0000ff">//                              posix_spawnattr_getflags()</font>
<font color="#0000ff">//                              posix_spawnattr_setflags()</font>
<font color="#0000ff">//                              posix_spawnattr_getpgroup()</font>
<font color="#0000ff">//                              posix_spawnattr_setpgroup()</font>
<font color="#0000ff">//                              posix_spawnattr_getschedpolicy()</font>
<font color="#0000ff">//                              posix_spawnattr_setschedpolicy()</font>
<font color="#0000ff">//                              posix_spawnattr_getschedparam()</font>
<font color="#0000ff">//                              posix_spawnattr_setschedparam()</font>
<font color="#0000ff">//                              posix_spawn_file_actions_init()</font>
<font color="#0000ff">//                              posix_spawn_file_actions_destroy()</font>
<font color="#0000ff">//                              posix_spawn_file_actions_addopen()</font>
<font color="#0000ff">//                              posix_spawn_file_actions_addclose()</font>
<font color="#0000ff">//                              posix_spawn_file_actions_adddup2()</font>

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
<font color="#2e8b57"><b>namespace</b></font> rudiments {
<font color="#a020f0">#endif</font>

<font color="#2e8b57"><b>class</b></font> shellcommandprivate;

<font color="#2e8b57"><b>class</b></font> shellcommand {
        <font color="#a52a2a"><b>public</b></font>:
                <font color="#2e8b57"><b>int</b></font>   run(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *command);
                        <font color="#0000ff">// Runs &quot;command&quot;.</font>

                <font color="#2e8b57"><b>int</b></font>   getStandardInput();
                        <font color="#0000ff">// If run() succeeded, returns the file descriptor</font>
                        <font color="#0000ff">// of the standard input of the command or 0 otherwise.</font>

                <font color="#2e8b57"><b>int</b></font>   getStandardOutput();
                        <font color="#0000ff">// If run() succeeded, returns the file descriptor</font>
                        <font color="#0000ff">// of the standard output of the command or 0 otherwise.</font>

                <font color="#2e8b57"><b>int</b></font>   getStandardError();
                        <font color="#0000ff">// If run() succeeded, returns the file descriptor</font>
                        <font color="#0000ff">// of the standard error of the command or 0 otherwise.</font>

                <font color="#2e8b57"><b>int</b></font>   close();
                        <font color="#0000ff">// Closes the previously run command.</font>
                        <font color="#0000ff">//</font>
                        <font color="#0000ff">// Returns 1 on success and 0 on failure.</font>

<font color="#a020f0">        #include </font><font color="#ff00ff">&lt;rudiments/private/shellcommand.h&gt;</font>
};

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
}
<font color="#a020f0">#endif</font>

<font color="#a020f0">#endif</font>
</pre>
</body>
</html>