⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtk-server.1.html

📁 gtk_server的源代码
💻 HTML
📖 第 1 页 / 共 2 页
字号:
Content-type: text/html<HTML><HEAD><TITLE>Manpage of gtk-server</TITLE></HEAD><BODY><H1>gtk-server</H1>Section: User Commands  (1)<BR><A HREF="#index">Index</A><A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR><A NAME="lbAB">&nbsp;</A><H2>NAME</H2>gtk-server - GUI access for shellscripts and interpreted languages.<A NAME="lbAC">&nbsp;</A><H2>SYNOPSIS </H2><B>gtk-server</B><I>&lt;-stdin&gt; |</I><I>&lt;-tcp&gt;=host:port[:max] |</I><I>&lt;-sock&gt;=host:port |</I><I>&lt;-udp&gt;=host:port |</I><I>&lt;-fifo&gt;=filename |</I><I>&lt;-ipc&gt;=number</I><I>[-log=filename]</I><I>[-signal=number]</I><I>[-cfg=filename]</I><I>[-pre=string]</I><I>[-post=string]</I><I>[-handle]</I><I>[-detach]</I><I>[-nocreate]</I><I>[-showconf]</I><I>[-start=macro]</I><I>[-init=handshake]</I><I>[-ssl=[cert.pem]]</I><I>[-password=passwd]</I><I>[-ca=cert.pem]</I><A NAME="lbAD">&nbsp;</A><H2>DESCRIPTION</H2>The GTK-server is a binary which can be started from a (shell-)script oran interpreted language. It will read the configuration file 'gtk-server.cfg' after which a client script can execute GTK functions. These GTK functions are sent inplain text to the gtk-server, using a 2-way pipe, a named pipe or a TCP or UDPconnection.The GTK-server was inspired by 'dtksh' for the Common DesktopEnvironment (CDE).<A NAME="lbAE">&nbsp;</A><H2>ARGUMENTS</H2><P>The GTK-server must be started with one of the followingarguments:<DL COMPACT><DT><B>-stdin</B><DD>Start the GTK-server with 2-way pipes. The client script language must starta 2-way pipe to the GTK-server to enable communication. (In KSH and AWK for example, the symbol '|&amp;' is used for this.)<DT><B>-tcp=host:port[:max]</B><DD>Start the GTK-server as TCP server. The client script language mustconnect to this host and port. Commonly 'localhost' and a portnumber higher than 1024 are used. The 'max' part determines the maximum amount of client scripts which can connect. If 'max' is omitted only 1 client script may connect.<DT><B>-sock=host:port</B><DD>Start the GTK-server as TCP client. The client script language acts like a server, sendingthe commands to the GTK-server.<DT><B>-udp=host:port</B><DD>Start the GTK-server in UDP mode. The client script must connect to &lt;host&gt; and &lt;port&gt; using the UDP protocol.<DT><B>-fifo=&lt;file&gt;</B><DD>Start the GTK-server with a named pipe. The pipe is created by the GTK-server automaticallyand has the name of &lt;file&gt;. When the script is finished the named pipe will bedeleted automatically. To avoid the pipe being created automatically, also use the option 'nocreate'.<DT><B>-ipc=number</B><DD>Start the GTK-server with a message queue. The number must lay within the range from1 to 65535 and specifies the queue number. When the script is finished the GTK-server willdelete the message queue from memory.<BR><P>After the GTK-server has been started with a message queue, subsequent GTK requests mustbe sent with the GTK-server binary using the argument 'msg'. The number of the communicationchannel must be specified, as well as the string to be sent. For example:<BR><P><B>gtk-server -msg=1,gtk_init NULL NULL</B><BR><P>Here a GTK function is sent to communication channel 1. Make sure there is no space betweenthe number, the comma and the string, otherwise the GTK-server will regard these as separatearguments.<BR><P>Message queues also can be retrieved using the Unix command 'ipcs', and can be deleted usingthe Unix command 'ipcrm'.<BR><P></DL><A NAME="lbAF">&nbsp;</A><H2>OPTIONS</H2><P>The GTK-server accepts the following optional parameters:<DL COMPACT><DT><B>-log=&lt;filename&gt;</B><DD>Start the GTK-server in debug mode. A file with the name 'filename' will be created. This logfile contains the strings which were received by the GTK-server, and the responsesof the GTK-server to those strings.<DT><B>-signal=&lt;number&gt;</B><DD>Define a signal which must be sent to the clientprogram when the GTK-server exits (UNIX only).<DT><B>-cfg=&lt;filename&gt;</B><DD>Explain to the GTK-server where it can find the configfile if it cannot be found at a standardlocation.<DT><B>-pre=&lt;string&gt;</B><DD>Put the specified string in front of the GTK-server returnstrings.<DT><B>-post=&lt;string&gt;</B><DD>Put the specified string behind the GTK-server returnstrings.<DT><B>-nocreate</B><DD>To be used in combination with the fifo option. When specified the pipefile will not be createdby the GTK-server, but must be created by the client program.<DT><B>-handle</B><DD>This option can be used to synchronize communication. When specified the client script can send requestsstarting with a self-defined handle, for example a unique number. The GTK-server will ignore thishandle when parsing the incoming request, but the returnstring for this request will start with the same handle.<DT><B>-detach</B><DD>When specified the GTK-server will try to spawn to the background.<DT><B>-showconf</B><DD>When the GTK-server starts, it will read information about GTK-calls from the configfile.This argument will dump the information to stdout. This is particularly usefull whendebugging scripts.<DT><B>-start=&lt;macro&gt;</B><DD>When the GTK-server starts, first execute the specified macro before doing anything else.<DT><B>-init=&lt;handshake&gt;</B><DD>When running in socket mode, the GTK-server can send a string to handshake and identify itself withthe other side.<DT><B>-ssl[=cert.pem]</B><DD>When running in socket mode, this option sets up an SSL connection. An optional certificatefilecan be provided which is presented by the GTK-server to the remote host during the SSL negotiation.<DT><B>-ca=cert.pem</B><DD>When running in socket mode, this option sets up an SSL connection. A certificatefile must beprovided to this option to verify the certificate presented by the remote host.<DT><B>-password=string</B><DD>To be used in combination with the ssl option. This option should provide a password to decryptthe SSL certificate's key if the key was encrypted.<P></DL><A NAME="lbAG">&nbsp;</A><H2>SHEBANG</H2><P>A GTK-server configfile can contain a standalone program implemented with macro's. As with most Unixscripts, a shebang can be added to the first line of the configfile to execute it with the GTK-server:<B>#!/usr/bin/gtk-server -this</B>The GTK-server searches for a macro with the name 'main' which will be executed first.<P><A NAME="lbAH">&nbsp;</A><H2>SHARED OBJECT / DLL / MODULE</H2><P>If the GTK-server is compiled as a shared object, the function 'gtk' can be importedinto the client program. All GTK calls can be passed as a stringargument to this function(formatted as S-expression). The function always will return a pointer to a string containingthe result of the last GTK call.The C-prototype definition for the 'gtk' function in the GTK-server is as follows:<B>(char*) gtk (char* S-expression)</B>It is also possible to compile the GTK-server as an S-Lang, Scriptbasic or Kornshell module,which can be imported in a client program. See the respective directories in the sourcepackagefor details.Only with the first call to the imported 'gtk'-function the options 'log', 'cfg', 'pre' and 'post' can besubmitted. For example:gtk &quot;log=/dir/logfile cfg=/my/dir/gtk-server.cfg post=.&quot;Now the GTK-server module will open the configfile at location '/my/dir', output it's loggingto the configured logfile and also will put a dot behind all returned answers. (These separate optionsalso may be preceded by the dummy command 'gtk_server_cfg'.)<P><A NAME="lbAI">&nbsp;</A><H2>INTERNAL COMMANDS</H2><P>The GTK-server recognizes the following internal commands:<DL COMPACT><DT><B>gtk_server_version</B><DD>This command returns the current version of the GTK-server.<DT><B>gtk_server_ffi</B><DD>This command returns the Foreign Function interface which has been used to compile the GTK-server: FFI,FFCALL, C/Invoke or DYNCALL.<DT><B>gtk_server_toolkit</B><DD>This command returns the backend which has been used to compile the GTK-server: GTK1, GTK2 or XForms.<DT><B>gtk_server_os</B><DD>This command returns the platform for which the GTK-server was compiled.<DT><B>gtk_server_callback &lt;argument&gt;</B><DD>With this command the client program will fetch a signal for one of the widgets.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -