initial import 0.1
This commit is contained in:
		
						commit
						1095734b48
					
				
							
								
								
									
										39
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,39 @@ | ||||
| *~ | ||||
| *.o | ||||
| *.a | ||||
| *.lo | ||||
| *.la | ||||
| *.dvi | ||||
| *.synctex.gz | ||||
| .deps | ||||
| .libs | ||||
| autom4te.cache/ | ||||
| Makefile | ||||
| Makefile.in | ||||
| aclocal.m4 | ||||
| config.guess | ||||
| config.h | ||||
| config.h.in | ||||
| config.log | ||||
| config.status | ||||
| config.sub | ||||
| configure | ||||
| depcomp | ||||
| install-sh | ||||
| intltool-extract.in | ||||
| intltool-merge.in | ||||
| intltool-update.in | ||||
| lib/libtdata-0.2.pc | ||||
| libtool | ||||
| ltmain.sh | ||||
| missing | ||||
| mkinstalldirs | ||||
| po/Makefile.in.in | ||||
| po/POTFILES | ||||
| po/stamp-it | ||||
| stamp-h1 | ||||
| include/version.h | ||||
| .emacs.desktop | ||||
| nbproject | ||||
| config.guess.dh-orig | ||||
| config.sub.dh-orig | ||||
							
								
								
									
										5
									
								
								AUTHORS
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								AUTHORS
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
| This software was developed by Askele companies group. | ||||
|  * EU part: http://askele.com | ||||
|  * NW European part of Russia: http://askele-ingria.com | ||||
| Team: | ||||
|  * General SW Architect and PM: Alexander Vdolainen <vdo@askele.com> | ||||
							
								
								
									
										3
									
								
								COPYING
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								COPYING
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| Askele business software license. | ||||
| 
 | ||||
| Libs and others might be under LGPLv3. | ||||
							
								
								
									
										166
									
								
								COPYING.LGPL3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										166
									
								
								COPYING.LGPL3
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,166 @@ | ||||
| 		   GNU LESSER GENERAL PUBLIC LICENSE | ||||
|                        Version 3, 29 June 2007 | ||||
| 
 | ||||
|  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | ||||
|  Everyone is permitted to copy and distribute verbatim copies | ||||
|  of this license document, but changing it is not allowed. | ||||
| 
 | ||||
| 
 | ||||
|   This version of the GNU Lesser General Public License incorporates | ||||
| the terms and conditions of version 3 of the GNU General Public | ||||
| License, supplemented by the additional permissions listed below. | ||||
| 
 | ||||
|   0. Additional Definitions.  | ||||
| 
 | ||||
|   As used herein, "this License" refers to version 3 of the GNU Lesser | ||||
| General Public License, and the "GNU GPL" refers to version 3 of the GNU | ||||
| General Public License. | ||||
| 
 | ||||
|   "The Library" refers to a covered work governed by this License, | ||||
| other than an Application or a Combined Work as defined below. | ||||
| 
 | ||||
|   An "Application" is any work that makes use of an interface provided | ||||
| by the Library, but which is not otherwise based on the Library. | ||||
| Defining a subclass of a class defined by the Library is deemed a mode | ||||
| of using an interface provided by the Library. | ||||
| 
 | ||||
|   A "Combined Work" is a work produced by combining or linking an | ||||
| Application with the Library.  The particular version of the Library | ||||
| with which the Combined Work was made is also called the "Linked | ||||
| Version". | ||||
| 
 | ||||
|   The "Minimal Corresponding Source" for a Combined Work means the | ||||
| Corresponding Source for the Combined Work, excluding any source code | ||||
| for portions of the Combined Work that, considered in isolation, are | ||||
| based on the Application, and not on the Linked Version. | ||||
| 
 | ||||
|   The "Corresponding Application Code" for a Combined Work means the | ||||
| object code and/or source code for the Application, including any data | ||||
| and utility programs needed for reproducing the Combined Work from the | ||||
| Application, but excluding the System Libraries of the Combined Work. | ||||
| 
 | ||||
|   1. Exception to Section 3 of the GNU GPL. | ||||
| 
 | ||||
|   You may convey a covered work under sections 3 and 4 of this License | ||||
| without being bound by section 3 of the GNU GPL. | ||||
| 
 | ||||
|   2. Conveying Modified Versions. | ||||
| 
 | ||||
|   If you modify a copy of the Library, and, in your modifications, a | ||||
| facility refers to a function or data to be supplied by an Application | ||||
| that uses the facility (other than as an argument passed when the | ||||
| facility is invoked), then you may convey a copy of the modified | ||||
| version: | ||||
| 
 | ||||
|    a) under this License, provided that you make a good faith effort to | ||||
|    ensure that, in the event an Application does not supply the | ||||
|    function or data, the facility still operates, and performs | ||||
|    whatever part of its purpose remains meaningful, or | ||||
| 
 | ||||
|    b) under the GNU GPL, with none of the additional permissions of | ||||
|    this License applicable to that copy. | ||||
| 
 | ||||
|   3. Object Code Incorporating Material from Library Header Files. | ||||
| 
 | ||||
|   The object code form of an Application may incorporate material from | ||||
| a header file that is part of the Library.  You may convey such object | ||||
| code under terms of your choice, provided that, if the incorporated | ||||
| material is not limited to numerical parameters, data structure | ||||
| layouts and accessors, or small macros, inline functions and templates | ||||
| (ten or fewer lines in length), you do both of the following: | ||||
| 
 | ||||
|    a) Give prominent notice with each copy of the object code that the | ||||
|    Library is used in it and that the Library and its use are | ||||
|    covered by this License. | ||||
| 
 | ||||
|    b) Accompany the object code with a copy of the GNU GPL and this license | ||||
|    document. | ||||
| 
 | ||||
|   4. Combined Works. | ||||
| 
 | ||||
|   You may convey a Combined Work under terms of your choice that, | ||||
| taken together, effectively do not restrict modification of the | ||||
| portions of the Library contained in the Combined Work and reverse | ||||
| engineering for debugging such modifications, if you also do each of | ||||
| the following: | ||||
| 
 | ||||
|    a) Give prominent notice with each copy of the Combined Work that | ||||
|    the Library is used in it and that the Library and its use are | ||||
|    covered by this License. | ||||
| 
 | ||||
|    b) Accompany the Combined Work with a copy of the GNU GPL and this license | ||||
|    document. | ||||
| 
 | ||||
|    c) For a Combined Work that displays copyright notices during | ||||
|    execution, include the copyright notice for the Library among | ||||
|    these notices, as well as a reference directing the user to the | ||||
|    copies of the GNU GPL and this license document. | ||||
| 
 | ||||
|    d) Do one of the following: | ||||
| 
 | ||||
|        0) Convey the Minimal Corresponding Source under the terms of this | ||||
|        License, and the Corresponding Application Code in a form | ||||
|        suitable for, and under terms that permit, the user to | ||||
|        recombine or relink the Application with a modified version of | ||||
|        the Linked Version to produce a modified Combined Work, in the | ||||
|        manner specified by section 6 of the GNU GPL for conveying | ||||
|        Corresponding Source. | ||||
| 
 | ||||
|        1) Use a suitable shared library mechanism for linking with the | ||||
|        Library.  A suitable mechanism is one that (a) uses at run time | ||||
|        a copy of the Library already present on the user's computer | ||||
|        system, and (b) will operate properly with a modified version | ||||
|        of the Library that is interface-compatible with the Linked | ||||
|        Version.  | ||||
| 
 | ||||
|    e) Provide Installation Information, but only if you would otherwise | ||||
|    be required to provide such information under section 6 of the | ||||
|    GNU GPL, and only to the extent that such information is | ||||
|    necessary to install and execute a modified version of the | ||||
|    Combined Work produced by recombining or relinking the | ||||
|    Application with a modified version of the Linked Version. (If | ||||
|    you use option 4d0, the Installation Information must accompany | ||||
|    the Minimal Corresponding Source and Corresponding Application | ||||
|    Code. If you use option 4d1, you must provide the Installation | ||||
|    Information in the manner specified by section 6 of the GNU GPL | ||||
|    for conveying Corresponding Source.) | ||||
| 
 | ||||
|   5. Combined Libraries. | ||||
| 
 | ||||
|   You may place library facilities that are a work based on the | ||||
| Library side by side in a single library together with other library | ||||
| facilities that are not Applications and are not covered by this | ||||
| License, and convey such a combined library under terms of your | ||||
| choice, if you do both of the following: | ||||
| 
 | ||||
|    a) Accompany the combined library with a copy of the same work based | ||||
|    on the Library, uncombined with any other library facilities, | ||||
|    conveyed under the terms of this License. | ||||
| 
 | ||||
|    b) Give prominent notice with the combined library that part of it | ||||
|    is a work based on the Library, and explaining where to find the | ||||
|    accompanying uncombined form of the same work. | ||||
| 
 | ||||
|   6. Revised Versions of the GNU Lesser General Public License. | ||||
| 
 | ||||
|   The Free Software Foundation may publish revised and/or new versions | ||||
| of the GNU Lesser General Public License from time to time. Such new | ||||
| versions will be similar in spirit to the present version, but may | ||||
| differ in detail to address new problems or concerns. | ||||
| 
 | ||||
|   Each version is given a distinguishing version number. If the | ||||
| Library as you received it specifies that a certain numbered version | ||||
| of the GNU Lesser General Public License "or any later version" | ||||
| applies to it, you have the option of following the terms and | ||||
| conditions either of that published version or of any later version | ||||
| published by the Free Software Foundation. If the Library as you | ||||
| received it does not specify a version number of the GNU Lesser | ||||
| General Public License, you may choose any version of the GNU Lesser | ||||
| General Public License ever published by the Free Software Foundation. | ||||
| 
 | ||||
|   If the Library as you received it specifies that a proxy can decide | ||||
| whether future versions of the GNU Lesser General Public License shall | ||||
| apply, that proxy's public statement of acceptance of any version is | ||||
| permanent authorization for you to choose that version for the | ||||
| Library. | ||||
| 
 | ||||
							
								
								
									
										10
									
								
								ChangeLog
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								ChangeLog
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | ||||
| 2013-09-22 Alexander Vdolainen <vdo@askele.com> | ||||
| 	* (a set of files): added autotools | ||||
| 
 | ||||
| 2014-11-23 Alexander Vdolainen <vdo@askele.com> | ||||
| 	* Initial import of 0.2 version | ||||
| 
 | ||||
| 
 | ||||
| Copyright 2013-2014 Askele, Inc. | ||||
| Copying and distribution of this file, with or without modification, are | ||||
| permitted provided the copyright notice and this notice are preserved. | ||||
							
								
								
									
										370
									
								
								INSTALL
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										370
									
								
								INSTALL
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,370 @@ | ||||
| Installation Instructions | ||||
| ************************* | ||||
| 
 | ||||
| Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, | ||||
| Inc. | ||||
| 
 | ||||
|    Copying and distribution of this file, with or without modification, | ||||
| are permitted in any medium without royalty provided the copyright | ||||
| notice and this notice are preserved.  This file is offered as-is, | ||||
| without warranty of any kind. | ||||
| 
 | ||||
| Basic Installation | ||||
| ================== | ||||
| 
 | ||||
|    Briefly, the shell commands `./configure; make; make install' should | ||||
| configure, build, and install this package.  The following | ||||
| more-detailed instructions are generic; see the `README' file for | ||||
| instructions specific to this package.  Some packages provide this | ||||
| `INSTALL' file but do not implement all of the features documented | ||||
| below.  The lack of an optional feature in a given package is not | ||||
| necessarily a bug.  More recommendations for GNU packages can be found | ||||
| in *note Makefile Conventions: (standards)Makefile Conventions. | ||||
| 
 | ||||
|    The `configure' shell script attempts to guess correct values for | ||||
| various system-dependent variables used during compilation.  It uses | ||||
| those values to create a `Makefile' in each directory of the package. | ||||
| It may also create one or more `.h' files containing system-dependent | ||||
| definitions.  Finally, it creates a shell script `config.status' that | ||||
| you can run in the future to recreate the current configuration, and a | ||||
| file `config.log' containing compiler output (useful mainly for | ||||
| debugging `configure'). | ||||
| 
 | ||||
|    It can also use an optional file (typically called `config.cache' | ||||
| and enabled with `--cache-file=config.cache' or simply `-C') that saves | ||||
| the results of its tests to speed up reconfiguring.  Caching is | ||||
| disabled by default to prevent problems with accidental use of stale | ||||
| cache files. | ||||
| 
 | ||||
|    If you need to do unusual things to compile the package, please try | ||||
| to figure out how `configure' could check whether to do them, and mail | ||||
| diffs or instructions to the address given in the `README' so they can | ||||
| be considered for the next release.  If you are using the cache, and at | ||||
| some point `config.cache' contains results you don't want to keep, you | ||||
| may remove or edit it. | ||||
| 
 | ||||
|    The file `configure.ac' (or `configure.in') is used to create | ||||
| `configure' by a program called `autoconf'.  You need `configure.ac' if | ||||
| you want to change it or regenerate `configure' using a newer version | ||||
| of `autoconf'. | ||||
| 
 | ||||
|    The simplest way to compile this package is: | ||||
| 
 | ||||
|   1. `cd' to the directory containing the package's source code and type | ||||
|      `./configure' to configure the package for your system. | ||||
| 
 | ||||
|      Running `configure' might take a while.  While running, it prints | ||||
|      some messages telling which features it is checking for. | ||||
| 
 | ||||
|   2. Type `make' to compile the package. | ||||
| 
 | ||||
|   3. Optionally, type `make check' to run any self-tests that come with | ||||
|      the package, generally using the just-built uninstalled binaries. | ||||
| 
 | ||||
|   4. Type `make install' to install the programs and any data files and | ||||
|      documentation.  When installing into a prefix owned by root, it is | ||||
|      recommended that the package be configured and built as a regular | ||||
|      user, and only the `make install' phase executed with root | ||||
|      privileges. | ||||
| 
 | ||||
|   5. Optionally, type `make installcheck' to repeat any self-tests, but | ||||
|      this time using the binaries in their final installed location. | ||||
|      This target does not install anything.  Running this target as a | ||||
|      regular user, particularly if the prior `make install' required | ||||
|      root privileges, verifies that the installation completed | ||||
|      correctly. | ||||
| 
 | ||||
|   6. You can remove the program binaries and object files from the | ||||
|      source code directory by typing `make clean'.  To also remove the | ||||
|      files that `configure' created (so you can compile the package for | ||||
|      a different kind of computer), type `make distclean'.  There is | ||||
|      also a `make maintainer-clean' target, but that is intended mainly | ||||
|      for the package's developers.  If you use it, you may have to get | ||||
|      all sorts of other programs in order to regenerate files that came | ||||
|      with the distribution. | ||||
| 
 | ||||
|   7. Often, you can also type `make uninstall' to remove the installed | ||||
|      files again.  In practice, not all packages have tested that | ||||
|      uninstallation works correctly, even though it is required by the | ||||
|      GNU Coding Standards. | ||||
| 
 | ||||
|   8. Some packages, particularly those that use Automake, provide `make | ||||
|      distcheck', which can by used by developers to test that all other | ||||
|      targets like `make install' and `make uninstall' work correctly. | ||||
|      This target is generally not run by end users. | ||||
| 
 | ||||
| Compilers and Options | ||||
| ===================== | ||||
| 
 | ||||
|    Some systems require unusual options for compilation or linking that | ||||
| the `configure' script does not know about.  Run `./configure --help' | ||||
| for details on some of the pertinent environment variables. | ||||
| 
 | ||||
|    You can give `configure' initial values for configuration parameters | ||||
| by setting variables in the command line or in the environment.  Here | ||||
| is an example: | ||||
| 
 | ||||
|      ./configure CC=c99 CFLAGS=-g LIBS=-lposix | ||||
| 
 | ||||
|    *Note Defining Variables::, for more details. | ||||
| 
 | ||||
| Compiling For Multiple Architectures | ||||
| ==================================== | ||||
| 
 | ||||
|    You can compile the package for more than one kind of computer at the | ||||
| same time, by placing the object files for each architecture in their | ||||
| own directory.  To do this, you can use GNU `make'.  `cd' to the | ||||
| directory where you want the object files and executables to go and run | ||||
| the `configure' script.  `configure' automatically checks for the | ||||
| source code in the directory that `configure' is in and in `..'.  This | ||||
| is known as a "VPATH" build. | ||||
| 
 | ||||
|    With a non-GNU `make', it is safer to compile the package for one | ||||
| architecture at a time in the source code directory.  After you have | ||||
| installed the package for one architecture, use `make distclean' before | ||||
| reconfiguring for another architecture. | ||||
| 
 | ||||
|    On MacOS X 10.5 and later systems, you can create libraries and | ||||
| executables that work on multiple system types--known as "fat" or | ||||
| "universal" binaries--by specifying multiple `-arch' options to the | ||||
| compiler but only a single `-arch' option to the preprocessor.  Like | ||||
| this: | ||||
| 
 | ||||
|      ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ | ||||
|                  CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ | ||||
|                  CPP="gcc -E" CXXCPP="g++ -E" | ||||
| 
 | ||||
|    This is not guaranteed to produce working output in all cases, you | ||||
| may have to build one architecture at a time and combine the results | ||||
| using the `lipo' tool if you have problems. | ||||
| 
 | ||||
| Installation Names | ||||
| ================== | ||||
| 
 | ||||
|    By default, `make install' installs the package's commands under | ||||
| `/usr/local/bin', include files under `/usr/local/include', etc.  You | ||||
| can specify an installation prefix other than `/usr/local' by giving | ||||
| `configure' the option `--prefix=PREFIX', where PREFIX must be an | ||||
| absolute file name. | ||||
| 
 | ||||
|    You can specify separate installation prefixes for | ||||
| architecture-specific files and architecture-independent files.  If you | ||||
| pass the option `--exec-prefix=PREFIX' to `configure', the package uses | ||||
| PREFIX as the prefix for installing programs and libraries. | ||||
| Documentation and other data files still use the regular prefix. | ||||
| 
 | ||||
|    In addition, if you use an unusual directory layout you can give | ||||
| options like `--bindir=DIR' to specify different values for particular | ||||
| kinds of files.  Run `configure --help' for a list of the directories | ||||
| you can set and what kinds of files go in them.  In general, the | ||||
| default for these options is expressed in terms of `${prefix}', so that | ||||
| specifying just `--prefix' will affect all of the other directory | ||||
| specifications that were not explicitly provided. | ||||
| 
 | ||||
|    The most portable way to affect installation locations is to pass the | ||||
| correct locations to `configure'; however, many packages provide one or | ||||
| both of the following shortcuts of passing variable assignments to the | ||||
| `make install' command line to change installation locations without | ||||
| having to reconfigure or recompile. | ||||
| 
 | ||||
|    The first method involves providing an override variable for each | ||||
| affected directory.  For example, `make install | ||||
| prefix=/alternate/directory' will choose an alternate location for all | ||||
| directory configuration variables that were expressed in terms of | ||||
| `${prefix}'.  Any directories that were specified during `configure', | ||||
| but not in terms of `${prefix}', must each be overridden at install | ||||
| time for the entire installation to be relocated.  The approach of | ||||
| makefile variable overrides for each directory variable is required by | ||||
| the GNU Coding Standards, and ideally causes no recompilation. | ||||
| However, some platforms have known limitations with the semantics of | ||||
| shared libraries that end up requiring recompilation when using this | ||||
| method, particularly noticeable in packages that use GNU Libtool. | ||||
| 
 | ||||
|    The second method involves providing the `DESTDIR' variable.  For | ||||
| example, `make install DESTDIR=/alternate/directory' will prepend | ||||
| `/alternate/directory' before all installation names.  The approach of | ||||
| `DESTDIR' overrides is not required by the GNU Coding Standards, and | ||||
| does not work on platforms that have drive letters.  On the other hand, | ||||
| it does better at avoiding recompilation issues, and works well even | ||||
| when some directory options were not specified in terms of `${prefix}' | ||||
| at `configure' time. | ||||
| 
 | ||||
| Optional Features | ||||
| ================= | ||||
| 
 | ||||
|    If the package supports it, you can cause programs to be installed | ||||
| with an extra prefix or suffix on their names by giving `configure' the | ||||
| option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. | ||||
| 
 | ||||
|    Some packages pay attention to `--enable-FEATURE' options to | ||||
| `configure', where FEATURE indicates an optional part of the package. | ||||
| They may also pay attention to `--with-PACKAGE' options, where PACKAGE | ||||
| is something like `gnu-as' or `x' (for the X Window System).  The | ||||
| `README' should mention any `--enable-' and `--with-' options that the | ||||
| package recognizes. | ||||
| 
 | ||||
|    For packages that use the X Window System, `configure' can usually | ||||
| find the X include and library files automatically, but if it doesn't, | ||||
| you can use the `configure' options `--x-includes=DIR' and | ||||
| `--x-libraries=DIR' to specify their locations. | ||||
| 
 | ||||
|    Some packages offer the ability to configure how verbose the | ||||
| execution of `make' will be.  For these packages, running `./configure | ||||
| --enable-silent-rules' sets the default to minimal output, which can be | ||||
| overridden with `make V=1'; while running `./configure | ||||
| --disable-silent-rules' sets the default to verbose, which can be | ||||
| overridden with `make V=0'. | ||||
| 
 | ||||
| Particular systems | ||||
| ================== | ||||
| 
 | ||||
|    On HP-UX, the default C compiler is not ANSI C compatible.  If GNU | ||||
| CC is not installed, it is recommended to use the following options in | ||||
| order to use an ANSI C compiler: | ||||
| 
 | ||||
|      ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" | ||||
| 
 | ||||
| and if that doesn't work, install pre-built binaries of GCC for HP-UX. | ||||
| 
 | ||||
|    HP-UX `make' updates targets which have the same time stamps as | ||||
| their prerequisites, which makes it generally unusable when shipped | ||||
| generated files such as `configure' are involved.  Use GNU `make' | ||||
| instead. | ||||
| 
 | ||||
|    On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot | ||||
| parse its `<wchar.h>' header file.  The option `-nodtk' can be used as | ||||
| a workaround.  If GNU CC is not installed, it is therefore recommended | ||||
| to try | ||||
| 
 | ||||
|      ./configure CC="cc" | ||||
| 
 | ||||
| and if that doesn't work, try | ||||
| 
 | ||||
|      ./configure CC="cc -nodtk" | ||||
| 
 | ||||
|    On Solaris, don't put `/usr/ucb' early in your `PATH'.  This | ||||
| directory contains several dysfunctional programs; working variants of | ||||
| these programs are available in `/usr/bin'.  So, if you need `/usr/ucb' | ||||
| in your `PATH', put it _after_ `/usr/bin'. | ||||
| 
 | ||||
|    On Haiku, software installed for all users goes in `/boot/common', | ||||
| not `/usr/local'.  It is recommended to use the following options: | ||||
| 
 | ||||
|      ./configure --prefix=/boot/common | ||||
| 
 | ||||
| Specifying the System Type | ||||
| ========================== | ||||
| 
 | ||||
|    There may be some features `configure' cannot figure out | ||||
| automatically, but needs to determine by the type of machine the package | ||||
| will run on.  Usually, assuming the package is built to be run on the | ||||
| _same_ architectures, `configure' can figure that out, but if it prints | ||||
| a message saying it cannot guess the machine type, give it the | ||||
| `--build=TYPE' option.  TYPE can either be a short name for the system | ||||
| type, such as `sun4', or a canonical name which has the form: | ||||
| 
 | ||||
|      CPU-COMPANY-SYSTEM | ||||
| 
 | ||||
| where SYSTEM can have one of these forms: | ||||
| 
 | ||||
|      OS | ||||
|      KERNEL-OS | ||||
| 
 | ||||
|    See the file `config.sub' for the possible values of each field.  If | ||||
| `config.sub' isn't included in this package, then this package doesn't | ||||
| need to know the machine type. | ||||
| 
 | ||||
|    If you are _building_ compiler tools for cross-compiling, you should | ||||
| use the option `--target=TYPE' to select the type of system they will | ||||
| produce code for. | ||||
| 
 | ||||
|    If you want to _use_ a cross compiler, that generates code for a | ||||
| platform different from the build platform, you should specify the | ||||
| "host" platform (i.e., that on which the generated programs will | ||||
| eventually be run) with `--host=TYPE'. | ||||
| 
 | ||||
| Sharing Defaults | ||||
| ================ | ||||
| 
 | ||||
|    If you want to set default values for `configure' scripts to share, | ||||
| you can create a site shell script called `config.site' that gives | ||||
| default values for variables like `CC', `cache_file', and `prefix'. | ||||
| `configure' looks for `PREFIX/share/config.site' if it exists, then | ||||
| `PREFIX/etc/config.site' if it exists.  Or, you can set the | ||||
| `CONFIG_SITE' environment variable to the location of the site script. | ||||
| A warning: not all `configure' scripts look for a site script. | ||||
| 
 | ||||
| Defining Variables | ||||
| ================== | ||||
| 
 | ||||
|    Variables not defined in a site shell script can be set in the | ||||
| environment passed to `configure'.  However, some packages may run | ||||
| configure again during the build, and the customized values of these | ||||
| variables may be lost.  In order to avoid this problem, you should set | ||||
| them in the `configure' command line, using `VAR=value'.  For example: | ||||
| 
 | ||||
|      ./configure CC=/usr/local2/bin/gcc | ||||
| 
 | ||||
| causes the specified `gcc' to be used as the C compiler (unless it is | ||||
| overridden in the site shell script). | ||||
| 
 | ||||
| Unfortunately, this technique does not work for `CONFIG_SHELL' due to | ||||
| an Autoconf bug.  Until the bug is fixed you can use this workaround: | ||||
| 
 | ||||
|      CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash | ||||
| 
 | ||||
| `configure' Invocation | ||||
| ====================== | ||||
| 
 | ||||
|    `configure' recognizes the following options to control how it | ||||
| operates. | ||||
| 
 | ||||
| `--help' | ||||
| `-h' | ||||
|      Print a summary of all of the options to `configure', and exit. | ||||
| 
 | ||||
| `--help=short' | ||||
| `--help=recursive' | ||||
|      Print a summary of the options unique to this package's | ||||
|      `configure', and exit.  The `short' variant lists options used | ||||
|      only in the top level, while the `recursive' variant lists options | ||||
|      also present in any nested packages. | ||||
| 
 | ||||
| `--version' | ||||
| `-V' | ||||
|      Print the version of Autoconf used to generate the `configure' | ||||
|      script, and exit. | ||||
| 
 | ||||
| `--cache-file=FILE' | ||||
|      Enable the cache: use and save the results of the tests in FILE, | ||||
|      traditionally `config.cache'.  FILE defaults to `/dev/null' to | ||||
|      disable caching. | ||||
| 
 | ||||
| `--config-cache' | ||||
| `-C' | ||||
|      Alias for `--cache-file=config.cache'. | ||||
| 
 | ||||
| `--quiet' | ||||
| `--silent' | ||||
| `-q' | ||||
|      Do not print messages saying which checks are being made.  To | ||||
|      suppress all normal output, redirect it to `/dev/null' (any error | ||||
|      messages will still be shown). | ||||
| 
 | ||||
| `--srcdir=DIR' | ||||
|      Look for the package's source code in directory DIR.  Usually | ||||
|      `configure' can determine that directory automatically. | ||||
| 
 | ||||
| `--prefix=DIR' | ||||
|      Use DIR as the installation prefix.  *note Installation Names:: | ||||
|      for more details, including other options available for fine-tuning | ||||
|      the installation locations. | ||||
| 
 | ||||
| `--no-create' | ||||
| `-n' | ||||
|      Run the configure checks, but stop before creating any output | ||||
|      files. | ||||
| 
 | ||||
| `configure' also accepts some other, not widely useful, options.  Run | ||||
| `configure --help' for more details. | ||||
| 
 | ||||
							
								
								
									
										32
									
								
								Makefile.am
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								Makefile.am
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | ||||
| ## Process this file with automake to produce Makefile.in
 | ||||
| 
 | ||||
| SUBDIRS = po include lib | ||||
| 
 | ||||
| libsntldocdir = ${prefix}/doc/libsexpr | ||||
| libsntldoc_DATA = \
 | ||||
| 	README\
 | ||||
| 	COPYING\
 | ||||
| 	AUTHORS\
 | ||||
| 	ChangeLog\
 | ||||
| 	INSTALL\
 | ||||
| 	NEWS | ||||
| 
 | ||||
| 
 | ||||
| INTLTOOL_FILES = intltool-extract.in \
 | ||||
| 	intltool-merge.in \
 | ||||
| 	intltool-update.in | ||||
| 
 | ||||
| EXTRA_DIST = $(libsntldoc_DATA) \
 | ||||
| 	$(INTLTOOL_FILES) | ||||
| 
 | ||||
| DISTCLEANFILES = intltool-extract \
 | ||||
| 	intltool-merge \
 | ||||
| 	intltool-update \
 | ||||
| 	po/.intltool-merge-cache | ||||
| 
 | ||||
| clean-local: | ||||
| 
 | ||||
| 
 | ||||
| # Remove doc directory on uninstall
 | ||||
| uninstall-local: | ||||
| 	-rm -r $(libsntldocdir) | ||||
							
								
								
									
										157
									
								
								autogen.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										157
									
								
								autogen.sh
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,157 @@ | ||||
| #!/bin/sh | ||||
| # Run this to generate all the initial makefiles, etc. | ||||
| 
 | ||||
| srcdir=`dirname $0` | ||||
| test -z "$srcdir" && srcdir=. | ||||
| 
 | ||||
| DIE=0 | ||||
| 
 | ||||
| if [ -n "$GNOME2_DIR" ]; then | ||||
| 	ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" | ||||
| 	LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" | ||||
| 	PATH="$GNOME2_DIR/bin:$PATH" | ||||
| 	export PATH | ||||
| 	export LD_LIBRARY_PATH | ||||
| fi | ||||
| 
 | ||||
| (test -f $srcdir/configure.ac) || { | ||||
|     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" | ||||
|     echo " top-level package directory" | ||||
|     exit 1 | ||||
| } | ||||
| 
 | ||||
| (autoconf --version) < /dev/null > /dev/null 2>&1 || { | ||||
|   echo | ||||
|   echo "**Error**: You must have \`autoconf' installed." | ||||
|   echo "Download the appropriate package for your distribution," | ||||
|   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" | ||||
|   DIE=1 | ||||
| } | ||||
| 
 | ||||
| (grep "^IT_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && { | ||||
|   (intltoolize --version) < /dev/null > /dev/null 2>&1 || { | ||||
|     echo  | ||||
|     echo "**Error**: You must have \`intltool' installed." | ||||
|     echo "You can get it from:" | ||||
|     echo "  ftp://ftp.gnome.org/pub/GNOME/" | ||||
|     DIE=1 | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| (grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && { | ||||
|   (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { | ||||
|     echo | ||||
|     echo "**Error**: You must have \`xml-i18n-toolize' installed." | ||||
|     echo "You can get it from:" | ||||
|     echo "  ftp://ftp.gnome.org/pub/GNOME/" | ||||
|     DIE=1 | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| (grep "^LT_INIT" $srcdir/configure.ac >/dev/null) && { | ||||
|   (libtool --version) < /dev/null > /dev/null 2>&1 || { | ||||
|     echo | ||||
|     echo "**Error**: You must have \`libtool' installed." | ||||
|     echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" | ||||
|     DIE=1 | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && { | ||||
|   (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \ | ||||
|   (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { | ||||
|     echo | ||||
|     echo "**Error**: You must have \`glib' installed." | ||||
|     echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" | ||||
|     DIE=1 | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| (automake --version) < /dev/null > /dev/null 2>&1 || { | ||||
|   echo | ||||
|   echo "**Error**: You must have \`automake' installed." | ||||
|   echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" | ||||
|   DIE=1 | ||||
|   NO_AUTOMAKE=yes | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| # if no automake, don't bother testing for aclocal | ||||
| test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { | ||||
|   echo | ||||
|   echo "**Error**: Missing \`aclocal'.  The version of \`automake'" | ||||
|   echo "installed doesn't appear recent enough." | ||||
|   echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" | ||||
|   DIE=1 | ||||
| } | ||||
| 
 | ||||
| if test "$DIE" -eq 1; then | ||||
|   exit 1 | ||||
| fi | ||||
| 
 | ||||
| if test -z "$*"; then | ||||
|   echo "**Warning**: I am going to run \`configure' with no arguments." | ||||
|   echo "If you wish to pass any to it, please specify them on the" | ||||
|   echo \`$0\'" command line." | ||||
|   echo | ||||
| fi | ||||
| 
 | ||||
| case $CC in | ||||
| xlc ) | ||||
|   am_opt=--include-deps;; | ||||
| esac | ||||
| 
 | ||||
| for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.ac -print` | ||||
| do  | ||||
|   dr=`dirname $coin` | ||||
|   if test -f $dr/NO-AUTO-GEN; then | ||||
|     echo skipping $dr -- flagged as no auto-gen | ||||
|   else | ||||
|     echo processing $dr | ||||
|     ( cd $dr | ||||
| 
 | ||||
|       aclocalinclude="$ACLOCAL_FLAGS" | ||||
| 
 | ||||
|       if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then | ||||
| 	echo "Creating $dr/aclocal.m4 ..." | ||||
| 	test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 | ||||
| 	echo "Running glib-gettextize...  Ignore non-fatal messages." | ||||
| 	echo "no" | glib-gettextize --force --copy | ||||
| 	echo "Making $dr/aclocal.m4 writable ..." | ||||
| 	test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 | ||||
|       fi | ||||
|       if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then | ||||
|         echo "Running intltoolize..." | ||||
| 	intltoolize --copy --force --automake | ||||
|       fi | ||||
|       if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then | ||||
|         echo "Running xml-i18n-toolize..." | ||||
| 	xml-i18n-toolize --copy --force --automake | ||||
|       fi | ||||
|       if grep "^LT_INIT" configure.ac >/dev/null; then | ||||
| 	if test -z "$NO_LIBTOOLIZE" ; then  | ||||
| 	  echo "Running libtoolize..." | ||||
| 	  libtoolize --force --copy | ||||
| 	fi | ||||
|       fi | ||||
|       echo "Running aclocal $aclocalinclude ..." | ||||
|       aclocal $aclocalinclude | ||||
|       if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then | ||||
| 	echo "Running autoheader..." | ||||
| 	autoheader | ||||
|       fi | ||||
|       echo "Running automake --gnu $am_opt ..." | ||||
|       automake --add-missing --copy --gnu $am_opt | ||||
|       echo "Running autoconf ..." | ||||
|       autoconf | ||||
|     ) | ||||
|   fi | ||||
| done | ||||
| 
 | ||||
| if test x$NOCONFIGURE = x; then | ||||
|   echo Running $srcdir/configure "$@" ... | ||||
|   $srcdir/configure "$@" \ | ||||
|   && echo Now type \`make\' to compile. || exit 1 | ||||
| else | ||||
|   echo Skipping configure process. | ||||
| fi | ||||
							
								
								
									
										47
									
								
								configure.ac
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								configure.ac
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,47 @@ | ||||
| dnl Process this file with autoconf to produce a configure script. | ||||
| 
 | ||||
| AC_INIT(libsntl, 0.1) | ||||
| 
 | ||||
| AC_CONFIG_HEADERS([config.h]) | ||||
| 
 | ||||
| AM_INIT_AUTOMAKE([1.11]) | ||||
| 
 | ||||
| AM_SILENT_RULES([yes]) | ||||
| 
 | ||||
| AC_PROG_CC | ||||
| 
 | ||||
| dnl *************************************************************************** | ||||
| dnl Internationalization | ||||
| dnl *************************************************************************** | ||||
| IT_PROG_INTLTOOL([0.35.0]) | ||||
| 
 | ||||
| GETTEXT_PACKAGE=libsntl | ||||
| AC_SUBST(GETTEXT_PACKAGE) | ||||
| AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name]) | ||||
| AM_GLIB_GNU_GETTEXT | ||||
| 
 | ||||
| 
 | ||||
| LT_INIT | ||||
| 
 | ||||
| PKG_CHECK_MODULES(OPENSSL, [openssl]) | ||||
| PKG_CHECK_MODULES(LIBUUID, [uuid]) | ||||
| PKG_CHECK_MODULES(LIBTDATA, [libtdata-0.2]) | ||||
| PKG_CHECK_MODULES(LIBSEXPR, [libsexpr-1.2]) | ||||
| 
 | ||||
| dnl  ***************** | ||||
| dnl ***** options ***** | ||||
| dnl  ***************** | ||||
| 
 | ||||
| AC_ARG_ENABLE([build_examples], | ||||
|     AS_HELP_STRING([--enable-build-examples], [Enable examples build])) | ||||
| 
 | ||||
| AS_IF([test "x$enable_build_examples" = "xyes"], [ | ||||
|   AC_DEFINE([BUILD_EXAMPLES], 1, [build of examples enabled]) | ||||
| ]) | ||||
| 
 | ||||
| AC_OUTPUT([ | ||||
| Makefile | ||||
| lib/libsntl-0.1.pc | ||||
| lib/Makefile | ||||
| include/Makefile | ||||
| po/Makefile.in]) | ||||
							
								
								
									
										0
									
								
								examples/TODO
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/TODO
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										1
									
								
								include/Makefile.am
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								include/Makefile.am
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| nobase_include_HEADERS = sntl/pth_queue.h sntl/connection.h | ||||
							
								
								
									
										213
									
								
								include/sntl/connection.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										213
									
								
								include/sntl/connection.h
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,213 @@ | ||||
| /* 
 | ||||
|  * File:   connection.h | ||||
|  * Author: vdo | ||||
|  * | ||||
|  * Created on September 24, 2014, 2:36 AM | ||||
|  */ | ||||
| 
 | ||||
| #ifndef __ESXC_CONNECTION_H_ | ||||
| #define	__ESXC_CONNECTION_H_ | ||||
| 
 | ||||
| #include <stdint.h> | ||||
| #include <time.h> | ||||
| #include <sys/types.h> | ||||
| #include <pthread.h> | ||||
| 
 | ||||
| #include <openssl/ssl.h> | ||||
| 
 | ||||
| #include <tdata/usrtc.h> | ||||
| #include <tdata/idx_allocator.h> | ||||
| #include <sexpr/sexp.h> | ||||
| #include <sexpr/faststack.h> | ||||
| 
 | ||||
| #include <sntl/pth_queue.h> | ||||
| 
 | ||||
| /* sexp helpers */ | ||||
| #define SEXP_IS_LIST(sx) \ | ||||
|         ((sx)->ty == SEXP_LIST) ? 1 : 0 | ||||
| 
 | ||||
| #define SEXP_IS_TYPE(sx,type) \ | ||||
|         ((sx)->ty == SEXP_VALUE && (sx)->aty == (type)) ? 1 : 0 | ||||
| 
 | ||||
| #define SEXP_ITERATE_LIST(lst, iter, ind) \ | ||||
|         for((ind) = 0, (iter) = (lst)->list; (ind) < sexp_list_length(lst); \ | ||||
|             (ind)++, (iter) = (iter)->next) | ||||
| 
 | ||||
| int sexp_list_cdr(sexp_t *expr, sexp_t **sx); | ||||
| int sexp_list_car(sexp_t *expr, sexp_t **sx); | ||||
| 
 | ||||
| #define VERIFY_DEPTH  1  /* FIXME: */ | ||||
| 
 | ||||
| #define MAX_CONNECTIONS  32768 | ||||
| #define MAX_CHANNELS     4096 | ||||
| #define MAX_RPC_LIST     2048 | ||||
| #define MAX_MULTI        12 | ||||
| #define MAX_PENDINGMSG   16384 | ||||
| #define MAX_MSGINDEX     ((MAX_PENDINGMSG) * (MAX_MULTI)) | ||||
| 
 | ||||
| typedef struct __perm_context_type { | ||||
|   char *login; | ||||
|   char *passwd; | ||||
|   ulong_t certid; | ||||
|   ulong_t uid; | ||||
|   ulong_t gid; | ||||
|   ulong_t *gids; | ||||
|   int n_gids; | ||||
|   int p_attr; | ||||
|   void *priv; | ||||
| } perm_ctx_t; | ||||
| 
 | ||||
| #define CXCONN_MASTER  (1 << 1) | ||||
| #define CXCONN_SLAVE   (1 << 2) | ||||
| #define CXCONN_ESTABL  (1 << 3) | ||||
| 
 | ||||
| typedef struct __connection_t { | ||||
|   char *uuid; /** < uuid of the connection */ | ||||
|   idx_allocator_t *idx_ch; /** < index allocation for channels */ | ||||
|   usrtc_t *chnl_tree; /** < search tree of all channels */ | ||||
|   usrtc_t *rpc_list; /** < search tree of possible RPC typed lists */ | ||||
|   SSL_CTX *ctx; /** < SSL context */ | ||||
|   SSL *ssl; /** < SSL connection */ | ||||
|   int ssl_data_index; /** < SSL index for the custom data */ | ||||
|   perm_ctx_t *pctx; /** < higher layer authentification context */ | ||||
|   pthread_t cthread; /** < thread for listening the connection socket */ | ||||
|   pthread_mutex_t oplock; /** < mutex used to sync operations on connection */ | ||||
|   pthread_rwlock_t chnl_lock; /** < rwlock used to sync ops with channels */ | ||||
|   int flags; /** < flags of the connection */ | ||||
|   usrtc_node_t csnode; /** < node to store the connection within list */ | ||||
| } conn_t; | ||||
| 
 | ||||
| struct __connection_rpc_list_type; | ||||
| struct __message_t; | ||||
| 
 | ||||
| #define ESXCHAN_PENDING  (1 << 1) | ||||
| #define ESXCHAN_CLOSURE  (1 << 2) | ||||
| 
 | ||||
| typedef struct __channel_t { | ||||
|   ulong_t cid; /** < ID of the channel */ | ||||
|   char *uuid; /** < UUID of the channel, used in advanced implementation
 | ||||
|                 * of the complex distributed systems */ | ||||
|   conn_t *connection; /** < pointer to the parent connection */ | ||||
|   idx_allocator_t *idx_msg; /** < index allocation for messages */ | ||||
|   usrtc_t *msgs_tree; /** < search tree of the existing messages */ | ||||
|   struct __message_t *sysmsg; /** < system message used to operate with channel */ | ||||
|   struct __connection_rpc_list_type *rpc_list; /** < rpc functions list */ | ||||
|   pthread_mutex_t oplock; /** < operation ops lock */ | ||||
|   pthread_rwlock_t msglock; /** < rwlock used to operate with messages */ | ||||
|   usrtc_node_t node; /** < node for connection search tree */ | ||||
|   int use_count; /** < use count */ | ||||
|   int flags; /** < flags of the channel */ | ||||
| } chnl_t; | ||||
| 
 | ||||
| typedef struct __sexp_payload_t { | ||||
|   char *cstr; | ||||
|   sexp_t *sx; | ||||
| } sxpayload_t; | ||||
| 
 | ||||
| #define ESX_SYSMSG_SIZE  512 | ||||
| 
 | ||||
| #define ESXMSG_SYS      (1 << 1) | ||||
| #define ESXMSG_USR      (1 << 2) | ||||
| #define ESXMSG_PENDING  (1 << 3) | ||||
| #define ESXMSG_NOWAY    (1 << 4) | ||||
| 
 | ||||
| typedef struct __message_t { | ||||
|   chnl_t *pch; /** < channel of the message(if applicable) */ | ||||
|   ulong_t mid; /** < unique ID within connection context */ | ||||
|   char *uuid; /** < UUID of the message, used for special messages */ | ||||
|   usrtc_node_t chnl_node; /** < node for channel search tree */ | ||||
|   usrtc_node_t poll_node; /** < node for the poll of the messages */ | ||||
|   usrtc_node_t pendingq_node; /** < node for the pending queue */ | ||||
|   pthread_mutex_t wait; /** < special wait mutex, used for sync */ | ||||
|   void *payload; /** < payload */ | ||||
|   int opcode; /** < opcode for system and pulse messages */ | ||||
|   int flags; /** < flags of the message (type, state etc ...)*/ | ||||
|   int use_count; /** < use count */ | ||||
| } sxmsg_t; | ||||
| 
 | ||||
| typedef struct __connection_rpc_entry_type { | ||||
|   char *name; | ||||
|   int (*rpcf)(void *, sexp_t *); | ||||
|   usrtc_node_t node; | ||||
| } cx_rpc_t; | ||||
| 
 | ||||
| typedef struct __connection_rpc_list_type { | ||||
|   usrtc_t *rpc_tree; /** < search tree for the rpc lookup */ | ||||
|   char *opt_version; /** < reserved for future implementations */ | ||||
| } cx_rpc_list_t; | ||||
| 
 | ||||
| typedef struct __connections_subsys_type { | ||||
|   int ex_ssldata_index; /** < index used to work with additional data provided to the special call during SSL handshake */ | ||||
|   usrtc_t *connections; | ||||
|   pth_queue_t *ioq; /** < general messages queue */ | ||||
|   pth_queue_t *ioqueue; /** < system messages queue */ | ||||
|   /* system threads */ | ||||
|   pthread_t iog_thread; /** < general io queue */ | ||||
|   pthread_t ios_thread; /** < system io queue */ | ||||
|   pthread_rwlock_t rwlock; | ||||
|   char *rootca, *certpem, *certkey; /* path name to the certificates */ | ||||
|   cx_rpc_list_t *system_rpc; | ||||
|   /* special functions pointers */ | ||||
|   int (*validate_sslpem)(conn_t *); /** < this function used to validate SSL certificate while SSL handshake */ | ||||
|   int (*secure_check)(conn_t *); /** < this function authorize user to login, and also should check SSL cert and user, and already made sessions */ | ||||
|   usrtc_t* (*get_rpc_typed_list_tree)(conn_t *); /** < this function is used to set RPC list of the functions */ | ||||
|   int (*set_typed_list_callback)(conn_t *, int, char *); /** < this function is a callback during setting up a typed channel */ | ||||
|   void *priv; | ||||
| } conn_sys_t; | ||||
| 
 | ||||
| typedef struct __rpc_typed_list_type { | ||||
|   int type_id; | ||||
|   char *description; | ||||
|   cx_rpc_list_t *rpc_list; | ||||
|   usrtc_node_t lnode; | ||||
| } rpc_typed_list_t; | ||||
| 
 | ||||
| extern conn_sys_t *conn_sys; | ||||
| 
 | ||||
| /* General API */ | ||||
| /* subsystem */ | ||||
| int connections_subsystem_init(void); | ||||
| 
 | ||||
| int connections_subsystem_setsslserts(const char *rootca, const char *certpem, | ||||
|         const char *certkey); | ||||
| 
 | ||||
| int connections_subsystem_setrpclist_function(usrtc_t* (*get_rpc_typed_list_tree)(conn_t *)); | ||||
| 
 | ||||
| #define connections_subsystem_set_securecheck(c, fuu)    (c)->secure_check = fuu | ||||
| #define connections_subsystem_set_sslvalidator(c, fuu)   (c)->validate_sslpem = fuu | ||||
| #define connections_subsystem_set_rpctlist_call(c, fuu)  (c)->set_typed_list_callback = fuu | ||||
| 
 | ||||
| /* connection */ | ||||
| int connection_initiate (conn_t *co, const char *host, int port,  | ||||
|         const char *SSL_cert, perm_ctx_t *pctx); | ||||
| 
 | ||||
| int connection_create(conn_t *co, int sck); | ||||
| 
 | ||||
| int connection_close(conn_t *co); | ||||
| 
 | ||||
| int connection_reinit(conn_t *co); | ||||
| 
 | ||||
| /* channels */ | ||||
| int channel_open(conn_t *co, chnl_t **ch, int type); | ||||
| 
 | ||||
| int channel_close(conn_t *co); | ||||
| 
 | ||||
| /* message passing */ | ||||
| int msg_send(chnl_t *ch, sexp_t *sx, sxmsg_t **msg); | ||||
| 
 | ||||
| int msg_send_timed(chnl_t *ch, sexp_t *sx, sxmsg_t **msg, struct timespec *tio); | ||||
| 
 | ||||
| int msg_return(sxmsg_t *msg, int opcode); | ||||
| 
 | ||||
| int msg_reply(sxmsg_t *msg, sexp_t *sx); | ||||
| 
 | ||||
| int msg_reply_timed(sxmsg_t *msg, sexp_t *sx, struct timespec *tio); | ||||
| 
 | ||||
| int msg_send_pulse(chnl_t *ch, sexp_t *sx); | ||||
| 
 | ||||
| int msg_send_pulse_timed(chnl_t *ch, sexp_t *sx, struct timespec *tio); | ||||
| 
 | ||||
| int msg_send_pulse_nowait(chnl_t *ch, sexp_t *sx); | ||||
| 
 | ||||
| #endif	/* __ESXC_CONNECTION_H_ */ | ||||
| 
 | ||||
							
								
								
									
										57
									
								
								include/sntl/pth_queue.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								include/sntl/pth_queue.h
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,57 @@ | ||||
| /*
 | ||||
|  * This is a proprietary software. See COPYING for further details. | ||||
|  * | ||||
|  * (c) 2013 Copyright Askele, inc. <http://askele.com>
 | ||||
|  * (c) 2013 Copyright Askele Ingria, inc. <http://askele-ingria.com>
 | ||||
|  * (c) 2014 Copyright Confident, inc. (granted permission to use in commercial software) | ||||
|  */ | ||||
| 
 | ||||
| /**
 | ||||
|  * @file pth_queue.h | ||||
|  * @author Alexander Vdolainen | ||||
|  * @date 4 Nov 2013 | ||||
|  * @brief queue implementation for threads intercommunication | ||||
|  * | ||||
|  */ | ||||
| 
 | ||||
| #ifndef __PTH_QUEUE_H__ | ||||
| #define __PTH_QUEUE_H__ | ||||
| 
 | ||||
| #include <pthread.h> | ||||
| 
 | ||||
| #define SYS_MSG  0x0f0affee | ||||
| #define USR_MSG  0x0afeeffe | ||||
| #define NIL_MSG  0x0 | ||||
| 
 | ||||
| typedef struct pth_msg_s { | ||||
|   void *data;           /** < message payload */ | ||||
|   unsigned int msgtype; /** < message type ID */ | ||||
|   unsigned int qlength; /** < current queue length (actual on add moment),
 | ||||
|                           * it makes no sense with few readers */ | ||||
|   usrtc_node_t node; | ||||
| } pth_msg_t; | ||||
| 
 | ||||
| typedef struct pth_queue_s { | ||||
|   unsigned int length; | ||||
|   /* sync */ | ||||
|   pthread_mutex_t mutex; | ||||
|   pthread_cond_t cond; | ||||
|   /* queue data */ | ||||
|   usrtc_t qtree; | ||||
|   /* cache */ | ||||
|   usrtc_t msgcache; | ||||
| } pth_queue_t; | ||||
| 
 | ||||
| int pth_queue_init(pth_queue_t *queue); | ||||
| 
 | ||||
| int pth_queue_add(pth_queue_t *queue, void *data, unsigned int msgtype); | ||||
| 
 | ||||
| int pth_queue_get(pth_queue_t *queue, const struct timespec *timeout, | ||||
|                   pth_msg_t *msg); | ||||
| 
 | ||||
| unsigned int pth_queue_length(pth_queue_t *queue); | ||||
| 
 | ||||
| int pth_queue_destroy(pth_queue_t *queue, int freedata, | ||||
|                       void (*free_msg)(void *)); | ||||
| 
 | ||||
| #endif /* __PTH_QUEUE_H__ */ | ||||
							
								
								
									
										28
									
								
								lib/Makefile.am
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								lib/Makefile.am
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,28 @@ | ||||
| ## Process this file with automake to produce Makefile.in
 | ||||
| 
 | ||||
| AM_CPPFLAGS = \
 | ||||
| 	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
 | ||||
| 	-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
 | ||||
| 	-DPACKAGE_DATA_DIR=\""$(pkgdatadir)"\" \
 | ||||
| 	$(LIBSNTL_CFLAGS) -I../include | ||||
| 
 | ||||
| AM_CFLAGS =\
 | ||||
| 	 -Wall\
 | ||||
| 	 -g | ||||
| 
 | ||||
| lib_LTLIBRARIES = libsntl.la | ||||
| 
 | ||||
| 
 | ||||
| libsntl_la_SOURCES = \
 | ||||
| 	queue.c connection.c | ||||
| 
 | ||||
| libsntl_la_LDFLAGS =  | ||||
| 
 | ||||
| libsntl_la_LIBADD =  | ||||
| 
 | ||||
| pkgconfigdir = $(libdir)/pkgconfig | ||||
| pkgconfig_DATA = libsntl-0.1.pc | ||||
| 
 | ||||
| EXTRA_DIST = \
 | ||||
| 	libsntl-1.2.pc.in | ||||
| 
 | ||||
							
								
								
									
										1507
									
								
								lib/connection.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1507
									
								
								lib/connection.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										13
									
								
								lib/libsntl-0.1.pc.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								lib/libsntl-0.1.pc.in
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | ||||
| prefix=@prefix@ | ||||
| exec_prefix=@exec_prefix@ | ||||
| libdir=@libdir@ | ||||
| datarootdir=@datarootdir@ | ||||
| datadir=@datadir@ | ||||
| includedir=@includedir@ | ||||
| 
 | ||||
| Name: liblibsntl | ||||
| Description: Secure Network Transport Layer library implementation | ||||
| Version: @VERSION@ | ||||
| Requires:  | ||||
| Libs: -L${libdir} -llibsntl | ||||
| Cflags: -I${includedir} | ||||
							
								
								
									
										213
									
								
								lib/queue.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										213
									
								
								lib/queue.c
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,213 @@ | ||||
| /*
 | ||||
|  * This is a proprietary software. See COPYING for further details. | ||||
|  * | ||||
|  * (c) 2013 Copyright Askele, inc. <http://askele.com>
 | ||||
|  * (c) 2013 Copyright Askele Ingria, inc. <http://askele-ingria.com>
 | ||||
|  * (c) 2014 Copyright Confident, inc. (granted permission to use in commercial software) | ||||
|  */ | ||||
| 
 | ||||
| #include <stdlib.h> | ||||
| #include <stdio.h> | ||||
| #include <sys/types.h> | ||||
| #include <sys/stat.h> | ||||
| #include <sys/time.h> | ||||
| #include <fcntl.h> | ||||
| #include <errno.h> | ||||
| #include <unistd.h> | ||||
| #include <string.h> | ||||
| #include <pthread.h> | ||||
| 
 | ||||
| #include <tdata/usrtc.h> | ||||
| 
 | ||||
| #include <sntl/pth_queue.h> | ||||
| 
 | ||||
| #define MAX_QUEUE_SIZE  4096 | ||||
| #define MAX_QUEUE_POOL  256 | ||||
| 
 | ||||
| static long __cmp_uint(const void *a, const void *b) | ||||
| { | ||||
|   return (long)(*(unsigned int *)a - *(unsigned int *)b); | ||||
| } | ||||
| 
 | ||||
| static inline pth_msg_t *__get_newmsg(pth_queue_t *queue) | ||||
| { | ||||
|   usrtc_t *tree = &queue->msgcache; | ||||
|   usrtc_node_t *node; | ||||
|   pth_msg_t *tmp; | ||||
| 
 | ||||
|   if(usrtc_count(tree)) { | ||||
|     node = usrtc_first(tree); | ||||
|     tmp = (pth_msg_t *)usrtc_node_getdata(node); | ||||
|     usrtc_delete(tree, node); | ||||
|   } else { | ||||
|     tmp = malloc(sizeof(pth_msg_t)); | ||||
|     tree = &queue->qtree; | ||||
|     node = &tmp->node; | ||||
|     usrtc_node_init(node, tmp); | ||||
|   } | ||||
|   /* insert it */ | ||||
|   tree = &queue->qtree; | ||||
|   tmp->qlength = usrtc_count(tree); | ||||
|   usrtc_insert(tree, node, (void *)(&tmp->qlength)); | ||||
| 
 | ||||
|   return tmp; | ||||
| } | ||||
| 
 | ||||
| static inline void __release_msg(pth_queue_t *queue, pth_msg_t *msg) | ||||
| { | ||||
|   usrtc_node_t *node = &msg->node; | ||||
|   usrtc_t *tree = &queue->qtree; | ||||
| 
 | ||||
|   tree = &queue->qtree; /* remove from queue */ | ||||
|   usrtc_delete(tree, node); | ||||
| 
 | ||||
|   tree = &queue->msgcache; | ||||
| 
 | ||||
|   if(usrtc_count(tree) >= MAX_QUEUE_POOL) | ||||
|     free(msg); | ||||
|   else { | ||||
|     msg->data = NULL; | ||||
|     msg->msgtype = NIL_MSG; | ||||
|     usrtc_insert(tree, node, (void *)&msg->qlength); | ||||
|   } | ||||
| 
 | ||||
|   return; | ||||
| } | ||||
| 
 | ||||
| int pth_queue_init(pth_queue_t *queue) | ||||
| { | ||||
|   int r = 0; | ||||
| 
 | ||||
|   memset(queue, 0, sizeof(pth_queue_t)); | ||||
|   if((r = pthread_cond_init(&queue->cond, NULL))) | ||||
|     return r; | ||||
| 
 | ||||
|   if((r = pthread_mutex_init(&queue->mutex, NULL))) { | ||||
|     pthread_cond_destroy(&queue->cond); | ||||
|     return r; | ||||
|   } | ||||
| 
 | ||||
|   usrtc_init(&queue->qtree, USRTC_AVL, MAX_QUEUE_SIZE, __cmp_uint); | ||||
|   usrtc_init(&queue->msgcache, USRTC_AVL, MAX_QUEUE_POOL, __cmp_uint); | ||||
| 
 | ||||
|   return r; | ||||
| } | ||||
| 
 | ||||
| int pth_queue_add(pth_queue_t *queue, void *data, unsigned int msgtype) | ||||
| { | ||||
|   pth_msg_t *newmsg; | ||||
| 
 | ||||
|   pthread_mutex_lock(&queue->mutex); | ||||
|   newmsg = __get_newmsg(queue); | ||||
|   if (newmsg == NULL) { | ||||
|     pthread_mutex_unlock(&queue->mutex); | ||||
|     return ENOMEM; | ||||
|   } | ||||
| 
 | ||||
|   newmsg->data = data; | ||||
|   newmsg->msgtype = msgtype; | ||||
| 
 | ||||
|   if(queue->length == 0) | ||||
|     pthread_cond_broadcast(&queue->cond); | ||||
|   queue->length++; | ||||
|   pthread_mutex_unlock(&queue->mutex); | ||||
| 
 | ||||
|   return 0; | ||||
| } | ||||
| 
 | ||||
| int pth_queue_get(pth_queue_t *queue, const struct timespec *timeout, pth_msg_t *msg) | ||||
| { | ||||
|   usrtc_t *tree; | ||||
|   usrtc_node_t *node = NULL; | ||||
|   pth_msg_t *tmp; | ||||
|   int r = 0; | ||||
|   struct timespec abstimeout; | ||||
| 
 | ||||
|   if (queue == NULL || msg == NULL) | ||||
|     return EINVAL; | ||||
|   else | ||||
|     tree = &queue->qtree; | ||||
| 
 | ||||
|   if (timeout) { /* setup timeout */ | ||||
|     struct timeval now; | ||||
| 
 | ||||
|     gettimeofday(&now, NULL); | ||||
|     abstimeout.tv_sec = now.tv_sec + timeout->tv_sec; | ||||
|     abstimeout.tv_nsec = (now.tv_usec * 1000) + timeout->tv_nsec; | ||||
|     if (abstimeout.tv_nsec >= 1000000000) { | ||||
|       abstimeout.tv_sec++; | ||||
|       abstimeout.tv_nsec -= 1000000000; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   pthread_mutex_lock(&queue->mutex); | ||||
| 
 | ||||
|   /* Will wait until awakened by a signal or broadcast */ | ||||
|   while ((node = usrtc_first(tree)) == NULL && r != ETIMEDOUT) {  /* Need to loop to handle spurious wakeups */ | ||||
|     if (timeout) | ||||
|       r = pthread_cond_timedwait(&queue->cond, &queue->mutex, &abstimeout); | ||||
|     else | ||||
|       pthread_cond_wait(&queue->cond, &queue->mutex); | ||||
|   } | ||||
|   if (r == ETIMEDOUT) { | ||||
|     pthread_mutex_unlock(&queue->mutex); | ||||
|     return r; | ||||
|   } | ||||
| 
 | ||||
|   tmp = (pth_msg_t *)usrtc_node_getdata(node); | ||||
|   queue->length--; | ||||
| 
 | ||||
|   msg->data = tmp->data; | ||||
|   msg->msgtype = tmp->msgtype; | ||||
|   msg->qlength = tmp->qlength; /* we will hold the msg id instead of size here */ | ||||
| 
 | ||||
|   __release_msg(queue, tmp); | ||||
|   pthread_mutex_unlock(&queue->mutex); | ||||
| 
 | ||||
|   return 0; | ||||
| } | ||||
| 
 | ||||
| int pth_queue_destroy(pth_queue_t *queue, int freedata, void (*free_msg)(void *)) | ||||
| { | ||||
|   int r = 0; | ||||
|   usrtc_t *tree = &queue->qtree; | ||||
|   usrtc_node_t *node = NULL; | ||||
|   pth_msg_t *msg; | ||||
| 
 | ||||
|   if (queue == NULL)     return EINVAL; | ||||
| 
 | ||||
|   pthread_mutex_lock(&queue->mutex); | ||||
| 
 | ||||
|   for (node = usrtc_first(tree); node != NULL; node = usrtc_first(tree)) { | ||||
|     usrtc_delete(tree, node); | ||||
|     msg = (pth_msg_t *)usrtc_node_getdata(node); | ||||
| 
 | ||||
|     if(freedata) free(msg->data); | ||||
|     else if(free_msg) free_msg(msg->data); | ||||
| 
 | ||||
|     free(msg); | ||||
|   } | ||||
|   /* free cache */ | ||||
|   tree = &queue->msgcache; | ||||
|   for (node = usrtc_first(tree); node != NULL; node = usrtc_first(tree)) { | ||||
|     usrtc_delete(tree, node); | ||||
|     free(usrtc_node_getdata(node)); | ||||
|   } | ||||
| 
 | ||||
|   pthread_mutex_unlock(&queue->mutex); | ||||
|   r = pthread_mutex_destroy(&queue->mutex); | ||||
|   pthread_cond_destroy(&queue->cond); | ||||
| 
 | ||||
|   return r; | ||||
| } | ||||
| 
 | ||||
| unsigned int pth_queue_length(pth_queue_t *queue) | ||||
| { | ||||
|   unsigned int c; | ||||
| 
 | ||||
|   pthread_mutex_lock(&queue->mutex); | ||||
|   c = queue->length; | ||||
|   pthread_mutex_unlock(&queue->mutex); | ||||
| 
 | ||||
|   return c; | ||||
| } | ||||
							
								
								
									
										0
									
								
								po/ChangeLog
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								po/ChangeLog
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										2
									
								
								po/LINGUAS
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								po/LINGUAS
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,2 @@ | ||||
| # please keep this list sorted alphabetically | ||||
| # | ||||
							
								
								
									
										3
									
								
								po/POTFILES.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								po/POTFILES.in
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| # List of source files containing translatable strings. | ||||
| 
 | ||||
| 
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user