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

📄 readme.1st

📁 gtk_server的源代码
💻 1ST
字号:
----------------------------------------------------------Introduction----------------------------------------------------------This is the GTK-server. The GTK-server is a small toolto enable GUI access for shell scripts and interpretedprogramming languages.It offers a stream-oriented interface which uses theS-expression syntax. Please consult the manpages anddemonstration programs for details.----------------------------------------------------------Force compilation with GTK----------------------------------------------------------If you have trouble detecting GTK2 with './configure', please tryto run the './configure'-script with the following option:./configure --with-gtk2Similarly, compilation with GTK1 can be forced as well:./configure --with-gtk1----------------------------------------------------------Shared Object, S-Lang, ScriptBasic, Kornshell93----------------------------------------------------------To compile the GTK-server as a shared object, run theconfigure script as follows:./configure --enable-libraryTo compile the GTK-server as a module for S-Lang, installS-Lang first and then run the configure script as follows:./configure --enable-slangTo compile the GTK-server as a module for ScriptBasic,copy the SciptBasic sourcedirectory into the "scriptbasic"subdirectory of your GTK-server installation. Then run:./configure --enable-scriptbasic --libdir=/usr/local/lib/scriba --includedir=/usr/share/scriba/includeAdjust the locations to the situation of your system.To compile the GTK-server as a module for Kornshell93, downloadthe Kornshell Development Kit (KDK) from www.kornshell.com, copy theheader files and the static libraries into the ksh93 subdirectory, thenrun the configure script as follows:./configure --enable-ksh93----------------------------------------------------------Foreign Function Interfaces----------------------------------------------------------Starting from GTK-server 2.0, a Foreign Function interfaceis required. Four interfaces are supported (but you onlyneed one of these for the GTK-server).1) Foreign Function Call library (FFCALL)The FFCALL library also has been ported to many platforms.The canonical website for FFCALL is:http://www.haible.de/bruno/packages-ffcall.htmlThe latest package can also be obtained fromwww.gtk-server.org in the section 'Download'.2) C/Invoke (CINV)Homepage of C/Invoke:http://www.nongnu.org/cinvoke/The latest package can also be obtained fromwww.gtk-server.org in the section 'Download'.3) Foreign Function Interface library (FFI)The FFI library has been ported to many platforms. It ispart of GCC since version 3.x and should be availablein most modern Linux distributions. More info about FFIcan be found here:http://sourceware.org/libffi/The latest package can also be obtained fromwww.gtk-server.org in the section 'Download'.4) DynCall (DYNCALL)Homepage of DynCall:http://dyncall.org/The latest package can also be obtained fromwww.gtk-server.org in the section 'Download'.First install FFI, FFCALL, CINV or DYNCALL, after whichcompilation of the GTK-server should be successfull.----------------------------------------------------------Other backend - XForms----------------------------------------------------------If you do not have GTK on your system, or you thinkthe installbase for GTK is too big, it is possibleto use the GTK-server with XForms instead (only possiblewith Linux/Unix/BSD).To compile with XForms, run:./configure --with-xformsAll GTK and Glade support will be disabled.The latest version of the XForms library can beobtained from:http://savannah.nongnu.org/projects/xforms/Unoffical XForms package patched by me so it compileswith newer GCC versions can be obtained fromwww.gtk-server.org in the section 'Download'.----------------------------------------------------------Other backend - Console----------------------------------------------------------If there is no graphical backend on your machine, it is possibleto compile the GTK-server for console:./configure --with-consoleThe GTK-server will not have a dependency to any X-relatedlibrary but is able to use console-based libraries likenCurses.----------------------------------------------------------Other compiler----------------------------------------------------------The GTK-server can be compiled with the Tiny C Compileralso. Homepage of this compiler: http://bellard.org/tcc/This allows fast compilation on small or slow machines.TCC version 0.9.24 was tested successfully.In order to compile with the Tiny C Compiler, firstset the environment variable 'CC' and then run theconfigure script.So first:export CC=tccThen run:./configure <...options...>Please note that compiling the GTK-server as a shared object withTCC delivers an unusable library. From the TCC documentation:"Dynamic ELF libraries can be output but the C compiler does notgenerate position independent code (PIC). It means that the dynamiclibrary code generated by TCC cannot be factorized among processesyet."----------------------------------------------------------Testing SSL----------------------------------------------------------The GTK-server can handle SSL connections when it runs in'-sock' mode.The SSL library should be available on your system in orderto compile with support for SSL.To troubleshoot SSL problems, the following procedure canbe performed.1) Create a key file.===> openssl genrsa -out server.key 10242a) Optionally, create CSR file - send it to some commercial Certificate Authority.Use returned certificate to create PEM file at step (3).===> openssl req -new -key server.key -out server.csr2b) Or create a self-signed certificate. Make sure 'Common Name', this MUST be your hostname!If not using Certificate Authority use this self-signed certificate to create PEM file at step (3).===> openssl req -x509 -new -days 3650 -key server.key -out server.crt3) Create the final PEM file===> cat server.key server.crt > server.pem*** Test verification of the remote certificate. ***1) Start an SSL server.===> openssl s_server -cert server.pem2) Start GTK-server in other shell.===> gtk-server -sock=localhost:4433 -ca=server.pem -log=/tmp/log.txtNow, in the SSL server, start typing GTK commands.*** Test verification of my local certificate. ***1) Start an SSL server.===> openssl s_server -CAfile server.pem -Verify 52) Start GTK-server in other shell.===> gtk-server -sock=localhost:4433 -ssl=server.pem -log=/tmp/log.txtNow, in the SSL server, start typing GTK commands.If the key in the certificate is encrypted, optionally the GTK-servercan be started with the password to decrypt it:gtk-server -sock=localhost:4433 -ssl=server.pem -password=passwd -log=/tmp/log.txt*** Test SSL using 'stunnel' ***1) Edit the 'stunnel.conf' file as follows:[sdemo]accept  = 50001; connect = 60000exec = /some/dir/gtk-server/demo-gtk/demo-sock.bashexecargs = demo-sock.bash2) Start stunnel: stunnel /etc/stunnel/stunnel.conf3) Run GTK-server in SSL mode: gtk-server -sock=localhost:50001 -ssl -nodetach4) Comment 'exec' and 'execargs', uncomment 'connect'. Restart stunnel.5) Start the 'demo-sock.lsp' demoprogram, it listens to port 600003) Run GTK-server in SSL mode: gtk-server -sock=localhost:50001 -ssl -nodetach----------------------------------------------------------Recommended configure flags for your platform----------------------------------------------------------./configure --prefix=/usr --sysconfdir=/etcThis will put the GTK-server binary into '/usr/bin', theGTK-server library into '/usr/lib' and the default configfileinto '/etc' .Please combine with any of the other flags mentionedabove, if needed.The 'build' script will configure, compile and install theGTK-server with these recommended options.----------------------------------------------------------License----------------------------------------------------------The UTHASH library was released under the BSD license.Visit the UTHASH homepage for details:http://uthash.sourceforge.net/The GTK-server is released under the GPL license.Visit the GTK-server site for details:http://www.gtk-server.org/GreetingsPeter van Eerten----------------------------------------------------------

⌨️ 快捷键说明

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