📄 libgnome-gnome-exec.html
字号:
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the process id, or <code class="literal">-1</code> on error.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2796878"></a><h3><a name="gnome-execute-shell"></a>gnome_execute_shell ()</h3><a class="indexterm" name="id2796891"></a><pre class="programlisting">int gnome_execute_shell (const char *dir, const char *commandline);</pre><p>Like <a href="libgnome-gnome-exec.html#gnome-execute-async-with-env"><code class="function">gnome_execute_async_with_env()</code></a>, but uses the user's shellto run the desired program. Note that the pid of the shell is returned, notthe pid of the user's program.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>dir</code></em> :</span></td><td> Directory in which child should be executed, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> for current directory</td></tr><tr><td><span class="term"><em class="parameter"><code>commandline</code></em> :</span></td><td> Shell command to execute</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> process id of shell, or <code class="literal">-1</code> on error.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2797007"></a><h3><a name="gnome-execute-shell-fds"></a>gnome_execute_shell_fds ()</h3><a class="indexterm" name="id2797020"></a><pre class="programlisting">int gnome_execute_shell_fds (const char *dir, const char *commandline, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> close_fds);</pre><p>Like <a href="libgnome-gnome-exec.html#gnome-execute-async-with-env-fds"><code class="function">gnome_execute_async_with_env_fds()</code></a>, but uses the user'sshell to run the desired program. Note that the pid of the shell isreturned, not the pid of the user's program.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>dir</code></em> :</span></td><td> Directory in which child should be executed, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> for current directory</td></tr><tr><td><span class="term"><em class="parameter"><code>commandline</code></em> :</span></td><td> Shell command to execute</td></tr><tr><td><span class="term"><em class="parameter"><code>close_fds</code></em> :</span></td><td> Like close_fds in <a href="libgnome-gnome-exec.html#gnome-execute-async-with-env-fds"><code class="function">gnome_execute_async_with_env_fds()</code></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> process id of shell, or <code class="literal">-1</code> on error.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2797170"></a><h3><a name="gnome-prepend-terminal-to-vector"></a>gnome_prepend_terminal_to_vector ()</h3><a class="indexterm" name="id2797183"></a><pre class="programlisting">void gnome_prepend_terminal_to_vector (int *argc, char ***argv);</pre><p>Prepends a terminal (either the one configured as default inthe user's GNOME setup, or one of the common xterm emulators) to the passedin vector, modifying it in the process. The vector should be allocated with<ahref="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-malloc"><span class="type">g_malloc</span></a>, as this will <ahref="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><span class="type">g_free</span></a> the original vector. Also all elements musthave been allocated separately. That is the standard glib/GNOME way ofdoing vectors however. If the integer that <em class="parameter"><code>argc</code></em> points to is negative, thesize will first be computed. Also note that passing in pointers to a vectorthat is empty, will just create a new vector for you.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>argc</code></em> :</span></td><td> a pointer to the vector size</td></tr><tr><td><span class="term"><em class="parameter"><code>argv</code></em> :</span></td><td> a pointer to the vector</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2797288"></a><h3><a name="gnome-execute-terminal-shell"></a>gnome_execute_terminal_shell ()</h3><a class="indexterm" name="id2797301"></a><pre class="programlisting">int gnome_execute_terminal_shell (const char *dir, const char *commandline);</pre><p>Like <a href="libgnome-gnome-exec.html#gnome-execute-async"><span class="type">gnome_execute_async</span></a>, except that it runs theterminal as well. Note that the pid of the terminal isreturned, not the pid of the user's program.If commandline is <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, just the shell is run.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>dir</code></em> :</span></td><td> Directory in which child should be executed, or NULL for current directory</td></tr><tr><td><span class="term"><em class="parameter"><code>commandline</code></em> :</span></td><td> Shell command to execute</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> process id of terminal, or <code class="literal">-1</code> on error.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2797415"></a><h3><a name="gnome-execute-terminal-shell-fds"></a>gnome_execute_terminal_shell_fds ()</h3><a class="indexterm" name="id2797428"></a><pre class="programlisting">int gnome_execute_terminal_shell_fds (const char *dir, const char *commandline, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> close_fds);</pre><p>Like <a href="libgnome-gnome-exec.html#gnome-execute-shell-fds"><code class="function">gnome_execute_shell_fds()</code></a>, except that it runs theterminal as well. Note that the pid of the terminal isreturned, not the pid of the user's program.If commandline is <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, just the shell is run.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>dir</code></em> :</span></td><td> Directory in which child should be executed, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> for current directory</td></tr><tr><td><span class="term"><em class="parameter"><code>commandline</code></em> :</span></td><td> Shell command to execute</td></tr><tr><td><span class="term"><em class="parameter"><code>close_fds</code></em> :</span></td><td> Like close_fds in <a href="libgnome-gnome-exec.html#gnome-execute-async-with-env-fds"><code class="function">gnome_execute_async_with_env_fds()</code></a></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> process id of terminal, or <code class="literal">-1</code> on error.</td></tr></tbody></table></div></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -